:root {
  --bg: #f7f3ea;
  --bg-surface: #ffffff;
  --bg-raised: #efe8d8;
  --text-primary: #201a12;
  --text-secondary: #4a4030;
  --text-muted: #6b5f4a;
  --accent: #8a4a1f;
  --accent-strong: #6b3814;
  --border: #d8cdb4;
  --border-strong: #b8a97f;
  --map-land: #e4d9bd;
  --map-outline: #8a4a1f;
  --shadow: 0 1px 3px rgba(40, 30, 10, 0.12);
  --focus: #1d5fae;
  --st-ok: #4a7c3f;
  --st-none: #a13a3a;
  --st-revoked: #8a4a1f;
  --st-lapsed: #b8860b;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171310;
    --bg-surface: #1f1a15;
    --bg-raised: #262019;
    --text-primary: #f3ecdd;
    --text-secondary: #cdc0a2;
    --text-muted: #a99b7d;
    --accent: #e0a15c;
    --accent-strong: #f0b876;
    --border: #3a3226;
    --border-strong: #514736;
    --map-land: #2c261c;
    --map-outline: #e0a15c;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    --focus: #7ab4ff;
    --st-ok: #7fb374;
    --st-none: #e07a7a;
    --st-revoked: #e0a15c;
    --st-lapsed: #e0c15c;
  }
}

