/* ============================================================================
   CampingSorted — Explore (discover → park → site → alert)
   Extends the "field guide at dawn" token system from styles.css. Adds the
   discovery map, park/site cards, the site list, filter panel, and availability
   chips. Never redefines a :root token; only consumes them. No inline styles
   (strict CSP). No external assets.
   ========================================================================== */

/* availability state palette — derived from the existing forest/ember system,
   plus a calm slate for the honest "checking" (NEVER reuse the booked red). */
:root {
  --avail-open:    #2c5a43;   /* forest — bookable */
  --avail-open-bg: rgba(44, 90, 67, 0.12);
  --avail-shut:    #a8392a;   /* clay-red — booked/held/closed (a real state) */
  --avail-shut-bg: rgba(168, 57, 42, 0.10);
  --avail-soon:    #b14f1c;   /* ember-deep — window-not-yet-open / seasonal */
  --avail-soon-bg: rgba(177, 79, 28, 0.10);
  --avail-check:   #6b7280;   /* neutral slate — "checking", never a verdict */
  --avail-check-bg: rgba(107, 114, 128, 0.12);
}

/* The explore body uses the same paper/contour/grain background from styles.css;
   give it a touch more room than the marketing pages. */
.explore-body { padding-bottom: 1px; }

/* off-screen icon sprite host (no inline style — CSP-clean) */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* a chip + its "demo" qualifier sit together */
.avail-pair { display: inline-flex; align-items: center; gap: 0.4rem; }

/* ---- header nav ---------------------------------------------------------- */
.header-nav { display: inline-flex; align-items: center; gap: 0.6rem; }

/* ---- breadcrumbs --------------------------------------------------------- */
.crumbs {
  position: relative; z-index: 2;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem;
  margin: 0.9rem auto 0;
  font-size: 0.82rem; color: var(--sage); letter-spacing: 0.02em;
}
.crumbs a { color: var(--forest-deep); text-decoration: none; font-weight: 600; }
.crumbs a:hover { color: var(--ember-deep); }
.crumbs .sep { opacity: 0.5; }
.crumbs .here { color: var(--ink); font-weight: 600; }

/* ---- generic loading / spinner ------------------------------------------- */
.view-loading {
  display: flex; flex-direction: column; align-items: center; gap: 0.9rem;
  padding: clamp(3rem, 12vw, 6rem) 0; color: var(--sage);
  font-family: var(--font-display); font-style: italic; font-size: 1.1rem;
}
.spinner {
  width: 2rem; height: 2rem; border-radius: 999px;
  border: 3px solid var(--line-strong); border-top-color: var(--forest);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2s; } }

/* ---- a refusal / empty panel (honest "we don't know yet") ---------------- */
.notice {
  margin: 1.6rem 0 0; padding: clamp(1.2rem, 4vw, 1.8rem);
  background: var(--paper-card); border: 1.5px solid var(--line);
  border-left: 4px solid var(--avail-check); border-radius: var(--radius-lg);
  box-shadow: 0 18px 36px -30px rgba(28, 63, 47, 0.5);
}
.notice.is-err { border-left-color: var(--avail-shut); }
.notice.is-check { border-left-color: var(--avail-check); }
.notice h2 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.3rem; margin: 0; color: var(--forest-deep);
}
.notice p { margin: 0.5rem 0 0; color: var(--sage); }
.notice .wz-btn-secondary { margin-top: 1rem; }

/* ============================================================================
   DISCOVER VIEW
   ========================================================================== */
.discover-head { padding: clamp(1.4rem, 4vw, 2.4rem) 0 0; max-width: 40rem; }
.discover-head h1 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(2rem, 5.5vw, 3rem); line-height: 1.02;
  letter-spacing: -0.02em; margin: 0.5rem 0 0; color: var(--ink);
}
.discover-head .lede { margin-top: 0.8rem; }

/* ---- park-page date row (label + the shared wz-cal chip) ------------------ */
.park-date-row {
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
  margin: 0 0 1rem;
}
.park-date-label {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-weight: 600; color: var(--forest); font-size: 0.95rem;
}
.park-date-label .ic { width: 1.05rem; height: 1.05rem; }
/* the chip wrapper shouldn't add the discover top margin inside the row */
.park-date-row .dc-cal-wrap { margin: 0; flex: 1 1 auto; min-width: 14rem; }

