/* ==========================================================================
   Midterms 2026 — La Libre
   style.css : jetons, reset, grille, typographie
   ========================================================================== */

:root {
  /* Charte La Libre */
  --llb-magenta: #ac115d;
  --llb-marine: #061e4d;

  /* Rampe partisane : la teinte porte le parti, la clarte porte la certitude */
  --dem-gagne: #061e4d;
  --dem-projete: #26437a;
  --dem-sur: #6f87b3;
  --dem-penche: #b9c4d8;
  --rep-gagne: #ac115d;
  --rep-projete: #c43b7c;
  --rep-sur: #d98baf;
  --rep-penche: #eec9da;
  --ind-gagne: #4a7c59;
  --indecis: #c3cad6;
  --vide: #e7ebf2;

  /* Surfaces */
  --papier: #ffffff;
  --surface: #f3f5f9;
  --surface-2: #e9edf4;
  --ligne: #dbe1eb;
  --encre: #061e4d;
  --encre-douce: #566382;
  --encre-faible: #8a94ad;
  --focus: #ac115d;

  /* Typographie */
  --titre: "Manuale", Georgia, "Times New Roman", serif;
  --texte: "Libre Franklin", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Helvetica, Arial, sans-serif;

  --t-display: clamp(2.15rem, 5vw, 3.9rem);
  --t-h2: clamp(1.7rem, 3vw, 2.4rem);
  --t-h3: 1.3125rem;
  --t-base: 1.0625rem;
  --t-petit: 0.875rem;
  --t-micro: 0.75rem;

  /* Rythme : base 8 */
  --e1: 0.5rem;
  --e2: 1rem;
  --e3: 1.5rem;
  --e4: 2rem;
  --e5: 3rem;
  --e6: 4.5rem;
  --e7: 7rem;

  /* Grille Muller-Brockmann : 12 colonnes, gouttiere 24 */
  --grille-max: 1320px;
  --gouttiere: 24px;
  --marge: clamp(20px, 5vw, 56px);

  --rayon: 14px;
  --rayon-petit: 9px;

  /* Courbe iOS : sortie franche, arrivee posee */
  --ressort: cubic-bezier(0.32, 0.72, 0, 1);
  --doux: cubic-bezier(0.4, 0, 0.2, 1);
  --duree: 520ms;
  --duree-courte: 220ms;

  --ombre-1: 0 1px 2px rgba(6, 30, 77, 0.06),
    0 4px 16px rgba(6, 30, 77, 0.06);
  --ombre-2: 0 2px 6px rgba(6, 30, 77, 0.08),
    0 18px 48px rgba(6, 30, 77, 0.14);

  color-scheme: light;
}

:root[data-theme="sombre"] {
  --dem-gagne: #6d97e0;
  --dem-projete: #4f79c4;
  --dem-sur: #38558c;
  --dem-penche: #26385c;
  --rep-gagne: #e4478d;
  --rep-projete: #c33a76;
  --rep-sur: #8d2b55;
  --rep-penche: #5a1f3a;
  --ind-gagne: #6fae82;
  --indecis: #3b4766;
  --vide: #172343;

  --papier: #050d1f;
  --surface: #0b1730;
  --surface-2: #142344;
  --ligne: #1e2f55;
  --encre: #edf1f9;
  --encre-douce: #a4b1cc;
  --encre-faible: #6c7b9c;
  --focus: #e4478d;

  --ombre-1: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.35);
  --ombre-2: 0 2px 6px rgba(0, 0, 0, 0.45), 0 18px 48px rgba(0, 0, 0, 0.55);

  color-scheme: dark;
}

/* --------------------------------------------------------------- reset -- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Une ancre ne doit pas atterrir sous l'en-tête collant. */
  scroll-padding-top: calc(var(--hauteur-entete, 96px) + 16px);
}

body {
  margin: 0;
  background: var(--papier);
  color: var(--encre);
  font-family: var(--texte);
  font-size: var(--t-base);
  line-height: 1.6;
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

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

a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, var(--llb-magenta) 55%, transparent);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: var(--llb-magenta);
}

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

/* ----------------------------------------------------------- typographie */

h1,
h2,
h3 {
  font-family: var(--titre);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.018em;
  margin: 0;
  text-wrap: balance;
}

h1 {
  font-size: var(--t-display);
  letter-spacing: -0.03em;
}

h2 {
  font-size: var(--t-h2);
}

h3 {
  font-size: var(--t-h3);
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 var(--e2);
  max-width: 66ch;
}

.chapo {
  font-size: clamp(1.1rem, 1.9vw, 1.375rem);
  line-height: 1.5;
  color: var(--encre-douce);
  max-width: 54ch;
}

.etiquette {
  font-size: var(--t-micro);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--encre-faible);
}

.chiffre {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* Le lien « Aller à la carte » réapparaît quand on y arrive au clavier. */
a.invisible:focus-visible {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  width: auto;
  height: auto;
  margin: 0;
  padding: 10px 16px;
  overflow: visible;
  clip: auto;
  clip-path: none;
  white-space: nowrap;
  background: #061e4d;
  color: #fff;
  border-radius: 8px;
  outline: 3px solid #e6007e;
  outline-offset: 2px;
}

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

/* ---------------------------------------------------------------- grille */

.enveloppe {
  width: 100%;
  max-width: var(--grille-max);
  margin-inline: auto;
  padding-inline: var(--marge);
}

.grille {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gouttiere);
}

.col-plein {
  grid-column: 1 / -1;
}

.col-principale {
  grid-column: 1 / span 8;
}

.col-laterale {
  grid-column: 9 / span 4;
}

@media (max-width: 1000px) {
  .col-principale,
  .col-laterale {
    grid-column: 1 / -1;
  }
}

/* --------------------------------------------------------------- mouvement */

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