:root[data-theme="dark"] {
  --bg: #171310;
  --bg-surface: #1f1a15;
  --bg-raised: #262019;
  --text-primary: #f3ecdd;
  --text-secondary: #cdc0a2;
  --text-muted: #a99b7d;
  --accent: #e0a15c;
  --accent-strong: #f0b876;
  --border: #3a3226;
  --border-strong: #514736;
  --map-land: #2c261c;
  --map-outline: #e0a15c;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  --focus: #7ab4ff;
  --st-ok: #7fb374;
  --st-none: #e07a7a;
  --st-revoked: #e0a15c;
  --st-lapsed: #e0c15c;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  line-height: 1.6;
}
a { color: var(--accent-strong); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

section, .park-card { scroll-margin-top: 3.6rem; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 1rem;
  height: 3.1rem; padding: 0 1rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}
.topbar .home { font-family: -apple-system, sans-serif; font-size: 0.82rem; color: var(--text-secondary); text-decoration: none; white-space: nowrap; }
.topbar .home:hover { color: var(--accent-strong); }
.topnav { display: flex; gap: 1rem; overflow-x: auto; scrollbar-width: none; white-space: nowrap; font-family: -apple-system, sans-serif; font-size: 0.85rem; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a { text-decoration: none; color: var(--text-secondary); padding: 0.3rem 0; }
.topnav a[aria-current="true"], .topnav a:hover { color: var(--accent-strong); border-bottom: 2px solid var(--accent-strong); }
.spacer { flex: 1; }
.chip { font-family: -apple-system, sans-serif; font-size: 0.78rem; text-decoration: none; color: var(--text-secondary); border: 1px solid var(--border-strong); border-radius: 999px; padding: 0.25rem 0.7rem; white-space: nowrap; }
.chip:hover { color: var(--accent-strong); border-color: var(--accent-strong); }
.icon-btn { width: 2rem; height: 2rem; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--bg-surface); color: var(--text-secondary); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.icon-btn:hover { color: var(--accent-strong); border-color: var(--accent-strong); }
.icon-btn svg[hidden] { display: none; }

main { max-width: 44rem; margin: 0 auto; padding: 0 1.3rem; }

.hero { padding: 3.4rem 0 1.6rem; }
.kicker { font-family: -apple-system, sans-serif; font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
h1 { font-size: clamp(1.9rem, 4.4vw, 2.7rem); line-height: 1.18; margin: 0.5rem 0 1rem; }
.deck { font-size: 1.2rem; color: var(--text-secondary); margin: 0 0 1.2rem; }
.byline { font-family: -apple-system, sans-serif; font-size: 0.82rem; color: var(--text-muted); }

h2 { font-size: 1.5rem; margin: 2.6rem 0 0.9rem; }
h3 { font-size: 1.15rem; margin: 1.6rem 0 0.5rem; }
h4 { font-size: 1rem; margin: 1.2rem 0 0.4rem; color: var(--text-secondary); }
h5 { font-size: 0.9rem; margin: 1rem 0 0.4rem; color: var(--text-secondary); font-family: -apple-system, sans-serif; text-transform: uppercase; letter-spacing: 0.02em; }
p { margin: 0 0 1.05rem; }

.callout { background: var(--bg-raised); border-left: 3px solid var(--accent); border-radius: 0.3rem; padding: 1rem 1.2rem; margin: 1.4rem 0; font-size: 0.98rem; }
.callout.tier3 h3 { margin-top: 0; }
.tier3-note { font-size: 0.88rem; color: var(--text-muted); margin-top: 0.6rem; }
.law-caveat { font-family: -apple-system, sans-serif; font-size: 0.8rem; color: var(--text-muted); }

.map-wrap { margin: 1.6rem 0; }
.map-svg { width: 100%; height: auto; display: block; background: var(--bg-raised); border-radius: 0.5rem; }
.map-svg .land { fill: var(--map-land); stroke: var(--map-outline); stroke-width: 1.4; }
.map-svg .pin { cursor: pointer; stroke: var(--bg-raised); stroke-width: 1; }
.map-svg .pin.st-ok { fill: var(--st-ok); }
.map-svg .pin.st-none { fill: var(--st-none); }
.map-svg .pin.st-revoked { fill: var(--st-revoked); }
.map-svg .pin.st-lapsed { fill: var(--st-lapsed); }
.map-caption { font-family: -apple-system, sans-serif; font-size: 0.8rem; color: var(--text-muted); margin-top: 0.6rem; }

.map-legend { list-style: none; margin: 0.9rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.2rem; font-family: -apple-system, sans-serif; font-size: 0.82rem; color: var(--text-secondary); }
.map-legend li { display: flex; align-items: center; gap: 0.4rem; }
.swatch { width: 0.7rem; height: 0.7rem; border-radius: 999px; flex-shrink: 0; display: inline-block; }
.swatch.st-ok { background: var(--st-ok); }
.swatch.st-none { background: var(--st-none); }
.swatch.st-revoked { background: var(--st-revoked); }
.swatch.st-lapsed { background: var(--st-lapsed); }

.badge { font-family: -apple-system, sans-serif; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; padding: 0.2rem 0.55rem; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--text-secondary); }
.status-line { font-family: -apple-system, sans-serif; font-size: 0.86rem; color: var(--text-secondary); display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.6rem; }
.park-note { font-size: 0.9rem; color: var(--text-muted); font-style: italic; }

table.park-table { width: 100%; border-collapse: collapse; font-family: -apple-system, sans-serif; font-size: 0.88rem; margin: 0.8rem 0 1rem; }
table.park-table th, table.park-table td { text-align: left; padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--border); vertical-align: top; }
table.park-table th { color: var(--text-muted); font-weight: 600; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.03em; width: 9rem; }

.park-sources { font-family: -apple-system, sans-serif; font-size: 0.78rem; color: var(--text-muted); margin: 0; }
.park-sources a { color: var(--text-muted); }

.park-figure { margin: 0.8rem 0 1rem; }
.park-figure img { width: 100%; height: auto; border-radius: 0.5rem; display: block; box-shadow: var(--shadow); }
.park-figure figcaption { font-family: -apple-system, sans-serif; font-size: 0.76rem; color: var(--text-muted); margin-top: 0.45rem; }
.park-figure figcaption a { color: var(--text-muted); }
.park-highlight { font-size: 1.02rem; }
.trail-list { list-style: none; margin: 0 0 0.8rem; padding: 0; }
.trail-list li { padding: 0.5rem 0; border-bottom: 1px dashed var(--border); }
.trail-list li:last-child { border-bottom: none; }
.trail-meta { font-family: -apple-system, sans-serif; font-size: 0.82rem; color: var(--text-muted); }
.trail-source { font-family: -apple-system, sans-serif; font-size: 0.76rem; color: var(--text-muted); margin: 0 0 1rem; }
table.practical-table th { width: 8rem; }

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Park directory: search + filter chips + A-Z jump + compact linked cards. */
.directory-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.7rem; margin: 1.2rem 0 0.8rem; font-family: -apple-system, sans-serif; }
.dir-search input { width: 100%; max-width: 16rem; font-size: 0.92rem; padding: 0.5rem 0.8rem; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--bg-surface); color: var(--text-primary); }
.dir-search input:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.chip-group { display: flex; flex-wrap: wrap; gap: 0.4rem; }
button.chip { font: inherit; }
button.chip[aria-pressed="true"] { color: var(--bg-surface); background: var(--accent-strong); border-color: var(--accent-strong); }
.az-strip { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0.6rem 0 0.9rem; font-family: -apple-system, sans-serif; }
.az-letter { width: 1.7rem; height: 1.7rem; font-size: 0.78rem; border-radius: 0.3rem; border: 1px solid var(--border); background: transparent; color: var(--text-secondary); cursor: pointer; }
.az-letter:hover { border-color: var(--accent-strong); color: var(--accent-strong); }
.dir-count { font-family: -apple-system, sans-serif; font-size: 0.8rem; color: var(--text-muted); margin: 0 0 0.6rem; }
.directory-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); gap: 1rem; }
.directory-grid[hidden] { display: none; }
.dir-card { display: flex; flex-direction: column; gap: 0.6rem; text-decoration: none; color: inherit; border: 1px solid var(--border); border-radius: 0.6rem; padding: 0.8rem; background: var(--bg-surface); box-shadow: var(--shadow); scroll-margin-top: 4.5rem; }
.dir-card[hidden] { display: none; }
.dir-card:hover { border-color: var(--accent-strong); }
.dir-card:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.dir-thumb { display: block; width: 100%; aspect-ratio: 4 / 3; border-radius: 0.4rem; overflow: hidden; background: var(--bg-raised); }
.dir-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dir-body { display: flex; flex-direction: column; gap: 0.3rem; }
.dir-name { font-size: 1.02rem; font-weight: 600; display: flex; align-items: center; flex-wrap: wrap; gap: 0.45rem; }
.dir-highlight { font-family: -apple-system, sans-serif; font-size: 0.84rem; color: var(--text-secondary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dir-empty-msg { font-family: -apple-system, sans-serif; font-size: 0.92rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.7rem; }
.dir-empty-msg[hidden] { display: none; }

/* Standalone park page. */
.breadcrumbs { font-family: -apple-system, sans-serif; font-size: 0.8rem; color: var(--text-muted); margin: 1.1rem 0 0; }
.breadcrumbs a { color: var(--text-muted); }
.park-hero { padding: 1.1rem 0 0.6rem; }
.park-hero h1 { margin: 0.3rem 0 0; }
.park-page-body h2 { margin-top: 2rem; }
.park-nav { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 2rem 0 0.6rem; font-family: -apple-system, sans-serif; font-size: 0.88rem; }
.park-nav-link { text-decoration: none; }
.park-nav-link.next { margin-left: auto; text-align: right; }

.sources-list { font-size: 0.92rem; }
.sources-list li { margin-bottom: 0.5rem; }

footer.site-footer { border-top: 1px solid var(--border); margin-top: 3rem; padding: 1.6rem 0 2.4rem; font-family: -apple-system, sans-serif; font-size: 0.82rem; color: var(--text-muted); }
footer.site-footer a { color: var(--text-muted); }
footer.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin-bottom: 0.8rem; }

.rail { position: fixed; right: 1.4rem; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 0.85rem; z-index: 20; }
.rail a { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; }
.rail .dot { width: 6px; height: 6px; border-radius: 999px; background: var(--border-strong); transition: transform 0.15s, background 0.15s; }
.rail a[aria-current="true"] .dot { background: var(--accent-strong); transform: scale(1.45); }
.rail .label { font-family: -apple-system, sans-serif; font-size: 0.76rem; color: var(--text-secondary); opacity: 0; transform: translateX(4px); transition: opacity 0.15s, transform 0.15s; white-space: nowrap; }
.rail a:hover .label, .rail a:focus-visible .label { opacity: 1; transform: translateX(0); }

@media (min-width: 76rem) {
  .rail { display: flex; }
}
@media (max-width: 75.99rem) {
  .rail { display: none; }
}
@media print { .rail, .topbar { display: none; } }

@media (max-width: 30rem) {
  main { padding: 0 1rem; }
  .hero { padding-top: 2.2rem; }
  table.park-table th { width: 7rem; }
}
