/* ==========================================================================
   PrépaForce — feuille de style principale
   --------------------------------------------------------------------------
   Sommaire :
   01. Variables (thème clair + sombre)
   02. Reset & base
   03. Typographie
   04. Utilitaires (container, sr-only, skip-link…)
   05. Boutons, badges, chips
   06. Header & navigation (mega-menu, drawer mobile)
   07. Recherche
   08. Hero & sections d'accueil
   09. Cartes
   10. Fil d'Ariane
   11. Mise en page article (sidebar + sommaire)
   12. Prose (contenu rédactionnel : titres, tableaux, listes…)
   13. Callouts (encadrés éditoriaux)
   14. Accordéons (FAQ)
   15. Timeline (étapes du concours)
   16. Glossaire
   17. Blog
   18. Newsletter
   19. Footer
   20. Boutons flottants (retour en haut) & barre de progression
   21. Animations & micro-interactions
   22. Impression
   ========================================================================== */

/* ==========================================================================
   01. VARIABLES
   ========================================================================== */

:root {
  /* --- Palette de marque -------------------------------------------------- */
  --brand-night: #0a1b33;      /* bleu nuit — fonds sombres, footer          */
  --brand-night-2: #0e2547;    /* bleu nuit éclairci                          */
  --brand-blue: #1d4fd8;       /* bleu Police — actions, liens                */
  --brand-blue-dark: #163ea8;  /* hover des actions                           */
  --brand-blue-deep: #14367f;  /* dégradés                                    */
  --brand-sky: #3b82f6;        /* accents clairs                              */
  --brand-gold: #c9a227;       /* touche institutionnelle discrète (galons)   */

  /* --- Thème clair (par défaut) ------------------------------------------ */
  --bg: #ffffff;
  --bg-soft: #f4f6fa;          /* gris clair bleuté — sections alternées      */
  --bg-raised: #ffffff;        /* cartes                                      */
  --bg-inset: #eef2f8;         /* code, kbd, surlignages                      */
  --text: #14213a;             /* texte principal                             */
  --text-strong: #0a1b33;      /* titres                                      */
  --text-muted: #4c5a73;       /* texte secondaire (contraste AA sur blanc)   */
  --link: #1a46bf;
  --link-hover: #16389b;
  --border: #dde4ee;
  --border-strong: #c3cede;
  --shadow-color: 214 32% 20%;
  --shadow-1: 0 1px 2px hsl(var(--shadow-color) / 0.06), 0 1px 6px hsl(var(--shadow-color) / 0.05);
  --shadow-2: 0 2px 6px hsl(var(--shadow-color) / 0.07), 0 12px 32px -12px hsl(var(--shadow-color) / 0.18);
  --shadow-3: 0 4px 12px hsl(var(--shadow-color) / 0.1), 0 24px 60px -18px hsl(var(--shadow-color) / 0.28);
  --header-glass: rgba(255, 255, 255, 0.82);
  --hero-grad-a: #0a1b33;
  --hero-grad-b: #14367f;
  --focus-ring: #1d4fd8;

  /* --- Callouts (clair) --------------------------------------------------- */
  --callout-info-bg: #eef4ff;      --callout-info-border: #b8cdf8;    --callout-info-accent: #1a46bf;
  --callout-conseil-bg: #edfaf3;   --callout-conseil-border: #b3e5c9; --callout-conseil-accent: #157347;
  --callout-attention-bg: #fff6ec; --callout-attention-border: #f5d3a6;--callout-attention-accent: #a05e03;
  --callout-important-bg: #f4efff; --callout-important-border: #d5c5f5;--callout-important-accent: #6236c5;
  --callout-temoignage-bg: #f4f6fa;--callout-temoignage-border: #d5dde9;--callout-temoignage-accent: #4c5a73;
  --callout-reglement-bg: #fdf8ec; --callout-reglement-border: #eadfb8;--callout-reglement-accent: #8a6d1a;

  /* --- Dimensions & rythme ------------------------------------------------ */
  --container: 76rem;          /* 1216 px                                     */
  --container-narrow: 46rem;   /* colonne de lecture                          */
  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 18px;
  --radius-xl: 26px;
  --header-h: 4.25rem;
  --gutter: clamp(1rem, 4vw, 2rem);

  /* --- Typographie -------------------------------------------------------- */
  --font-sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "Segoe UI Mono", Consolas, monospace;

  color-scheme: light;
}

/* --- Thème sombre ---------------------------------------------------------
   Activé par data-theme="dark" sur <html> (géré par assets/js/main.js,
   appliqué avant le premier rendu pour éviter tout flash). */
:root[data-theme="dark"] {
  --bg: #0a1120;
  --bg-soft: #0e1730;
  --bg-raised: #111c38;
  --bg-inset: #16223f;
  --text: #d5deee;
  --text-strong: #f2f6fc;
  --text-muted: #93a3bd;
  --link: #7ea6f8;
  --link-hover: #a5c1fb;
  --border: #223252;
  --border-strong: #31456c;
  --shadow-color: 220 60% 2%;
  --header-glass: rgba(10, 17, 32, 0.8);
  --hero-grad-a: #0a1120;
  --hero-grad-b: #10265c;
  --focus-ring: #7ea6f8;

  --callout-info-bg: #11213f;      --callout-info-border: #27427a;    --callout-info-accent: #8db1f9;
  --callout-conseil-bg: #0e2419;   --callout-conseil-border: #1e4b34; --callout-conseil-accent: #5ecf96;
  --callout-attention-bg: #2a1e0c; --callout-attention-border: #5c4419;--callout-attention-accent: #eab24d;
  --callout-important-bg: #1e1733; --callout-important-border: #3d2f63;--callout-important-accent: #b79bf3;
  --callout-temoignage-bg: #131d33;--callout-temoignage-border: #2a3a5c;--callout-temoignage-accent: #a4b4cd;
  --callout-reglement-bg: #241f0e; --callout-reglement-border: #4d431f;--callout-reglement-accent: #d9bc55;

  color-scheme: dark;
}

