/* camera.adelaidelive.app — where safety cameras have actually issued fines. */
:root {
  --font-sans: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --gutter: clamp(1rem, 3vw, 2.5rem);
}
:root[data-theme="day"] {
  color-scheme: light;
  --bg: #f2f0ee; --surface: #fbfaf9; --sunk: #e9e6e3;
  --ink: #1a1817; --dim: #6b6560;
  --line: rgba(26, 24, 23, 0.12); --line-strong: rgba(26, 24, 23, 0.3);
  --accent: #4a5568;
  --speed: #c0392b; --red_light: #b8410e; --phone: #7b5ea7; --registration: #1b7f8c;
  --seatbelt: #a8850a; --other: #6b6560;
  --bar: rgba(26, 24, 23, 0.1);
}
:root[data-theme="night"] {
  color-scheme: dark;
  --bg: #131211; --surface: #1b1a18; --sunk: #232120;
  --ink: #ece9e6; --dim: #9a938d;
  --line: rgba(236, 233, 230, 0.12); --line-strong: rgba(236, 233, 230, 0.3);
  --accent: #8fa2bd;
  --speed: #f0655a; --red_light: #f08a4f; --phone: #b49ce0; --registration: #4dc1d1;
  --seatbelt: #e6c14a; --other: #9a938d;
  --bar: rgba(236, 233, 230, 0.1);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); font-family: var(--font-sans); font-size: clamp(16px, 0.45vw + 11px, 19px); line-height: 1.45; font-variant-ligatures: none; transition: background-color 700ms ease, color 700ms ease; }
