/* ============================================================
   Scavenger Quest — quest detail page
   Page-specific parts only; tokens, type, buttons, nav, bands and
   footer come from css/site.css, which loads first.
   ============================================================ */

/* nav: the app link reads as a pill here, beside a hero photo */
.nav-links a.hl{
  color: var(--sea-deep);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 8px 16px;
  border-radius: 999px;
}

/* ---------- banner ---------- */

.banner{
  position: relative;
  min-height: clamp(460px, 68vh, 620px);
  border-radius: 28px;
  overflow: hidden;
  background: var(--night);
  box-shadow: var(--lift);
  display: flex;
  align-items: flex-end;
  isolation: isolate;
}
.banner-img{
  position: absolute; inset: 0; z-index: -2;
  background-size: cover;
  background-position: center 30%;
  transform: scale(1.02);
}
/* scrim: dark where the copy sits, clear where the picture matters */
.banner::before{
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(20,44,58,.86) 0%, rgba(20,44,58,.62) 38%, rgba(20,44,58,.08) 72%),
    linear-gradient(0deg, rgba(20,44,58,.55) 0%, transparent 46%);
}
.banner-copy{
  padding: clamp(28px, 5vw, 56px);
  max-width: 660px;
  display: flex; flex-direction: column; gap: 20px;
  color: #FFFFFF;
}
.banner-copy h1{ color: #FFFFFF; font-size: clamp(44px, 7vw, 84px); }
.banner-lede{ font-size: 18px; line-height: 1.55; color: #E3F2F7; max-width: 50ch; }
.banner-cta{ display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }

.facts{ display: flex; flex-wrap: wrap; gap: 8px; }
.fact{
  display: flex; flex-direction: column; gap: 1px;
  padding: 9px 15px 10px;
  border-radius: 14px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.22);
  backdrop-filter: blur(6px);
}
.fact b{
  font-family: var(--f-label); font-size: 15px; font-weight: 700;
  color: #FFFFFF; font-variant-numeric: tabular-nums;
}
.fact span{
  font-family: var(--f-label); font-size: 9.5px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: #BFE0EA;
}

.badges{ position: absolute; top: 20px; right: 20px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.badge{
  font-family: var(--f-label); font-size: 10.5px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  padding: 7px 13px; border-radius: 999px;
  background: #FFFFFF; color: var(--ink-2);
  box-shadow: var(--lift-sm);
}
.badge.sun{ background: var(--sun); color: #FFFFFF; }

/* difficulty dots, used in facts, glance and the switch */
.tierdots{ display: inline-flex; gap: 4px; vertical-align: middle; }
.tierdots i{ width: 8px; height: 8px; border-radius: 50%; display: block; }
.tierdots .easy{ background: var(--t-easy); }
.tierdots .medium{ background: var(--t-medium); }
.tierdots .hard{ background: var(--t-hard); }

/* ---------- story + glance ---------- */

.story{
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}
.story-body{ display: flex; flex-direction: column; gap: 16px; max-width: 62ch; }
.story-body p{ font-size: 18px; line-height: 1.7; color: var(--ink); }
.story-body p:first-child::first-letter{
  font-family: var(--f-display); font-weight: 800;
  float: left; font-size: 64px; line-height: .9;
  margin: 6px 10px 0 0; color: var(--sea-deep);
}

.glance{
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--lift);
  padding: 24px 26px 8px;
}
.glance h3{ font-size: 18px; margin-bottom: 8px; }
.glance dl{ margin: 0; }
.glance .row{
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line-soft);
}
.glance .row:first-child{ border-top: 0; }
.glance dt{
  font-family: var(--f-label); font-size: 10.5px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3);
  flex: none;
}
.glance dd{ margin: 0; text-align: right; font-weight: 600; font-size: 14.5px; color: var(--ink); }
.glance dd small{ display: block; font-weight: 500; font-size: 12.5px; color: var(--ink-2); }

/* ---------- route ---------- */

.route-head{ display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px 32px; margin-bottom: 36px; }
.route-head .band-head{ margin-bottom: 0; flex: 1 1 520px; }

.tierswitch{
  display: inline-flex; gap: 4px; padding: 5px;
  background: var(--surface); border-radius: 999px; box-shadow: var(--lift-sm);
}
.tierswitch button{
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-label); font-size: 13px; font-weight: 700;
  padding: 9px 16px; border-radius: 999px;
  border: 0; background: transparent; color: var(--ink-2);
  cursor: pointer; transition: background .15s ease, color .15s ease;
}
.tierswitch button i{ width: 8px; height: 8px; border-radius: 50%; }
.tierswitch button:hover{ color: var(--ink); }
.tierswitch button[aria-checked="true"]{ background: var(--ground); color: var(--ink); }

