/* FORCE_UPLOAD: 20260501_140635 — bumps mtime for FTP-Deploy state */
/**
 * IBODE Academy — Design System Grade A (v2026.03)
 * Fichier CSS partagé pour TOUTES les leçons
 *
 * Usage : <link rel="stylesheet" href="/assets/css/lesson.css">
 *         <div class="lesson-wrapper" data-module="hygiene">
 *
 * La couleur du module est définie par data-module sur .lesson-wrapper
 * Valeurs possibles : hygiene, digestif, gyneco, uro, ortho, risques,
 *   instrumentation, histoire, neuro, cardio, plastique, vasculaire,
 *   pediatrique, orl, prepa-bloc, actes-exclusifs, anesthesie,
 *   revisions, devoirs, sterilisation, communication
 */

/* ═══════════════════════════════════════════════════════════
   1. VARIABLES GLOBALES
   ═══════════════════════════════════════════════════════════ */

:root {
  /* ── Couleurs modules ── */
  --hygiene:          #01579B; --hygiene-light:          #e3f2fd;
  --digestif:         #1B5E20; --digestif-light:         #e8f5e9;
  --gyneco:           #E91E63; --gyneco-light:           #fce7f3;
  --uro:              #006064; --uro-light:              #e0f7fa;
  --ortho:            #E65100; --ortho-light:            #fff3e0;
  --risques:          #B71C1C; --risques-light:          #ffebee;
  --instrumentation:  #455A64; --instrumentation-light:  #eceff1;
  --histoire:         #F57F17; --histoire-light:         #fff8e1;
  --neuro:            #4A148C; --neuro-light:            #f3e5f5;
  --cardio:           #880E4F; --cardio-light:           #fce4ec;
  --plastique:        #BF360C; --plastique-light:        #fbe9e7;
  --vasculaire:       #1A237E; --vasculaire-light:       #e8eaf6;
  --pediatrique:      #F9A825; --pediatrique-light:      #fff8e1;
  --orl:              #00695C; --orl-light:              #e0f2f1;
  --prepa-bloc:       #6366F1; --prepa-bloc-light:       #eef2ff;
  --actes-exclusifs:  #7C3AED; --actes-exclusifs-light:  #ede9fe;
  --anesthesie:       #0E7490; --anesthesie-light:       #ecfeff;
  --revisions:        #4F46E5; --revisions-light:        #eef2ff;
  --devoirs:          #0369A1; --devoirs-light:          #e0f2fe;
  --sterilisation:    #0D9488; --sterilisation-light:    #f0fdfa;
  --communication:    #D97706; --communication-light:    #fffbeb;

  /* ── Module actif (écrasé par data-module) ── */
  --module-color:       #6366F1;
  --module-color-light: #eef2ff;

  /* ── Palette anatomique ── */
  --anat-os: #E8B86D; --anat-muscle: #D4856A; --anat-artere: #C99A9A;
  --anat-veine: #2C5F7C; --anat-nerf: #B8A5C6; --anat-ligament: #A8C6A5;

  /* ── Encadrés pédagogiques ── */
  --enc-astuce-bg:     #e8f4fd; --enc-astuce-bord:     #3b82f6;
  --enc-securite-bg:   #fef3c7; --enc-securite-bord:   #f59e0b;
  --enc-erreur-bg:     #fee2e2; --enc-erreur-bord:     #ef4444;
  --enc-legal-bg:      #f0fdf4; --enc-legal-bord:      #10b981;
  --enc-mnemot-bg:     #faf5ff; --enc-mnemot-bord:     #8b5cf6;
  --enc-approfond-bg:  #f8fafc; --enc-approfond-bord:  #64748b;

  /* ── Typographie ── */
  --font-main:  'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Crimson Pro', Georgia, serif;

  /* ── Neutres ── */
  --bg-primary:    #f8fafc;
  --bg-secondary:  #ffffff;
  --bg-tertiary:   #f1f5f9;
  --text-primary:  #0f172a;
  --text-secondary:#475569;
  --text-muted:    #94a3b8;
  --border:        #e2e8f0;
  --border-light:  #f1f5f9;

  /* ── Feedback ── */
  --success: #10B981; --success-bg: #ecfdf5;
  --warning: #F59E0B; --warning-bg: #fffbeb;
  --danger:  #EF4444; --danger-bg:  #fef2f2;
  --info:    #3B82F6; --info-bg:    #eff6ff;

  /* ── Ombres & Rayons ── */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}


/* ═══════════════════════════════════════════════════════════
   2. ATTRIBUTION COULEUR PAR MODULE (data-module)
   ═══════════════════════════════════════════════════════════ */

.lesson-wrapper[data-module="hygiene"]         { --module-color: var(--hygiene);         --module-color-light: var(--hygiene-light); }
.lesson-wrapper[data-module="digestif"]        { --module-color: var(--digestif);        --module-color-light: var(--digestif-light); }
.lesson-wrapper[data-module="gyneco"]          { --module-color: var(--gyneco);          --module-color-light: var(--gyneco-light); }
.lesson-wrapper[data-module="uro"]             { --module-color: var(--uro);             --module-color-light: var(--uro-light); }
.lesson-wrapper[data-module="ortho"]           { --module-color: var(--ortho);           --module-color-light: var(--ortho-light); }
.lesson-wrapper[data-module="risques"]         { --module-color: var(--risques);         --module-color-light: var(--risques-light); }
.lesson-wrapper[data-module="instrumentation"] { --module-color: var(--instrumentation); --module-color-light: var(--instrumentation-light); }
.lesson-wrapper[data-module="histoire"]        { --module-color: var(--histoire);        --module-color-light: var(--histoire-light); }
.lesson-wrapper[data-module="neuro"]           { --module-color: var(--neuro);           --module-color-light: var(--neuro-light); }
.lesson-wrapper[data-module="cardio"]          { --module-color: var(--cardio);          --module-color-light: var(--cardio-light); }
.lesson-wrapper[data-module="plastique"]       { --module-color: var(--plastique);       --module-color-light: var(--plastique-light); }
.lesson-wrapper[data-module="vasculaire"]      { --module-color: var(--vasculaire);      --module-color-light: var(--vasculaire-light); }
.lesson-wrapper[data-module="pediatrique"]     { --module-color: var(--pediatrique);     --module-color-light: var(--pediatrique-light); }
.lesson-wrapper[data-module="orl"]             { --module-color: var(--orl);             --module-color-light: var(--orl-light); }
.lesson-wrapper[data-module="prepa-bloc"]      { --module-color: var(--prepa-bloc);      --module-color-light: var(--prepa-bloc-light); }
.lesson-wrapper[data-module="actes-exclusifs"] { --module-color: var(--actes-exclusifs); --module-color-light: var(--actes-exclusifs-light); }
.lesson-wrapper[data-module="anesthesie"]      { --module-color: var(--anesthesie);      --module-color-light: var(--anesthesie-light); }
.lesson-wrapper[data-module="revisions"]       { --module-color: var(--revisions);       --module-color-light: var(--revisions-light); }
.lesson-wrapper[data-module="devoirs"]         { --module-color: var(--devoirs);         --module-color-light: var(--devoirs-light); }
.lesson-wrapper[data-module="sterilisation"]   { --module-color: var(--sterilisation);   --module-color-light: var(--sterilisation-light); }
.lesson-wrapper[data-module="communication"]   { --module-color: var(--communication);   --module-color-light: var(--communication-light); }