/* ---- discover date picker (wz-cal shared widget, collapsible) ------------- */
/* Outer wrapper — collapses to just the toggle chip; opens to show the calendar. */
.dc-cal-wrap {
  margin: 1.2rem 0 0;
}
/* The toggle chip that shows the currently chosen date range (or "Any dates"). */
.dc-cal-toggle {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.62rem 1rem;
  font: inherit; font-size: 0.95rem; font-weight: 600; color: var(--forest-deep);
  background: var(--paper-card);
  border: 1.5px solid var(--line-strong); border-radius: calc(var(--radius) + 4px);
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset;
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease), background 0.15s var(--ease);
}
.dc-cal-toggle .ic { width: 1.1rem; height: 1.1rem; color: var(--forest); flex: none; }
.dc-cal-toggle .chev { font-size: 0.85rem; transition: transform 0.2s var(--ease); color: var(--sage); }
.dc-cal-toggle:hover { border-color: var(--forest); background: var(--paper-soft); }
.dc-cal-toggle:focus-visible { outline: 3px solid var(--forest); outline-offset: 2px; }
/* When dates are set, tint the toggle to signal an active filter. */
.dc-cal-wrap:not(.is-collapsed) .dc-cal-toggle,
.dc-cal-wrap .dc-cal-toggle[aria-expanded="true"] {
  border-color: var(--forest); color: var(--forest-deep); background: var(--paper-soft);
}
.dc-cal-wrap .dc-cal-toggle[aria-expanded="true"] .chev { transform: rotate(-180deg); }

/* Calendar panel (hidden when collapsed). */
.dc-cal-wrap.is-collapsed .dc-cal { display: none; }
.dc-cal {
  margin-top: 0.5rem;
  /* Inherits all .wz-cal styles from alerts.css — we only add discover-context
     overrides here (max-width, drop shadow). */
  max-width: 22rem;
}

/* Footer row inside the calendar: "Clear dates" button. */
.dc-cal-footer {
  margin-top: 0.75rem;
  display: flex; justify-content: flex-end;
}
.dc-cal-clear {
  font: inherit; font-size: 0.84rem; font-weight: 600; color: var(--ember-deep);
  background: transparent; border: 0; cursor: pointer; padding: 0.2rem 0;
  text-decoration: underline; text-underline-offset: 2px;
}
.dc-cal-clear:hover { color: var(--ember); }
.dc-cal-clear:focus-visible { outline: 3px solid var(--forest); outline-offset: 2px; }

