/* /map/ — loaded only by layouts/_default/map.html. Tokens come from style.css (:root). */

.map-page .map-head { padding-bottom: 2rem; }
.map-page .toc-lede { max-width: 42rem; color: #9aa7b4; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* The map breaks out of the 720px column: geography needs the width. */
.map-shell { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.map-canvas {
  height: min(74vh, 760px); min-height: 420px;
  border: 1px solid #1c242c; border-radius: 4px; overflow: hidden;
  background: #0c0c0c;
}

.map-panel {
  margin-top: 14px; padding: 14px 16px 12px;
  border: 1px solid #1c242c; border-radius: 4px; background: rgba(12, 16, 20, 0.85);
  font-family: var(--mono); font-size: 0.82rem; color: var(--dim);
}
.map-scrub { display: flex; align-items: center; gap: 12px; }
.map-play {
  flex: none; width: 2.4rem; height: 2.4rem; border-radius: 50%;
  border: 1px solid var(--accent-dim); background: transparent; color: var(--accent);
  font: inherit; font-size: 0.9rem; cursor: pointer;
}
.map-play:hover, .map-play:focus-visible { border-color: var(--accent); }
.map-range { flex: 1; display: flex; }
.map-range input { width: 100%; accent-color: var(--accent); }
.map-now { margin: 0.6rem 0 0.9rem; color: var(--fg); font-size: 0.95rem; min-height: 1.4em; }

.map-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; }
.map-who { display: flex; gap: 8px; flex-wrap: wrap; }
.who-chip, .map-3d {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 0.35rem 0.7rem; border-radius: 999px; cursor: pointer;
  border: 1px solid #2a343e; background: transparent; color: var(--fg); font: inherit;
}
.who-chip[aria-pressed="false"] { color: #56606a; border-style: dashed; }
.who-chip[aria-pressed="false"] .sw { opacity: 0.25; }
.map-3d[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.sw { width: 18px; height: 3px; border-radius: 2px; display: inline-block; }
.sw-samantha { background: #7fd1c4; }
.sw-marcus { background: #e6b35a; }
.sw-vlad { background: #b9a2ff; }

.map-modes { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.map-modes span { display: inline-flex; align-items: center; gap: 6px; }
/* map.js hides modes the slider has not reached; inline-flex above would otherwise beat [hidden]. */
.map-modes span[hidden] { display: none; }
.ln { display: inline-block; width: 26px; height: 0; border-top: 2px solid #aab4be; }
.ln-drive { border-top-style: dashed; }
.ln-transit { border-top-style: dotted; }
.ln-jump { border-top: 2px dotted #5d6772; }

/* Where each of them is, as of the slider's chapter. */
.zk-head {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  font: 700 11px/1 var(--mono); color: #07090c;
  box-shadow: 0 0 0 2px #07090c, 0 0 14px 2px currentColor;
}
.zk-head span { pointer-events: none; }
.zk-head-samantha { background: #7fd1c4; color: #7fd1c4; }
.zk-head-marcus { background: #e6b35a; color: #e6b35a; }
.zk-head-vlad { background: #b9a2ff; color: #b9a2ff; }
.zk-head span { color: #07090c; }

/* Popups, restyled to the site. Every map-library selector below names BOTH prefixes: production
   renders with Mapbox GL (.mapboxgl-*), the no-token fallback with MapLibre (.maplibregl-*), and a
   rule written for one leaves the other with its library's white default under our light text. */
.zk-popup :is(.maplibregl-popup-content, .mapboxgl-popup-content) {
  background: #0e1318; color: var(--fg); border: 1px solid #26303a; border-radius: 4px;
  font-family: var(--mono); font-size: 0.8rem; line-height: 1.45; padding: 12px 14px;
}
.zk-popup :is(.maplibregl-popup-tip, .mapboxgl-popup-tip) { border-top-color: #26303a; border-bottom-color: #26303a; }
.zk-popup :is(.maplibregl-popup-close-button, .mapboxgl-popup-close-button) { color: var(--dim); font-size: 18px; padding: 0 6px; }
.zk-popup h3 { margin: 0 0 4px; font-size: 0.92rem; color: var(--fg); }
.zk-popup .tag { margin: 0 0 6px; color: var(--dim); font-style: italic; }
.zk-popup ul { list-style: none; margin: 6px 0 0; padding: 0; max-height: 260px; overflow: auto; }
.zk-popup li { margin: 0 0 8px; }
.zk-popup .ev { color: #9aa7b4; }
.zk-popup .dots { margin-right: 6px; }
.zk-popup .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 2px; }

.map-canvas :is(.maplibregl-ctrl-attrib, .mapboxgl-ctrl-attrib),
.map-canvas :is(.maplibregl-ctrl-attrib.maplibregl-compact, .mapboxgl-ctrl-attrib.mapboxgl-compact) {
  font-family: var(--mono); font-size: 10px; background: rgba(7, 9, 12, 0.8); color: var(--dim);
}
.map-canvas :is(.maplibregl-ctrl-attrib, .mapboxgl-ctrl-attrib) a { color: var(--dim); }
.map-canvas :is(.maplibregl-ctrl-attrib-button, .mapboxgl-ctrl-attrib-button) { filter: invert(1); background-color: transparent; }
.map-canvas :is(.maplibregl-ctrl-scale, .mapboxgl-ctrl-scale) {
  background: rgba(7, 9, 12, 0.7); color: var(--dim); border-color: var(--dim);
  font-family: var(--mono); font-size: 10px;
}
.map-canvas :is(.maplibregl-ctrl-group, .mapboxgl-ctrl-group) { background: #0e1318; border: 1px solid #26303a; }
.map-canvas :is(.maplibregl-ctrl-group, .mapboxgl-ctrl-group) button + button { border-top-color: #26303a; }
.map-canvas :is(.maplibregl-ctrl-icon, .mapboxgl-ctrl-icon) { filter: invert(0.85); }

.map-toggles { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }

/* Elevation: a picker (the keyboard way in) and the profile it opens. */
.map-elev { margin-top: 12px; padding-top: 10px; border-top: 1px solid #1c242c; }
.map-pick { display: flex; align-items: center; gap: 10px; max-width: 40rem; }
/* min-width: 0 lets the select shrink below its longest option ("Back up the twenty miles…"),
   which otherwise pushes the page wider than a phone. */
.map-pick select {
  flex: 1; min-width: 0; text-overflow: ellipsis;
  font: inherit; color: var(--fg); background: #0e1318; border: 1px solid #2a343e;
  border-radius: 4px; padding: 0.3rem 0.5rem;
}
.map-profile { margin: 12px 0 0; }
.map-profile figcaption { display: flex; justify-content: space-between; align-items: center; color: var(--fg); }
.map-profile-close {
  border: 0; background: transparent; color: var(--dim); font: inherit; font-size: 1.1rem; cursor: pointer; padding: 0 4px;
}
.map-profile-close:hover, .map-profile-close:focus-visible { color: var(--fg); }
/* pan-y: a thumb swipe over the chart still scrolls the page; horizontal drags scrub it. */
.map-profile-chart svg { display: block; width: 100%; height: 150px; margin-top: 6px; touch-action: pan-y; }
.map-profile-chart .area { fill: rgba(127, 209, 196, 0.16); }
.map-profile-chart .ridge { fill: none; stroke: #7fd1c4; stroke-width: 1.6; stroke-linejoin: round; }
.map-profile-chart .grid { stroke: #1f2830; stroke-width: 1; stroke-dasharray: 3 4; }
.map-profile-chart .ax { fill: var(--dim); font: 11px var(--mono); }
.map-profile-chart .cursor line { stroke: #d7dde3; stroke-width: 1; opacity: 0.6; }
.map-profile-chart .cursor circle { fill: #d7dde3; }
.map-profile-chart .cursor text { fill: #d7dde3; }
.map-profile-stats { margin: 4px 0 0; color: #9aa7b4; }
.map-profile-wait { height: 150px; margin-top: 6px; }

/* The point on the map the profile cursor is over. */
.zk-probe {
  width: 12px; height: 12px; border-radius: 50%; background: #d7dde3;
  box-shadow: 0 0 0 2px #07090c, 0 0 10px 2px rgba(215, 221, 227, 0.7); pointer-events: none;
}

.map-list { margin-top: 2.4rem; font-size: 0.9rem; }
.map-list summary { cursor: pointer; color: var(--accent); font-family: var(--mono); font-size: 0.85rem; }
.map-list ol { padding-left: 1.2rem; }
.map-list > ol > li { margin: 0.9rem 0; }
.map-list ul { padding-left: 1rem; color: #9aa7b4; }
.map-credits a { color: inherit; text-decoration: underline; }

@media (max-width: 560px) {
  .map-shell { padding: 0 12px; }
  .map-canvas { height: 62vh; min-height: 360px; }
  .map-controls { gap: 10px; }
  .map-toggles { margin-left: 0; }
}
