/* ============================================================================
   Turquoise Necklace — compact CTA + expanded scrollytelling sidecar
   Self-contained. Loaded on every page (small), but the heavy MapLibre view is
   only mounted on demand by /assets/js/necklace-compact.js.
   Palette reuses the site tokens defined on :root in index.html.
   ========================================================================== */

/* ---- Compact view: the "Explore the full Necklace" CTA ------------------- */
/* Compact view is a lean teaser; the expanded view is the hero. */
.necklace-teaser{font-family:var(--display);font-weight:600;font-size:1.7rem;line-height:1.15;color:var(--bone)}
.necklace-teaser-sub{margin-top:.7rem;font-size:.98rem;line-height:1.5;color:rgba(246,240,229,.82);max-width:34ch}
.necklace-cta{margin-top:1.5rem;display:flex;flex-direction:column;gap:.55rem;align-items:flex-start}
.necklace-cta .btn{display:inline-flex;align-items:center;gap:.5rem;font-size:1rem;padding:.9rem 1.7rem}
.necklace-cta .nk-cta-sub{font-size:.78rem;color:rgba(246,240,229,.72);max-width:38ch}
.necklace-cta .btn svg{width:1.05em;height:1.05em;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}

/* ---- Expanded view: full-screen modal overlay ---------------------------- */
.nk-overlay{
  position:fixed;inset:0;z-index:1000;
  background:var(--bone);
  display:flex;flex-direction:column;
  opacity:0;visibility:hidden;
  transition:opacity .25s ease;
}
.nk-overlay.is-open{opacity:1;visibility:visible}
@media (prefers-reduced-motion:reduce){.nk-overlay{transition:none}}
.nk-overlay[hidden]{display:none}