/* search + near-me control bar */
.discover-controls {
  display: flex; flex-wrap: wrap; gap: 0.7rem; margin: 1.4rem 0 0;
  align-items: stretch;
}
.search-box {
  flex: 1 1 18rem; min-width: 0; display: flex; align-items: center; gap: 0.4rem;
  padding: 0.2rem 0.2rem 0.2rem 0.9rem;
  background: var(--paper-card); border: 1.5px solid var(--line-strong);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset, 0 10px 30px -24px rgba(28,63,47,0.5);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.search-box:focus-within {
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(44, 90, 67, 0.16);
}
/* Defensive base size for inline icons — every icon SVG carries class "ic".
   Per-context rules (.parent .ic) are more specific and keep their own sizes;
   this only catches an icon placed in a context that forgot to size it, so a
   missing rule degrades to a small icon instead of the SVG's huge intrinsic
   size (the "Hookups & type" oversized-logo bug). */
.ic { width: 1rem; height: 1rem; flex: none; }
.search-box .ic { width: 1.2rem; height: 1.2rem; color: var(--sage); flex: none; }
.search-box input {
  flex: 1 1 auto; min-width: 0; padding: 0.7rem 0.4rem;
  font: inherit; font-size: 1rem; color: var(--ink);
  background: transparent; border: 0;
}
.search-box input:focus { outline: none; }
.search-box input::placeholder { color: #9aa093; }

.btn-near {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.7rem 1.1rem; font: inherit; font-size: 0.96rem; font-weight: 700;
  color: var(--forest-deep); background: var(--paper);
  border: 1.5px solid var(--line-strong); border-radius: calc(var(--radius) + 4px);
  cursor: pointer; transition: border-color 0.15s var(--ease), color 0.15s var(--ease), background 0.15s var(--ease);
}
.btn-near .ic { width: 1.2rem; height: 1.2rem; flex: none; }
.btn-near:hover { border-color: var(--forest); background: var(--paper-soft); }
.btn-near:focus-visible { outline: 3px solid var(--forest); outline-offset: 2px; }
.btn-near[disabled] { opacity: 0.6; cursor: progress; }
.btn-near.is-active { border-color: var(--ember); color: var(--ember-deep); }

.discover-status {
  margin: 0.7rem 0 0; min-height: 1.2em; font-size: 0.9rem; color: var(--sage);
}
.discover-status.is-err { color: var(--avail-shut); }

/* the map-beside-list layout (desktop) */
.discover-layout {
  display: grid; gap: clamp(1.2rem, 3vw, 2rem);
  grid-template-columns: 1fr; /* mobile: stacked */
  margin: 1.4rem 0 0;
}
@media (min-width: 900px) {
  .discover-layout { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); align-items: start; }
  .discover-layout .map-wrap { position: sticky; top: 1rem; }
}

/* ---- the self-hosted locator map ----------------------------------------- */
.map-wrap {
  background: var(--paper-card); border: 1.5px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: 0 22px 44px -32px rgba(28, 63, 47, 0.55);
}
.map-toggle {
  display: none; /* desktop: always visible */
  width: 100%; align-items: center; justify-content: space-between; gap: 0.5rem;
  padding: 0.8rem 1rem; font: inherit; font-size: 0.92rem; font-weight: 700;
  color: var(--forest-deep); background: var(--paper-soft);
  border: 0; border-bottom: 1.5px solid var(--line); cursor: pointer;
}
.map-toggle .chev { transition: transform 0.2s var(--ease); }
.map-wrap.is-collapsed .map-toggle .chev { transform: rotate(-90deg); }
/* MapLibre map container — needs an explicit height (the canvas fills it). */
.map-figure { margin: 0; position: relative; display: block; height: 460px; border-radius: var(--radius-lg); overflow: hidden; }
.map-figure .maplibregl-map { width: 100%; height: 100%; font: inherit; }
.map-wrap.is-collapsed .map-figure { display: none; }
@media (max-width: 640px) { .map-figure { height: 320px; } }

/* HTML park-pin markers (coloured dots, availability-honest) */
.ml-pin {
  width: 16px; height: 16px; padding: 0; box-sizing: border-box;
  border: 2px solid var(--paper-card); border-radius: 50%;
  background: var(--avail-check); cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: transform 0.12s var(--ease);
}
.ml-pin:hover, .ml-pin:focus { transform: scale(1.3); outline: none; z-index: 2; }
.ml-pin.is-open  { background: var(--avail-open); }
.ml-pin.is-shut  { background: var(--avail-shut); }
.ml-pin.is-check { background: var(--avail-check); }
.ml-pin.is-selected {
  background: var(--ember); transform: scale(1.25); z-index: 3;
  box-shadow: 0 0 0 3px rgba(207, 99, 38, 0.35), 0 1px 4px rgba(0, 0, 0, 0.4);
}
.map-legend {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.1rem;
  padding: 0.7rem 1rem 0.85rem; font-size: 0.78rem; color: var(--sage);
  border-top: 1.5px solid var(--line);
}
.map-legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.map-legend i { width: 0.7rem; height: 0.7rem; border-radius: 999px; flex: none; }
.map-legend .lg-open  { background: var(--avail-open); }
.map-legend .lg-shut  { background: var(--avail-shut); }
.map-legend .lg-check { background: var(--avail-check); }

/* ---- the park list (discover) -------------------------------------------- */
.park-list { display: grid; gap: 0.8rem; margin: 0; padding: 0; list-style: none; }
.park-list .count {
  margin: 0 0 0.2rem; font-size: 0.82rem; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--sage); font-weight: 600;
}
.park-card {
  display: grid; grid-template-columns: auto 1fr auto; gap: 0.5rem 0.9rem;
  align-items: center;
  padding: 0.95rem 1.05rem;
  background: var(--paper-card); border: 1.5px solid var(--line);
  border-radius: var(--radius-lg); text-decoration: none; color: inherit;
  box-shadow: 0 14px 30px -28px rgba(28, 63, 47, 0.5);
  transition: transform 0.15s var(--ease), border-color 0.15s var(--ease), box-shadow 0.2s var(--ease);
}
.park-card:hover {
  transform: translateY(-2px); border-color: var(--forest);
  box-shadow: 0 20px 38px -26px rgba(28, 63, 47, 0.55);
}
.park-card:focus-visible { outline: 3px solid var(--forest); outline-offset: 2px; }
.park-card.is-selected {
  border-color: var(--ember);
  background: rgba(207, 99, 38, 0.08);
  box-shadow: inset 4px 0 0 var(--ember), 0 2px 10px -6px rgba(207, 99, 38, 0.5);
}

