/*
 * Base : remise à zéro, typographie, mise en page de la coquille, focus,
 * utilitaires. Mobile d'abord : les règles larges sont dans des min-width.
 */

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

/* L'attribut hidden l'emporte sur tout display posé par une classe (.bouton…). */
[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--e-6);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--fond);
  color: var(--encre);
  font-family: var(--police-texte);
  font-size: var(--t-2);
  line-height: var(--interligne);
  font-feature-settings: 'kern', 'liga';
  overflow-x: hidden;
}

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

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

h1,
h2,
h3,
h4 {
  font-family: var(--police-titre);
  font-weight: 600;
  line-height: var(--interligne-serre);
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-size: var(--t-5);
}
h2 {
  font-size: var(--t-4);
}
h3 {
  font-size: var(--t-3);
}

p,
ul,
ol,
dl,
figure,
blockquote {
  margin: 0;
}

p,
li,
dd {
  text-wrap: pretty;
  max-width: var(--largeur-texte);
}

ul,
ol {
  padding-left: 1.25em;
}

/* Liens toujours soulignés : jamais distingués par la seule couleur */
a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover {
  text-decoration-thickness: 2px;
}

strong {
  font-weight: 650;
}

abbr[title] {
  text-decoration: underline dotted;
}

hr {
  border: 0;
  border-top: var(--trait) solid var(--filet);
  margin: var(--e-6) 0;
}

/* Chiffres alignés dans les tableaux et mesures */
.chiffres,
table,
time {
  font-variant-numeric: tabular-nums;
}

/* --- Focus --------------------------------------------------------------- */
:focus {
  outline: none;
}
:focus-visible {
  outline: var(--trait-fort) solid var(--focus-externe);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--focus-interne);
  border-radius: var(--rayon-1);
}
[tabindex='-1']:focus-visible {
  outline: none;
  box-shadow: none;
}

/* --- Coquille ----------------------------------------------------------- */
.lien-evitement {
  position: absolute;
  left: var(--e-2);
  top: -10rem;
  z-index: 10;
  padding: var(--e-2) var(--e-4);
  background: var(--accent);
  color: var(--sur-accent);
  border-radius: var(--rayon-2);
}
.lien-evitement:focus {
  top: var(--e-2);
}

.conteneur {
  width: 100%;
  max-width: var(--largeur-page);
  margin-inline: auto;
  padding-inline: var(--marge-page);
}

.entete {
  border-bottom: var(--trait) solid var(--filet);
  background: var(--fond);
}
.entete__barre {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--e-3);
  min-height: 3.5rem;
}
.marque {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35em;
  font-family: var(--police-titre);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}
.marque__annee {
  font-family: var(--police-chiffres);
  font-size: 0.8em;
  font-weight: 500;
  padding: 0 0.3em;
  border: var(--trait) solid currentColor;
  border-radius: var(--rayon-1);
}
.navigation {
  display: none;
}
.navigation ul {
  display: flex;
  gap: var(--e-5);
  list-style: none;
  margin: 0;
  padding: 0;
}
.navigation a {
  text-decoration: none;
  font-size: var(--t-1);
  padding-block: var(--e-2);
  border-bottom: var(--trait-fort) solid transparent;
}
.navigation a:hover {
  border-bottom-color: var(--filet-fort);
}
.navigation a[aria-current='page'] {
  border-bottom-color: var(--encre);
  font-weight: 600;
}
.entete__outils {
  display: flex;
  align-items: center;
  gap: var(--e-2);
}

/* Menu mobile */
.menu-mobile {
  border-top: var(--trait) solid var(--filet);
  padding-block: var(--e-3);
}
.menu-mobile ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--e-1);
}
.menu-mobile a {
  display: block;
  padding: var(--e-2) 0;
  text-decoration: none;
  min-height: var(--cible-min);
}
.menu-mobile a[aria-current='page'] {
  font-weight: 650;
  text-decoration: underline;
}

@media (min-width: 56rem) {
  .navigation {
    display: block;
  }
  .bouton-menu,
  .menu-mobile {
    display: none !important;
  }
}

.principal {
  flex: 1;
  padding-block: var(--e-6) var(--e-8);
}
.principal:focus {
  outline: none;
}

.pied {
  border-top: var(--trait) solid var(--filet);
  background: var(--fond-2);
  font-size: var(--t-1);
  color: var(--encre-2);
  padding-block: var(--e-6);
}
.pied__grille {
  display: grid;
  gap: var(--e-5);
}
.pied ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--e-1);
}
.pied a {
  display: inline-block;
  padding-block: 0.15rem;
}
.pied__mentions {
  margin-top: var(--e-5);
  padding-top: var(--e-4);
  border-top: var(--trait) solid var(--filet);
  display: grid;
  gap: var(--e-2);
  font-size: var(--t-0);
}
@media (min-width: 48rem) {
  .pied__grille {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

/* --- Rythme vertical ------------------------------------------------------ */
.pile > * + * {
  margin-top: var(--e-4);
}
.pile-large > * + * {
  margin-top: var(--e-6);
}
.pile-serree > * + * {
  margin-top: var(--e-2);
}
.grappe {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--e-3);
}

/* --- Utilitaires ------------------------------------------------------------ */
.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;
}
.secondaire {
  color: var(--encre-2);
}
.mention {
  font-size: var(--t-0);
  color: var(--encre-2);
}
.surtitre {
  font-family: var(--police-texte);
  font-size: var(--t-0);
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--encre-2);
}
.chapo {
  font-size: var(--t-3);
  line-height: 1.45;
  color: var(--encre-2);
  max-width: 36rem;
}
.texte-long {
  max-width: var(--largeur-texte);
}
.texte-long h2 {
  font-size: var(--t-3);
  margin-top: var(--e-6);
}
.texte-long > * + * {
  margin-top: var(--e-4);
}
.a-completer {
  font-family: var(--police-chiffres);
  font-size: 0.92em;
  background: var(--trame);
  border: var(--trait) dashed var(--filet-fort);
  border-radius: var(--rayon-1);
  padding: 0 0.25em;
}

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

@media print {
  .entete,
  .pied,
  .lien-evitement {
    display: none;
  }
  body {
    background: #fff;
    color: #000;
  }
}
