/* ==========================================================================
   VTCPass — base : reset, typographie, RTL, accessibilité
   ========================================================================== */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 5rem;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--fond);
  color: var(--texte);
  font-family: var(--police-texte);
  font-size: var(--t-0);
  line-height: var(--interligne);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Arabe : police dédiée, interligne 1,8, sens RTL porté par l'attribut dir */
:lang(ar),
[dir="rtl"] body {
  font-family: var(--police-arabe);
  line-height: var(--interligne-ar);
}
.ar { font-family: var(--police-arabe); line-height: var(--interligne-ar); }

main { flex: 1 0 auto; }
body > * { min-width: 0; }

h1, h2, h3, h4 {
  font-family: var(--police-titre);
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 var(--e-4);
  letter-spacing: -0.01em;
  text-wrap: balance;
}
:lang(ar) h1, :lang(ar) h2, :lang(ar) h3, :lang(ar) h4 {
  font-family: var(--police-arabe);
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0;
}
h1 { font-size: var(--t-4); }
h2 { font-size: var(--t-3); }
h3 { font-size: var(--t-2); }
h4 { font-size: var(--t-1); font-weight: 700; }
@media (max-width: 40rem) {
  h1 { font-size: var(--t-3); }
  h2 { font-size: var(--t-2); }
  h3 { font-size: var(--t-1); }
}

p, ul, ol { margin: 0 0 var(--e-4); max-width: var(--mesure); }
li + li { margin-top: var(--e-2); }
strong { font-weight: 700; }
small, .mention { font-size: var(--t-moins-1); color: var(--texte-doux); }

a { color: var(--lien); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

img, svg { max-width: 100%; height: auto; }
.icon { width: 1.25em; height: 1.25em; flex: none; fill: currentColor; vertical-align: -0.2em; }

hr { border: 0; border-top: 1px solid var(--ligne); margin: var(--e-6) 0; }

/* Chiffres (notes, comptes à rebours) : Overpass, chiffres tabulaires */
.chiffre {
  font-family: var(--police-titre);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* Focus toujours visible, double anneau lisible sur tous les fonds */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--focus-anneau);
}
:focus:not(:focus-visible) { outline: none; }

/* Lien d'évitement */
.evitement {
  position: absolute;
  inset-inline-start: var(--e-4);
  top: -10rem;
  z-index: 100;
  padding: var(--e-3) var(--e-4);
  background: var(--surface);
  color: var(--texte);
  border-radius: var(--r-bouton);
}
.evitement:focus { top: var(--e-4); }

.visuellement-cache {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Conteneur de page */
.page {
  width: 100%;
  max-width: var(--largeur-page);
  margin-inline: auto;
  padding-inline: var(--e-4);
}
.page-etroite { max-width: 40rem; }
.section { padding-block: var(--e-7); }
.section-serree { padding-block: var(--e-5); }
.pile > * + * { margin-top: var(--e-4); }
.pile-large > * + * { margin-top: var(--e-6); }

/* Mouvement : une seule animation à l'ouverture, désactivée sur demande du système */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