/* MapLibre pin popups (hover tooltip + click card) */
.map-pop .maplibregl-popup-content {
  font: inherit; padding: 0.55rem 0.7rem; border-radius: 10px;
  box-shadow: 0 6px 20px -8px rgba(28, 63, 47, 0.5);
}
.map-pop--hover .maplibregl-popup-content { padding: 0.35rem 0.55rem; font-size: 0.88rem; font-weight: 600; color: var(--forest); }
.map-pop__name { margin: 0 0 0.3rem; font-weight: 700; color: var(--forest); }
.map-pop__link { display: inline-block; font-size: 0.9rem; font-weight: 600; color: var(--ember); text-decoration: none; }
.map-pop__link:hover { text-decoration: underline; }
.park-card__dot {
  grid-row: 1 / span 2; width: 0.85rem; height: 0.85rem; border-radius: 999px;
  align-self: start; margin-top: 0.35rem;
}
.park-card__dot.is-open  { background: var(--avail-open); box-shadow: 0 0 0 4px var(--avail-open-bg); }
.park-card__dot.is-shut  { background: var(--avail-shut); box-shadow: 0 0 0 4px var(--avail-shut-bg); }
.park-card__dot.is-check { background: var(--avail-check); box-shadow: 0 0 0 4px var(--avail-check-bg); }
.park-card__name {
  font-family: var(--font-display); font-weight: 600; font-size: 1.2rem;
  line-height: 1.15; color: var(--ink); margin: 0;
}
.park-card__meta { grid-column: 2; font-size: 0.88rem; color: var(--sage); margin: 0.1rem 0 0; }
.park-card__dist {
  grid-column: 3; grid-row: 1 / span 2; align-self: center;
  font-size: 0.8rem; font-weight: 700; color: var(--forest-deep);
  white-space: nowrap; text-align: right;
}
.park-card__go { grid-column: 3; grid-row: 1 / span 2; align-self: center; color: var(--moss); }
.park-card__go .ic { width: 1.2rem; height: 1.2rem; }

/* ============================================================================
   PARK VIEW
   ========================================================================== */
.park-hero {
  margin: 1.2rem 0 0; padding: clamp(1.4rem, 4vw, 2.2rem);
  background:
    radial-gradient(120% 120% at 88% -20%, rgba(201,138,75,0.18), transparent 55%),
    var(--paper-card);
  border: 1.5px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: 0 22px 44px -34px rgba(28, 63, 47, 0.5);
}
.park-hero h1 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.9rem, 5vw, 2.9rem); line-height: 1.02;
  letter-spacing: -0.02em; margin: 0.5rem 0 0; color: var(--ink);
}
.park-hero .loc {
  display: inline-flex; align-items: center; gap: 0.4rem;
  margin: 0.5rem 0 0; font-size: 0.95rem; color: var(--forest); font-weight: 600;
}
.park-hero .loc .ic { width: 1rem; height: 1rem; }
.park-hero .desc { margin: 0.9rem 0 0; max-width: 44rem; color: var(--ink); line-height: 1.65; }

.facts { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1.2rem 0 0; }
.fact {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.5rem 0.85rem; font-size: 0.86rem; font-weight: 600; color: var(--forest-deep);
  background: var(--paper); border: 1.5px solid var(--line-strong); border-radius: 999px;
}
.fact .ic { width: 1.05rem; height: 1.05rem; color: var(--moss); }
.fact.is-check { color: var(--avail-check); border-color: var(--avail-check); }
.fact .val { color: var(--ink); }