/* Top bar: title + language note + close ----------------------------------- */
.nk-topbar{
  position:relative;z-index:30;flex:none;
  display:flex;align-items:center;gap:1rem;
  padding:.7rem 1rem .7rem 1.2rem;
  background:var(--teal-ink);color:var(--bone);
  box-shadow:0 1px 0 rgba(0,0,0,.25);
}
.nk-topbar .nk-eyebrow{font-size:.66rem;font-weight:700;letter-spacing:.16em;text-transform:uppercase;color:#8FD6D4}
.nk-topbar .nk-title{font-family:var(--display);font-weight:600;font-size:1.05rem;line-height:1.15}
.nk-topbar .nk-title-wrap{flex:1 1 auto;min-width:0}
.nk-lang{flex:none;display:flex;gap:.25rem}
.nk-lang button{font-family:var(--body);font-weight:700;font-size:.76rem;letter-spacing:.04em;width:2.2rem;height:2.2rem;border-radius:50%;border:1.5px solid rgba(246,240,229,.35);background:transparent;color:var(--bone);cursor:pointer}
.nk-lang button:hover{border-color:var(--bone)}
.nk-lang button[aria-pressed="true"]{background:var(--turquoise);border-color:var(--turquoise);color:#fff}
.nk-close{
  flex:none;width:2.5rem;height:2.5rem;border-radius:50%;
  border:1.5px solid rgba(246,240,229,.4);background:transparent;color:var(--bone);
  cursor:pointer;display:grid;place-items:center;font-size:1.2rem;line-height:1;
}
.nk-close:hover{border-color:var(--bone);background:rgba(246,240,229,.1)}
.nk-close svg{width:1.1rem;height:1.1rem;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round}

/* Body holds the scroll region + bottom chrome in a bounded flex column. */
.nk-body{flex:1 1 auto;display:flex;flex-direction:column;min-height:0}

/* Scroll region: pinned map + scrolling steps ------------------------------ */
/* proximity (not mandatory): snaps the card into frame when scrolling settles,
   without trapping/hanging continuous scrolling between parks. */
.nk-scroll{position:relative;flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;scroll-snap-type:y proximity}

.nk-graphic{position:sticky;top:0;height:100%;width:100%;z-index:1}
/* Size with width/height (not absolute inset): MapLibre's own .maplibregl-map
   rule forces position:relative and would override absolute positioning,
   collapsing the container to 0 height. The graphic gets an explicit px height
   from JS, so height:100% here resolves correctly. */
.nk-map{width:100%;height:100%;background:var(--bone)}
.nk-map .maplibregl-canvas{outline:none}

/* The steps scroll OVER the pinned map. The negative top-margin (pulling the
   steps up to overlap the sticky graphic) is set in JS to the scroll viewport
   height in px — percentage margins resolve against width, not height. The
   steps are click-through (pointer-events:none) so the map stays pannable in
   the gaps; only the cards capture pointer events. */
.nk-steps{position:relative;z-index:10;pointer-events:none}
.nk-step{
  min-height:92vh;display:flex;align-items:center;
  padding:1.5rem;
  /* Snap each bead's card fully into frame instead of letting it rest
     half-scrolled behind the bottom controls. */
  scroll-snap-align:center;
}
/* Desktop: cards dock to the right over a readable scrim. */
.nk-step{justify-content:flex-end}
.nk-card{
  pointer-events:auto;
  width:min(30rem,42vw);
  background:rgba(244,241,234,.94);
  border:1px solid var(--line);
  border-left:5px solid var(--turquoise);
  border-radius:14px;
  padding:1.3rem 1.4rem;
  box-shadow:0 8px 30px rgba(20,8,0,.18);
  backdrop-filter:blur(2px);
  opacity:.45;transform:translateY(8px);
  transition:opacity .4s ease,transform .4s ease;
}
.nk-step.is-active .nk-card{opacity:1;transform:none}
@media (prefers-reduced-motion:reduce){.nk-card{transition:none;opacity:1;transform:none}}
.nk-card.is-pendant{border-left-color:var(--clay);border-left-width:7px}
.nk-card .nk-num{font-size:.72rem;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:var(--turquoise-deep)}
.nk-card.is-pendant .nk-num{color:var(--clay-deep)}
.nk-card .nk-region{font-size:.72rem;color:rgba(36,28,20,.6);font-weight:700;letter-spacing:.06em;text-transform:uppercase;float:right}
.nk-card h3{font-family:var(--display);font-weight:600;font-size:1.45rem;line-height:1.18;margin:.35rem 0 .5rem;color:var(--ink)}
.nk-card p{font-size:.96rem;color:#241C14;line-height:1.5}
.nk-card .nk-approx{display:inline-block;margin-top:.7rem;font-size:.68rem;letter-spacing:.05em;text-transform:uppercase;border:1px solid var(--line);border-radius:99px;padding:.18rem .6rem;color:rgba(36,28,20,.7)}
.nk-card .nk-approx[hidden]{display:none}

/* A leading + trailing spacer so the first/last bead can reach center. */
.nk-spacer{min-height:30vh;pointer-events:none}

/* Bottom controls: keyboard-friendly prev/next + progress ------------------ */
.nk-controls{
  position:relative;z-index:30;flex:none;
  display:flex;align-items:center;gap:1rem;
  padding:.6rem 1.2rem;
  background:var(--teal-ink);color:var(--bone);
}
.nk-controls .nk-counter{font-size:.82rem;font-weight:700;letter-spacing:.04em;font-variant-numeric:tabular-nums}
.nk-controls .nk-spring{flex:1 1 auto}
.nk-btn{
  font-family:var(--body);font-weight:700;font-size:.85rem;
  border-radius:99px;border:1.5px solid rgba(246,240,229,.45);
  background:transparent;color:var(--bone);cursor:pointer;
  padding:.5rem 1.1rem;display:inline-flex;align-items:center;gap:.4rem;
}
.nk-btn:hover:not(:disabled){border-color:var(--bone);background:rgba(246,240,229,.1)}
.nk-btn:disabled{opacity:.4;cursor:default}
.nk-progress{flex:1 1 auto;height:4px;border-radius:99px;background:rgba(246,240,229,.2);overflow:hidden;max-width:40vw}
.nk-progress>i{display:block;height:100%;background:var(--turquoise);width:0;transition:width .4s ease}
@media (prefers-reduced-motion:reduce){.nk-progress>i{transition:none}}

/* Accessible text-equivalent: the full ordered list of all parks.
   Visible to AT and to anyone who opens it; not a substitute for the map but
   conveys the same information (WCAG). */
.nk-at{position:relative;z-index:30;flex:none;background:var(--bone);border-top:1px solid var(--line)}
.nk-at>summary{cursor:pointer;padding:.6rem 1.2rem;font-size:.82rem;font-weight:700;color:var(--turquoise-deep);list-style:none}
.nk-at>summary::-webkit-details-marker{display:none}
.nk-at>summary::before{content:"▸ ";color:var(--clay)}
.nk-at[open]>summary::before{content:"▾ "}
.nk-at ol{margin:0;padding:.4rem 1.2rem 1rem 2.4rem;max-height:40vh;overflow-y:auto;columns:2;column-gap:2rem}
.nk-at li{margin:.3rem 0;break-inside:avoid;font-size:.88rem}
.nk-at li strong{font-weight:700}
.nk-at li span{color:rgba(36,28,20,.7)}

/* Visually-hidden helper for the live region announcing the active bead. */
.nk-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}

/* Loading / error states while the map module boots. */
.nk-status{position:absolute;inset:0;display:grid;place-items:center;z-index:20;color:var(--teal-ink);text-align:center;padding:2rem;pointer-events:none}
.nk-status p{font-family:var(--display);font-size:1.1rem;max-width:36ch}
.nk-status .nk-err{color:var(--clay-deep);font-weight:700}

/* ---- Mobile: full-bleed sticky map, cards over a contrast scrim ---------- */
@media (max-width:720px){
  .nk-step{justify-content:center;padding:1rem;align-items:flex-end;min-height:88vh}
  .nk-card{width:min(34rem,94vw);opacity:.6}
  .nk-progress{max-width:none}
  /* A bottom scrim improves card-over-map contrast on small screens. */
  .nk-steps::after{content:none}
}

/* Hide MapLibre's cooperative-gesture hint (it re-appears on every blocked
   scroll). We show our own one-time hint instead (.nk-coop-hint). */
.nk-overlay .maplibregl-cooperative-gesture-screen{display:none!important}
.nk-coop-hint{
  position:absolute;top:1rem;left:50%;transform:translateX(-50%);
  z-index:25;pointer-events:none;
  background:rgba(36,28,20,.9);color:var(--bone);
  font-size:.8rem;font-weight:600;letter-spacing:.01em;
  padding:.5rem .9rem;border-radius:99px;
  box-shadow:0 3px 12px rgba(20,8,0,.3);
  opacity:0;transition:opacity .4s ease;white-space:nowrap;
}
.nk-coop-hint.is-on{opacity:1}
@media (prefers-reduced-motion:reduce){.nk-coop-hint{transition:none}}

/* MapLibre attribution stays legible on the bone canvas. */
.nk-overlay .maplibregl-ctrl-attrib{font-size:10px;background:rgba(244,241,234,.7)}
.nk-overlay .maplibregl-ctrl-attrib a{color:var(--turquoise-deep)}