/* ==========================================================================
   02. RESET & BASE
   ========================================================================== */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Compense le header fixe lors de la navigation par ancres */
  scroll-padding-top: calc(var(--header-h) + 1.25rem);
}

/* Aucun défilement horizontal, jamais (drawer translaté, mots longs…).
   `clip` plutôt que `hidden` pour ne pas casser position:sticky. */
html, body { overflow-x: clip; }
@supports not (overflow-x: clip) {
  html, body { overflow-x: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: var(--font-sans);
  font-size: 1.0625rem; /* 17px : confort de lecture */
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word; /* les mots/URL longs ne débordent pas sur mobile */
}

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

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

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

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--link-hover); }

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

::selection { background: var(--brand-blue); color: #fff; }

/* ==========================================================================
   03. TYPOGRAPHIE
   ========================================================================== */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--text-strong);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h1 { font-size: clamp(1.9rem, 4.2vw, 2.9rem); }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); }
h3 { font-size: clamp(1.15rem, 1.8vw, 1.3rem); }
h4 { font-size: 1.05rem; }

p { text-wrap: pretty; }

strong { color: var(--text-strong); }

code, kbd {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-inset);
  border-radius: 6px;
  padding: 0.1em 0.4em;
}

/* ==========================================================================
   04. UTILITAIRES
   ========================================================================== */

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Lien d'évitement : premier élément focusable de chaque page */
.skip-link {
  position: fixed;
  top: 0.75rem; left: 0.75rem;
  z-index: 200;
  background: var(--brand-blue);
  color: #fff;
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius-s);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform 0.2s ease;
}
.skip-link:focus { transform: translateY(0); color: #fff; }

.icon { flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section--soft { background: var(--bg-soft); }

.section-head { max-width: 44rem; margin-bottom: clamp(1.75rem, 4vw, 2.75rem); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head .kicker {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--brand-blue);
  margin-bottom: 0.6rem;
}
:root[data-theme="dark"] .section-head .kicker { color: var(--brand-sky); }
.section-head p { margin-top: 0.75rem; color: var(--text-muted); font-size: 1.05rem; }

/* ==========================================================================
   05. BOUTONS, BADGES, CHIPS
   ========================================================================== */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  padding: 0.8rem 1.5rem;
  border-radius: 999px;
  font-weight: 600; font-size: 0.98rem;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  will-change: transform;
}
.btn:active { transform: scale(0.97); }

.btn--primary {
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-deep));
  color: #fff;
  box-shadow: 0 8px 24px -10px rgba(29, 79, 216, 0.65);
}
.btn--primary:hover { color: #fff; box-shadow: 0 12px 30px -10px rgba(29, 79, 216, 0.8); transform: translateY(-1px); }

.btn--ghost {
  background: transparent;
  color: var(--text-strong);
  border-color: var(--border-strong);
}
.btn--ghost:hover { border-color: var(--brand-blue); color: var(--brand-blue); transform: translateY(-1px); }

.btn--light { background: #fff; color: var(--brand-night); }
.btn--light:hover { color: var(--brand-blue-dark); transform: translateY(-1px); box-shadow: var(--shadow-2); }

.btn--small { padding: 0.5rem 1rem; font-size: 0.9rem; }

.badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.78rem; font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--bg-inset);
  color: var(--text-muted);
}
.badge--blue { background: color-mix(in srgb, var(--brand-blue) 12%, transparent); color: var(--link); }
.badge--live {
  background: color-mix(in srgb, #16a34a 14%, transparent); color: #157347;
}
:root[data-theme="dark"] .badge--live { color: #5ecf96; }
.badge--live::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: currentColor;
  animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 45%, transparent); }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ==========================================================================
   06. HEADER & NAVIGATION
   ========================================================================== */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.25s ease;
}
/* L'effet "verre" vit sur un pseudo-élément : un backdrop-filter posé
   directement sur .site-header en ferait le containing block des
   descendants en position:fixed (drawer mobile) — bug iOS/Chrome. */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--header-glass);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
}
.site-header.is-scrolled { box-shadow: var(--shadow-1); }

.site-header__inner {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
  height: 100%;
  display: flex; align-items: center; gap: 1rem;
}

/* Logo */
.brand {
  display: inline-flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-display);
  font-weight: 800; font-size: 1.22rem; letter-spacing: -0.02em;
  color: var(--text-strong); text-decoration: none;
}
.brand:hover { color: var(--text-strong); }
.brand__logo { width: 34px; height: 34px; }
.brand b { color: var(--brand-blue); font-weight: 800; }
:root[data-theme="dark"] .brand b { color: var(--brand-sky); }

/* Navigation desktop */
.main-nav { margin-inline: auto; }
.main-nav__list { display: flex; list-style: none; margin: 0; padding: 0; gap: 0.15rem; }
.main-nav__item { position: relative; }

.main-nav__link {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.55rem 0.7rem;
  font-size: 0.93rem; font-weight: 600;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius-s);
  white-space: nowrap; /* jamais de libellé sur 2 lignes dans la barre */
  transition: background 0.15s ease, color 0.15s ease;
}
.main-nav__link:hover, .main-nav__link[aria-expanded="true"] {
  background: var(--bg-inset);
  color: var(--text-strong);
}
.main-nav__link .icon { transition: transform 0.2s ease; }
.main-nav__link[aria-expanded="true"] .icon { transform: rotate(180deg); }

/* Mega-menu (panneau déroulant) */
.mega {
  position: absolute; top: calc(100% + 0.6rem); left: 50%;
  translate: -50% 0;
  width: min(30rem, calc(100vw - 2rem));
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-3);
  padding: 0.75rem;
  opacity: 0; visibility: hidden;
  transform: translateY(6px) scale(0.98);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}