.park-cta { display: flex; flex-wrap: wrap; gap: 0.7rem; margin: 1.3rem 0 0; }

/* sites layout: filters + list */
.sites-layout {
  display: grid; gap: clamp(1rem, 3vw, 1.6rem); margin: 1.6rem 0 0;
  grid-template-columns: 1fr;
}
@media (min-width: 940px) {
  .sites-layout { grid-template-columns: 17rem minmax(0, 1fr); align-items: start; }
  .filter-panel { position: sticky; top: 1rem; }
}

/* ---- filter panel -------------------------------------------------------- */
.filter-panel {
  background: var(--paper-card); border: 1.5px solid var(--line);
  border-radius: var(--radius-lg); padding: clamp(1rem, 3vw, 1.3rem);
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset;
}
.filter-panel h2 {
  font-family: var(--font-display); font-weight: 600; font-size: 1.2rem;
  margin: 0 0 0.4rem; color: var(--forest-deep);
}
.fp-group { margin: 1rem 0 0; border: 0; padding: 0; }
.fp-group:first-of-type { margin-top: 0.6rem; }
.fp-group legend, .fp-label {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ember-deep); margin: 0 0 0.5rem; padding: 0;
}
/* equipment chips */
.equip-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.equip-chip {
  display: inline-flex; align-items: center; gap: 0.4rem; cursor: pointer;
  padding: 0.45rem 0.7rem; font-size: 0.88rem; font-weight: 600; color: var(--forest-deep);
  background: var(--paper); border: 1.5px solid var(--line-strong); border-radius: 999px;
  transition: border-color 0.12s var(--ease), background 0.12s var(--ease), color 0.12s var(--ease);
}
.equip-chip .ic { width: 1.05rem; height: 1.05rem; }
.equip-chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.equip-chip:hover { border-color: var(--forest); }
.equip-chip:has(input:checked) { background: var(--forest); color: #fff; border-color: var(--forest-deep); }
.equip-chip:has(input:focus-visible) { outline: 3px solid var(--forest); outline-offset: 2px; }

.fp-check { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; font-size: 0.94rem; color: var(--ink); margin: 0.5rem 0 0; }
.fp-check input { accent-color: var(--forest); width: 1.05rem; height: 1.05rem; flex: none; }
.fp-check .ic { width: 1.05rem; height: 1.05rem; color: var(--moss); flex: none; }

.fp-prox { display: grid; gap: 0.9rem; }
.fp-prox-item { display: flex; flex-direction: column; gap: 0.25rem; }
.fp-prox-item .row { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.fp-prox-item .row span { font-size: 0.9rem; font-weight: 600; color: var(--ink); }
.fp-prox-item .row .out { font-size: 0.82rem; color: var(--sage); font-variant-numeric: tabular-nums; }
.fp-prox-item input[type=range] { width: 100%; accent-color: var(--forest); }

.fp-num { display: flex; align-items: center; gap: 0.5rem; }
.fp-num input[type=number] {
  width: 5rem; padding: 0.45rem 0.55rem; font: inherit; color: var(--ink);
  background: var(--paper); border: 1.5px solid var(--line-strong); border-radius: var(--radius);
}
.fp-num input:focus { outline: none; border-color: var(--forest); box-shadow: 0 0 0 3px rgba(44,90,67,0.16); }
.fp-num label { font-size: 0.9rem; color: var(--ink); }

.fp-actions { margin: 1.2rem 0 0; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.fp-reset {
  font: inherit; font-size: 0.86rem; font-weight: 600; color: var(--sage);
  background: none; border: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.fp-reset:hover { color: var(--ember-deep); }

/* mobile: filters collapse behind a button */
.filter-toggle {
  display: none; width: 100%; align-items: center; justify-content: space-between;
  padding: 0.8rem 1rem; font: inherit; font-weight: 700; color: var(--forest-deep);
  background: var(--paper-card); border: 1.5px solid var(--line-strong);
  border-radius: var(--radius); cursor: pointer;
}
@media (max-width: 939px) {
  .filter-toggle { display: flex; margin-bottom: 0.8rem; }
  .filter-panel.is-collapsed { display: none; }
}

/* ---- site list ----------------------------------------------------------- */
.sites-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem; margin: 0 0 0.7rem; }
.sites-head h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.4rem; margin: 0; color: var(--ink); }
.sites-head .as-of { font-size: 0.8rem; color: var(--sage); }
.truncation-note {
  margin: 0 0 0.8rem; padding: 0.6rem 0.85rem; font-size: 0.84rem; color: var(--avail-soon);
  background: var(--avail-soon-bg); border-radius: var(--radius);
}

.site-list { display: grid; gap: 0.7rem; margin: 0; padding: 0; list-style: none; }
.site-row {
  display: grid; grid-template-columns: 1fr auto; gap: 0.5rem 0.9rem; align-items: center;
  padding: 0.85rem 1rem; background: var(--paper-card);
  border: 1.5px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: 0 12px 26px -28px rgba(28, 63, 47, 0.5);
  transition: border-color 0.12s var(--ease), transform 0.12s var(--ease);
}
.site-row:hover { border-color: var(--forest); transform: translateY(-1px); }
.site-row__main { min-width: 0; }
.site-row__name {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; color: var(--ink); margin: 0;
}
.site-row__name a { color: inherit; text-decoration: none; }
.site-row__name a:hover { color: var(--ember-deep); }
.site-row__tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.4rem 0 0; }
.tag {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.2rem 0.55rem; font-size: 0.76rem; font-weight: 600; color: var(--forest-deep);
  background: var(--paper); border: 1px solid var(--line-strong); border-radius: 999px;
}
.tag .ic { width: 0.85rem; height: 0.85rem; color: var(--moss); }
.tag.is-linked { color: var(--ember-deep); border-color: var(--ember); }

.site-row__right { display: flex; flex-direction: column; align-items: flex-end; gap: 0.4rem; }

/* ---- availability chip (the honest centerpiece) -------------------------- */
.avail {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.32rem 0.7rem; font-size: 0.82rem; font-weight: 700;
  border-radius: 999px; white-space: nowrap; border: 1.5px solid transparent;
}
.avail::before { content: ""; width: 0.55rem; height: 0.55rem; border-radius: 999px; background: currentColor; flex: none; }
.avail.is-open  { color: var(--avail-open);  background: var(--avail-open-bg);  border-color: rgba(44,90,67,0.3); }
.avail.is-shut  { color: var(--avail-shut);  background: var(--avail-shut-bg);  border-color: rgba(168,57,42,0.3); }
.avail.is-soon  { color: var(--avail-soon);  background: var(--avail-soon-bg);  border-color: rgba(177,79,28,0.3); }
.avail.is-check {
  color: var(--avail-check); background: var(--avail-check-bg); border-color: rgba(107,114,128,0.35);
}
.avail.is-check::before { animation: pulse-dot 1.6s var(--ease) infinite; }
@keyframes pulse-dot { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { .avail.is-check::before { animation: none; } }
.demo-tag {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--sage);
}

.watch-mini {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.4rem 0.75rem; font: inherit; font-size: 0.82rem; font-weight: 700;
  color: var(--forest-deep); background: var(--paper);
  border: 1.5px solid var(--line-strong); border-radius: 999px; cursor: pointer; text-decoration: none;
  transition: border-color 0.12s var(--ease), color 0.12s var(--ease), background 0.12s var(--ease);
}
.watch-mini .ic { width: 0.9rem; height: 0.9rem; }
.watch-mini:hover { border-color: var(--ember); color: var(--ember-deep); background: var(--paper-soft); }

/* ============================================================================
   SITE VIEW
   ========================================================================== */
.site-detail { margin: 1.2rem 0 0; }
.site-detail__head {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1rem;
}
.site-detail h1 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.8rem, 5vw, 2.6rem); line-height: 1.04;
  letter-spacing: -0.02em; margin: 0.4rem 0 0; color: var(--ink);
}
.site-detail .avail { font-size: 0.92rem; padding: 0.5rem 0.95rem; }

