/* topicmap/style.css — the look of every topic map page (shared by
   /datacenters/ and /AISD/ since 2026-09-14; each folder had a copy before).
   Plain and quiet: the map is the page. Controls, cards, timeline player,
   intro card and the phone-mode container queries live here. Each page sets
   its own --accent in its own style.css, loaded after this one. */
:root {
  --ink: #1f2933;
  --paper: rgba(255, 255, 255, 0.94);
  --line: #d9dee3;
  --accent: #7b3294;                 /* the default; each page overrides it */
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
html, body { margin: 0; height: 100%; }
/* .page is a size container so the narrow-screen rules below respond to the
   page's own size. That is what lets ?phone (app.js) zoom the whole page to
   phone proportions inside a 1080x1920 recording and still get the phone
   layout: media queries ignore CSS zoom, container queries do not. */
.page { position: relative; width: 100%; height: 100vh; height: 100dvh; overflow: hidden; container: page / size; }
#map { position: absolute; inset: 0; }

/* top-left stack: controls and layers box */
.topleft { position: absolute; top: 12px; left: 12px; z-index: 5; display: flex; flex-direction: column; gap: 8px; width: 276px; max-width: calc(100% - 24px); max-height: calc(100% - 24px); overflow-y: auto; pointer-events: none; }
.topleft > * { flex-shrink: 0; pointer-events: auto; }
.page.austin-map-surface .topleft { left: 52px; max-width: calc(100% - 120px); }
.home {
  position: absolute; top: 12px; right: 12px; z-index: 5;
  padding: 6px 10px; background: var(--paper); color: var(--ink);
  border: 1px solid var(--line); border-radius: 6px; text-decoration: none;
  font-size: 13px; font-weight: 600;
}
.title {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 5;
  margin: 0; padding: 6px 14px; background: var(--paper); border: 1px solid var(--line);
  border-radius: 6px; font-size: 16px; font-weight: 600; color: var(--ink); white-space: nowrap;
}

.map-controls { display: flex; flex-direction: row; gap: 6px; align-items: flex-start; }
.map-ctrl {
  width: 34px; height: 34px; padding: 0; display: grid; place-items: center; cursor: pointer;
  background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 18px;
}
.map-ctrl:hover { background: #f0f2f4; }
.map-ctrl svg { width: 17px; height: 17px; fill: currentColor; }
.map-ctrl-text { width: auto; padding: 0 8px; font-size: 12px; }
.map-ctrl.is-on { background: var(--ink); color: #fff; border-color: var(--ink); }

.overlays { width: 100%; box-sizing: border-box; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-size: 13px; color: var(--ink); }
.overlays-title { font-size: 12px; color: #52606d; margin-bottom: 4px; }
/* Collapsed cards rise above expanded cards in the top-left stack. */
.topleft > .overlays, .topleft > .legend { order: 2; }
.topleft > .is-collapsed { order: 1; }
.card-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; min-height: 28px; padding: 0; border: 0; background: transparent;
  font-family: inherit; font-size: inherit; color: inherit; text-align: left; cursor: pointer;
}
.card-toggle::after {
  content: ''; width: 7px; height: 7px; margin: 0 3px 4px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg); flex-shrink: 0;
}
.card-toggle[aria-expanded="false"]::after { transform: rotate(-45deg); margin-bottom: 0; }
.card-toggle:hover { color: var(--accent); }
.card-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.is-collapsed .card-toggle { margin-bottom: 0; }
.overlays label { display: grid; grid-template-columns: 14px 16px minmax(0, 1fr); align-items: start; gap: 6px; padding: 2px 0; cursor: pointer; }
.overlays input { margin: 3px 0 0; width: 13px; height: 13px; }
/* group headings in the Layers box (Electric, Water, Boundaries) */
.overlay-group { margin: 6px 0 2px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #52606d; }
.overlay-group:first-child { margin-top: 0; }
/* a small sample of how each overlay draws: dashed box for polygons, a bar for lines, a dot for points */
.overlay-swatch { display: inline-block; width: 14px; height: 14px; margin-top: 2px; box-sizing: border-box; }
.overlay-swatch.is-polygon { border: 1.5px dashed currentColor; background: color-mix(in srgb, currentColor 12%, transparent); }
.overlay-swatch.is-line { height: 3px; margin-top: 8px; background: currentColor; border-radius: 2px; }
.overlay-swatch.is-point { width: 10px; height: 10px; margin: 4px 2px 0; border-radius: 50%; background: currentColor; }

/* legend follows the buttons and Layers box in the left stack */
.legend {
  width: 100%; box-sizing: border-box;
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
  font-size: 13px; color: var(--ink);
}
.legend-title { font-weight: 600; }
.legend-sub { color: #52606d; margin-bottom: 6px; font-size: 12px; }
.legend-rows { list-style: none; margin: 0; padding: 0; }
.legend-rows li { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.legend-rows label { display: grid; grid-template-columns: 14px 15px minmax(0, 1fr); align-items: start; gap: 8px; cursor: pointer; min-width: 0; }
.legend-rows input { margin: 3px 0 0; width: 13px; height: 13px; }
.swatch { width: 13px; height: 13px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.3); flex: none; }
.count { color: #52606d; font-variant-numeric: tabular-nums; margin-left: auto; }
.legend-size { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--line); font-size: 12px; color: #52606d; }
.legend-size .dots { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 4px; }
.legend-size .dots span { display: inline-flex; align-items: center; gap: 4px; }
.legend-size .dots i { display: inline-block; border-radius: 50%; background: #fff; border: 1.5px solid #333; }

.about-toggle {
  margin-top: 8px; font: inherit; font-size: 12px; padding: 3px 8px;
  border: 1px solid var(--line); background: #fff; border-radius: 4px; cursor: pointer;
}
.about { margin-top: 6px; max-height: 45vh; overflow-y: auto; font-size: 12px; line-height: 1.45; }
.about p { margin: 0 0 6px; }

/* Recording sequence: fixed camera, a separate site list, and bottom timeline. */
.has-player .topleft { max-height: calc(100% - 64px); }
.player { position: absolute; z-index: 7; left: 12px; right: 48px; bottom: 4px; max-width: 850px; margin: 0 auto; padding: 4px 6px; display: flex; align-items: center; gap: 5px; box-sizing: border-box; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--ink); font-size: 12px; }
.player-controls { display: contents; }
.player button { flex-shrink: 0; font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 0; width: 28px; height: 28px; cursor: pointer; }
.player-left { order: 0; }
.player-right { order: 2; }
.player button:disabled { opacity: .45; cursor: default; }
.player button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.player-controls label { order: 3; display: flex; align-items: center; gap: 3px; white-space: nowrap; }
.player-ticks { order: 1; flex: 1; min-width: 0; display: flex; justify-content: space-between; gap: 2px; background: linear-gradient(var(--line), var(--line)) center / 100% 2px no-repeat; }
/* plain tick marks, no numbers (owner 2026-09-13): a thin bar per step, the
   current one in the accent colour, past ones tinted */
.player-ticks button { width: 3px; flex: none; min-width: 0; height: 16px; padding: 0; border: 0; border-radius: 2px; background: #b9c0c7; }
.player-ticks button.is-past { background: #b99bc7; }
.player-ticks button[aria-current="step"] { width: 5px; height: 22px; background: var(--accent); }
.player-ticks button:hover { background: var(--accent); }
.player-step { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* the story card. The site list (status steps) sits top-right; a text box
   (.is-text) sits centred at the top with larger type (owner 2026-09-13). */
.sequence-card { position: absolute; top: 56px; right: 12px; z-index: 6; width: min(344px, calc(100% - 320px)); max-height: calc(100% - 212px); box-sizing: border-box; padding: 14px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; color: var(--ink); display: flex; flex-direction: column; }
.sequence-card[hidden] { display: none; }
.sequence-card h2 { margin: 0 0 10px; font-size: 16px; }
.sequence-body { overflow-y: auto; font-size: 12px; line-height: 1.4; }
.sequence-card.is-text { right: auto; left: 50%; transform: translateX(-50%); width: min(560px, calc(100% - 24px)); padding: 16px 20px; }
.sequence-card.is-text h2 { font-size: 20px; }
.sequence-card.is-text .sequence-body { font-size: 15px; line-height: 1.45; }
.sequence-body p { margin: 0; }
/* site lists show four rows, then scroll (owner 2026-09-14) */
.sequence-card.is-list .sequence-body { max-height: 152px; }
/* the intro card over the map */
.intro { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 9; width: min(420px, calc(100% - 32px)); box-sizing: border-box; padding: 22px 24px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; color: var(--ink); text-align: center; box-shadow: 0 6px 24px rgba(0,0,0,.15); }
.intro h2 { margin: 0 0 10px; font-size: 20px; }
.intro p { margin: 0 auto 16px; max-width: 30ch; font-size: 15px; line-height: 1.4; }
.intro button { display: block; width: 100%; box-sizing: border-box; margin: 0 0 8px; padding: 9px 12px; font: inherit; font-size: 15px; border-radius: 6px; cursor: pointer; }
.intro button:last-child { margin-bottom: 0; }
.intro-play { background: var(--accent); color: #fff; border: 1px solid var(--accent); }
.intro-nav { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.intro button:hover { filter: brightness(.95); }
.intro button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* portrait screens (9:16 recordings, phones held upright): the text card sits
   below the folded panel bars instead of over them */
@container page (orientation: portrait) and (min-width: 700px) {
  .sequence-card.is-text { top: 172px; }
}
/* countdown ring beside the ticks: track circle plus a draining stroke */
.player-clock { order: 1; flex: none; width: 24px; height: 24px; transform: rotate(-90deg); }
.player-clock circle { fill: none; stroke-width: 3; }
.player-clock-track { stroke: var(--line); }
.player-clock-left { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .1s linear; }
.sequence-body ul { list-style: none; padding: 0; margin: 0; }
.sequence-body li { padding: 4px 0; border-top: 1px solid var(--line); white-space: nowrap; }
.sequence-body li:first-child { border-top: 0; }
.sequence-body strong, .sequence-body span { display: block; }
.sequence-body span { color: #52606d; }
.sequence-body table { border-collapse: collapse; min-width: 100%; white-space: nowrap; }
.sequence-body th { position: sticky; top: 0; background: #fff; text-align: left; }
.sequence-body th button { font: inherit; font-weight: 600; border: 0; background: transparent; padding: 6px 8px; cursor: pointer; }
.sequence-body td { padding: 5px 8px; border-top: 1px solid var(--line); }
.sequence-body tbody tr { cursor: pointer; }
.sequence-body tbody tr:hover, .sequence-body tbody tr:focus { background: #eee6f2; outline: 2px solid var(--accent); outline-offset: -2px; }
@container page (max-width: 640px) {
  .player { left: 4px; right: 4px; bottom: 4px; padding: 3px; gap: 3px; flex-wrap: wrap; }
  .player-controls label { font-size: 10px; }
  .player-ticks { min-width: 110px; }
  .has-player .topleft { max-height: calc(100% - 90px); }
  /* on phones the site list sits under the two folded panel bars, and the
     text card at the bottom above the timeline, so the panels stay visible
     (2026-09-14) */
  .sequence-card { top: 160px; right: 8px; width: calc(100% - 16px); max-height: calc(100% - 300px); }
  .sequence-card.is-text { top: auto; bottom: 62px; width: calc(100% - 16px); max-height: calc(100% - 200px); padding: 12px 14px; }
  .sequence-card.is-text h2 { font-size: 17px; }
  .sequence-card.is-text .sequence-body { font-size: 13px; }
}

/* popups: a name, a table of facts, the notes, the source links */
.maplibregl-popup-content { font-size: 13px; color: var(--ink); padding: 10px 12px; max-width: 320px; max-height: 60vh; overflow-y: auto; }
.maplibregl-popup-content h3 { margin: 0 0 6px; font-size: 14px; padding-right: 14px; }
.maplibregl-popup-content table { border-collapse: collapse; }
.maplibregl-popup-content td { padding: 1px 6px 1px 0; vertical-align: top; }
.maplibregl-popup-content td:first-child { color: #52606d; white-space: nowrap; }
.maplibregl-popup-content .notes { margin: 6px 0 0; font-size: 12px; line-height: 1.4; }
.maplibregl-popup-content .notes strong { color: #52606d; font-weight: 500; }
.maplibregl-popup-content .sources { margin: 6px 0 0; padding: 6px 0 0; border-top: 1px solid var(--line); font-size: 12px; }
.maplibregl-popup-content .sources a { display: block; color: #1f6f8b; }

@container page (max-width: 640px) {
  .title { display: none; }
  .topleft { width: 260px; }
  .map-controls { flex-direction: row; }
  .overlays { font-size: 12px; }
  .legend { font-size: 12px; }
  .legend-rows li { gap: 4px; }
  .legend-rows label { gap: 4px; }
}

/* the plan's timeline list inside the About panel */
.timeline { margin: 6px 0 0; padding: 0; list-style: none; }
.timeline li { display: flex; gap: 8px; padding: 2px 0; border-top: 1px solid var(--line); }
.timeline .date { flex: none; width: 78px; color: #52606d; font-variant-numeric: tabular-nums; }