.main-nav__item.is-open .mega,
.main-nav__item:has(.main-nav__link[aria-expanded="true"]) .mega {
  opacity: 1; visibility: visible; transform: translateY(0) scale(1);
}
.mega__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.15rem; }
.mega a {
  display: block;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-s);
  text-decoration: none;
  transition: background 0.14s ease;
}
.mega a:hover { background: var(--bg-inset); }
.mega a strong { display: block; font-size: 0.92rem; color: var(--text-strong); font-weight: 600; }
.mega a span { display: block; font-size: 0.8rem; color: var(--text-muted); line-height: 1.45; margin-top: 0.1rem; }

/* Actions à droite du header */
.header-actions { display: flex; align-items: center; gap: 0.4rem; margin-left: auto; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem;
  border-radius: var(--radius-s);
  color: var(--text);
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.icon-btn:hover { background: var(--bg-inset); color: var(--text-strong); transform: translateY(-1px); }

/* Icônes du bouton thème : on affiche l'une ou l'autre selon le thème actif */
.theme-toggle .icon--sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon--sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon--moon { display: none; }

/* Burger mobile */
.nav-burger { display: none; }

/* --- Navigation mobile (drawer) -------------------------------------------
   Le seuil est volontairement haut (1248 px) : avec 8 entrées, la barre
   horizontale a besoin de place — en dessous, le burger prend le relais. */
@media (max-width: 77.99rem) {
  .main-nav {
    position: fixed;
    inset: var(--header-h) 0 0 0;
    margin: 0;
    background: var(--bg);
    overflow-y: auto;
    padding: 1rem var(--gutter) 4rem;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0.2, 1);
    visibility: hidden;
  }
  .main-nav.is-open { transform: translateX(0); visibility: visible; }

  .main-nav__list { flex-direction: column; gap: 0; }
  .main-nav__item { border-bottom: 1px solid var(--border); }
  .main-nav__link {
    width: 100%; justify-content: space-between;
    padding: 0.95rem 0.25rem; font-size: 1.05rem;
  }
  .mega {
    position: static; translate: none; width: auto;
    border: 0; box-shadow: none; border-radius: 0;
    background: transparent; padding: 0 0 0.75rem;
    opacity: 1; visibility: visible; transform: none;
    display: none;
  }
  .main-nav__item.is-open .mega { display: block; }
  .mega__grid { grid-template-columns: 1fr; }

  .nav-burger { display: inline-flex; }
  .nav-burger .icon--close { display: none; }
  .nav-burger[aria-expanded="true"] .icon--close { display: block; }
  .nav-burger[aria-expanded="true"] .icon--menu { display: none; }

  body.nav-open { overflow: hidden; }
}

/* Décalage du contenu sous le header fixe */
main { padding-top: var(--header-h); }

/* ==========================================================================
   07. RECHERCHE
   ========================================================================== */

/* Panneau de recherche plein écran */
.search-modal {
  position: fixed; inset: 0; z-index: 150;
  display: none;
  background: color-mix(in srgb, var(--brand-night) 45%, transparent);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  padding: min(12vh, 7rem) var(--gutter) 2rem;
}
.search-modal.is-open { display: block; }

.search-panel {
  max-width: 38rem; margin-inline: auto;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-3);
  overflow: hidden;
  animation: search-in 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes search-in {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
}

.search-panel__bar {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 1rem 1.15rem;
  border-bottom: 1px solid var(--border);
}
.search-panel__bar .icon { color: var(--text-muted); }
.search-panel__input {
  flex: 1; border: 0; background: transparent; outline: none;
  font-size: 1.08rem; color: var(--text-strong);
}
.search-panel__input::placeholder { color: var(--text-muted); }
.search-panel__esc {
  font-size: 0.72rem; font-weight: 700; color: var(--text-muted);
  border: 1px solid var(--border-strong); border-radius: 6px;
  padding: 0.2rem 0.45rem;
}

.search-results { max-height: min(55vh, 26rem); overflow-y: auto; padding: 0.5rem; }
.search-results__hint { padding: 1.4rem 1rem; text-align: center; color: var(--text-muted); font-size: 0.95rem; }
.search-result {
  display: block; padding: 0.7rem 0.85rem;
  border-radius: var(--radius-s);
  text-decoration: none;
}
.search-result:hover, .search-result.is-active { background: var(--bg-inset); }
.search-result__type {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--link);
}
.search-result strong { display: block; color: var(--text-strong); font-size: 0.98rem; font-weight: 600; }
.search-result span { display: block; color: var(--text-muted); font-size: 0.85rem; line-height: 1.5; }
.search-result mark { background: color-mix(in srgb, var(--brand-gold) 30%, transparent); color: inherit; border-radius: 3px; padding: 0 0.1em; }

/* Champ de recherche « en dur » (hero, page recherche) */
.search-inline {
  display: flex; align-items: center; gap: 0.7rem;
  width: 100%; max-width: 34rem;
  background: var(--bg-raised);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 0.6rem 0.45rem 1.2rem;
  box-shadow: var(--shadow-2);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.search-inline:focus-within { border-color: var(--brand-blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-blue) 18%, transparent); }
.search-inline input { flex: 1; border: 0; background: transparent; outline: none; font-size: 1rem; min-width: 0; }
.search-inline .btn { flex: none; }

/* ==========================================================================
   08. HERO & SECTIONS D'ACCUEIL
   ========================================================================== */

.hero {
  position: relative;
  background:
    radial-gradient(90rem 42rem at 85% -20%, color-mix(in srgb, var(--brand-blue) 45%, transparent), transparent 60%),
    linear-gradient(160deg, var(--hero-grad-a), var(--hero-grad-b) 130%);
  color: #dbe5f5;
  overflow: hidden;
}
.hero::after {
  /* Trame en pointillés très discrète, façon plan d'architecte */
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.13) 1px, transparent 1.4px);
  background-size: 26px 26px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent 75%);
  pointer-events: none;
}

