/* ==========================================================================
   Base: reset, document defaults, typographic elements, focus, skip link.
   No component or layout classes belong here.
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 7rem; /* clears the sticky masthead on anchor jumps */
}

body {
  margin: 0;
  background: var(--papier);
  color: var(--ink);
  font-family: var(--ff-body);
  font-size: var(--fs-md);
  line-height: var(--lh-relaxed);
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Trailing figures in French copy should not be orphaned by the browser. */
:lang(fr) { hyphens: manual; }

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--ff-display);
  font-weight: 600;
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-tight);
  color: var(--ink);
  text-wrap: balance;
}

h1 { font-size: var(--fs-3xl); line-height: var(--lh-tight); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); letter-spacing: var(--ls-normal); }
h5, h6 { font-size: var(--fs-md); letter-spacing: var(--ls-normal); }

p { margin: 0; text-wrap: pretty; }

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

a {
  color: var(--vert-etat);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover { color: var(--vert-profond); }

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

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

button { background: none; border: 0; cursor: pointer; }

table {
  border-collapse: collapse;
  width: 100%;
}

hr {
  border: 0;
  border-top: 1px solid var(--ligne);
  margin: var(--sp-6) 0;
}

abbr[title] { text-decoration: none; border-bottom: 1px dotted var(--ink-3); cursor: help; }

code {
  font-family: var(--ff-mono);
  font-size: 0.9em;
  background: var(--vert-voile);
  border-radius: var(--r-xs);
  padding: 1px 4px;
}

::selection { background: var(--or-voile); color: var(--ink); }


/* --- Focus ---------------------------------------------------------------
   A single visible ring, on every focusable thing, on both grounds. */

:focus-visible {
  outline: 3px solid var(--or);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

.on-dark :focus-visible,
.masthead :focus-visible,
.statebar :focus-visible,
.sitefoot :focus-visible {
  outline-color: var(--or-clair);
}


/* --- Skip link ------------------------------------------------------------ */

.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: var(--sp-4);
  z-index: var(--z-skip);
  transform: translateY(-200%);
  background: var(--or);
  color: var(--vert-nuit);
  font-family: var(--ff-body);
  font-size: var(--fs-sm);
  font-weight: 700;
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--r-sm);
  text-decoration: none;
  transition: transform var(--dur-base) var(--ease-out);
}
.skip-link:focus { transform: translateY(0); }


/* --- Screen-reader-only --------------------------------------------------- */

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


/* --- Shared typographic helpers ------------------------------------------ */

.lead {
  font-size: var(--fs-lg);
  line-height: var(--lh-relaxed);
  color: var(--ink-2);
  max-width: var(--measure);
}

.prose > * + * { margin-top: var(--sp-4); }
.prose { max-width: var(--measure); }
.prose h2 { margin-top: var(--sp-7); }
.prose h3 { margin-top: var(--sp-6); }
.prose ul { display: grid; gap: var(--sp-2); }
.prose ul li {
  position: relative;
  padding-left: var(--sp-5);
}
.prose ul li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.65em;
  width: 7px; height: 7px;
  background: var(--or);
  transform: rotate(45deg);
}

/* The eyebrow is a mono label. It names the section's role in the record,
   which is why it is set in the same face as reference numbers. */
.eyebrow {
  font-family: var(--ff-mono);
  font-size: var(--fs-3xs);
  font-weight: 500;
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  color: var(--vert-etat);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--ligne);
}
.eyebrow--dark { color: var(--or-clair); }
.eyebrow--dark::after { background: var(--ligne-sombre); }
.eyebrow--plain::after { display: none; }

/* Secondary body text: panel copy, card bodies, list notes. */
.text-note {
  font-size: var(--fs-sm);
  line-height: var(--lh-normal);
  color: var(--ink-2);
}
.section--dark .text-note,
.panel--dark .text-note { color: rgba(255, 255, 255, 0.76); }

.ref {
  font-family: var(--ff-mono);
  font-size: var(--fs-2xs);
  font-weight: 500;
  letter-spacing: var(--ls-wide);
  color: var(--ink-3);
}


/* --- Reduced motion -------------------------------------------------------
   Collapse the motion tokens once, so no component has to opt out. */

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-fast: 0.01ms;
    --dur-base: 0.01ms;
    --dur-slow: 0.01ms;
    --dur-story: 0.01ms;
  }
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}


/* --- Print ---------------------------------------------------------------- */

@media print {
  .statebar, .proposal-bar, .masthead__nav, .sitefoot__gov, .to-top { display: none; }
  body { background: #fff; font-size: 11pt; }
  a::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555; }
}
