/* Task 23: WCAG 2.2 AA fixes. Additive: loaded after styles.css / site.css / lp.css on every public page.
   Nothing here changes the Direction B look for sighted mouse users; it adds what keyboard, screen-reader,
   zoom / text-spacing and Windows high-contrast users need. */

/* The site has one (light) theme. Saying so keeps browser-drawn controls (selects, checkboxes, scrollbars)
   light on a dark-mode OS, so their contrast against the film background stays as designed. */
:root { color-scheme: light; }

/* Visually hidden text for screen readers (same recipe as .sr-only). */
.a11y-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* 2.4.7 Focus visible: MapLibre's container has overflow:hidden, so the site's outward focus ring on the map
   canvas was clipped away entirely. Draw it inside the map instead, with a white inner ring so it shows on both
   the film basemap and the aerial photo. */
.maplibregl-canvas:focus-visible { outline: 3px solid #1B8FB3; outline-offset: -3px; }
.maplibregl-map:has(.maplibregl-canvas:focus-visible)::after {
  content: ""; position: absolute; inset: 0; z-index: 5; pointer-events: none;
  border: 3px solid #1B8FB3; box-shadow: inset 0 0 0 2px #fff; }

/* 2.2.2 Pause, stop, hide: the control for the rotating line under the H1. */
.a11y-rotbtn { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; min-width: 32px;
  width: max-content; max-width: 100%; justify-self: start; align-self: flex-start; margin: 6px 0 0; padding: 4px 10px; border: 1.5px solid #1D2420; border-radius: 0; background: transparent;
  color: #1D2420; font: inherit; font-size: 14px; font-family: var(--wide, inherit); cursor: pointer; }
.a11y-rotbtn:hover { background: #1D2420; color: #fff; }
.a11y-rotbtn svg { width: 12px; height: 12px; fill: currentColor; flex: none; }
.a11y-rotbtn[hidden] { display: none; }

/* 1.4.12 Text spacing: with WCAG's spacing overrides (letter 0.12em, word 0.16em, line 1.5) at 320 px the
   status pill and the wordmark ran past the right edge. Let them wrap instead. */
.pill { white-space: normal; }
@media (max-width: 480px) {
  /* sheet header = grid [icon | title | status pill]; let the title column shrink and its words wrap */
  .rc-head { grid-template-columns: auto minmax(0, 1fr) auto; }
  .rc-head > h3 { min-width: 0; overflow-wrap: anywhere; }
}
.wordmark, .logo-text, .tagline { overflow-wrap: anywhere; min-width: 0; }
.logo { min-width: 0; max-width: 100%; }

/* The elevation keeps its look; keyboard focus on a unit is a thick ring that sits outside the cell. */
.elev-unit:focus-visible { outline: 3px solid #1B8FB3; outline-offset: 2px; position: relative; z-index: 2; }

/* Windows high-contrast / forced colors: keep state that the design shows only with fills and tints. */
@media (forced-colors: active) {
  .elev-unit[aria-pressed="true"] { outline: 3px solid Highlight; outline-offset: -3px; }
  .pill, .lookup-badge, .sc-thumb[aria-current="true"] { border: 1px solid CanvasText; }
  :focus-visible, .maplibregl-canvas:focus-visible { outline: 3px solid Highlight !important; }
  .maplibregl-map:has(.maplibregl-canvas:focus-visible)::after { border-color: Highlight; box-shadow: none; }
  .report-grid.gated { opacity: 1; filter: none; }
}

/* Reduced motion: the slider and sheets already stop; also stop smooth scrolling triggered by in-page links
   in browsers that ignore the html rule in styles.css, and the plat's self-drawing boundary label fade. */
@media (prefers-reduced-motion: reduce) {
  .a11y-rotbtn { display: none; }
  .plat-labels, .sc-slide, .rotline > span { transition: none !important; }
}