.hero__inner {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  padding-block: clamp(3.5rem, 8vw, 6.5rem);
}
@media (max-width: 56rem) {
  .hero__inner { grid-template-columns: minmax(0, 1fr); }
  .hero__art { display: none; }
}

.hero h1 {
  color: #fff;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
}
.hero h1 em { font-style: normal; color: #8db1f9; }
.hero__lead { margin-top: 1.1rem; font-size: clamp(1.02rem, 1.6vw, 1.18rem); max-width: 36rem; color: #b9c8e2; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.8rem; }
.hero__search { margin-top: 1.6rem; }
.hero__search .search-inline { border-color: transparent; }

.hero__badges { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.2rem; }
.hero__badges .badge { background: rgba(255, 255, 255, 0.1); color: #cddcf7; }

.hero__art svg { width: 100%; height: auto; filter: drop-shadow(0 24px 48px rgba(2, 8, 20, 0.45)); }

/* Bandeau de chiffres clés */
.stats-band { background: var(--bg-soft); border-block: 1px solid var(--border); }
.stats-band__grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: var(--border);
}
@media (max-width: 48rem) { .stats-band__grid { grid-template-columns: repeat(2, 1fr); } }
.stat {
  background: var(--bg-soft);
  padding: 1.6rem 1.2rem;
  text-align: center;
}
.stat b {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800; letter-spacing: -0.02em;
  color: var(--text-strong);
}
.stat span { font-size: 0.88rem; color: var(--text-muted); }

/* ==========================================================================
   09. CARTES
   ========================================================================== */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 1.1rem;
}

.card {
  position: relative;
  display: flex; flex-direction: column; gap: 0.55rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: 1.5rem;
  box-shadow: var(--shadow-1);
  transition: transform 0.18s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--border-strong); }

.card__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.9rem; height: 2.9rem;
  border-radius: var(--radius-m);
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand-blue) 14%, transparent), color-mix(in srgb, var(--brand-sky) 8%, transparent));
  color: var(--link);
  margin-bottom: 0.4rem;
}
.card h3 { font-size: 1.12rem; }
.card p { font-size: 0.94rem; color: var(--text-muted); line-height: 1.6; }

/* Carte entièrement cliquable via un pseudo-élément sur le lien du titre */
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card h3 a:focus-visible::after { outline: 3px solid var(--focus-ring); outline-offset: 2px; border-radius: var(--radius-l); }

.card__more {
  margin-top: auto; padding-top: 0.5rem;
  font-size: 0.9rem; font-weight: 600; color: var(--link);
  display: inline-flex; align-items: center; gap: 0.35rem;
}
.card:hover .card__more .icon { transform: translateX(3px); }
.card__more .icon { transition: transform 0.18s ease; }

/* Liste de sous-pages en bas des hubs */
.card__links { list-style: none; padding: 0; margin: 0.4rem 0 0; font-size: 0.92rem; }
.card__links li + li { margin-top: 0.3rem; }
.card__links a { position: relative; z-index: 1; }

/* ==========================================================================
   10. FIL D'ARIANE
   ========================================================================== */

.breadcrumb { padding-block: 1.1rem 0; font-size: 0.86rem; }
.breadcrumb ol {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem;
}
.breadcrumb li { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--text-muted); }
.breadcrumb li:not(:first-child)::before { content: "/"; color: var(--border-strong); }
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--link); text-decoration: underline; }
.breadcrumb [aria-current="page"] { color: var(--text-strong); font-weight: 600; }

/* ==========================================================================
   11. MISE EN PAGE ARTICLE (contenu + sommaire latéral)
   ========================================================================== */

.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16.5rem;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
  padding-block: 1.5rem 4rem;
}
@media (max-width: 63.99rem) {
  /* minmax(0, …) obligatoire : sans lui, un tableau large force la colonne
     au-delà du viewport et tout le contenu déborde à droite (bug iOS). */
  .page-grid { grid-template-columns: minmax(0, 1fr); }
  .page-aside { display: none; }
}

.page-header { margin-bottom: 1.8rem; }
.page-header h1 { margin-bottom: 0.8rem; }
.page-header__lead { font-size: 1.12rem; color: var(--text-muted); max-width: 44rem; }
.page-header__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem;
  margin-top: 1.1rem;
  font-size: 0.86rem; color: var(--text-muted);
}
.page-header__meta > span { display: inline-flex; align-items: center; gap: 0.4rem; }

/* Actions de page : favori, partage, impression */
.page-actions { display: flex; gap: 0.35rem; margin-left: auto; }
.page-actions .icon-btn { width: 2.2rem; height: 2.2rem; border: 1px solid var(--border); }
.page-actions .icon-btn.is-active { color: var(--brand-gold); border-color: var(--brand-gold); }

/* Sommaire latéral */
.page-aside {
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
  max-height: calc(100vh - var(--header-h) - 3rem);
  overflow-y: auto;
  padding-bottom: 1rem;
}
.toc { border-left: 2px solid var(--border); }
.toc__title {
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted);
  padding-left: 1rem; margin-bottom: 0.6rem;
}
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc a {
  display: block;
  padding: 0.32rem 1rem;
  font-size: 0.88rem; line-height: 1.45;
  color: var(--text-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  margin-left: -2px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.toc a:hover { color: var(--text-strong); }
.toc a.is-active { color: var(--link); border-color: var(--brand-blue); font-weight: 600; }
.toc li[data-level="3"] a { padding-left: 1.9rem; font-size: 0.84rem; }

/* Encadré « l'essentiel » en début de page */
.summary-box {
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand-blue) 7%, var(--bg-raised)), var(--bg-raised));
  border: 1px solid color-mix(in srgb, var(--brand-blue) 25%, var(--border));
  border-radius: var(--radius-l);
  padding: 1.4rem 1.6rem;
  margin-block: 1.6rem 2.2rem;
}
.summary-box__title {
  display: flex; align-items: center; gap: 0.5rem;
  font-weight: 700; color: var(--text-strong); font-size: 0.95rem;
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: 0.7rem;
}
.summary-box__title .icon { color: var(--link); }
.summary-box ul { margin: 0; padding-left: 1.2rem; }
.summary-box li { margin-block: 0.35rem; font-size: 0.98rem; }
.summary-box li::marker { color: var(--brand-blue); }

