:root {
  --bg: #f5efe7;
  --surface: rgba(255, 249, 241, 0.74);
  --surface-strong: rgba(255, 252, 248, 0.95);
  --panel: #fff8ef;
  --line: rgba(50, 35, 24, 0.12);
  --text: #211915;
  --muted: #6a5a50;
  --accent: #c85d40;
  --accent-deep: #7c321f;
  --accent-soft: #f3d786;
  --ok: #2d7954;
  --shadow: 0 30px 60px rgba(78, 42, 30, 0.14);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(243, 215, 134, 0.55), transparent 30%),
    radial-gradient(circle at 84% 12%, rgba(200, 93, 64, 0.22), transparent 26%),
    linear-gradient(160deg, #f6efe5 0%, #efe2d3 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #0b63ce;
  outline-offset: 3px;
}

img {
  display: block;
  max-width: 100%;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10000;
  padding: 10px 14px;
  border-radius: 999px;
  color: #fff;
  background: #0a1f44;
  font-weight: 800;
  transform: translateY(-160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  width: min(1380px, calc(100% - 24px));
  margin: 12px auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 34px;
  background: rgba(255, 250, 245, 0.4);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 6px 18px;
  position: relative;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.brand-mark,
.login-form .save-button {
  border-radius: 999px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: #fff8f3;
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  box-shadow: 0 16px 32px rgba(124, 50, 31, 0.28);
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 1.2rem;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  position: relative;
  z-index: 60;
}

.nav-item {
  position: relative;
}

.nav-item > a {
  display: inline-flex;
  padding: 12px 16px;
  border-radius: 999px;
  color: var(--muted);
}

.nav-item:hover > a {
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
}

.nav-item > a[aria-current="page"] {
  color: var(--text);
  background: rgba(243, 215, 134, 0.36);
}

.language-toggle {
  min-height: 40px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent-deep);
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.language-toggle[aria-pressed="true"] {
  color: #fff8f2;
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
}

.nav-children {
  position: absolute;
  z-index: 70;
  top: calc(100% - 2px);
  left: 0;
  min-width: 180px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 251, 247, 0.96);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: all 180ms ease;
}

.nav-item:hover > .nav-children {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.nav-children a {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
}

.nav-children a:hover {
  background: rgba(243, 215, 134, 0.28);
}

.nav-children .nav-item > a {
  width: 100%;
}

.nav-children .nav-children {
  top: -8px;
  left: calc(100% - 2px);
}

.login-form .save-button {
  padding: 12px 18px;
  border: 1px solid transparent;
  color: #fff8f2;
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  cursor: pointer;
  font-weight: 700;
}

.workspace {
  display: block;
}

.canvas,
.block-card,
.not-found {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  backdrop-filter: blur(14px);
}

.canvas {
  padding: 24px;
  position: relative;
}

.canvas {
  z-index: 1;
}

.panel-eyebrow {
  margin: 0 0 10px;
  color: var(--accent-deep);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  font-weight: 800;
}

.template-sidebar h1,
.canvas h2,
.not-found h1 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.panel-copy,
.feature-list,
.copy,
.not-found p {
  color: var(--muted);
  line-height: 1.7;
}

.dropzone {
  display: grid;
  gap: 14px;
}

.dropzone {
  min-height: 260px;
}

.empty-drop-hint {
  min-height: 260px;
  display: none;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 28px;
  border: 2px dashed rgba(124, 50, 31, 0.3);
  border-radius: 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.48);
  text-align: center;
}

.empty-drop-hint strong {
  display: block;
  color: var(--text);
}

.empty-drop-hint span {
  display: block;
}

.dropzone.is-empty .empty-drop-hint {
  display: grid;
}

.section-element {
  display: block;
}

.section-dropzone {
  min-height: 0;
}

.feature-list {
  margin: 0;
  padding-left: 18px;
}

.canvas-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.block-card {
  padding: 18px;
  background: var(--surface-strong);
  box-shadow: 0 18px 38px rgba(84, 50, 38, 0.07);
  cursor: grab;
}

.cms-has-tool-dock[data-editor-enabled="true"] .editable.is-easy-language {
  outline: 2px dashed rgba(45, 121, 84, 0.35);
  outline-offset: 5px;
}

.hero-block,
.two-column-block,
.dual-image-block,
.carousel-block {
  display: grid;
  gap: 16px;
}

.hero-block {
  grid-template-columns: 1.1fr 0.9fr;
  align-items: start;
}

.hero-block .editable:first-child {
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: clamp(1.8rem, 2.5vw, 3rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.hero-block .copy {
  grid-column: 1;
}

.hero-block .media-image {
  grid-column: 2;
  grid-row: 1 / span 2;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
  border-radius: 20px;
}

.hero-block .media-placeholder {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-height: 260px;
}

.two-column-block,
.dual-image-block {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.carousel-block {
  gap: 14px;
}

.carousel-headline {
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: clamp(1.6rem, 2.3vw, 2.4rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.carousel-viewport {
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(50, 35, 24, 0.16);
  background: rgba(255, 255, 255, 0.7);
}

.carousel-track {
  display: flex;
  transition: transform 220ms ease;
  will-change: transform;
}

.carousel-slide {
  flex: 0 0 100%;
  margin: 0;
  min-height: 240px;
  position: relative;
}

.carousel-slide .media-image {
  border-radius: 0;
  min-height: 240px;
  max-height: 460px;
  width: 100%;
  object-fit: cover;
}

.carousel-slide figcaption {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  color: #fff;
  background: rgba(20, 18, 15, 0.6);
  font-size: 0.9rem;
}

.carousel-empty {
  width: 100%;
  min-height: 220px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
  padding: 16px;
}

.carousel-controls {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.carousel-nav {
  border: 1px solid var(--line);
  border-radius: 999px;
  min-width: 42px;
  min-height: 42px;
  color: var(--accent-deep);
  background: rgba(255, 255, 255, 0.86);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.carousel-manager {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px dashed rgba(124, 50, 31, 0.28);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.64);
}

.carousel-manager > header {
  display: grid;
  gap: 3px;
}

.carousel-manager > header span {
  color: var(--muted);
  font-size: 0.86rem;
}

.carousel-slides-admin {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  align-items: start;
  gap: 12px;
}

.carousel-slide-admin {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 0;
  padding: 0;
  border: 1px solid rgba(96, 165, 250, 0.32);
  border-radius: 14px;
  background: rgba(248, 251, 255, 0.92);
}

.carousel-slide-index {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 4;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--accent-deep);
  font-size: 0.78rem;
  font-weight: 800;
}

.carousel-slide-admin .media-image,
.carousel-slide-admin .media-placeholder {
  width: 100%;
  min-height: 0;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 0;
  background: rgba(219, 234, 254, 0.7);
}

.carousel-slide-admin .cms-image-meta-wrap {
  display: block;
  min-width: 0;
}

.carousel-slide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.carousel-admin-empty {
  padding: 10px;
  border-radius: 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.66);
}

.carousel-bulk-dropzone {
  min-height: 88px;
  display: grid;
  place-items: center;
  border: 2px dashed rgba(124, 50, 31, 0.32);
  border-radius: 14px;
  color: var(--accent-deep);
  font-weight: 800;
  text-align: center;
  padding: 10px;
  background: linear-gradient(135deg, rgba(243, 215, 134, 0.18), rgba(255, 255, 255, 0.46));
}

.carousel-bulk-dropzone.is-over {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(200, 93, 64, 0.2), rgba(243, 215, 134, 0.22));
}

.carousel-bulk-actions {
  display: flex;
  justify-content: flex-end;
}

.media-image {
  width: 100%;
  border-radius: 18px;
}

.media-placeholder {
  min-height: 220px;
  display: grid;
  place-items: center;
  border: 2px dashed rgba(124, 50, 31, 0.28);
  border-radius: 18px;
  color: var(--accent-deep);
  background:
    linear-gradient(135deg, rgba(243, 215, 134, 0.18), rgba(255, 255, 255, 0.5));
  font-weight: 800;
  text-align: center;
}

.video-block iframe {
  width: 100%;
  min-height: 320px;
  border: 0;
  border-radius: 20px;
}

.not-found {
  width: min(720px, calc(100% - 24px));
  margin: 24px auto;
  padding: 32px;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(440px, 100%);
  display: grid;
  gap: 22px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 249, 241, 0.88);
  box-shadow: var(--shadow);
}

.login-panel h1 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  font-size: 2.4rem;
  line-height: 1;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

.login-form input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid rgba(50, 35, 24, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
  font: inherit;
}

.login-error {
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  color: #7c1f1f;
  background: rgba(190, 45, 45, 0.12);
}

@media (max-width: 1080px) {
  .workspace,
  .hero-block,
  .two-column-block,
  .dual-image-block {
    grid-template-columns: 1fr;
  }

  .hero-block .media-image {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 12px, 1380px);
    padding: 10px;
    border-radius: 24px;
  }

  .topbar,
  .canvas-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .main-nav {
    width: 100%;
  }

  .nav-item {
    width: 100%;
  }

  .nav-item > a {
    width: 100%;
    justify-content: center;
  }

  .nav-children {
    position: static;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    margin-top: 8px;
  }

  .nav-children .nav-children {
    margin-left: 12px;
  }
}