.routegrid{
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  align-items: start;
}

/* with JS off the map and the switch can't work, so the stop list stands alone */
.no-js .mapcard, .no-js .tierswitch{ display: none; }
.no-js .routegrid{ grid-template-columns: minmax(0, 1fr); }
.no-js .stoprail{ max-height: none; overflow: visible; }

.mapcard{
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--lift);
  overflow: hidden;
}
.mapbox{ position: relative; height: clamp(460px, 72vh, 700px); }
.mapbox svg{ display: block; width: 100%; height: 100%; }
.mapbox svg{ user-select: none; -webkit-user-select: none; }
.mapbox.zoomed svg{ cursor: grab; }
.mapbox.panning svg{ cursor: grabbing; }

/* zoom buttons, stacked in the chart's top-left corner */
.mapctl{
  position: absolute; top: 10px; left: 10px; z-index: 2;
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--lift-sm);
  overflow: hidden;
}
.mapctl button{
  width: 42px; height: 40px;
  display: grid; place-items: center;
  background: none; border: 0; cursor: pointer;
  color: var(--sea-deep);
}
.mapctl button + button{ border-top: 1px solid var(--line-soft); }
.mapctl button:hover:not(:disabled){ background: var(--ground); }
.mapctl button:disabled{ color: var(--ink-3); opacity: .45; cursor: default; }
.mapctl button:focus-visible{ outline-offset: -3px; border-radius: 10px; }
.mapctl svg{ width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* shown briefly when someone scrolls over the chart without the zoom modifier */
.maphint{
  position: absolute; left: 50%; top: 50%; z-index: 3;
  transform: translate(-50%, -50%);
  background: rgba(29,58,74,.82); color: #FFFFFF;
  font-family: var(--f-label); font-size: 13px; font-weight: 700;
  padding: 10px 16px; border-radius: 999px;
  pointer-events: none;
  opacity: 0; transition: opacity .2s ease;
}
.mapbox.hinting .maphint{ opacity: 1; }

.maplegend{
  display: flex; flex-wrap: wrap; gap: 8px 20px;
  padding: 14px 20px;
  border-top: 1px solid var(--line-soft);
  font-family: var(--f-label); font-size: 11px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3);
}
.maplegend span{ display: inline-flex; align-items: center; gap: 8px; }
.lg{ display: inline-block; width: 12px; height: 12px; border-radius: 50%; flex: none; }
.lg-start{ background: var(--sun); }
.lg-stop{ background: #FFFFFF; border: 2.5px solid var(--sea); }
.lg-detour{ width: 9px; height: 9px; border-radius: 2px; transform: rotate(45deg); background: var(--teal); }
.lg-egg{ border: 1.5px dashed var(--ink-3); background: #FFFFFF; }
.lg-finale{ background: var(--sun-soft); border: 2.5px solid var(--sun); }

.egg-note{
  margin: 0 20px 18px;
  background: var(--sun-soft);
  border: 1px solid #FFD9A8;
  border-radius: var(--r-sm);
  padding: 12px 16px;
  font-size: 13.5px; color: var(--ink-2);
}

/* --- map drawing: same vocabulary as the home hero chart --- */
.m-land{ fill: #FFFFFF; }
.m-grid{ fill: #E3EEF4; }
.m-sea{ fill: #DDF0F7; }
.m-wave{ fill: none; stroke: #BFE2EE; stroke-width: 1.4; stroke-linejoin: round; }
.m-coast{ fill: none; stroke: #9FD3E5; stroke-width: 2; stroke-linejoin: round; }
.m-pier{ fill: #E6EEF2; stroke: #B9C9D2; stroke-width: 1.5; stroke-linejoin: round; }
.m-pier-line{ fill: none; stroke: #B9C9D2; stroke-width: 4; stroke-linecap: round; }
.m-ship{ fill: #FFFFFF; stroke: var(--sea); stroke-width: 2; stroke-linejoin: round; }
.m-ship-stack{ fill: var(--sea); }

.m-route-base{ fill: none; stroke: #C9DEEA; stroke-width: 3; stroke-dasharray: 2 9; stroke-linecap: round; }
.m-route-draw{ fill: none; stroke: #9CCBE4; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.m-route-trace{ fill: none; stroke: var(--sea); stroke-width: 3.5; stroke-linecap: round; }

.m-leader{ stroke: var(--sea); stroke-width: 1.2; stroke-dasharray: 2 2.5; }
.m-leader-sun{ stroke: var(--sun); }
.m-anchor{ fill: var(--sea); }

.m-stop{ cursor: pointer; transition: opacity .3s ease; }
.m-stop circle{ fill: #FFFFFF; stroke: var(--sea); stroke-width: 2.5; transition: fill .15s ease, stroke-width .15s ease; }
.m-stop text{
  font-family: var(--f-label); font-size: 10.5px; font-weight: 800;
  fill: var(--sea-deep); text-anchor: middle; dominant-baseline: central;
  pointer-events: none;
}
.m-stop.pending{ opacity: 0; }
.m-stop:hover circle, .m-stop:focus-visible circle, .m-stop.on circle{ fill: var(--sea); stroke-width: 3; }
.m-stop:hover text, .m-stop:focus-visible text, .m-stop.on text{ fill: #FFFFFF; }
.m-stop:focus-visible{ outline: none; }

.m-start{ fill: var(--sun); stroke: #FFFFFF; stroke-width: 2.5; }
.m-finale{ fill: none; stroke: var(--sun); stroke-width: 2.5; stroke-dasharray: 4 4; transform-box: fill-box; transform-origin: center; }
.m-finale-glow{ fill: var(--sun-soft); }

.m-detour{ cursor: pointer; }
.m-detour rect{ fill: var(--teal); stroke: #FFFFFF; stroke-width: 2; }

.m-egg{ cursor: pointer; }
.m-egg circle{ fill: rgba(255,255,255,.7); stroke: var(--ink-3); stroke-width: 1.5; stroke-dasharray: 3 4; transition: stroke .2s ease; }
.m-egg text{ font-family: var(--f-label); font-size: 13px; font-weight: 700; fill: var(--ink-3); text-anchor: middle; dominant-baseline: central; transition: fill .2s ease; }
.m-egg:hover circle, .m-egg:focus-visible circle{ stroke: var(--sun); }
.m-egg:hover text, .m-egg:focus-visible text{ fill: var(--sun); }
.m-egg:focus-visible{ outline: none; }

.m-tag{
  font-family: var(--f-label); font-weight: 700; font-size: 10px;
  letter-spacing: .08em; fill: var(--ink-3);
  paint-order: stroke; stroke: #FFFFFF; stroke-width: 4px; stroke-linejoin: round;
}
.m-tag.sun{ fill: var(--sun-deep); }
.m-zoomtag{ fill: var(--sea-deep); cursor: pointer; }
.m-zoomtag:hover, .m-zoomtag:focus-visible{ fill: var(--sea); text-decoration: underline; outline: none; }
.m-tip rect{ fill: var(--ink); }
.m-tip text{ font-family: var(--f-label); font-size: 12px; font-weight: 700; fill: #FFFFFF; dominant-baseline: central; }
.m-tip{ pointer-events: none; transition: opacity .15s ease; }

.m-scale line{ stroke: var(--ink-2); stroke-width: 1.5; }
.m-scale text, .m-north text, .m-credit{
  font-family: var(--f-label); font-size: 10px; font-weight: 700; letter-spacing: .08em; fill: var(--ink-2);
}
.m-credit{ font-size: 9px; font-weight: 600; letter-spacing: .03em; fill: var(--ink-3); }
.m-north path{ fill: var(--ink-2); }

/* --- stop rail --- */
.stoprail{
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 10px;
  max-height: calc(clamp(460px, 72vh, 700px) + 50px);
  overflow-y: auto;
  padding: 2px 6px 14px 2px;
  scrollbar-width: thin;
}
.stop{
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--lift-sm);
  border: 1.5px solid transparent;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.stop.on{ border-color: var(--sea); box-shadow: 0 18px 22px -14px rgba(69,160,206,.55); }
.stop > button{
  width: 100%;
  display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px;
  align-items: start;
  padding: 14px 16px;
  background: none; border: 0; text-align: left; cursor: pointer;
  font: inherit; color: inherit;
}
.stop-n{
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--f-label); font-size: 12px; font-weight: 800;
  color: var(--sea-deep); border: 2.5px solid var(--sea); background: #FFFFFF;
}
.stop.on .stop-n{ background: var(--sea); color: #FFFFFF; }
.stop.finale .stop-n{ border-color: var(--sun); color: var(--sun-deep); }
.stop.finale.on .stop-n{ background: var(--sun); color: #FFFFFF; }
.stop-name{ font-weight: 700; font-size: 15px; line-height: 1.3; display: block; }
.stop-sub{ font-family: var(--f-label); font-size: 11.5px; color: var(--ink-3); font-weight: 600; margin-top: 2px; display: block; }
.stop-tasks{ display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.tchip{
  font-family: var(--f-label); font-size: 10.5px; font-weight: 700; letter-spacing: .03em;
  color: var(--ink-2); background: var(--ground-2);
  border-radius: 999px; padding: 3px 9px;
}
.tchip.opt{ background: transparent; border: 1px dashed var(--line); color: var(--ink-3); }

.stop-more{ padding: 0 16px 16px 58px; display: flex; flex-direction: column; gap: 10px; }
.stop-more img{ width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 10px; display: block; background: var(--ground-2); }
.stop-more p{
  font-size: 13.5px; line-height: 1.55; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden;
}
.gets{ display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.gets > span:first-child{
  font-family: var(--f-label); font-size: 10px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin-right: 3px;
}
.gets .g{ font-family: var(--f-label); font-size: 11px; font-weight: 700; color: var(--ok); background: var(--ok-soft); border-radius: 999px; padding: 3px 9px; }

.railnote{
  font-family: var(--f-label); font-size: 12px; font-weight: 600;
  color: var(--ink-3);
  padding: 6px 14px 6px 16px;
  border-left: 2px dashed var(--line);
  margin-left: 30px;
}
.railnote b{ color: var(--teal-deep); font-weight: 700; }

/* ---------- collect ---------- */

.tiles{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 16px;
}
.tile{
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--lift-sm);
  overflow: hidden;
}
.tile img{ width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--ground-2); }
.tile div{ padding: 12px 14px 14px; }
.tile b{ display: block; font-family: var(--f-display); font-size: 17px; line-height: 1.2; }
.tile span{ display: block; font-size: 12.5px; color: var(--ink-2); margin-top: 3px; line-height: 1.4; }

.finale{
  margin-top: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--lift);
  overflow: hidden;
}
.finale img{ width: 100%; height: 100%; min-height: 240px; object-fit: cover; display: block; background: var(--sun-soft); }
.finale-copy{ padding: clamp(24px, 4vw, 40px); display: flex; flex-direction: column; gap: 12px; justify-content: center; }
.finale-copy h3{ font-size: clamp(24px, 2.6vw, 32px); }
.finale-copy .eyebrow{ color: var(--sun-deep); margin-bottom: 4px; }
.finale-copy .eyebrow::before{ background: var(--sun); }
.finale-copy p{ color: var(--ink-2); font-size: 16px; }
.finale-copy .where{ font-family: var(--f-label); font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--sun-deep); }

/* ---------- play ---------- */

.play{
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 40px;
  padding: clamp(32px, 5vw, 56px);
  border-radius: 28px;
  background: linear-gradient(110deg, var(--sea-deep), var(--sea) 55%, var(--aqua));
  color: #FFFFFF;
  box-shadow: var(--lift);
}
.play h2{ color: #FFFFFF; }
.play p{ margin-top: 12px; color: #E3F4FA; font-size: 17px; max-width: 48ch; }
.play-cta{ display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- responsive ---------- */

@media (max-width: 960px){
  .story{ grid-template-columns: 1fr; gap: 32px; }
  .routegrid{ grid-template-columns: 1fr; }
  .stoprail{ max-height: none; overflow: visible; padding-right: 2px; }
  .finale{ grid-template-columns: 1fr; }
  .finale img{ min-height: 0; aspect-ratio: 16 / 9; }
}
@media (max-width: 560px){
  .banner{ border-radius: 22px; min-height: 560px; }
  .banner::before{
    background: linear-gradient(0deg, rgba(20,44,58,.9) 0%, rgba(20,44,58,.7) 50%, rgba(20,44,58,.15) 100%);
  }
  .banner-lede{ font-size: 16px; }
  .badges{ top: 14px; right: 14px; }
  .mapbox{ height: 480px; }
  .tierswitch{ width: 100%; justify-content: space-between; }
  .tierswitch button{ flex: 1; justify-content: center; padding-inline: 8px; }
  .tiles{ grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .stop-more{ padding-left: 16px; }
}