/* Mirror — data-specialty (alias actif sur les leçons V3) */
.lesson-wrapper[data-specialty="hygiene"]         { --module-color: var(--hygiene);         --module-color-light: var(--hygiene-light); }
.lesson-wrapper[data-specialty="digestif"]        { --module-color: var(--digestif);        --module-color-light: var(--digestif-light); }
.lesson-wrapper[data-specialty="gyneco"]          { --module-color: var(--gyneco);          --module-color-light: var(--gyneco-light); }
.lesson-wrapper[data-specialty="uro"]             { --module-color: var(--uro);             --module-color-light: var(--uro-light); }
.lesson-wrapper[data-specialty="ortho"]           { --module-color: var(--ortho);           --module-color-light: var(--ortho-light); }
.lesson-wrapper[data-specialty="risques"]         { --module-color: var(--risques);         --module-color-light: var(--risques-light); }
.lesson-wrapper[data-specialty="instrumentation"] { --module-color: var(--instrumentation); --module-color-light: var(--instrumentation-light); }
.lesson-wrapper[data-specialty="histoire"]        { --module-color: var(--histoire);        --module-color-light: var(--histoire-light); }
.lesson-wrapper[data-specialty="neuro"]           { --module-color: var(--neuro);           --module-color-light: var(--neuro-light); }
.lesson-wrapper[data-specialty="cardio"]          { --module-color: var(--cardio);          --module-color-light: var(--cardio-light); }
.lesson-wrapper[data-specialty="plastique"]       { --module-color: var(--plastique);       --module-color-light: var(--plastique-light); }
.lesson-wrapper[data-specialty="vasculaire"]      { --module-color: var(--vasculaire);      --module-color-light: var(--vasculaire-light); }
.lesson-wrapper[data-specialty="pediatrique"]     { --module-color: var(--pediatrique);     --module-color-light: var(--pediatrique-light); }
.lesson-wrapper[data-specialty="pediatrie"]       { --module-color: var(--pediatrique);     --module-color-light: var(--pediatrique-light); }
.lesson-wrapper[data-specialty="orl"]             { --module-color: var(--orl);             --module-color-light: var(--orl-light); }
.lesson-wrapper[data-specialty="prepa-bloc"]      { --module-color: var(--prepa-bloc);      --module-color-light: var(--prepa-bloc-light); }
.lesson-wrapper[data-specialty="actes-exclusifs"] { --module-color: var(--actes-exclusifs); --module-color-light: var(--actes-exclusifs-light); }
.lesson-wrapper[data-specialty="anesthesie"]      { --module-color: var(--anesthesie);      --module-color-light: var(--anesthesie-light); }
.lesson-wrapper[data-specialty="revisions"]       { --module-color: var(--revisions);       --module-color-light: var(--revisions-light); }
.lesson-wrapper[data-specialty="devoirs"]         { --module-color: var(--devoirs);         --module-color-light: var(--devoirs-light); }
.lesson-wrapper[data-specialty="sterilisation"]   { --module-color: var(--sterilisation);   --module-color-light: var(--sterilisation-light); }
.lesson-wrapper[data-specialty="communication"]   { --module-color: var(--communication);   --module-color-light: var(--communication-light); }


/* ═══════════════════════════════════════════════════════════
   3. RESET & BASE
   ═══════════════════════════════════════════════════════════ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-main);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.75;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}


/* ═══════════════════════════════════════════════════════════
   4. LESSON WRAPPER — Conteneur principal
   ═══════════════════════════════════════════════════════════ */

.lesson-wrapper {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px 60px;
}


/* ═══════════════════════════════════════════════════════════
   5. LESSON HEADER — En-tête gradient
   ═══════════════════════════════════════════════════════════ */

