:root {
  color-scheme: light;
  --bg: #f7f8f4;
  --surface: #ffffff;
  --surface-muted: #eef3ec;
  --ink: #17201b;
  --muted: #5d685f;
  --line: #dfe6dc;
  --accent: #1f6b52;
  --accent-dark: #154737;
  --amber: #b86424;
  --blue: #315f85;
  --shadow: 0 16px 48px rgba(23, 32, 27, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}

a {
  color: var(--accent-dark);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--ink);
  color: white;
  padding: 0.5rem 0.75rem;
  z-index: 20;
}

.skip-link:focus {
  top: 1rem;
}

.topbar {
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
}

.topbar-inner,
.footer-inner {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--ink);
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

.main-nav,
.footer nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.main-nav a,
.footer a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 650;
  font-size: 0.94rem;
}

.site-shell {
  max-width: 1380px;
  margin: 0 auto;
  padding: 1.25rem;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 270px;
  gap: 1.25rem;
  align-items: start;
}

.content {
  min-width: 0;
}

.rail {
  position: sticky;
  top: 84px;
  display: grid;
  gap: 1rem;
}

.rail-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: var(--shadow);
}

.rail-block h2 {
  font-size: 0.92rem;
  margin: 0 0 0.65rem;
}

.rail-block a:not(.button) {
  display: block;
  color: var(--ink);
  text-decoration: none;
  padding: 0.44rem 0;
  border-top: 1px solid var(--line);
  font-size: 0.94rem;
}

.rail-block a:first-of-type {
  border-top: 0;
}

.rail-block p,
.rail-block li {
  color: var(--muted);
  font-size: 0.92rem;
}

.rail-block ul {
  padding-left: 1.1rem;
  margin: 0;
}

.highlight {
  border-color: #c9dccf;
  background: #fbfdf9;
}

.button,
.cta-row a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0.65rem 0.9rem;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  font-weight: 750;
  border: 0;
  cursor: pointer;
}

.secondary-button {
  background: var(--surface-muted);
  color: var(--ink);
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 650;
  padding: 0;
}

.hero {
  min-height: 470px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  display: grid;
  align-items: end;
  background: #23352d;
  box-shadow: var(--shadow);
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(10, 20, 15, 0.78), rgba(10, 20, 15, 0.32) 58%, rgba(10, 20, 15, 0.08));
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 710px;
  padding: clamp(1.25rem, 4vw, 3rem);
  color: white;
}

.eyebrow {
  color: var(--amber);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 0.78rem;
  margin: 0 0 0.5rem;
}

.hero .eyebrow {
  color: #ffd39a;
}

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 6vw, 4.9rem);
  max-width: 12ch;
}

.hero p {
  font-size: 1.1rem;
  max-width: 62ch;
}

.section {
  margin: 1.25rem 0;
  padding: clamp(1rem, 3vw, 2rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.section.unframed {
  background: transparent;
  border: 0;
  padding: 0;
}

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

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 1rem;
  min-height: 190px;
}

.card h3 {
  margin-top: 0;
}

.card p {
  color: var(--muted);
}

.path-card {
  color: var(--ink);
  text-decoration: none;
}

.article-list {
  display: grid;
  gap: 0.8rem;
}

.archive-group {
  margin-top: 1.5rem;
}

.archive-group h2 {
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--line);
}

.article-row {
  display: grid;
  gap: 0.25rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-decoration: none;
  color: var(--ink);
}

.article-row span {
  color: var(--muted);
}

.breadcrumb {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 1rem;
}

.article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(1.2rem, 4vw, 3rem);
  box-shadow: var(--shadow);
}

.article-header h1 {
  color: var(--ink);
  font-size: clamp(2rem, 4.2vw, 4rem);
  max-width: 15ch;
}

.article-hero-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  margin: 1.5rem 0;
}

.lead {
  color: var(--muted);
  font-size: 1.15rem;
  max-width: 68ch;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.92rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0.8rem 0;
  margin: 1.4rem 0;
}

.article-body {
  max-width: 790px;
}

.article-body h2 {
  margin-top: 2rem;
  font-size: 1.65rem;
}

.article-body p,
.article-body li {
  color: #303a33;
}

.article-body blockquote {
  margin: 1.5rem 0;
  border-left: 4px solid var(--accent);
  padding: 0.3rem 0 0.3rem 1rem;
  color: var(--muted);
  background: var(--surface-muted);
}

.notice {
  border-left: 4px solid var(--blue);
  background: #f2f7fb;
  padding: 1rem;
  border-radius: 6px;
}

.cookie-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 30;
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 1rem;
}

.cookie-banner[hidden] {
  display: none;
}

.cookie-banner p {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.cookie-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.print-actions {
  margin: 1.25rem 0;
}

.checklist-section {
  break-inside: avoid;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  margin-top: 1.5rem;
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.55rem;
}

.checklist li {
  display: grid;
  grid-template-columns: 1.3rem minmax(0, 1fr);
  gap: 0.55rem;
  align-items: start;
}

.checklist input {
  width: 1rem;
  height: 1rem;
  margin-top: 0.28rem;
}

.journey-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.journey-trail { margin: 0 0 1rem; font-size: 0.95rem; }
.guide-scope { padding: 1rem; border-left: 4px solid var(--accent); background: var(--surface-muted); }
.profile-label { color: var(--muted); font-size: 0.9rem; margin-bottom: 0.4rem; }
.affiliate-search { margin: 1rem 0; padding: 0.8rem 1rem; border: 1px solid var(--line); border-radius: 6px; }
.affiliate-search > a { font-weight: 700; }
.affiliate-search p { font-size: 0.9rem; margin: 0.4rem 0 0; color: var(--muted); }
.local-index { display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; margin: 1.25rem 0; padding: 1rem; background: var(--surface-muted); border-radius: 6px; }
.local-index strong { flex-basis: 100%; }
.local-section { padding-top: 1rem; margin-top: 1.5rem; border-top: 1px solid var(--line); }
.local-section h3 { font-size: 1.35rem; }
.local-section h4 { margin: 1rem 0 0.4rem; font-size: 1rem; }
.local-section, .article-body h2[id] { scroll-margin-top: 10rem; }
.table-scroll { max-width: 100%; overflow-x: auto; }
.local-decision-table { border-collapse: collapse; width: 100%; min-width: 28rem; }
.local-decision-table caption { text-align: left; font-weight: 700; margin-bottom: 0.6rem; }
.local-decision-table th, .local-decision-table td { padding: 0.8rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.local-decision-table thead { background: var(--surface-muted); }

.footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  margin-top: 2rem;
}

.footer p {
  color: var(--muted);
  margin: 0.25rem 0 0;
}

@media (max-width: 1120px) {
  .site-shell {
    grid-template-columns: minmax(0, 1fr) 260px;
  }

  .left-rail {
    display: none;
  }
}

@media (max-width: 820px) {
  .topbar-inner,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-shell {
    grid-template-columns: 1fr;
    padding: 0.85rem;
  }

  .rail {
    position: static;
  }

  .right-rail {
    order: 2;
  }

  .hero {
    min-height: 430px;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .cookie-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .cookie-actions {
    justify-content: flex-start;
  }
}

@media print {
  .topbar,
  .rail,
  .footer,
  .breadcrumb,
  .print-actions,
  .cookie-banner {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  .site-shell {
    display: block;
    max-width: none;
    padding: 0;
  }

  .article {
    border: 0;
    box-shadow: none;
    padding: 0;
  }

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