:root {
  --bg: #f7f3ea;
  --ink: #20251f;
  --muted: #667065;
  --line: #d9d0bd;
  --leaf: #2f6b4f;
  --water: #2a7187;
  --sun: #c6772d;
  --panel: #fffdf8;
  --shadow: 0 16px 38px rgba(34, 42, 35, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 253, 248, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: 1160px;
  min-height: 72px;
  margin: 0 auto;
  padding: 0 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--leaf);
  color: white;
  font-size: 0.78rem;
}

.main-nav {
  display: flex;
  flex: 1;
  justify-content: center;
  gap: 6px;
}

.main-nav a,
.quick-links button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 10px 12px;
  text-decoration: none;
}

.main-nav a.active,
.quick-links button.active {
  background: #e2efe8;
  color: var(--leaf);
  font-weight: 700;
}

.edit-button,
.editor-actions button,
.media-tools button,
.media-edit-bar button,
.media-file-button {
  border: 0;
  border-radius: 6px;
  background: var(--leaf);
  color: white;
  padding: 11px 16px;
  font-weight: 700;
}

.editor-actions .ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}

.hero {
  position: relative;
  display: grid;
  min-height: 320px;
  height: clamp(320px, 52vw, 520px);
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(19, 30, 23, 0.2), rgba(19, 30, 23, 0.42)),
    var(--hero-image, url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1600' height='900' viewBox='0 0 1600 900'%3E%3Crect width='1600' height='900' fill='%23a8c7b4'/%3E%3Cpath d='M0 590 C260 500 390 610 620 520 C850 430 980 470 1200 380 C1390 305 1500 330 1600 280 L1600 900 L0 900 Z' fill='%233f7354'/%3E%3Cpath d='M0 690 C240 615 450 690 670 625 C900 557 1120 610 1600 488 L1600 900 L0 900 Z' fill='%232c5943'/%3E%3Cpath d='M710 900 C770 700 855 605 980 455 C1085 330 1105 255 1128 120' fill='none' stroke='%23efe1bd' stroke-width='34' stroke-linecap='round' opacity='.85'/%3E%3Ccircle cx='235' cy='160' r='82' fill='%23f1bd63'/%3E%3C/svg%3E"));
  background-position: center;
  background-size: cover;
}

.hero-content {
  position: relative;
  align-self: end;
  max-width: 900px;
  padding: 130px 26px 78px;
  margin: 0 auto;
  color: white;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.32);
}

.hero-content p {
  max-width: 700px;
  font-size: 1.12rem;
  line-height: 1.6;
}

#heroLabel,
.section-label {
  margin: 0;
  color: var(--sun);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.hero #heroLabel {
  color: #ffe1a6;
}

.editor {
  max-width: 1160px;
  margin: 28px auto 0;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.editor-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.editor-top h2 {
  margin: 0;
}

.editor-actions,
.media-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.editor-status {
  min-height: 24px;
  margin: -8px 0 18px;
  color: var(--leaf);
  font-weight: 700;
}

.editor-grid,
.page-editor {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.page-editor {
  margin-top: 18px;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  padding: 11px 12px;
}

textarea {
  resize: vertical;
}

.wide,
.media-tools {
  grid-column: 1 / -1;
}

.media-tools {
  align-items: end;
  padding-top: 8px;
}

.media-tools h3 {
  flex-basis: 100%;
  margin: 0;
  color: var(--ink);
  font-size: 1.08rem;
}

.media-tools label {
  flex: 1 1 220px;
}

.media-tools input[type="file"] {
  background: #eef6f1;
  border-color: #b7d2c2;
}

.page-band,
.media-section {
  max-width: 1160px;
  margin: 0 auto;
  padding: 56px 22px 0;
}

.page-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 42px;
  align-items: start;
}

.page-copy h2,
.section-heading h2 {
  margin: 7px 0 12px;
  font-size: clamp(2rem, 4vw, 3.4rem);
  letter-spacing: 0;
}

.page-copy p {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.75;
  white-space: pre-line;
}

.quick-links {
  display: grid;
  gap: 8px;
  position: sticky;
  top: 96px;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.media-section {
  padding-bottom: 64px;
}

.section-heading {
  margin-bottom: 20px;
}

.media-edit-bar {
  display: none;
  grid-template-columns: repeat(2, max-content) minmax(220px, 1fr) max-content;
  gap: 10px;
  align-items: center;
  margin: 0 0 18px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.editor-open .media-edit-bar {
  display: grid;
}

.media-file-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.media-card {
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.media-card img,
.media-card video,
.media-card iframe {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 0;
}

.media-empty {
  grid-column: 1 / -1;
  padding: 34px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.55);
}

.remove-media {
  width: 100%;
  border: 0;
  background: #f1e4d0;
  color: #5f3421;
  padding: 10px;
  font-weight: 700;
}

footer {
  border-top: 1px solid var(--line);
  padding: 26px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 860px) {
  .header-inner {
    flex-wrap: wrap;
    padding-block: 12px;
  }

  .main-nav {
    justify-content: flex-start;
    order: 3;
    width: 100%;
    overflow-x: auto;
  }

  .edit-button {
    margin-left: auto;
  }

  .hero {
    min-height: 280px;
    height: clamp(280px, 76vw, 390px);
  }

  .hero-media {
    background-position: center;
  }

  .editor-grid,
  .page-editor,
  .page-wrap,
  .media-grid,
  .media-edit-bar {
    grid-template-columns: 1fr;
  }

  .quick-links {
    position: static;
  }
}

@media (max-width: 520px) {
  .brand {
    max-width: calc(100% - 120px);
  }

  .brand span:last-child {
    overflow-wrap: anywhere;
  }

  .hero-content {
    padding: 86px 22px 42px;
  }

  .editor-top {
    align-items: stretch;
    flex-direction: column;
  }

  .editor-actions button,
  .media-tools button,
  .media-edit-bar button,
  .media-file-button {
    width: 100%;
  }
}