/* Navigation précédent/suivant en bas de page */
.pager {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
  margin-top: 3rem; padding-top: 2rem;
  border-top: 1px solid var(--border);
}
@media (max-width: 40rem) { .pager { grid-template-columns: 1fr; } }
.pager a {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  padding: 1rem 1.2rem;
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.18s ease, box-shadow 0.2s ease;
}
.pager a:hover { border-color: var(--brand-blue); transform: translateY(-2px); box-shadow: var(--shadow-1); }
.pager a span { display: block; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 0.25rem; }
.pager a strong { color: var(--text-strong); font-size: 0.98rem; }
.pager__next { text-align: right; }

/* Pages liées (maillage interne) */
.related { margin-top: 3rem; }
.related h2 { font-size: 1.3rem; margin-bottom: 1rem; }

/* ==========================================================================
   12. PROSE — contenu rédactionnel
   ========================================================================== */

.prose { max-width: var(--container-narrow); min-width: 0; }
.prose > * + * { margin-top: 1.1rem; }

.prose h2 { margin-top: 2.6rem; padding-top: 1.4rem; border-top: 1px solid var(--border); }
.prose h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.prose h3 { margin-top: 2rem; }
.prose h4 { margin-top: 1.5rem; }

/* Ancre de titre (markdown-it-anchor, style linkAfterHeader) */
.heading-wrapper { position: relative; }
.heading-wrapper > a[href^="#"] {
  position: absolute; top: 0; left: -1.6rem;
  display: none;
  width: 1.3rem; height: 100%;
  align-items: center; justify-content: center;
  color: var(--text-muted); text-decoration: none; font-weight: 400;
}
.heading-wrapper > a[href^="#"]::after { content: "#"; font-size: 1.05rem; }
.heading-wrapper:hover > a[href^="#"] { display: inline-flex; }
.heading-wrapper > a[href^="#"]:hover { color: var(--link); }
@media (max-width: 48rem) { .heading-wrapper > a[href^="#"] { display: none !important; } }

.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin-block: 0.4rem; }
.prose li::marker { color: var(--brand-blue); font-weight: 600; }

.prose blockquote {
  border-left: 3px solid var(--brand-blue);
  padding: 0.4rem 0 0.4rem 1.2rem;
  color: var(--text-muted);
  font-style: italic;
}

.prose hr { border: 0; border-top: 1px solid var(--border); margin-block: 2.5rem; }

/* Tableaux : enveloppés dans .table-scroll par le JS pour le défilement mobile */
.table-scroll { overflow-x: auto; margin-block: 1.4rem; border-radius: var(--radius-m); border: 1px solid var(--border); box-shadow: var(--shadow-1); }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.94rem; line-height: 1.5; }
.prose thead th {
  background: var(--brand-night);
  color: #e8eefb;
  font-weight: 600;
  text-align: left;
  padding: 0.75rem 1rem;
  white-space: nowrap;
}
:root[data-theme="dark"] .prose thead th { background: var(--bg-inset); color: var(--text-strong); }
.prose tbody td { padding: 0.7rem 1rem; border-top: 1px solid var(--border); vertical-align: top; }
.prose tbody tr:nth-child(even) { background: var(--bg-soft); }
.prose tbody th { padding: 0.7rem 1rem; border-top: 1px solid var(--border); text-align: left; background: var(--bg-soft); font-weight: 600; }

.prose a { font-weight: 500; }

/* Définitions (glossaire inline) */
.prose dl dt { font-weight: 700; color: var(--text-strong); margin-top: 1rem; }
.prose dl dd { margin-left: 0; color: var(--text-muted); }

/* ==========================================================================
   13. CALLOUTS
   ========================================================================== */

.callout {
  border-radius: var(--radius-m);
  border: 1px solid;
  padding: 1.1rem 1.3rem;
  margin-block: 1.5rem;
  font-size: 0.97rem;
}
.callout__title {
  display: flex; align-items: center; gap: 0.5rem;
  font-weight: 700; margin-bottom: 0.5rem;
}
.callout__body > * + * { margin-top: 0.7rem; }
.callout__body p:first-child { margin-top: 0; }
.callout__body ul { padding-left: 1.2rem; margin: 0; }

.callout--info       { background: var(--callout-info-bg);       border-color: var(--callout-info-border); }
.callout--info .callout__title { color: var(--callout-info-accent); }
.callout--conseil    { background: var(--callout-conseil-bg);    border-color: var(--callout-conseil-border); }
.callout--conseil .callout__title { color: var(--callout-conseil-accent); }
.callout--attention  { background: var(--callout-attention-bg);  border-color: var(--callout-attention-border); }
.callout--attention .callout__title { color: var(--callout-attention-accent); }
.callout--important  { background: var(--callout-important-bg);  border-color: var(--callout-important-border); }
.callout--important .callout__title { color: var(--callout-important-accent); }
.callout--temoignage { background: var(--callout-temoignage-bg); border-color: var(--callout-temoignage-border); }
.callout--temoignage .callout__title { color: var(--callout-temoignage-accent); }
.callout--temoignage .callout__body { font-style: italic; }
.callout--reglement  { background: var(--callout-reglement-bg);  border-color: var(--callout-reglement-border); }
.callout--reglement .callout__title { color: var(--callout-reglement-accent); }
.callout--reglement .callout__body { font-size: 0.92rem; }

