/* Shot preview page (/photo/<spot-id>): templates/photo_shot.html.
   Same colours and card style as the Photographers toolbox (/photo). Sizes in rem; only hairline
   borders and outlines are in px.
   The stage (#ps-stage) keeps the picture and its controls together and fits one phone screen:
   view tabs, picture, plain-words readout, slider with key moments, part-of-day and date row.
   Phones: one column, stage first. From 64rem: stage in the wide left column and staying in sight,
   the text boxes on the right, the timeline below. */
.ps { --ps-ink:#e7e5e4; --ps-muted:#a8a29e; --ps-line:rgba(255,255,255,.09); --ps-amber:#f59e0b; --ps-silver:#cbd5e1;
      --ps-sun:#fde047; --ps-good:#22c55e; color:var(--ps-ink); min-width:0; overflow-wrap:anywhere; }
.ps *, .ps *::before, .ps *::after { box-sizing:border-box; }
.ps [hidden] { display:none !important; }
.ps-sr { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }

.ps-head { margin:0 0 0.625rem; }
.ps-back { display:inline-flex; align-items:center; min-height:2.75rem; color:var(--ps-amber); font-size:0.8125rem; text-decoration:none; }
.ps-back:hover { text-decoration:underline; }
.ps-h1 { font-size:clamp(1.5rem,5.5vw,2.25rem); font-weight:800; line-height:1.08; margin:0 0 0.125rem; }
.ps-kinds { font-size:0.75rem; color:var(--ps-muted); }
.ps-summary { margin:0.375rem 0 0; font-size:1rem; line-height:1.4; font-weight:600; }

/* every control: one look, one tap size */
.ps-tabs button, .ps-date a, .ps-date button, .ps-chips button, .ps-ctl button, .ps-jumps button, .ps-links a, .ps-copyrow button,
.ps-align-item a {
  min-height:2.75rem; min-width:2.75rem; display:inline-flex; align-items:center; justify-content:center; gap:0.375rem;
  border:1px solid var(--ps-line); background:rgba(255,255,255,.04); color:var(--ps-ink); border-radius:999px;
  padding:0.375rem 0.75rem; font-size:0.8125rem; line-height:1.2; text-decoration:none; cursor:pointer; font-family:inherit;
  white-space:nowrap; flex:none; }
.ps-tabs button:hover, .ps-date a:hover, .ps-date button:hover, .ps-chips button:hover, .ps-jumps button:hover, .ps-links a:hover,
.ps-copyrow button:hover, .ps-align-item a:hover { border-color:var(--ps-amber); color:var(--ps-amber); }
.ps button[aria-pressed="true"] { border-color:var(--ps-amber); color:#0c0a09; background:var(--ps-amber); font-weight:700; }
.ps button:focus-visible, .ps a:focus-visible, .ps input:focus-visible { outline:2px solid var(--ps-amber); outline-offset:2px; }

.ps-grid { display:flex; flex-direction:column; gap:0.75rem; min-width:0; }
.ps-side, .ps-below { display:flex; flex-direction:column; gap:0.75rem; min-width:0; }

/* ---- the stage ---- */
.ps-stage { display:flex; flex-direction:column; gap:0.375rem; min-width:0; border:1px solid var(--ps-line); border-radius:0.875rem;
  padding:0.375rem; background:rgba(255,255,255,.02); }
.ps-tabs { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:0.375rem; }
.ps-tabs button { border-radius:0.625rem; font-weight:600; white-space:normal; }
.ps-visual { display:flex; flex-direction:column; gap:0.5rem; min-width:0; }
.ps-panel { position:relative; min-width:0; border-radius:0.625rem; overflow:hidden; background:#0c0a09; }
.ps-svg { display:block; width:100%; height:auto; }
#ps-plan { max-width:24rem; margin:0 auto; }
/* with the script: one picture at a time, in a box of a fixed height so nothing below it jumps */
/* The box takes the drawing's own shape (3:2), so no dead bands sit between the picture and its controls. */
.ps-js .ps-visual { aspect-ratio:3 / 2; width:100%; max-height:26rem; }
.ps-js .ps-panel { height:100%; }
.ps-js .ps-svg, .ps-js #ps-plan { width:100%; height:100%; max-width:none; }
/* without the script the 3D box has nothing to show but its one line */
.ps:not(.ps-js) .ps-map, .ps:not(.ps-js) .ps-3d-cover, .ps:not(.ps-js) .ps-3d-controls { display:none; }

/* By id: MapLibre's own stylesheet sets .maplibregl-map { position:relative }, which loads later and would
   leave this box 0 high (seen live 2026-12-01: a black 3D panel). */
#ps-map { position:absolute; inset:0; width:100%; height:100%; }
.ps-3d-cover { position:absolute; inset:0; margin:0; display:flex; align-items:center; justify-content:center; padding:1rem; text-align:center;
  font-size:0.8125rem; color:var(--ps-muted); }
.ps-map:not(:empty) ~ .ps-3d-cover { display:none; }
.ps-3d-error { position:absolute; inset:0; margin:0; display:flex; align-items:center; justify-content:center; padding:1rem; text-align:center;
  font-size:0.875rem; line-height:1.45; color:#fde68a; background:#0c0a09; z-index:3; }
.ps-3d-controls { position:absolute; left:0; right:0; bottom:0; z-index:2; display:flex; gap:0.75rem; align-items:center; overflow-x:auto;
  padding:0.375rem; background:linear-gradient(to top, rgba(12,10,9,.85), rgba(12,10,9,0)); scrollbar-width:thin; }
/* The map's own credit line and zoom buttons sit above our control row, never under it (the credit must stay readable). */
#ps-map .maplibregl-ctrl-bottom-left, #ps-map .maplibregl-ctrl-bottom-right { bottom:3.5rem; }
.ps-ctl { display:inline-flex; gap:0.375rem; flex:none; }
.ps-ctl button { background:rgba(12,10,9,.8); }
.ps-panel-3d:has(.ps-map:empty) .ps-3d-controls { display:none; }

/* ---- the 3D view covers the whole window (2026-12-04) ----
   photo-shot.js puts .ps-3d-full on the stage when the 3D tab is pressed, so on every device the stage is a
   layer over the whole window: the map takes the space, and the readout, slider and key moments stay in a band
   under it. Tall and narrow is the first layout (a phone held upright); a short wide window (a phone on its side)
   puts the band beside the map. 100dvh follows the phone's moving address bar; 100vh is the fallback; both are divided by the desktop page zoom (--mam-z), which enlarges vh units (seen 2026-12-04: a 1125px layer in a 900px window). The
   page behind is locked by html.ps-3d-lock. Without the script none of this is ever switched on. */
.ps-band { display:flex; flex-direction:column; gap:0.375rem; min-width:0; }
.ps-3d-close, .ps-3d-hint { display:none; }
html.ps-3d-lock { overflow:hidden; }
html.ps-3d-lock body { position:fixed; left:0; right:0; width:100%; overflow:hidden; }

.ps .ps-stage.ps-3d-full { position:fixed; inset:0; z-index:2000; width:100%; height:calc(100vh / var(--mam-z, 1)); height:calc(100dvh / var(--mam-z, 1)); margin:0; gap:0; border:0;
  border-radius:0; background:#0c0a09; overflow:hidden; overscroll-behavior:none; padding:0;
  padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.ps-3d-full .ps-tabs { display:none; }
.ps-3d-full .ps-3d-close { display:inline-flex; align-items:center; justify-content:center; gap:0.375rem; position:absolute; z-index:6;
  top:0.5rem; right:0.5rem; top:calc(env(safe-area-inset-top) + 0.5rem); right:calc(env(safe-area-inset-right) + 0.5rem);
  min-height:2.75rem; min-width:2.75rem; padding:0.375rem 1rem; border:1px solid var(--ps-amber); border-radius:999px;
  background:rgba(12,10,9,.92); color:var(--ps-ink); font:inherit; font-size:0.9375rem; font-weight:700; line-height:1.2; cursor:pointer; }
.ps-3d-full .ps-3d-close::before { content:"\00d7"; font-size:1.5rem; line-height:1; }
.ps-3d-full .ps-3d-close:hover { background:var(--ps-amber); color:#0c0a09; }

.ps .ps-stage.ps-3d-full .ps-visual { flex:1 1 auto; min-height:0; width:100%; height:auto; max-height:none; aspect-ratio:auto; gap:0; }
.ps .ps-stage.ps-3d-full .ps-panel-3d { flex:1 1 auto; min-height:0; height:auto; display:flex; flex-direction:column; border-radius:0; }
/* the map keeps its id rule above: here it only gives up the corner-to-corner box so the camera row can sit under it */
.ps .ps-stage.ps-3d-full #ps-map { position:relative; inset:auto; flex:1 1 auto; min-height:0; width:100%; height:auto; }
/* one finger drags the map, never the page */
.ps-3d-full #ps-map, .ps-3d-full #ps-map .maplibregl-canvas-container, .ps-3d-full #ps-map canvas { touch-action:none; }
.ps-3d-full #ps-map { user-select:none; -webkit-user-select:none; -webkit-touch-callout:none; -webkit-tap-highlight-color:transparent; }
.ps .ps-stage.ps-3d-full .ps-3d-controls { position:static; flex:none; padding:0.375rem 0.5rem; background:#0c0a09; border-top:1px solid var(--ps-line);
  scrollbar-width:none; overscroll-behavior-x:contain; touch-action:pan-x; -webkit-overflow-scrolling:touch; }
.ps-3d-full .ps-3d-controls::-webkit-scrollbar { display:none; }
/* the map's own credit line and buttons sit at the map's own bottom edge, above our camera row, and above the lens frame's dimming */
.ps-3d-full #ps-map .maplibregl-ctrl-bottom-left, .ps-3d-full #ps-map .maplibregl-ctrl-bottom-right { bottom:0; z-index:4; }
.ps-3d-full #ps-map .maplibregl-ctrl-bottom-right { margin-bottom:0.25rem; }
.ps-3d-full #ps-map .maplibregl-ctrl-group button { width:2.75rem; height:2.75rem; }
.ps-3d-full #ps-map .maplibregl-ctrl-attrib { max-width:calc(100vw - 4.5rem); font-size:0.6875rem; line-height:1.35; padding:0.125rem 0.375rem; }
.ps-3d-full #ps-map .maplibregl-ctrl-attrib-inner { white-space:normal; }

.ps .ps-stage.ps-3d-full .ps-3d-hint { display:flex; align-items:center; position:absolute; z-index:3; top:0.5rem; left:0.5rem; width:fit-content;
  max-width:calc(100% - 9rem); min-height:2.75rem; margin:0; padding:0.25rem 0.75rem; border-radius:0.625rem; background:rgba(12,10,9,.72);
  color:var(--ps-ink); font-size:0.8125rem; line-height:1.3; pointer-events:none; opacity:1; transition:opacity .6s ease; }
.ps .ps-stage.ps-3d-full .ps-3d-hint.ps-hint-off { opacity:0; }
@media (prefers-reduced-motion: reduce) { .ps .ps-stage.ps-3d-full .ps-3d-hint { transition:none; } }

/* the time controls, kept short so the map keeps most of the screen */
.ps .ps-stage.ps-3d-full .ps-band { flex:none; max-height:calc(55vh / var(--mam-z, 1)); max-height:calc(55dvh / var(--mam-z, 1)); overflow-y:auto; padding:0.375rem 0.5rem 0.5rem; gap:0.25rem;
  background:#0c0a09; border-top:1px solid var(--ps-line); }
.ps-3d-full .ps-readout { min-height:0; padding:0; }
.ps-3d-full .ps-readout-words { font-size:0.9375rem; line-height:1.25; }
.ps-3d-full .ps-readout-nums { font-size:0.75rem; margin:0; }
.ps-3d-full .ps-date { display:none; }   /* a date change would reload the page and drop this view */
/* The arch caveat stays under the sentence it corrects here too (George 2026-12-01), only smaller. */
.ps-3d-full .ps-archbox-stage { padding:0.25rem 0.5rem; font-size:0.75rem; line-height:1.3; }
.ps-3d-full .ps-row { flex-wrap:nowrap; justify-content:flex-start; overflow-x:auto; scrollbar-width:none; }
.ps-3d-full .ps-chips { flex-wrap:nowrap; }
@media (orientation: landscape) and (max-height: 32rem) {
  .ps .ps-stage.ps-3d-full { display:grid; grid-template-columns:minmax(0,1fr) minmax(15rem,22rem); grid-template-rows:minmax(0,1fr); }
  .ps .ps-stage.ps-3d-full:not(:has(.ps-band)) { grid-template-columns:minmax(0,1fr); }
  .ps .ps-stage.ps-3d-full .ps-visual { grid-column:1; grid-row:1; }
  .ps .ps-stage.ps-3d-full .ps-band { grid-column:2; grid-row:1; max-height:none; border-top:0; border-left:1px solid var(--ps-line); padding-top:3.5rem; }
  .ps .ps-stage.ps-3d-full .ps-3d-hint { max-width:calc(100% - 1rem); }
}

.ps-readout { min-height:3.75rem; padding:0 0.25rem; }
.ps-readout-words { margin:0; font-size:1.0625rem; line-height:1.3; font-weight:700; }
.ps-readout-nums { margin:0.125rem 0 0; font-size:0.8125rem; color:var(--ps-muted); font-variant-numeric:tabular-nums; }
.ps-slider { display:block; width:100%; height:2.75rem; margin:0; accent-color:var(--ps-sun); touch-action:pan-y; }
.ps-ticks { min-width:0; }
.ps-tickline { position:relative; height:0.5rem; margin:-0.5rem 0.625rem 0.25rem; }
.ps-tickline i { position:absolute; top:0; width:0.125rem; height:0.5rem; margin-left:-0.0625rem; background:var(--ps-sun); }
.ps-jumps { display:flex; gap:0.375rem; overflow-x:auto; scrollbar-width:thin; scrollbar-color:#57534e transparent; padding-bottom:0.125rem; }
.ps-jumps button { border-radius:0.625rem; }
.ps-jumps button span { color:var(--ps-muted); font-variant-numeric:tabular-nums; }
.ps-row { display:flex; flex-wrap:wrap; gap:0.375rem 0.75rem; align-items:center; justify-content:space-between; }
.ps-chips { display:inline-flex; flex-wrap:wrap; gap:0.375rem; align-items:center; }
.ps-date { display:inline-flex; flex-wrap:wrap; gap:0.375rem; align-items:center; margin:0; }
/* with the script the date box sends itself when a day is picked */
.ps-js .ps-date-go { display:none; }
.ps-date input[type=date] { min-height:2.75rem; border:1px solid var(--ps-line); background:rgba(255,255,255,.03);
  color:var(--ps-ink); border-radius:0.625rem; padding:0.25rem 0.5rem; font-size:0.875rem; color-scheme:dark; max-width:100%; }

/* ---- text boxes ---- */
.ps-card { border:1px solid var(--ps-line); border-radius:0.875rem; padding:0.75rem 0.875rem; background:rgba(255,255,255,.02); min-width:0; }
.ps-card h2, .ps-how h2 { font-family:ui-monospace, SFMono-Regular, Menlo, monospace; font-size:0.6875rem; letter-spacing:.16em;
  text-transform:uppercase; color:var(--ps-amber); margin:0 0 0.5rem; font-weight:600; }
.ps-archbox { margin:0; border:1px solid rgba(245,158,11,.45); background:rgba(245,158,11,.08); border-radius:0.75rem;
  padding:0.5rem 0.75rem; font-size:0.875rem; line-height:1.4; font-weight:600; }
.ps-archbox-stage { padding:0.375rem 0.625rem; font-size:0.8125rem; line-height:1.4; }

.ps-rows { margin:0; font-size:0.875rem; line-height:1.5; }
.ps-rows > div { border-top:1px solid var(--ps-line); padding:0.375rem 0; }
.ps-rows > div:first-child { border-top:0; padding-top:0; }
.ps-rows dt { color:var(--ps-muted); font-size:0.75rem; }
.ps-rows dd { margin:0; font-weight:600; }
.ps-src { color:var(--ps-muted); font-weight:400; font-size:0.75rem; line-height:1.45; }
p.ps-src { margin:0.375rem 0 0; }
.ps-line { display:block; font-weight:400; font-size:0.8125rem; margin-top:0.25rem; }
.ps-arch { color:var(--ps-amber); font-weight:600; }
.ps-closing { color:#fde68a; }
span.ps-closing { border:1px solid rgba(234,179,8,.45); background:rgba(234,179,8,.08); border-radius:0.625rem; padding:0.375rem 0.5rem; }
.ps-closing b { color:#fcd34d; }
.ps-align-item { display:flex; flex-wrap:wrap; gap:0.5rem; align-items:center; }
.ps-align-item a { color:var(--ps-amber); }

.ps-stand { margin:0 0 0.5rem; font-size:0.875rem; line-height:1.45; padding-left:0.625rem; border-left:2px solid var(--ps-ink); }
.ps-stand-candidate { border-left-style:dashed; }
.ps-stand-none { border-left-style:dotted; border-left-color:var(--ps-muted); }
.ps-copyrow { display:flex; flex-wrap:wrap; align-items:center; gap:0.5rem; }
.ps-copyrow label { flex:1 0 100%; font-size:0.75rem; color:var(--ps-muted); }
.ps-ll { flex:1 1 12rem; min-width:0; min-height:2.75rem; border:1px solid var(--ps-line); background:rgba(0,0,0,.25); color:var(--ps-ink);
  border-radius:0.625rem; padding:0.375rem 0.625rem; font-family:ui-monospace, SFMono-Regular, Menlo, monospace; font-size:0.875rem; }
.ps-copied { font-size:0.8125rem; color:var(--ps-good); min-width:3.5rem; }
.ps-facts, .ps-notes { margin:0.5rem 0 0; padding-left:1.125rem; font-size:0.8125rem; line-height:1.5; color:var(--ps-muted); }
.ps-notes { color:var(--ps-ink); }
.ps-notes a, .ps-ban a, .ps-warn a { color:var(--ps-amber); display:inline-flex; align-items:center; min-height:2.75rem; }
.ps-links { display:flex; flex-wrap:wrap; gap:0.5rem; margin-top:0.5rem; }
.ps-links a { color:var(--ps-amber); white-space:normal; }
.ps .get-there { margin-top:0.625rem; gap:0.5rem; }
.ps .get-there-btn { min-height:2.75rem; }

.ps-tablewrap { overflow-x:auto; }
/* the script hides the table of the part of the day that is not picked: its card goes with it */
.ps-card:has(.ps-table[hidden]) { display:none; }
.ps-table { width:100%; border-collapse:collapse; font-size:0.8125rem; line-height:1.35; }
.ps-table th { text-align:left; font-weight:600; color:var(--ps-muted); padding:0.25rem 0.375rem 0.25rem 0; border-bottom:1px solid var(--ps-line); vertical-align:bottom; }
.ps-table td { padding:0.3125rem 0.375rem 0.3125rem 0; border-bottom:1px solid var(--ps-line); vertical-align:top; font-variant-numeric:tabular-nums; }
.ps-table tr.ps-now td, .ps-table tr[aria-current="true"] td { color:var(--ps-sun); font-weight:700; }

.ps-how { font-size:0.8125rem; line-height:1.55; color:var(--ps-muted); margin-top:0.625rem; }
.ps-how h3 { font-size:0.8125rem; font-weight:700; color:var(--ps-ink); margin:0.75rem 0 0.25rem; }
.ps-how ul { margin:0; padding-left:1.125rem; }
.ps-how li { margin-bottom:0.375rem; }
.ps-how .ps-fixed { color:var(--ps-ink); }

.ps-ban { border:1px solid rgba(239,68,68,.5); background:rgba(239,68,68,.08); border-radius:0.625rem; padding:0.625rem 0.75rem;
  margin-top:0.5rem; font-size:0.875rem; line-height:1.45; }
.ps-ban b { color:#fca5a5; }
.ps-warn { border:1px solid rgba(234,179,8,.45); background:rgba(234,179,8,.08); border-radius:0.75rem; padding:0.625rem 0.75rem;
  margin:0; font-size:0.8125rem; line-height:1.45; }

/* .ps-top (stage + text boxes) is part of the phone column as if it were not there */
.ps-top { display:contents; }

@media (min-width: 64rem) {
  .ps-grid { gap:0.875rem; }
  .ps-top { display:grid; grid-template-columns:minmax(0,3fr) minmax(0,2fr); gap:0.875rem; align-items:start; }
  .ps-js .ps-visual { max-height:min(26rem,42vh); }
}
/* The stage stays in sight while the text beside it scrolls, but only where the whole stage fits under the site
   header (about 44rem of window: 4.5rem header gap + 27rem of controls + a picture of at least 12rem). A taller
   stage would be cut off and cannot be scrolled to, so shorter windows just scroll it with the page.
   62rem is that, in window pixels, for the desktop text zoom steps. It sticks only inside .ps-top, so it
   can never ride over the full-width .ps-below or the footer. Under the page zoom 100vh is the window times the
   zoom, hence / var(--mam-z). */
@media (min-width: 64rem) and (min-height: 62rem) {
  .ps-stage { position:sticky; top:4.5rem; }
  .ps-js .ps-visual { max-height:min(26rem, max(12rem, calc(100vh / var(--mam-z, 1) - 32rem))); }
}