.site-grid { display: grid; gap: clamp(1rem, 3vw, 1.6rem); margin: 1.4rem 0 0; grid-template-columns: 1fr; }
@media (min-width: 820px) { .site-grid { grid-template-columns: minmax(0,1.3fr) minmax(0,1fr); } }

.panel {
  background: var(--paper-card); border: 1.5px solid var(--line);
  border-radius: var(--radius-lg); padding: clamp(1.1rem, 3vw, 1.5rem);
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset;
}
.panel h2 {
  font-family: var(--font-display); font-weight: 600; font-size: 1.25rem;
  margin: 0 0 0.8rem; color: var(--forest-deep);
}
.attr-list { display: grid; grid-template-columns: auto 1fr; gap: 0.55rem 1rem; margin: 0; }
.attr-list dt { font-weight: 600; color: var(--sage); font-size: 0.92rem; }
.attr-list dd { margin: 0; color: var(--ink); font-size: 0.95rem; }

.feature-tags { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0; padding: 0; list-style: none; }
.feature-tags .tag { font-size: 0.82rem; padding: 0.3rem 0.7rem; }

.linked-note {
  margin: 1rem 0 0; padding: 0.85rem 1rem; font-size: 0.9rem; line-height: 1.5; color: var(--ink);
  background: var(--avail-soon-bg); border: 1.5px solid var(--ember); border-radius: var(--radius);
}
.linked-note strong { color: var(--ember-deep); }

