/* Reset, document defaults, accessibility basics. Nothing project-specific. */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-base);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;          /* nothing may scroll the page sideways */
}

img, picture, video, canvas, svg { display: block; max-width: 100%; }
img { height: auto; }

input, button, textarea, select { font: inherit; color: inherit; }

/* headings take face, size and line-height from their class, per mockup node — a
   global display face silently changes every card title set in the body face */
h1, h2, h3, h4 { font: inherit; }

a { color: inherit; }

ul, ol { list-style: none; padding: 0; }

/* Visible focus is not optional, whatever the mockup shows. */
:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }
/* links, buttons and switches keep a ring on any focus, not only the keyboard heuristic */
a:focus, .btn:focus, .ibtn:focus, .switch input:focus { outline: 2px solid var(--color-brand); outline-offset: 2px; }

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

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: var(--z-modal);
  padding: 12px 16px; background: var(--color-text); color: #fff;
  font-weight: 600; text-decoration: none;
  transition: transform var(--dur-base) var(--ease);
}
.skip-link:focus { transform: translateY(72px); }

/* A hidden control inside a component must stay hidden even when the component
   sizes its inputs (`.field input { width:100% }`): the doubled class wins. */
.visually-hidden.visually-hidden { width: 1px; height: 1px; min-height: 0; padding: 0; border: 0; }

/* A hidden element must stay hidden even when a component sets display.
   Without this a closed panel keeps its height and pushes sections down. */
[hidden][hidden] { display: none !important; }

/* Tap targets: 24×24 minimum (WCAG 2.2 AA, 2.5.8) added by a pseudo-element,
   never by padding — padding changes the layout, this does not. */
.tap-target { position: relative; }
.tap-target::after {
  content: ""; position: absolute; inset: 50% 0 auto 0; translate: 0 -50%;
  height: 100%; min-height: 24px; z-index: 1;
}

/* Tabular figures for every number that is data (times, distances, rateios). */
.mono { font-family: var(--font-mono); font-feature-settings: "tnum" 1, "zero" 0; }
button { cursor: pointer; }
abbr[title] { text-decoration: none; cursor: help; }

/* Closed <details>: the body leaves the layout entirely (no stray boxes, no focusable links). */
details:not([open]) > :not(summary) { display: none; }

/* #main takes programmatic focus after a regulatory choice; no ring on the whole column */
#main:focus { outline: none; }