.lesson-header {
  background: linear-gradient(135deg, var(--module-color) 0%, color-mix(in srgb, var(--module-color), #000 15%) 100%);
  color: white;
  padding: 56px 40px 36px;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  margin: 0 -20px 32px;
  position: relative;
  overflow: hidden;
  /* Bandeau couleur module pure (légèrement plus foncé que le gradient pour contraste subtil) */
  border-top: 8px solid color-mix(in srgb, var(--module-color), #000 30%);
}

.lesson-header::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
  border-radius: 50%;
}

/* ─── Badge spécialité au-dessus du h1 (serif italique uppercase) ───
   Content injecté via attr() avec règles de surcharge par data-specialty
   pour avoir un nom lisible en français.
   NB: !important nécessaire car le CSS V3 inline des leçons applique un
       `display:none !important` sur tous les ::before/::after du header.
*/
.lesson-wrapper[data-specialty] .lesson-header::after {
  content: "Spécialité";
  display: inline-block !important;
  position: absolute;
  top: 16px;
  left: 40px;
  font-family: var(--font-serif), 'Crimson Pro', 'Fraunces', Georgia, serif;
  font-style: italic;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  z-index: 5;
  padding: 4px 12px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  backdrop-filter: blur(2px);
}

/* Re-active le ::before décoratif (radial gradient blanc) que le V3 cachait */
.lesson-wrapper[data-specialty] .lesson-header::before {
  display: block !important;
}

/* Mapping data-specialty → texte lisible du badge (français) */
.lesson-wrapper[data-specialty="hygiene"]         .lesson-header::after { content: "Hygiène & ISO"; }
.lesson-wrapper[data-specialty="digestif"]        .lesson-header::after { content: "Chirurgie Digestive"; }
.lesson-wrapper[data-specialty="gyneco"]          .lesson-header::after { content: "Gynécologie & Obstétrique"; }
.lesson-wrapper[data-specialty="uro"]             .lesson-header::after { content: "Urologie"; }
.lesson-wrapper[data-specialty="ortho"]           .lesson-header::after { content: "Orthopédie & Traumatologie"; }
.lesson-wrapper[data-specialty="risques"]         .lesson-header::after { content: "Gestion des Risques"; }
.lesson-wrapper[data-specialty="instrumentation"] .lesson-header::after { content: "Instrumentation"; }
.lesson-wrapper[data-specialty="histoire"]        .lesson-header::after { content: "Histoire & Mémoire IBODE"; }
.lesson-wrapper[data-specialty="neuro"]           .lesson-header::after { content: "Neurochirurgie"; }
.lesson-wrapper[data-specialty="cardio"]          .lesson-header::after { content: "Chirurgie Cardiaque"; }
.lesson-wrapper[data-specialty="plastique"]       .lesson-header::after { content: "Chirurgie Plastique"; }
.lesson-wrapper[data-specialty="vasculaire"]      .lesson-header::after { content: "Chirurgie Vasculaire"; }
.lesson-wrapper[data-specialty="pediatrique"]     .lesson-header::after { content: "Chirurgie Pédiatrique"; }
.lesson-wrapper[data-specialty="pediatrie"]       .lesson-header::after { content: "Chirurgie Pédiatrique"; }
.lesson-wrapper[data-specialty="orl"]             .lesson-header::after { content: "ORL & Cervico-faciale"; }
.lesson-wrapper[data-specialty="prepa-bloc"]      .lesson-header::after { content: "Préparation au Bloc"; }
.lesson-wrapper[data-specialty="actes-exclusifs"] .lesson-header::after { content: "Actes Exclusifs IBODE"; }
.lesson-wrapper[data-specialty="anesthesie"]      .lesson-header::after { content: "Anesthésie & Pharmacologie"; }
.lesson-wrapper[data-specialty="revisions"]       .lesson-header::after { content: "Révisions & QCM"; }
.lesson-wrapper[data-specialty="devoirs"]         .lesson-header::after { content: "Devoirs & TP"; }
.lesson-wrapper[data-specialty="sterilisation"]   .lesson-header::after { content: "Stérilisation"; }
.lesson-wrapper[data-specialty="communication"]   .lesson-header::after { content: "Communication au Bloc"; }

/* Décale le titre h1 pour laisser la place au badge */
.lesson-wrapper[data-specialty] .lesson-header h1 {
  margin-top: 28px;
}

/* Mobile : badge plus compact */
@media (max-width: 600px) {
  .lesson-wrapper[data-specialty] .lesson-header::after {
    top: 12px;
    left: 20px;
    font-size: 0.65rem;
    padding: 3px 9px;
    letter-spacing: 0.14em;
  }
  .lesson-wrapper[data-specialty] .lesson-header h1 {
    margin-top: 24px;
  }
}

.lesson-header h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.lesson-header .subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
  font-weight: 400;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.meta-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  background: rgba(255,255,255,0.2);
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
}


/* ═══════════════════════════════════════════════════════════
   6. TYPOGRAPHY — Titres et texte
   ═══════════════════════════════════════════════════════════ */

h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 40px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--module-color-light);
  display: flex;
  align-items: center;
  gap: 10px;
}

h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--module-color);
  margin: 28px 0 12px;
}

h4 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 20px 0 8px;
}

h5 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 16px 0 8px;
}

p { margin-bottom: 16px; }

ul, ol {
  margin: 12px 0 16px;
  padding-left: 24px;
}

li { margin-bottom: 8px; }

strong { font-weight: 700; }
em { font-style: italic; }

a {
  color: var(--module-color);
  text-decoration: underline;
  text-underline-offset: 2px;
}
a:hover { opacity: 0.8; }

/* Citation inline */
.src {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-style: italic;
}


/* ═══════════════════════════════════════════════════════════
   7. CONTENT CARDS — Sections dans des cartes
   ═══════════════════════════════════════════════════════════ */

.content-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  border: 1px solid var(--border-light);
}

.content-card h2 {
  margin-top: 0;
  border-bottom: none;
}


/* ═══════════════════════════════════════════════════════════
   8. ENCADRÉS PÉDAGOGIQUES
   ═══════════════════════════════════════════════════════════ */

.encadre {
  padding: 20px 24px;
  border-radius: var(--radius-md);
  margin: 24px 0;
  border-left: 4px solid var(--border);
  background: var(--bg-tertiary);
}

.encadre h4 {
  font-weight: 700;
  margin: 0 0 8px;
  font-size: 1rem;
}

.encadre p:last-child { margin-bottom: 0; }