/* photos */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: 0.6rem; margin: 0; padding: 0; list-style: none; }
.photo-grid li { margin: 0; }
.photo-grid img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block;
  border-radius: var(--radius); border: 1.5px solid var(--line); background: var(--paper-soft);
}
.photo-empty { font-size: 0.9rem; color: var(--sage); font-style: italic; }

.avail-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 0.7rem; margin: 0.4rem 0 0; }
.avail-strip .as-of { font-size: 0.82rem; color: var(--sage); }

/* ---- big primary CTA reused across park + site -------------------------- */
.cta-watch {
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.8rem 1.4rem; font: inherit; font-size: 1rem; font-weight: 700; color: #fff;
  background: linear-gradient(180deg, var(--ember), var(--ember-deep));
  border: 0; border-radius: var(--radius); cursor: pointer; text-decoration: none;
  box-shadow: 0 10px 22px -10px var(--ember-glow);
  transition: transform 0.15s var(--ease), box-shadow 0.2s var(--ease), filter 0.2s var(--ease);
}
.cta-watch .ic { width: 1.15rem; height: 1.15rem; }
.cta-watch:hover { transform: translateY(-1px); filter: brightness(1.04); box-shadow: 0 14px 28px -12px var(--ember-glow); }
.cta-watch:focus-visible { outline: 3px solid var(--forest); outline-offset: 2px; }

/* ---- staggered reveal (reuses keyframes from styles.css) ----------------- */
@media (prefers-reduced-motion: no-preference) {
  .view-enter > * { opacity: 0; transform: translateY(10px); animation: rise 0.55s var(--ease) forwards; }
  .view-enter > *:nth-child(1) { animation-delay: 0.02s; }
  .view-enter > *:nth-child(2) { animation-delay: 0.08s; }
  .view-enter > *:nth-child(3) { animation-delay: 0.14s; }
  .view-enter > *:nth-child(4) { animation-delay: 0.20s; }
  .view-enter > *:nth-child(5) { animation-delay: 0.26s; }
}

/* ============================================================================
   SECTION GROUPING + NAVIGATION (§4.2 / §4.3)
   ========================================================================== */