body { margin: 0; min-height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; font-variation-settings: "opsz" 14; }
body > *, main > * { min-width: 0; }
a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; text-decoration-color: var(--line-strong); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
p, h1, h2 { margin: 0; }
ol, ul { margin: 0; padding: 0; list-style: none; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.dim { color: var(--dim); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.8rem var(--gutter); font-family: var(--font-mono); font-size: 0.8rem; }
.brand { text-decoration: none; font-weight: 500; }
.top nav { display: flex; align-items: center; gap: 1.1rem; }
.top nav a { color: var(--dim); text-decoration: none; }
.theme { color: var(--dim); background: transparent; border: 1px solid var(--line-strong); border-radius: 999px; padding: 0.22rem 0.75rem; cursor: pointer; }
.theme:hover { color: var(--ink); border-color: var(--ink); }

main { width: min(100% - 2 * var(--gutter), 66rem); margin: 0 auto; padding: 0.6rem 0 2rem; display: grid; gap: clamp(1rem, 2.4vh, 1.6rem); align-content: start; }

.hero h1 { font-size: clamp(1.7rem, 3.6vw, 2.8rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; font-variation-settings: "opsz" 96; }
.hero .sub { color: var(--dim); margin-top: 0.5rem; max-width: 46rem; }

.controls { display: grid; gap: 0.6rem; }
.controls .row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.controls input { flex: 1 1 16rem; min-width: 0; padding: 0.6rem 0.8rem; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 0.6rem; }
.locate { background: transparent; border: 1px solid var(--line-strong); border-radius: 0.6rem; padding: 0.3rem 0.9rem; font-size: 0.85rem; color: var(--dim); cursor: pointer; white-space: nowrap; }
.locate:hover { color: var(--ink); border-color: var(--ink); }
.locate[disabled] { opacity: 0.55; cursor: default; }
.chips { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.chip { background: transparent; border: 1px solid var(--line-strong); border-radius: 999px; padding: 0.2rem 0.75rem; font-size: 0.78rem; color: var(--dim); cursor: pointer; }
.chip[aria-pressed="true"] { color: var(--bg); background: var(--ink); border-color: var(--ink); }
.chip .n { font-family: var(--font-mono); font-size: 0.9em; opacity: 0.7; margin-left: 0.3rem; }
.err { color: var(--speed); font-size: 0.85rem; }
.count { font-family: var(--font-mono); font-size: 0.74rem; margin-bottom: 0.6rem; }

.sites { display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: 0.7rem; }
.site { background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--c, var(--other)); border-radius: 0.7rem; padding: 0.8rem 0.9rem 0.85rem; display: grid; gap: 0.45rem; align-content: start; }
.site .head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem; }
.site .road { font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; }
.site .km { font-family: var(--font-mono); font-size: 0.7rem; color: var(--dim); white-space: nowrap; }
.site .where { font-size: 0.82rem; color: var(--dim); }
.tags { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.tag { font-family: var(--font-mono); font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.05em; padding: 0.12rem 0.42rem; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--dim); }
.tag--kind { color: var(--bg); background: var(--c); border-color: var(--c); }
.facts { display: grid; gap: 0.2rem; font-size: 0.83rem; }
.facts div { display: flex; justify-content: space-between; gap: 0.8rem; }
.facts .k { color: var(--dim); }
.facts .v { font-variant-numeric: tabular-nums; }
.facts .over { color: var(--speed); font-weight: 600; }

.when { display: grid; gap: 0.2rem; }
.when .strip { display: grid; grid-template-columns: repeat(24, 1fr); gap: 1px; height: 18px; align-items: end; }
.when .strip i { display: block; background: var(--c); border-radius: 1px 1px 0 0; opacity: 0.75; min-height: 1px; }
.when .axis { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 0.62rem; color: var(--dim); }

.site .map { font-family: var(--font-mono); font-size: 0.7rem; color: var(--dim); }
.more { justify-self: start; margin-top: 0.9rem; background: transparent; border: 1px solid var(--line-strong); border-radius: 0.6rem; padding: 0.45rem 1rem; font-size: 0.85rem; color: var(--dim); cursor: pointer; }
.more:hover { color: var(--ink); border-color: var(--ink); }

.foot { width: min(100% - 2 * var(--gutter), 66rem); margin: 0 auto; padding: 1.2rem 0 2rem; border-top: 1px solid var(--line); font-size: 0.78rem; color: var(--dim); line-height: 1.5; display: grid; gap: 0.55rem; }
.foot a { color: var(--dim); }
.foot b { color: var(--ink); }

/* ------------------------------------------------------------------ the map */
.mapwrap { display: grid; gap: 0.45rem; }
/* The id, not the class: each card also carries a .map paragraph for its
   "see it on a map" link, and a class rule here gave every one of them the
   height of the map itself. */
#map { height: clamp(20rem, 55vh, 34rem); border: 1px solid var(--line); border-radius: 0.8rem; overflow: hidden; background: var(--sunk); }
.legend { display: flex; gap: 0.9rem; flex-wrap: wrap; font-family: var(--font-mono); font-size: 0.68rem; color: var(--dim); }
.legend .key { display: inline-flex; align-items: center; gap: 0.32rem; }
.legend i { width: 9px; height: 9px; border-radius: 50%; opacity: 0.8; }
.mapnote { font-size: 0.74rem; line-height: 1.4; max-width: 46rem; }

/* MapLibre paints its own furniture; these keep it in the page's voice. */
.maplibregl-popup-content { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 0.6rem; padding: 0.6rem 0.75rem; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18); }
.maplibregl-popup-tip { border-top-color: var(--surface) !important; border-bottom-color: var(--surface) !important; }
.maplibregl-popup-close-button { color: var(--dim); font-size: 1.1rem; padding: 0 0.35rem; }
.pop { font-size: 0.82rem; line-height: 1.45; }
.pop b { font-size: 0.9rem; }
.maplibregl-ctrl-group { background: var(--surface); border: 1px solid var(--line); }
.maplibregl-ctrl-group button + button { border-top-color: var(--line); }
.maplibregl-ctrl-attrib { font-size: 0.62rem; }

/* Where the reader is, if they asked. */
.you { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); box-shadow: 0 0 0 2px var(--accent); }

.site { cursor: pointer; }
.site:hover { border-color: var(--line-strong); }
.site .map a { cursor: pointer; }