/* ==========================================================================
   14. ACCORDÉONS (FAQ)
   ========================================================================== */

.accordion { display: grid; gap: 0.65rem; }

.accordion details {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.accordion details[open] { border-color: var(--border-strong); box-shadow: var(--shadow-1); }

.accordion summary {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.25rem;
  font-weight: 600; color: var(--text-strong);
  cursor: pointer;
  list-style: none;
  transition: background 0.15s ease;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary:hover { background: var(--bg-inset); }
.accordion summary .icon { flex: none; color: var(--text-muted); transition: transform 0.25s ease; }
.accordion details[open] summary .icon { transform: rotate(45deg); color: var(--link); }

.accordion .accordion__body { padding: 0.15rem 1.25rem 1.2rem; color: var(--text); font-size: 0.97rem; }
.accordion .accordion__body > * + * { margin-top: 0.7rem; }
.accordion .accordion__body ul { padding-left: 1.25rem; margin: 0.4rem 0 0; }

/* Filtres de la page FAQ */
.filter-bar { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-block: 1.4rem 1.8rem; }
.filter-chip {
  padding: 0.45rem 1rem;
  border-radius: 999px;
  border: 1.5px solid var(--border-strong);
  font-size: 0.88rem; font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-raised);
  transition: all 0.16s ease;
}
.filter-chip:hover { border-color: var(--brand-blue); color: var(--link); }
.filter-chip[aria-pressed="true"] {
  background: var(--brand-blue); border-color: var(--brand-blue); color: #fff;
}

/* ==========================================================================
   15. TIMELINE — étapes du concours
   ========================================================================== */

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: "";
  position: absolute; left: 1.19rem; top: 0.5rem; bottom: 0.5rem;
  width: 2px;
  background: linear-gradient(to bottom, var(--brand-blue), color-mix(in srgb, var(--brand-blue) 20%, transparent));
}
.timeline li { position: relative; padding: 0 0 1.9rem 3.4rem; }
.timeline li:last-child { padding-bottom: 0; }
.timeline__dot {
  position: absolute; left: 0; top: 0.1rem;
  width: 2.5rem; height: 2.5rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--bg-raised);
  border: 2px solid var(--brand-blue);
  color: var(--link);
  font-weight: 800; font-size: 0.95rem;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--brand-blue) 10%, transparent);
}
.timeline h3 { font-size: 1.1rem; margin-bottom: 0.3rem; }
.timeline p { color: var(--text-muted); font-size: 0.95rem; max-width: 38rem; }
.timeline .badge { margin-top: 0.5rem; }

/* ==========================================================================
   16. GLOSSAIRE
   ========================================================================== */

.alpha-nav {
  display: flex; flex-wrap: wrap; gap: 0.3rem;
  margin-block: 1.4rem 2rem;
  position: sticky; top: calc(var(--header-h) + 0.5rem);
  background: var(--header-glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  padding: 0.6rem; border-radius: var(--radius-m);
  border: 1px solid var(--border);
  z-index: 10;
}
.alpha-nav a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem;
  border-radius: var(--radius-s);
  font-weight: 700; font-size: 0.88rem;
  color: var(--text); text-decoration: none;
  transition: background 0.14s ease, color 0.14s ease;
}
.alpha-nav a:hover { background: var(--brand-blue); color: #fff; }
.alpha-nav span { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; color: var(--border-strong); font-weight: 700; font-size: 0.88rem; }

.glossary-group { margin-block: 2.2rem; }
.glossary-group > h2 {
  font-size: 1.6rem; color: var(--brand-blue);
  border-bottom: 2px solid var(--border); padding-bottom: 0.4rem;
}
:root[data-theme="dark"] .glossary-group > h2 { color: var(--brand-sky); }
.glossary-item { padding: 1.1rem 0; border-bottom: 1px solid var(--border); }
.glossary-item:target { background: color-mix(in srgb, var(--brand-gold) 10%, transparent); border-radius: var(--radius-s); padding-inline: 0.8rem; }
.glossary-item dt { font-weight: 800; color: var(--text-strong); font-size: 1.05rem; }
.glossary-item dt small { font-weight: 600; color: var(--text-muted); font-size: 0.9rem; margin-left: 0.5rem; }
.glossary-item dd { margin: 0.35rem 0 0; color: var(--text); font-size: 0.96rem; }

/* ==========================================================================
   17. BLOG
   ========================================================================== */

.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: 1.2rem; }

.post-card {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  overflow: hidden;
  box-shadow: var(--shadow-1);
  transition: transform 0.18s ease, box-shadow 0.22s ease;
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }

.post-card__cover {
  aspect-ratio: 16 / 8.5;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, var(--brand-night), var(--brand-blue-deep));
  color: #8db1f9;
}
.post-card__cover .icon { width: 3rem; height: 3rem; opacity: 0.9; }

.post-card__body { display: flex; flex-direction: column; gap: 0.5rem; padding: 1.25rem 1.4rem 1.4rem; flex: 1; }
.post-card__meta { display: flex; align-items: center; gap: 0.7rem; font-size: 0.8rem; color: var(--text-muted); }
.post-card h3, .post-card h2 { font-size: 1.12rem; line-height: 1.35; }
.post-card h3 a, .post-card h2 a { color: inherit; text-decoration: none; }
.post-card h3 a::after, .post-card h2 a::after { content: ""; position: absolute; inset: 0; }
.post-card p { font-size: 0.92rem; color: var(--text-muted); }

/* En-tête d'article */
.article-header { padding-block: 2.2rem 0; }
.article-header .badge { margin-bottom: 1rem; }