/* ---- within-park section filter ------------------------------------------ */
.section-filter {
  margin: 0 0 0.9rem;
}
.section-filter-input {
  width: 100%; padding: 0.55rem 0.85rem;
  font: inherit; font-size: 0.92rem; color: var(--ink);
  background: var(--paper-card); border: 1.5px solid var(--line-strong);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset;
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.section-filter-input::placeholder { color: #9aa093; }
.section-filter-input:focus {
  outline: none;
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(44,90,67,0.16);
}

/* ---- collapsible section group (<details>/<summary>) --------------------- */
.sec-group {
  margin: 0 0 0.6rem;
  background: var(--paper-card); border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 28px -28px rgba(28,63,47,0.45);
  overflow: hidden;
}
.sec-group[open] > .sec-group__summary .chev-sec { transform: rotate(0deg); }

.sec-group__summary {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.8rem;
  padding: 0.75rem 1rem; cursor: pointer;
  list-style: none; /* hide the native disclosure triangle */
  border-radius: var(--radius-lg); /* matches parent when closed */
  transition: background 0.12s var(--ease);
}
/* Safari shows its own ::marker on summary; suppress it */
.sec-group__summary::-webkit-details-marker { display: none; }
.sec-group__summary::marker { display: none; }
.sec-group__summary:hover { background: var(--paper-soft); }
.sec-group__summary:focus-visible { outline: 3px solid var(--forest); outline-offset: -2px; }

/* When open, add a bottom border separating summary from the sites */
.sec-group[open] > .sec-group__summary {
  border-bottom: 1.5px solid var(--line);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.sec-group__title {
  font-family: var(--font-display); font-weight: 600; font-size: 1.05rem;
  color: var(--forest-deep); flex: 0 0 auto;
}
/* Custom disclosure chevron — a pure CSS triangle so we control direction */
.sec-group__title::before {
  content: "▶";
  display: inline-block;
  font-size: 0.65em;
  margin-right: 0.45em;
  color: var(--moss);
  transition: transform 0.18s var(--ease);
  transform: rotate(0deg);
  vertical-align: 0.08em;
}
.sec-group[open] > .sec-group__summary .sec-group__title::before {
  transform: rotate(90deg);
}

.sec-group__count {
  font-size: 0.8rem; font-weight: 600; color: var(--sage);
  flex: 0 0 auto;
}

.sec-group__deeplink {
  font-size: 0.8rem; font-weight: 700; color: var(--forest-deep);
  text-decoration: none; margin-left: auto; /* push to the right of title + count */
  white-space: nowrap; padding: 0.25rem 0.6rem;
  border: 1.5px solid var(--line-strong); border-radius: 999px;
  background: var(--paper);
  transition: border-color 0.12s var(--ease), color 0.12s var(--ease);
}
.sec-group__deeplink:hover { border-color: var(--forest); color: var(--forest); }
.sec-group__deeplink:focus-visible { outline: 3px solid var(--forest); outline-offset: 2px; }

.sec-group__watch {
  flex: 0 0 auto;
  /* inherits .watch-mini styles; add a small left margin on larger screens */
}

/* site list inside a group sits flush — the group card provides the container */
.sec-group > .site-list {
  margin: 0; padding: 0.7rem 0.85rem; list-style: none;
  display: grid; gap: 0.6rem;
}
/* tighten site rows inside a section group slightly */
.sec-group > .site-list .site-row {
  border-color: var(--line);
  box-shadow: none; /* the group card already provides depth */
}

/* ---- section view (click-into-section route) ------------------------------ */
.sec-view { margin: 1.2rem 0 0; }
.sec-view__hero {
  padding: clamp(1.2rem, 3.5vw, 2rem);
  background:
    radial-gradient(110% 120% at 90% -15%, rgba(44,90,67,0.12), transparent 55%),
    var(--paper-card);
  border: 1.5px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: 0 18px 38px -30px rgba(28,63,47,0.5);
  margin-bottom: 1.4rem;
}
.sec-view__hero h1 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.7rem, 4.5vw, 2.6rem); line-height: 1.04;
  letter-spacing: -0.02em; margin: 0.4rem 0 0; color: var(--ink);
}
.sec-view__count {
  font-size: 0.9rem; color: var(--sage); margin: 0.4rem 0 0;
}
.sec-back { white-space: nowrap; }

/* ---- mobile polish ------------------------------------------------------- */
@media (max-width: 560px) {
  .discover-controls { flex-direction: column; }
  .btn-near { justify-content: center; }
  .site-row { grid-template-columns: 1fr; }
  .site-row__right { flex-direction: row; align-items: center; justify-content: space-between; width: 100%; }
  .park-card { grid-template-columns: auto 1fr; }
  .park-card__dist, .park-card__go { grid-column: 2; grid-row: auto; text-align: left; align-self: start; }
  .map-toggle { display: flex; }
}
