/*
 * Base : polices, reset léger, focus, mouvement réduit et mise en page générale.
 * Les valeurs viennent de tokens.css (chargé avant cette feuille).
 */

@font-face {
  font-family: "Fredoka";
  src: url("../assets/polices/fredoka-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Lexend";
  src: url("../assets/polices/lexend-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--fond-page);
  color: var(--texte);
  font-family: var(--police-texte);
  font-size: var(--taille-texte);
  font-weight: 400;
  line-height: var(--interligne);
}

h1,
h2,
h3 {
  margin: 0 0 var(--espace-3);
  font-family: var(--police-titre);
  font-weight: 700;
  line-height: 1.2;
}

h1 { font-size: var(--taille-titre-1); line-height: 1.1; }
h2 { font-size: var(--taille-titre-2); }
h3 { font-size: var(--taille-titre-3); }

p {
  margin: 0 0 var(--espace-4);
}

a {
  color: var(--lien);
  text-underline-offset: 0.2em;
}

img,
svg {
  max-width: 100%;
}

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

/* Focus toujours visible : double anneau (clair puis foncé) lisible sur tous les fonds. */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px var(--blanc);
}

/* Le contenu principal reçoit le focus après un changement d'écran : pas d'anneau pour lui. */
main:focus {
  outline: none;
  box-shadow: none;
}

/* Mise en page fluide : de 768 à 1920 px, sans casser à 375 px. */
.conteneur {
  width: 100%;
  max-width: var(--largeur-contenu);
  margin-inline: auto;
  padding-inline: var(--espace-4);
}

@media (min-width: 768px) {
  .conteneur {
    padding-inline: var(--marge-page);
  }
}

/* Mouvement : on coupe toutes les animations quand l'élève ou le système le demande. */
html.animations-reduites *,
html.animations-reduites *::before,
html.animations-reduites *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}

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