/* ==========================================================================
   18. NEWSLETTER
   ========================================================================== */

.newsletter {
  background:
    radial-gradient(60rem 30rem at 110% 110%, color-mix(in srgb, var(--brand-blue) 40%, transparent), transparent 65%),
    linear-gradient(150deg, var(--brand-night), var(--brand-blue-deep) 150%);
  border-radius: var(--radius-xl);
  color: #c9d7ef;
  padding: clamp(2rem, 5vw, 3.5rem);
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 2rem; align-items: center;
}
@media (max-width: 56rem) { .newsletter { grid-template-columns: minmax(0, 1fr); } }
.newsletter h2 { color: #fff; }
.newsletter p { margin-top: 0.6rem; font-size: 0.98rem; }
.newsletter form { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.newsletter input[type="email"] {
  flex: 1; min-width: 14rem;
  padding: 0.85rem 1.2rem;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: #fff; outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.newsletter input[type="email"]::placeholder { color: #93a8ce; }
.newsletter input[type="email"]:focus { border-color: #8db1f9; background: rgba(255, 255, 255, 0.14); }
.newsletter__note { font-size: 0.8rem; color: #93a8ce; margin-top: 0.7rem; }
.newsletter__msg { margin-top: 0.7rem; font-weight: 600; color: #7be0a8; }

/* ==========================================================================
   19. FOOTER
   ========================================================================== */

.site-footer {
  background: var(--brand-night);
  color: #a7b8d4;
  margin-top: 4rem;
}
:root[data-theme="dark"] .site-footer { background: #060b16; }

.site-footer__main {
  display: grid;
  grid-template-columns: minmax(14rem, 1.3fr) repeat(4, minmax(0, 1fr));
  gap: 2.2rem;
  padding-block: 3.2rem 2.4rem;
}
@media (max-width: 63.99rem) { .site-footer__main { grid-template-columns: 1fr 1fr; } }
@media (max-width: 40rem) { .site-footer__main { grid-template-columns: 1fr; gap: 1.6rem; } }

.site-footer .brand { color: #fff; }
.site-footer .brand b { color: #8db1f9; }
.site-footer__about { font-size: 0.9rem; line-height: 1.65; margin-top: 0.9rem; max-width: 20rem; }

.site-footer h2 {
  color: #fff; font-size: 0.85rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 0.9rem;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li + li { margin-top: 0.45rem; }
.site-footer a { color: #a7b8d4; text-decoration: none; font-size: 0.92rem; transition: color 0.15s ease; }
.site-footer a:hover { color: #fff; text-decoration: underline; }

.site-footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-block: 1.3rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem 1.6rem;
  font-size: 0.82rem;
}
.site-footer__disclaimer {
  font-size: 0.78rem; color: #7488ab; line-height: 1.6;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-block: 1.1rem;
}

/* ==========================================================================
   20. BOUTONS FLOTTANTS & PROGRESSION DE LECTURE
   ========================================================================== */

.reading-progress {
  position: fixed; top: 0; left: 0; z-index: 110;
  height: 3px; width: 100%;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--brand-blue), var(--brand-sky));
  pointer-events: none;
}

.back-to-top {
  position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 90;
  width: 2.9rem; height: 2.9rem;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--bg-raised);
  color: var(--text-strong);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-2);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { color: var(--link); border-color: var(--brand-blue); }

/* Notification éphémère (copie de lien, favori…) */
.toast {
  position: fixed; left: 50%; bottom: 1.4rem; z-index: 160;
  translate: -50% 0;
  background: var(--brand-night);
  color: #fff;
  font-size: 0.9rem; font-weight: 600;
  padding: 0.7rem 1.3rem;
  border-radius: 999px;
  box-shadow: var(--shadow-3);
  opacity: 0; visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s;
}
.toast.is-visible { opacity: 1; visibility: visible; }

/* ==========================================================================
   21. ANIMATIONS & MICRO-INTERACTIONS
   ========================================================================== */

/* Apparition douce au scroll (classe posée par IntersectionObserver) */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.55s ease, transform 0.55s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ==========================================================================
   22. IMPRESSION
   ========================================================================== */

@media print {
  .site-header, .site-footer, .page-aside, .back-to-top, .reading-progress,
  .breadcrumb, .pager, .page-actions, .newsletter, .search-modal, .skip-link,
  .related, .filter-bar { display: none !important; }

  main { padding-top: 0; }
  body { font-size: 11pt; color: #000; background: #fff; }
  .prose { max-width: none; }
  a { color: #000; text-decoration: none; }
  /* Affiche l'URL des liens externes à l'impression */
  .prose a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; color: #444; }
  .callout { break-inside: avoid; }
  .table-scroll { border: 0; box-shadow: none; }
  .accordion details { break-inside: avoid; }
  /* Ouvre tous les accordéons à l'impression (le JS pose aussi [open]) */
  .accordion details:not([open]) .accordion__body { display: block; }
}

/* ==========================================================================
   23. AUTHENTIFICATION & ESPACE MEMBRE
   ========================================================================== */

/* --- Bouton compte du header (bascule visiteur / membre) ----------------- */
.header-account { display: none; }
html:not(.is-authed) .header-account--guest { display: inline-flex; }
html.is-authed .header-account--member { display: inline-flex; }

@media (max-width: 48rem) {
  /* Sur mobile, on garde l'icône seule pour ne pas encombrer la barre. */
  .header-account { padding: 0.5rem 0.7rem; }
  .header-account span { display: none; }
}

/* --- Carte d'authentification (connexion / inscription) ------------------ */
.auth-wrap {
  max-width: 27rem;
  margin: 2.5rem auto 4rem;
  padding-inline: var(--gutter);
}
.auth-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-2);
  padding: clamp(1.5rem, 4vw, 2.4rem);
}
.auth-card h1 { font-size: 1.5rem; margin-bottom: 0.4rem; }
.auth-card__intro { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 1.6rem; }

.field { margin-bottom: 1.1rem; }
.field label {
  display: block; font-size: 0.88rem; font-weight: 600;
  color: var(--text-strong); margin-bottom: 0.4rem;
}
.field input {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-m);
  background: var(--bg);
  color: var(--text-strong);
  font-size: 1rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.field input:focus {
  outline: none;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-blue) 16%, transparent);
}
.field__hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.35rem; }

.auth-card .btn { width: 100%; margin-top: 0.4rem; }
.auth-card__alt { margin-top: 1.4rem; font-size: 0.92rem; color: var(--text-muted); text-align: center; }
.auth-card__alt a { font-weight: 600; }

/* Messages (erreur / succès) */
.form-msg {
  border-radius: var(--radius-m);
  padding: 0.8rem 1rem;
  font-size: 0.92rem;
  margin-bottom: 1.2rem;
  display: none;
}
.form-msg.is-visible { display: block; }
.form-msg--error { background: var(--callout-attention-bg); border: 1px solid var(--callout-attention-border); color: var(--callout-attention-accent); }
.form-msg--success { background: var(--callout-conseil-bg); border: 1px solid var(--callout-conseil-border); color: var(--callout-conseil-accent); }

/* Bouton en cours de chargement */
.btn.is-loading { opacity: 0.7; pointer-events: none; }

/* --- Espace membre : en-tête et cartes ----------------------------------- */
.member-header {
  background: linear-gradient(150deg, var(--brand-night), var(--brand-blue-deep) 150%);
  color: #dbe5f5;
  border-radius: var(--radius-xl);
  padding: clamp(1.6rem, 4vw, 2.6rem);
  margin-block: 1.5rem 2.2rem;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 1rem;
}
.member-header h1 { color: #fff; font-size: clamp(1.5rem, 3vw, 2rem); }
.member-header p { color: #b9c8e2; margin-top: 0.3rem; font-size: 0.98rem; }
.member-header .badge { background: rgba(255,255,255,0.12); color: #cddcf7; }

.member-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1.1rem;
}
.member-tile {
  position: relative;
  display: flex; flex-direction: column; gap: 0.5rem;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: 1.5rem;
  box-shadow: var(--shadow-1);
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}
.member-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--border-strong); }
.member-tile__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.9rem; height: 2.9rem; border-radius: var(--radius-m);
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand-blue) 14%, transparent), color-mix(in srgb, var(--brand-sky) 8%, transparent));
  color: var(--link); margin-bottom: 0.3rem;
}
.member-tile h2 { font-size: 1.15rem; color: var(--text-strong); }
.member-tile p { font-size: 0.92rem; color: var(--text-muted); }
.member-tile__count { font-size: 0.82rem; font-weight: 700; color: var(--link); margin-top: auto; }
.member-tile--locked { opacity: 0.85; }
.member-tile--locked .badge--soon { background: color-mix(in srgb, var(--brand-gold) 16%, transparent); color: #8a6d1a; align-self: flex-start; }
:root[data-theme="dark"] .member-tile--locked .badge--soon { color: #d9bc55; }

/* --- Listes de contenu (fiches, vidéos, quiz) ---------------------------- */
.content-list { display: grid; gap: 1rem; margin-block: 1.5rem 3rem; }
.content-item {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  padding: 1.2rem 1.4rem;
  box-shadow: var(--shadow-1);
}
.content-item h2, .content-item h3 { font-size: 1.1rem; color: var(--text-strong); margin-bottom: 0.3rem; }
.content-item p { color: var(--text-muted); font-size: 0.94rem; }
.content-item__meta { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.4rem; }

.video-embed {
  position: relative; aspect-ratio: 16/9; margin-top: 0.9rem;
  border-radius: var(--radius-m); overflow: hidden; background: #000;
}
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* --- Lecteur de quiz ----------------------------------------------------- */
.quiz-player { max-width: 40rem; }
.quiz-progress { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.6rem; }
.quiz-question { font-size: 1.2rem; font-weight: 700; color: var(--text-strong); margin-bottom: 1.2rem; }
.quiz-choices { display: grid; gap: 0.6rem; }
.quiz-choice {
  text-align: left; width: 100%;
  padding: 0.9rem 1.1rem;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-m);
  background: var(--bg-raised);
  color: var(--text);
  font-size: 0.98rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.quiz-choice:hover:not(:disabled) { border-color: var(--brand-blue); }
.quiz-choice--correct { border-color: #157347; background: var(--callout-conseil-bg); color: var(--callout-conseil-accent); font-weight: 600; }
.quiz-choice--wrong { border-color: #a05e03; background: var(--callout-attention-bg); color: var(--callout-attention-accent); }
.quiz-explain {
  margin-top: 1rem; padding: 0.9rem 1.1rem;
  background: var(--callout-info-bg); border: 1px solid var(--callout-info-border);
  border-radius: var(--radius-m); font-size: 0.93rem;
}
.quiz-result { text-align: center; padding: 1.5rem 0; }
.quiz-result__score { font-family: var(--font-display); font-size: 3rem; font-weight: 800; color: var(--brand-blue); }

/* --- Encart premium (teaser) --------------------------------------------- */
.premium-teaser {
  border: 1px dashed color-mix(in srgb, var(--brand-gold) 55%, var(--border));
  background: color-mix(in srgb, var(--brand-gold) 7%, var(--bg-raised));
  border-radius: var(--radius-l);
  padding: 1.4rem 1.6rem;
  margin-block: 2rem;
}
.premium-teaser h2 { font-size: 1.2rem; color: var(--text-strong); }
.premium-teaser p { color: var(--text-muted); font-size: 0.95rem; margin-top: 0.3rem; }
