/* =====================================================================
   Cockpit La Brig'ads — socle : remise à plat, typographie, focus
   ===================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--fond);
  /* Le rebond de l'iPhone ne doit pas montrer une autre couleur que celle du cadre. */
  overscroll-behavior-y: none;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--fond);
  color: var(--texte);
  font-family: var(--police-texte);
  font-size: var(--t-2);
  line-height: 1.5;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }

h1, h2, h3, h4 {
  font-family: var(--police-titre);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.012em;
  text-wrap: balance;
  color: var(--texte);
}
h1 { font-size: var(--t-4); }
h2 { font-size: var(--t-3); }
h3 { font-size: var(--t-2); }
h4 { font-size: var(--t-1); }

p { text-wrap: pretty; }

a {
  color: var(--action);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
}
a:hover { text-decoration-thickness: 2px; }
:root[data-theme="sombre"] a { color: var(--accent-texte); }

img, svg, video { display: block; max-width: 100%; }
svg.icone { flex: none; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}
button { cursor: pointer; }
button:disabled, [aria-disabled="true"] { cursor: not-allowed; }
textarea { resize: vertical; }

table { border-collapse: collapse; width: 100%; }
th { text-align: start; font-weight: 600; }

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

::selection { background: var(--accent); color: var(--surface-haute); }
:root[data-theme="sombre"] ::selection { background: var(--accent); color: var(--cadre); }

/* Focus : toujours visible au clavier, de la couleur de l'action, jamais retiré. */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--action);
  outline-offset: 2px;
  border-radius: var(--r-petit);
}
:root[data-theme="sombre"] :focus-visible { outline-color: var(--accent); }

[hidden] { display: none !important; }

/* Lu par les lecteurs d'écran, absent de l'écran. */
.hors-ecran {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Les nombres s'alignent en colonne. */
.chiffres { font-variant-numeric: tabular-nums; }
.titre-chiffre {
  font-family: var(--police-titre);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}

.discret { color: var(--texte-2); }
.legende { color: var(--texte-3); font-size: var(--t-0); }
.code { font-family: var(--police-code); font-size: .92em; }
.sans-retour { white-space: nowrap; }
.coupe { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mesure { max-width: var(--mesure); }

/* Lien d'évitement : premier élément atteint au clavier. */
.evitement {
  position: fixed;
  inset-block-start: calc(var(--sur-haut) + var(--e-2));
  inset-inline-start: var(--e-2);
  z-index: 100;
  padding: var(--e-2) var(--e-4);
  background: var(--action);
  color: var(--sur-action);
  border-radius: var(--r-champ);
  text-decoration: none;
  transform: translateY(-200%);
}
.evitement:focus-visible { transform: none; outline-color: var(--jaune); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0s !important;
    scroll-behavior: auto !important;
  }
}