/* Variantes */
.enc-astuce {
  background: var(--enc-astuce-bg);
  border-left-color: var(--enc-astuce-bord);
}
.enc-astuce h4 { color: #1d4ed8; }

.enc-securite {
  background: var(--enc-securite-bg);
  border-left-color: var(--enc-securite-bord);
}
.enc-securite h4 { color: #92400e; }

.enc-erreur {
  background: var(--enc-erreur-bg);
  border-left-color: var(--enc-erreur-bord);
}
.enc-erreur h4 { color: #991b1b; }

.enc-legal {
  background: var(--enc-legal-bg);
  border-left-color: var(--enc-legal-bord);
}
.enc-legal h4 { color: #065f46; }

.enc-mnemot {
  background: var(--enc-mnemot-bg);
  border-left-color: var(--enc-mnemot-bord);
}
.enc-mnemot h4 { color: #6b21a8; }

.enc-approfond {
  background: var(--enc-approfond-bg);
  border-left-color: var(--enc-approfond-bord);
}
.enc-approfond h4 { color: var(--text-secondary); }

/* Legacy alert compat */
.alert { padding: 20px 24px; border-radius: var(--radius-md); margin: 24px 0; display: flex; gap: 16px; align-items: flex-start; }
.alert-icon { font-size: 1.5rem; flex-shrink: 0; }
.alert-content h4 { font-weight: 700; margin-bottom: 8px; }
.alert.info    { background: var(--info-bg);    border-left: 4px solid var(--info);    color: #1e40af; }
.alert.warning { background: var(--warning-bg); border-left: 4px solid var(--warning); color: #92400e; }
.alert.success { background: var(--success-bg); border-left: 4px solid var(--success); color: #065f46; }
.alert.danger  { background: var(--danger-bg);  border-left: 4px solid var(--danger);  color: #991b1b; }


/* ═══════════════════════════════════════════════════════════
   9. FLASHCARDS
   ═══════════════════════════════════════════════════════════ */

.flashcards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.flashcard {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: all 0.2s ease;
}

.flashcard:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--module-color-light);
}

.fc-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.fc-facile  { background: #d1fae5; color: #065f46; }
.fc-inter   { background: #fef3c7; color: #92400e; }
.fc-avance  { background: #fee2e2; color: #991b1b; }

.fc-recto {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.5;
}

.flashcard details summary {
  cursor: pointer;
  color: var(--module-color);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 8px 0;
  user-select: none;
}

.flashcard details summary:hover {
  opacity: 0.8;
}

.fc-verso {
  padding: 12px 0;
  color: var(--text-primary);
  line-height: 1.6;
}

.fc-mnemot {
  font-style: italic;
  color: #7c3aed;
  font-size: 0.9rem;
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--enc-mnemot-bg);
  border-radius: var(--radius-sm);
}

.fc-source {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 8px;
}


/* ═══════════════════════════════════════════════════════════
   10. QCM — Auto-évaluation
   ═══════════════════════════════════════════════════════════ */

.qcm-section {
  margin: 40px 0;
}

.qcm-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 20px;
}

.qcm-enonce {
  font-weight: 700;
  font-size: 1rem;
  color: var(--module-color);
  margin-bottom: 4px;
}

.qcm-type {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 12px;
}

.props {
  list-style: none;
  padding: 0;
  margin: 12px 0 16px;
}

.props li {
  padding: 10px 16px;
  margin-bottom: 6px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  transition: background 0.2s;
}

.props li:hover {
  background: var(--module-color-light);
}

.qcm-item details.correction summary {
  cursor: pointer;
  color: var(--module-color);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 8px 0;
  user-select: none;
}

.correction-body {
  padding: 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  margin-top: 8px;
}

.prop-ok {
  color: #065f46;
  background: var(--success-bg);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.prop-err {
  color: #991b1b;
  background: var(--danger-bg);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 0.9rem;
}


/* ═══════════════════════════════════════════════════════════
   11. TABLEAUX
   ═══════════════════════════════════════════════════════════ */

.table-wrapper {
  overflow-x: auto;
  margin: 24px 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

thead {
  background: var(--module-color);
  color: white;
}

th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
}

tbody tr:nth-child(even) {
  background: var(--bg-tertiary);
}

tbody tr:hover {
  background: var(--module-color-light);
}


/* ═══════════════════════════════════════════════════════════
   12. SOURCES FOOTER
   ═══════════════════════════════════════════════════════════ */

.sources-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 3px solid var(--module-color);
}

.sources-footer h2 {
  border-bottom: none;
  font-size: 1.3rem;
}

.sources-footer ol {
  padding-left: 20px;
}

.sources-footer li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.6;
}

.sources-footer li strong {
  color: var(--text-primary);
}

.sources-footer li a {
  color: var(--module-color);
  word-break: break-all;
}

.disclaimer {
  margin-top: 20px;
  padding: 16px 20px;
  background: var(--warning-bg);
  border-left: 4px solid var(--warning);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: #92400e;
  line-height: 1.6;
}


/* ═══════════════════════════════════════════════════════════
   13. PROGRESS SECTION
   ═══════════════════════════════════════════════════════════ */

.progress-section {
  margin: 32px 0;
}

.progress-bar-wrapper {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--module-color), color-mix(in srgb, var(--module-color), #fff 30%));
  border-radius: 4px;
  transition: width 0.5s ease;
}


/* ═══════════════════════════════════════════════════════════
   14. NAVIGATION LEÇON
   ═══════════════════════════════════════════════════════════ */

.lesson-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.nav-btn.prev {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

.nav-btn.next {
  background: var(--module-color);
  color: white;
  margin-left: auto;
}

.nav-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}


/* ═══════════════════════════════════════════════════════════
   15. ZONE CARDS (prepa-bloc)
   ═══════════════════════════════════════════════════════════ */

.zone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.zone-card {
  padding: 20px;
  border-radius: var(--radius-md);
  text-align: center;
}

.zone-card h4 { font-size: 1rem; margin-bottom: 8px; }
.zone-card p { font-size: 0.85rem; margin: 0; }

.zone-card.zone-1 { background: #fee2e2; border: 2px solid #ef4444; }
.zone-card.zone-2 { background: #fef3c7; border: 2px solid #f59e0b; }
.zone-card.zone-3 { background: #dbeafe; border: 2px solid #3b82f6; }
.zone-card.zone-4 { background: #d1fae5; border: 2px solid #10b981; }


/* ═══════════════════════════════════════════════════════════
   16. MNÉMOTECHNIQUES (standalone)
   ═══════════════════════════════════════════════════════════ */

.mnemonic {
  background: linear-gradient(135deg, #fdf4ff, #fae8ff);
  border: 2px solid #e879f9;
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin: 24px 0;
}

.mnemonic h4 {
  color: #a21caf;
  font-weight: 700;
  margin-bottom: 8px;
}

.mnemonic p {
  color: #86198f;
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
}


/* ═══════════════════════════════════════════════════════════
   17. DARK MODE — DÉSACTIVÉ
   ═══════════════════════════════════════════════════════════
   Dark mode supprimé : incompatible avec les inline styles des
   leçons existantes et inadapté pour une plateforme pédagogique.
   Le thème reste clair (light) quelle que soit la préférence OS.
   ═══════════════════════════════════════════════════════════ */


/* ═══════════════════════════════════════════════════════════
   18. RESPONSIVE
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .lesson-header {
    padding: 32px 24px 28px;
    margin: 0 -20px 24px;
  }

  .lesson-header h1 { font-size: 1.5rem; }
  .lesson-header .subtitle { font-size: 0.95rem; }
  .meta-badges { gap: 6px; }
  .badge { font-size: 0.7rem; padding: 3px 8px; }

  h2 { font-size: 1.25rem; }
  h3 { font-size: 1.1rem; }

  .content-card { padding: 20px; }

  .flashcards-grid {
    grid-template-columns: 1fr;
  }

  .lesson-nav { flex-direction: column; }
  .nav-btn.next { margin-left: 0; }

  .zone-grid { grid-template-columns: 1fr 1fr; }

  table { font-size: 0.85rem; }
  th, td { padding: 8px 12px; }
}

@media (max-width: 480px) {
  .lesson-wrapper { padding: 0 12px 40px; }
  .lesson-header { margin: 0 -12px 20px; padding: 24px 16px 20px; }
  .lesson-header h1 { font-size: 1.3rem; }
  .content-card { padding: 16px; }
  .encadre { padding: 16px; }
  .zone-grid { grid-template-columns: 1fr; }
}


/* ═══════════════════════════════════════════════════════════
   19. ANIMATIONS
   ═══════════════════════════════════════════════════════════ */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.content-card,
.flashcard,
.qcm-item,
.encadre {
  animation: fadeIn 0.4s ease forwards;
}


/* ═══════════════════════════════════════════════════════════
   20. PRINT
   ═══════════════════════════════════════════════════════════ */

@media print {
  body { background: white; font-size: 12pt; }
  .lesson-header { background: var(--module-color) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .flashcard, .qcm-item { break-inside: avoid; }
  .nav-btn, .progress-section { display: none; }
  .sources-footer { border-top: 2px solid #000; }
}

/* ═══════════════════════════════════════════════════════════
   21. LEGACY COMPATIBILITY — Classes des leçons pré-migration
   ═══════════════════════════════════════════════════════════
   Ces règles supportent les anciennes classes utilisées dans les
   leçons Hygiène (et autres modules) avant la migration CSS.
   Les nouvelles leçons doivent utiliser les classes Grade A
   (sections 2-19 ci-dessus). Ce bloc sera retiré progressivement.
   ═══════════════════════════════════════════════════════════ */

/* --- Legacy Variables (fallback pour contenu ancien) --- */
.lesson-wrapper {
  --primary: var(--module-color, #0891B2);
  --primary-light: var(--module-color-light, #22D3EE);
  --primary-dark: var(--module-color, #0E7490);
  --secondary: var(--module-color, #06B6D4);
  --accent: #14B8A6;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --info: #3B82F6;
  --bg-tertiary: #ECFEFF;
}

/* --- Legacy Hero --- */
.lesson-wrapper .hero,
.lesson-wrapper .ibode-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  padding: 4rem 2rem;
  text-align: center;
  color: white;
  border-radius: var(--radius-lg, 16px);
  margin-bottom: 2rem;
}

.lesson-wrapper .hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.lesson-wrapper .hero-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
}

.lesson-wrapper .hero h1,
.lesson-wrapper .ibode-hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.lesson-wrapper .hero-subtitle {
  font-size: 1.2rem;
  opacity: 0.95;
  margin-bottom: 2rem;
}

.lesson-wrapper .hero-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.lesson-wrapper .hero-stat { text-align: center; }
.lesson-wrapper .hero-stat-value { font-size: 1.8rem; font-weight: 800; display: block; }
.lesson-wrapper .hero-stat-label { font-size: 0.9rem; opacity: 0.9; }

/* --- Legacy ibode-lesson-content / ibode-lesson-illustration --- */
.lesson-wrapper .ibode-lesson-content {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
}

.lesson-wrapper .ibode-lesson-illustration {
  max-width: 100%;
  border-radius: var(--radius-md, 12px);
  margin: 1.5rem 0;
}

/* --- Legacy Section --- */
.lesson-wrapper .section {
  background: var(--bg-secondary, #fff);
  border-radius: var(--radius-lg, 16px);
  padding: 2.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
}

.lesson-wrapper .section-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 2rem;
}

.lesson-wrapper .section-icon {
  font-size: 2.5rem;
  line-height: 1;
}

.lesson-wrapper .section-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}

.lesson-wrapper .section-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
}

/* --- Legacy Cards --- */
.lesson-wrapper .card {
  background: var(--bg-tertiary, #ecfeff);
  border: 1px solid var(--border);
  border-radius: var(--radius-md, 12px);
  padding: 1.8rem;
  margin-bottom: 1.5rem;
}

.lesson-wrapper .card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary-dark, var(--module-color));
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lesson-wrapper .definition-card {
  background: linear-gradient(135deg, #E0F7FA, #B2EBF2);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md, 12px);
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.lesson-wrapper .definition-card h4 {
  color: var(--primary-dark, var(--module-color));
  font-weight: 700;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.lesson-wrapper .important-card {
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  border-left: 4px solid var(--warning);
  border-radius: var(--radius-md, 12px);
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.lesson-wrapper .important-card h4 {
  color: #92400E;
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* --- Legacy Grids --- */
.lesson-wrapper .grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.lesson-wrapper .grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

/* --- Legacy Timeline --- */
.lesson-wrapper .timeline {
  position: relative;
  padding-left: 2rem;
}

.lesson-wrapper .timeline::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, var(--primary), var(--accent));
  border-radius: 2px;
}

.lesson-wrapper .timeline-item {
  position: relative;
  padding-bottom: 2rem;
  padding-left: 1.5rem;
}

.lesson-wrapper .timeline-item::before {
  content: '';
  position: absolute;
  left: -2rem; top: 0.3rem;
  width: 12px; height: 12px;
  background: var(--primary);
  border-radius: 50%;
  border: 3px solid var(--bg-secondary, #fff);
}

.lesson-wrapper .timeline-date {
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.3rem;
}

.lesson-wrapper .timeline-content {
  color: var(--text-secondary);
}

/* --- Legacy Lists --- */
.lesson-wrapper .styled-list {
  list-style: none;
}

.lesson-wrapper .styled-list li {
  padding: 0.8rem 0 0.8rem 2rem;
  position: relative;
  border-bottom: 1px solid var(--border);
}

.lesson-wrapper .styled-list li:last-child { border-bottom: none; }

.lesson-wrapper .styled-list li::before {
  content: '\2192';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: bold;
}

/* --- Legacy Stats Box --- */
.lesson-wrapper .stats-box {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border-radius: var(--radius-md, 12px);
  padding: 2rem;
  text-align: center;
}

.lesson-wrapper .stats-box .stat-value {
  font-size: 3rem;
  font-weight: 800;
  display: block;
}

.lesson-wrapper .stats-box .stat-label {
  font-size: 1rem;
  opacity: 0.9;
}

/* --- Legacy QCM (ancien format interactif) --- */
.lesson-wrapper .qcm-container {
  background: var(--bg-tertiary, #ecfeff);
  border-radius: var(--radius-md, 12px);
  padding: 2rem;
  margin-top: 2rem;
}

.lesson-wrapper .qcm-question {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
}

.lesson-wrapper .qcm-options {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.lesson-wrapper .qcm-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
  background: var(--bg-secondary, #fff);
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.lesson-wrapper .qcm-option:hover {
  border-color: var(--primary);
}

.lesson-wrapper .qcm-option.correct {
  border-color: var(--success);
  background: #D1FAE5;
}

.lesson-wrapper .qcm-option.incorrect {
  border-color: var(--danger);
  background: #FEE2E2;
}

.lesson-wrapper .qcm-option input { display: none; }

.lesson-wrapper .qcm-radio {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.lesson-wrapper .qcm-option.correct .qcm-radio {
  border-color: var(--success);
  background: var(--success);
}

.lesson-wrapper .qcm-option.correct .qcm-radio::after { content: '\2713'; color: white; font-size: 0.8rem; }

.lesson-wrapper .qcm-option.incorrect .qcm-radio {
  border-color: var(--danger);
  background: var(--danger);
}

.lesson-wrapper .qcm-option.incorrect .qcm-radio::after { content: '\2717'; color: white; font-size: 0.8rem; }

.lesson-wrapper .qcm-feedback {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 8px;
  display: none;
}

.lesson-wrapper .qcm-feedback.show { display: block; }
.lesson-wrapper .qcm-feedback.correct { background: #D1FAE5; color: #065F46; }
.lesson-wrapper .qcm-feedback.incorrect { background: #FEE2E2; color: #991B1B; }

/* --- Legacy Navigation --- */
.lesson-wrapper .lesson-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 1rem;
}

.lesson-wrapper .nav-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  background: var(--bg-secondary, #fff);
  border: 2px solid var(--border);
  border-radius: var(--radius-md, 12px);
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  transition: all 0.3s ease;
}

.lesson-wrapper .nav-btn:hover {
  border-color: var(--primary);
}

.lesson-wrapper .nav-btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border: none;
}

/* --- Legacy Footer --- */
.lesson-wrapper .module-footer {
  background: var(--bg-secondary, #fff);
  padding: 2rem;
  text-align: center;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}

.lesson-wrapper .module-footer a { color: var(--primary); text-decoration: none; }
.lesson-wrapper .module-footer p { color: var(--text-muted); font-size: 0.9rem; margin: 0.3rem 0; }

/* --- Legacy Steps (phases chirurgicales) --- */
.lesson-wrapper .step-list {
  counter-reset: step-counter;
}

.lesson-wrapper .step {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: flex-start;
}

.lesson-wrapper .step-number {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.lesson-wrapper .step-content {
  flex: 1;
}

/* --- Legacy Phase blocks --- */
.lesson-wrapper .phase-block {
  background: var(--bg-secondary, #fff);
  border-radius: var(--radius-md, 12px);
  padding: 2rem;
  margin-bottom: 1.5rem;
  border-left: 4px solid var(--primary);
  box-shadow: var(--shadow-sm);
}

.lesson-wrapper .phase-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.lesson-wrapper .phase-number {
  background: var(--primary);
  color: white;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.lesson-wrapper .phase-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* --- Legacy Prevention items --- */
.lesson-wrapper .prevention-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  align-items: flex-start;
}

.lesson-wrapper .prevention-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.lesson-wrapper .prevention-content {
  flex: 1;
}

/* --- Legacy Responsive --- */
@media (max-width: 768px) {
  .lesson-wrapper .hero,
  .lesson-wrapper .ibode-hero {
    padding: 2.5rem 1.5rem;
  }
  .lesson-wrapper .hero h1,
  .lesson-wrapper .ibode-hero h1 {
    font-size: 1.8rem;
  }
  .lesson-wrapper .section {
    padding: 1.5rem;
  }
  .lesson-wrapper .section-title {
    font-size: 1.3rem;
  }
}


/* ═══════════════════════════════════════════════════════════
   TOC STICKY (Tâche S1.2 — sommaire auto-généré sur leçons V3)
   Posé en bas du body via theme child functions.php → wp_footer
   ═══════════════════════════════════════════════════════════ */

.ibode-toc {
  position: fixed;
  top: 110px;
  right: 24px;
  width: 250px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  background: var(--bg-secondary, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-md, 12px);
  padding: 18px 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  font-family: var(--font-main, 'Plus Jakarta Sans', system-ui, sans-serif);
  font-size: 0.86rem;
  line-height: 1.45;
  z-index: 9000;
  display: none;
}

@media (min-width: 1280px) {
  .ibode-toc { display: block; }
}

.ibode-toc__head {
  font-family: var(--font-serif, 'Crimson Pro', Georgia, serif);
  font-style: italic;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light, #f1f5f9);
}

.ibode-toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: toc-counter;
}

.ibode-toc__item {
  margin: 0;
  padding: 0;
}

.ibode-toc__item--lvl3 {
  padding-left: 14px;
}

.ibode-toc__link {
  display: block;
  padding: 6px 10px;
  color: var(--text-secondary, #475569);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color .18s ease, border-color .18s ease, background .18s ease;
  border-radius: 0 6px 6px 0;
}

.ibode-toc__link:hover {
  color: var(--text-primary, #0f172a);
  background: var(--bg-tertiary, #f1f5f9);
}

.ibode-toc__link.is-active {
  color: var(--module-color, #6366f1);
  border-left-color: var(--module-color, #6366f1);
  background: var(--module-color-light, #eef2ff);
  font-weight: 600;
}

/* Scrollbar discrète */
.ibode-toc::-webkit-scrollbar { width: 6px; }
.ibode-toc::-webkit-scrollbar-track { background: transparent; }
.ibode-toc::-webkit-scrollbar-thumb { background: var(--border, #e2e8f0); border-radius: 3px; }
.ibode-toc::-webkit-scrollbar-thumb:hover { background: var(--text-muted, #94a3b8); }

/* ── FAB mobile/tablet ─────────────────────── */
.ibode-toc-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--text-primary, #0f172a);
  color: white;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0,0,0,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9100;
  transition: transform .15s ease, background .15s ease;
}
.ibode-toc-fab:hover {
  transform: translateY(-2px);
  background: var(--module-color, #6366f1);
}
@media (min-width: 1280px) {
  .ibode-toc-fab { display: none; }
}

/* ── Drawer mobile (transformé depuis fixed-right) ─────── */
@media (max-width: 1279.98px) {
  .ibode-toc {
    display: block;
    top: auto;
    bottom: 80px;
    right: 24px;
    left: 24px;
    width: auto;
    max-width: 380px;
    margin-left: auto;
    max-height: 60vh;
    transform: translateY(calc(100% + 80px));
    opacity: 0;
    pointer-events: none;
    transition: transform .25s ease, opacity .25s ease;
  }
  .ibode-toc.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
}


/* ═══════════════════════════════════════════════════════════
   LESSON NAV STICKY — barre haute (Tâche S1.3)
   Posée en bas du body via theme child functions.php → wp_footer
   Sticky en haut avec offset selon admin bar / header IBODE
   ═══════════════════════════════════════════════════════════ */

.ibode-lesson-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9500;
  background: var(--bg-secondary, #ffffff);
  border-bottom: 1px solid var(--border, #e2e8f0);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  font-family: var(--font-main, 'Plus Jakarta Sans', system-ui, sans-serif);
  font-size: 0.85rem;
  padding: 8px 16px;
  transform: translateY(-100%);
  transition: transform .25s ease;
  pointer-events: none;
}

/* Apparaît quand on scrolle (offset position :sticky-like via JS scroll detection)
   pour l'instant on l'affiche tout le temps mais discrètement
*/
.ibode-lesson-nav { transform: translateY(0); pointer-events: auto; }

/* Si la barre admin WP est présente */
body.admin-bar .ibode-lesson-nav { top: 32px; }

.ibode-lesson-nav__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: center;
}

.ibode-lesson-nav__side {
  min-width: 0;
}
.ibode-lesson-nav__side--next { text-align: right; }

.ibode-lesson-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-secondary, #475569);
  padding: 6px 10px;
  border-radius: 6px;
  transition: color .15s ease, background .15s ease;
  max-width: 100%;
}
.ibode-lesson-nav__link:hover {
  color: var(--module-color, #6366f1);
  background: var(--module-color-light, #eef2ff);
}
.ibode-lesson-nav__link--next {
  flex-direction: row;
}

.ibode-lesson-nav__label {
  font-family: var(--font-serif, 'Crimson Pro', Georgia, serif);
  font-style: italic;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted, #94a3b8);
  white-space: nowrap;
}
.ibode-lesson-nav__title {
  font-weight: 500;
  color: var(--text-primary, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.ibode-lesson-nav__progress {
  min-width: 220px;
  text-align: center;
}
.ibode-lesson-nav__bar {
  height: 4px;
  background: var(--border-light, #f1f5f9);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}
.ibode-lesson-nav__fill {
  height: 100%;
  background: var(--module-color, #6366f1);
  border-radius: 2px;
  transition: width .35s ease;
}
.ibode-lesson-nav__counter {
  font-family: var(--font-serif, 'Crimson Pro', Georgia, serif);
  font-style: italic;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted, #94a3b8);
}

/* Décale le contenu de la page pour qu'il ne soit pas masqué par la nav fixe */
body.single-lesson { padding-top: 56px; }
body.admin-bar.single-lesson { padding-top: 88px; } /* 56 + 32 */

/* Mobile : compact, masque les titres détaillés */
@media (max-width: 800px) {
  .ibode-lesson-nav__title { max-width: 100px; font-size: 0.78rem; }
  .ibode-lesson-nav__label { font-size: 0.62rem; }
  .ibode-lesson-nav__progress { min-width: 0; }
  .ibode-lesson-nav__counter { font-size: 0.62rem; }
}
@media (max-width: 600px) {
  .ibode-lesson-nav__title { display: none; }
  .ibode-lesson-nav__inner { gap: 8px; padding: 0 4px; }
}


/* ═══════════════════════════════════════════════════════════
   END CTA — bloc "Continuer → leçon suivante" (Tâche S1.4)
   Inséré en fin de .lesson-wrapper
   ═══════════════════════════════════════════════════════════ */

/* === Editorial Surgical palette (override module-color) === */
.ibode-end-cta {
  margin-top: 48px;
  padding: 36px 32px;
  border-radius: 4px;
  background: linear-gradient(170deg, #faf7f2 0%, #f0e6d6 100%);
  border: 1px solid rgba(122, 14, 14, 0.18);
  border-left: 3px solid #7a0e0e;
  font-family: 'Instrument Sans', system-ui, sans-serif;
  color: #14110d;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.ibode-end-cta::before { display: none; }

.ibode-end-cta__label {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #7a0e0e;
  font-weight: 600;
  margin-bottom: 14px;
}

.ibode-end-cta__title {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-size: 1.75rem;
  font-weight: 500;
  color: #14110d;
  letter-spacing: -0.015em;
  margin-bottom: 22px;
  line-height: 1.2;
}

.ibode-end-cta__sub {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-size: 1rem;
  line-height: 1.55;
  color: #3a3530;
  margin-bottom: 22px;
}

.ibode-end-cta__next {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  background: #ffffff;
  border: 1px solid rgba(122, 14, 14, 0.18);
  border-radius: 4px;
  margin-bottom: 22px;
}

.ibode-end-cta__next-label {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #7a0e0e;
  font-weight: 600;
}

.ibode-end-cta__next-title {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 500;
  color: #14110d;
  font-size: 1.05rem;
}

.ibode-end-cta__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 26px;
  background: #14110d;
  color: #f5ebe0 !important;
  text-decoration: none;
  border-radius: 2px;
  font-family: 'Instrument Sans', sans-serif;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  transition: background .15s ease;
  border: 1px solid #14110d;
}
.ibode-end-cta__btn:hover {
  background: #7a0e0e;
  border-color: #7a0e0e;
  color: #f5ebe0 !important;
}

.ibode-end-cta__btn--ghost {
  background: transparent;
  color: #7a0e0e !important;
  border: 1px solid #7a0e0e;
}
.ibode-end-cta__btn--ghost:hover {
  background: #7a0e0e;
  color: #f5ebe0 !important;
}

.ibode-end-cta__btn-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 600px) {
  .ibode-end-cta { padding: 24px 20px; }
  .ibode-end-cta__title { font-size: 1.4rem; }
}


/* ═══════════════════════════════════════════════════════════
   FLASHCARDS FLIP 3D (S2.1) + QCM FEEDBACK IMMÉDIAT (S2.2)
   Activé via JS dans theme child functions.php
   ═══════════════════════════════════════════════════════════ */

.lesson-wrapper .flashcard.flashcard--flip {
  perspective: 1400px;
  cursor: pointer;
  position: relative;
  min-height: 200px;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  outline: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.flashcard__inner {
  position: relative;
  transform-style: preserve-3d;
  transition: transform .65s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  min-height: 280px;
}
.flashcard.is-flipped .flashcard__inner { transform: rotateY(180deg); }
.flashcard__face {
  position: absolute;
  inset: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  background: var(--bg-secondary, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-md, 12px);
  padding: 22px 24px 56px;
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,0.05));
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.2) transparent;
  transition: box-shadow .25s ease;
}
.flashcard__face::-webkit-scrollbar { width: 4px; }
.flashcard__face::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.18); border-radius: 4px; }
.flashcard__face::-webkit-scrollbar-track { background: transparent; }
/* Fade gradient en bas pour signaler du contenu scrollable */
.flashcard__face::after {
  content: '';
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  height: 24px;
  margin-top: -24px;
  margin-bottom: -22px;
  background: linear-gradient(to bottom, transparent, var(--bg-secondary, #ffffff));
  pointer-events: none;
  flex-shrink: 0;
}
.flashcard__face--back::after {
  background: linear-gradient(to bottom, transparent, var(--bg-secondary, #ffffff));
}
.flashcard--flip:hover .flashcard__face { box-shadow: 0 6px 20px rgba(0,0,0,0.08); }
.flashcard__face--front { border-top: 4px solid var(--module-color, #6366f1); }
.flashcard__face--back {
  transform: rotateY(180deg);
  border-top: 4px solid var(--success, #10B981);
  background: linear-gradient(180deg, var(--module-color-light, #eef2ff) 0%, var(--bg-secondary, #ffffff) 100%);
}
.flashcard__hint {
  position: absolute;
  bottom: 14px;
  left: 24px;
  right: 24px;
  font-family: var(--font-serif, 'Crimson Pro', Georgia, serif);
  font-style: italic;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted, #94a3b8);
  text-align: center;
  pointer-events: none;
}
.flashcard__face .fc-recto { font-weight: 600; font-size: 1rem; color: var(--text-primary, #0f172a); flex-shrink: 0; }
.flashcard__face .fc-verso { color: var(--text-secondary, #475569); font-size: 0.95rem; line-height: 1.55; }
.flashcard__face .fc-mnemot { margin-top: auto; padding: 8px 12px; background: var(--enc-mnemot-bg, #faf5ff); border-left: 3px solid var(--enc-mnemot-bord, #8b5cf6); border-radius: 4px; font-style: italic; font-size: 0.85rem; color: var(--enc-mnemot-bord, #8b5cf6); }
.flashcard__face .fc-source { font-size: 0.75rem; color: var(--text-muted, #94a3b8); font-style: italic; }
.flashcard__face .fc-badge { align-self: flex-start; font-size: 0.72rem; padding: 3px 10px; border-radius: 999px; background: var(--module-color-light, #eef2ff); color: var(--module-color, #6366f1); font-weight: 600; letter-spacing: 0.06em; }

@media (prefers-reduced-motion: reduce) {
  .flashcard__inner { transition: none !important; }
}

/* QCM */
.lesson-wrapper .qcm-item .props {
  list-style: none; padding-left: 0; margin: 12px 0;
  display: flex; flex-direction: column; gap: 8px;
}
.lesson-wrapper .qcm-prop {
  position: relative;
  padding: 12px 48px 12px 16px;
  background: var(--bg-tertiary, #f1f5f9);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  cursor: pointer;
  transition: all .18s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  font-size: 0.95rem;
  color: var(--text-primary, #0f172a);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.lesson-wrapper .qcm-prop:hover:not([data-qcm-revealed]) {
  background: var(--bg-secondary, #ffffff);
  border-color: var(--module-color, #6366f1);
  transform: translateX(2px);
}
.lesson-wrapper .qcm-prop:focus-visible {
  outline: 2px solid var(--module-color, #6366f1);
  outline-offset: 2px;
}
.lesson-wrapper .qcm-prop--correct {
  background: var(--success-bg, #ecfdf5) !important;
  border-color: var(--success, #10B981);
  color: var(--success, #10B981);
  font-weight: 600;
  cursor: default;
}
.lesson-wrapper .qcm-prop--wrong {
  background: var(--danger-bg, #fef2f2) !important;
  border-color: var(--danger, #EF4444);
  color: var(--danger, #EF4444);
  font-weight: 500;
  cursor: default;
}
.qcm-prop__marker {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  font-weight: 700;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  animation: ibode-qcm-pop .35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.qcm-prop--correct .qcm-prop__marker { background: var(--success, #10B981); color: white; }
.qcm-prop--wrong .qcm-prop__marker { background: var(--danger, #EF4444); color: white; }

@keyframes ibode-qcm-pop {
  0% { transform: translateY(-50%) scale(0); opacity: 0; }
  60% { transform: translateY(-50%) scale(1.2); opacity: 1; }
  100% { transform: translateY(-50%) scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .lesson-wrapper .qcm-prop, .qcm-prop__marker { transition: none !important; animation: none !important; }
}


/* ═══════════════════════════════════════════════════════════
   MICROINTERACTIONS (S2.4)
   - Scroll progress bar fixe en haut
   - Confetti burst au "Marquer comme complété"
   - Hover cards cours (renforce existant)
   ═══════════════════════════════════════════════════════════ */

.ibode-scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--module-color, #6366f1), color-mix(in srgb, var(--module-color, #6366f1), #fff 30%));
  z-index: 99999;
  transition: width .12s ease;
  pointer-events: none;
  box-shadow: 0 0 8px color-mix(in srgb, var(--module-color, #6366f1), transparent 50%);
}
body.admin-bar .ibode-scroll-progress { top: 32px; }
@media (max-width: 600px) {
  body.admin-bar .ibode-scroll-progress { top: 46px; }
}

/* Confetti burst */
.ibode-confetti-burst {
  position: fixed;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 99998;
}
.ibode-confetti-particle {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  top: 0;
  left: 0;
  opacity: 0;
  animation: ibode-confetti-fly 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
.ibode-confetti-particle:nth-child(odd) { border-radius: 50%; width: 6px; height: 6px; }
.ibode-confetti-particle:nth-child(3n) { width: 4px; height: 12px; }

@keyframes ibode-confetti-fly {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translate(calc(-50% + var(--dx, 0)), calc(-50% + var(--dy, 0) + 280px)) rotate(720deg);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ibode-scroll-progress { transition: none !important; }
  .ibode-confetti-burst, .ibode-confetti-particle { display: none !important; }
}


/* ═══════════════════════════════════════════════════════════
   HOVER CARDS COURS (S2.4 — global, pas seulement leçons)
   ═══════════════════════════════════════════════════════════ */

.tutor-card,
.tutor-course-list-item,
.tutor-card-course,
.tutor-courses-loop-list-item,
[class*="tutor-course"][class*="card"] {
  transition: transform .25s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow .25s ease;
}

.tutor-card:hover,
.tutor-course-list-item:hover,
.tutor-card-course:hover,
.tutor-courses-loop-list-item:hover,
[class*="tutor-course"][class*="card"]:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.10), 0 4px 12px rgba(0, 0, 0, 0.06);
}

@media (prefers-reduced-motion: reduce) {
  .tutor-card, .tutor-course-list-item, .tutor-card-course, .tutor-courses-loop-list-item {
    transition: none !important;
  }
  .tutor-card:hover, .tutor-course-list-item:hover, .tutor-card-course:hover, .tutor-courses-loop-list-item:hover {
    transform: none !important;
  }
}
