/* Shared design tokens and the few rules every page needs. Load first. */
:root {
  /* Interface colours (data colours live with their layers) */
  --text: #000000;
  --text-2: #555555;
  --text-3: #6b6b6b; /* notes and hints: 4.5:1 on white and on --surface */
  --line: #e3e3e3; /* dividers */
  --line-table: #d6d6d6; /* table rows */
  --line-table-sub: #e8e8e8; /* the rows opened under one */
  --line-button: #c2c7cd; /* outlines and dividers of buttons, which their labels identify */
  --line-control: #8a8a8a; /* borders of form fields: 3:1 */
  --surface: #f5f5f5;
  --surface-hover: #ebebeb;
  --brand: #245cc5; /* actions, links, focus */
  --brand-hover: #1d4ba3;
  --life-loss: #7a0177; /* the life-loss bars: the flooded tier's purple and a lighter tint of it */
  --life-loss-2: #a24da0;
  --selected: #6f8294; /* switches that are on: 3:1 or better on white */
  --tint: #dce0e4; /* light button fill: toggles, tabs, play */
  --tint-hover: #cfd5dc;
  --danger: #b3261e;
  --focus: var(--brand);

  /* Type scale. Text 400, headings and emphasis 600, sub-headings and buttons 500 */
  --fs-12: 12px;
  --fs-14: 14px;
  --fs-16: 16px;
  --fs-18: 18px;
  --fs-20: 20px;
  --fs-24: 24px;

  /* Corners: swatches, small controls, cards; buttons */
  --radius-s: 2px;
  --radius-m: 4px;
  --radius-l: 8px;
  --radius-button: 6px;

  /* Elevation, each with a hairline that separates it from what is under it. sm: small things on the map; md: panels and cards; lg: what
     opens over them */
  --shadow-sm: 0 0 0 1px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.08), 0 2px 6px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 0 0 1px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.08), 0 4px 10px rgba(0, 0, 0, 0.08), 0 12px 28px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 0 0 1px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.08), 0 8px 20px rgba(0, 0, 0, 0.1), 0 24px 56px rgba(0, 0, 0, 0.18);
}

:where(h1, h2, h3, h4, h5, h6, b, strong, th) {
  font-weight: 600;
}

/* One focus ring everywhere, in place of the browser's, Basecoat's and MapLibre's */
html :is(a, button, input, select, textarea, summary, canvas, [tabindex]:not([tabindex="-1"])):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
html :is(.btn, .textarea, select):focus-visible,
html .maplibregl-ctrl.maplibregl-ctrl-group button:focus-visible {
  --tw-ring-shadow: 0 0 #0000;
  box-shadow: none;
}
.card {
  --focus: #ffffff;
}

/* Back links ("← Summary", "← Overview") */
html .btn.back {
  display: inline-flex;
  height: 32px;
  margin: 0 0 4px -10px;
  padding: 0 10px;
  font: 500 var(--fs-14)/18px Inter, system-ui, sans-serif;
  color: var(--text);
  text-decoration: none;
}

/* Small expand chevrons take a 24px target */
button.expand {
  position: relative;
}
button.expand::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 24px;
  height: 24px;
  translate: -50% -50%;
}

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