/* ==========================================================================
   IFTJ – Portail étudiant · système de composants
   Reprend l'identité de iftj.org : palette bronze / parchemin / encre,
   Cormorant Garamond (titres), Cinzel (étiquettes capitales), Lato (texte).
   Ajustements d'accessibilité (WCAG 2.2 AA) : texte des boutons sur bronze foncé
   (7,5:1), petites étiquettes en bronze foncé, focus visible, cibles ≥ 44 px.
   Aucun style en ligne n'est utilisé (CSP stricte).

   Thèmes clair et sombre (1.4.0)
   - Les règles n'emploient que des jetons sémantiques (--bg, --surface, --text, --link,
     --accent-*, --ok/--danger/--warn…) : aucune couleur écrite en dur hors des blocs de jetons
     (vérifié par tests/unit/ThemeCssTest.php, contrastes WCAG compris).
   - Par défaut, le portail suit le réglage de l'appareil (prefers-color-scheme), en direct,
     sans JavaScript. Le serveur n'ajoute <html data-theme="light|dark"> que si l'utilisateur
     a imposé un thème (Mon profil › Préférences) : « light » bloque le thème sombre,
     « dark » l'impose. Les deux blocs sombres ci-dessous sont strictement identiques.
   - À l'impression, le thème clair est toujours rétabli.

   Sens de lecture (1.5.0 : interface en hébreu, de droite à gauche)
   - Le serveur écrit <html lang="fr|en|he" dir="ltr|rtl">. Toutes les règles emploient des propriétés
     logiques (margin/padding/border/inset-inline-*, text-align: start/end, coins logiques) : la mise
     en page entière se reflète en RTL (menu à droite, menu mobile qui glisse depuis la droite…).
   - Ce qui ne s'exprime pas en propriété logique (ombres décalées, translations, dégradés orientés)
     est multiplié par --dir-x (1 de gauche à droite, -1 de droite à gauche). Les rares valeurs
     physiques restantes portent le commentaire « rtl-ok » justifié, et rien d'autre n'est permis
     (vérifié par tests/unit/RtlCssTest.php, qui couvre aussi les feuilles de module).
   ========================================================================== */

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

/* Palette de marque et constantes (identiques dans les deux thèmes).
   La palette ne s'emploie pas directement dans les règles : passer par les jetons sémantiques. */
:root {
  --bronze:    #9e7a56;
  --bronze-l:  #c4a882;
  --bronze-d:  #6b4f34;
  --bronze-xd: #4e3925;
  --parchment: #f8f4ee;
  --cream:     #fffdf9;
  --stone:     #e8e0d4;
  --stone-d:   #d6cab8;
  --ink:       #2a1f14;
  --ink-2:     #4a3d2f;
  --muted:     #6f604f;   /* 5,9:1 sur crème */
  --night:     #1f170f;

  /* Barre latérale de l'administration : sombre dans les deux thèmes (seul son fond, --admin-bg, change). */
  --admin-line:       #3a2d20;
  --admin-hover:      #3a2d20;
  --admin-border:     #4e3d2c;
  --admin-text:       #e9dccb;
  --admin-text-2:     #f3e9dc;
  --admin-strong:     #fff;
  --admin-muted:      #b29c83;
  --admin-text-muted: #c9b49b;
  --admin-accent:     var(--bronze-l);

  /* Lecteur vidéo (façade) : toujours sombre, comme un écran. */
  --media-bg:     var(--ink);
  --media-glow:   #3a2b1d;
  --media-edge:   var(--night);
  --media-text:   var(--cream);
  --media-accent: var(--bronze-l);

  --serif:  'Cormorant Garamond', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --caps:   'Cinzel', 'Trajan Pro', Georgia, serif;
  --sans:   'Lato', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --hebrew: 'SBL Hebrew', 'Ezra SIL', 'Taamey Frank CLM', 'Times New Roman', serif;
  --greek:  'SBL Greek', 'Gentium Plus', 'Gentium', 'Times New Roman', serif;

  --radius: 2px;
  --dir-x: 1;               /* sens horizontal : 1 de gauche à droite, -1 de droite à gauche (dir="rtl") */
  --sidebar-w: 268px;
  --topbar-h: 64px;
  --focus: 0 0 0 3px var(--focus-gap), 0 0 0 5px var(--focus-ring);
}

/* Thème clair (par défaut) : jetons sémantiques. */
:root {
  color-scheme: light;
  /* Fonds et surfaces */
  --bg:             var(--parchment);   /* fond de page */
  --surface:        var(--cream);       /* cartes, barre latérale, tableaux, dialogues */
  --surface-2:      var(--parchment);   /* zones en retrait : en-têtes de tableau, survols, pastilles */
  --surface-3:      var(--stone);       /* badge neutre, survol des boutons discrets */
  --surface-raised: #fff;               /* options de quiz, cadre PDF, champs en lecture seule */
  --row-hover:      #fffaf2;            /* survol d'une ligne, question ciblée */
  --topbar-bg:      rgba(255, 253, 249, .95);

  /* Texte et liens */
  --text:         var(--ink);
  --text-2:       var(--ink-2);
  --text-muted:   var(--muted);
  --placeholder:  #8d7d6b;
  --link:         var(--bronze-d);
  --link-hover:   var(--ink);
  --inverse-bg:   var(--ink);           /* lien d'évitement */
  --inverse-text: var(--cream);
  --mark-bg:      #f1dfbd;              /* surlignage des résultats de recherche */
  --mark-text:    var(--ink);

  /* Accent bronze */
  --accent-text:     var(--bronze-d);   /* étiquettes, chiffres, indicateurs de sélection */
  --accent:          var(--bronze);     /* pictogrammes, bordures d'accent */
  --accent-line:     var(--bronze-l);   /* filets décoratifs */
  --accent-bg:       var(--bronze-d);   /* aplat : bouton principal, page courante */
  --accent-bg-hover: var(--bronze-xd);
  --on-accent:       #fff;              /* texte sur l'aplat bronze */

  /* Bordures, champs, focus */
  --border:         var(--stone);
  --border-strong:  var(--stone-d);
  --input-bg:       var(--cream);
  --input-border:   var(--stone-d);
  --control-accent: var(--bronze-d);    /* cases à cocher et boutons radio (accent-color) */
  --select-arrow:   url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b4f34' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  --focus-ring:     var(--bronze-d);
  --focus-gap:      var(--cream);
  --focus-halo:     rgba(107, 79, 52, .18);

  /* Progression */
  --track:         var(--stone);
  --progress:      var(--bronze-d);
  --progress-from: var(--bronze);

  /* États : texte, fond, bordures (alerte / badge), texte appuyé, aplat */
  --ok:                 #2f6b3a;
  --ok-bg:              #eef5ef;
  --ok-border:          #b9d4bd;
  --ok-border-soft:     #c7dccb;
  --ok-strong:          #1f4a28;
  --ok-solid:           var(--ok);
  --on-ok:              #fff;
  --danger:             #9b2c2c;
  --danger-bg:          #fbefed;
  --danger-border:      #e6c0bb;
  --danger-border-soft: #ecc7c2;
  --danger-strong:      #6e1d1d;
  --danger-solid:       var(--danger);
  --danger-solid-hover: #7a1f1f;
  --on-danger:          #fff;
  --danger-tint:        #fffafa;        /* champ invalide, ligne en erreur */
  --warn:               #7a5200;
  --warn-bg:            #fbf3e2;
  --warn-border:        #e8d3a7;
  --warn-border-soft:   #ead7ad;
  --warn-strong:        #5a3d00;
  --info:               #6b4f34;
  --info-bg:            #f5efe6;
  --info-strong:        var(--bronze-xd);
  --neutral:            #5b4f43;        /* archivé, expiré, ancien */
  --neutral-bg:         #ece7e1;
  --neutral-border:     #d9d0c4;
  --pending-bg:         #f1ece4;        /* en attente, brouillon, non commencé */

  /* Rôles et avatar */
  --badge-admin-bg:   var(--ink);
  --badge-admin-text: var(--bronze-l);
  --badge-dean-bg:    var(--bronze-xd);
  --badge-dean-text:  var(--cream);
  --avatar-bg:        var(--bronze-l);
  --avatar-text:      var(--bronze-xd);

  /* Administration : seul le fond de la barre latérale change de thème */
  --admin-bg: var(--ink);

  /* Voiles sur photo, fonds d'atténuation, ombres, logo, barres de défilement */
  --veil-welcome:       linear-gradient(calc(100deg * var(--dir-x)), rgba(255,253,249,.97) 0%, rgba(255,253,249,.9) 55%, rgba(248,244,238,.72) 100%);
  --veil-welcome-image: linear-gradient(calc(100deg * var(--dir-x)), rgba(255,253,249,.97) 0%, rgba(255,253,249,.88) 55%, rgba(248,244,238,.55) 100%);
  --veil-auth:          linear-gradient(180deg, rgba(255,253,249,.80) 0%, rgba(248,244,238,.66) 45%, rgba(248,244,238,.9) 100%);
  --backdrop:        rgba(31, 23, 15, .45);
  --backdrop-strong: rgba(31, 23, 15, .55);
  --shadow:    0 10px 30px -18px rgba(46, 32, 18, .35);
  --shadow-lg: 0 24px 60px -28px rgba(46, 32, 18, .45);
  --overlay-edge:  transparent;         /* liseré du dialogue et du menu mobile sur le fond atténué */
  --media-outline: transparent;         /* contour du lecteur vidéo */
  --logo-filter: none;
  --scrollbar:   auto;
}

/* Thème sombre : réglage de l'appareil (sauf thème clair imposé)… */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    /* Fonds et surfaces : bruns de nuit, jamais noir pur */
    --bg:             #1b140e;
    --surface:        #231a12;
    --surface-2:      #2d2219;
    --surface-3:      #3a2d21;
    --surface-raised: #2a2017;
    --row-hover:      #2b2118;
    --topbar-bg:      rgba(35, 26, 18, .95);

    /* Texte et liens : tons parchemin */
    --text:         #efe5d5;
    --text-2:       #d8c9b4;
    --text-muted:   #b09d87;
    --placeholder:  #a39079;
    --link:         #dcb98d;
    --link-hover:   #f6ead8;
    --inverse-bg:   #efe5d5;
    --inverse-text: #1b140e;
    --mark-bg:      #5e4622;
    --mark-text:    #fff6e6;

    /* Accent bronze éclairci */
    --accent-text:     #d6b386;
    --accent:          #b8946b;
    --accent-line:     #8c6f51;
    --accent-bg:       #c9a67b;
    --accent-bg-hover: #dcbf98;
    --on-accent:       #1d140c;

    /* Bordures, champs, focus */
    --border:         #3d2f23;
    --border-strong:  #5c4a39;
    --input-bg:       #1d1610;
    --input-border:   #8a7560;
    --control-accent: #c9a67b;
    --select-arrow:   url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23d6b386' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    --focus-ring:     #e2c398;
    --focus-gap:      #231a12;
    --focus-halo:     rgba(226, 195, 152, .28);

    /* Progression */
    --track:         #3a2d21;
    --progress:      #c9a67b;
    --progress-from: #9c7a55;

    /* États */
    --ok:                 #93cf9c;
    --ok-bg:              #172619;
    --ok-border:          #305a37;
    --ok-border-soft:     #2a4a30;
    --ok-strong:          #bae5c0;
    --ok-solid:           #6fb57b;
    --on-ok:              #0e1a0f;
    --danger:             #f4a79d;
    --danger-bg:          #2e1613;
    --danger-border:      #6b2f28;
    --danger-border-soft: #5c2924;
    --danger-strong:      #fbcdc6;
    --danger-solid:       #b8433a;
    --danger-solid-hover: #9c362f;
    --on-danger:          #fff;
    --danger-tint:        #29150f;
    --warn:               #e9c27a;
    --warn-bg:            #2a2010;
    --warn-border:        #5f4a22;
    --warn-border-soft:   #54421f;
    --warn-strong:        #f5dca8;
    --info:               #d6b386;
    --info-bg:            #2c2218;
    --info-strong:        #e8cfab;
    --neutral:            #cfc1af;
    --neutral-bg:         #322a22;
    --neutral-border:     #4c4136;
    --pending-bg:         #2f251c;

    /* Rôles et avatar */
    --badge-admin-bg:   #120d08;
    --badge-admin-text: #d9bd95;
    --badge-dean-bg:    #6b4f34;
    --badge-dean-text:  #fff8ee;
    --avatar-bg:        #b08d66;
    --avatar-text:      #1a120b;

    /* Administration */
    --admin-bg: #140e09;

    /* Voiles sombres (le texte reste lisible sur la photo), atténuation, ombres, logo éclairci */
    --veil-welcome:       linear-gradient(calc(100deg * var(--dir-x)), rgba(35,26,18,.97) 0%, rgba(35,26,18,.9) 55%, rgba(27,20,14,.72) 100%);
    --veil-welcome-image: linear-gradient(calc(100deg * var(--dir-x)), rgba(35,26,18,.96) 0%, rgba(35,26,18,.92) 55%, rgba(27,20,14,.84) 100%);
    --veil-auth:          linear-gradient(180deg, rgba(27,20,14,.84) 0%, rgba(27,20,14,.74) 45%, rgba(27,20,14,.92) 100%);
    --backdrop:        rgba(8, 5, 3, .6);
    --backdrop-strong: rgba(8, 5, 3, .7);
    --shadow:    0 10px 30px -18px rgba(5, 3, 2, .7);
    --shadow-lg: 0 24px 60px -28px rgba(5, 3, 2, .8);
    --overlay-edge:  #8c6f51;             /* l'ombre ne se voit pas sur un fond presque noir */
    --media-outline: #5c4a39;             /* le lecteur, sombre, ne se fond pas dans la page */
    --logo-filter: brightness(1.55) saturate(.8);
    --scrollbar:   #5c4a39 #1b140e;
  }
}

/* … ou thème sombre imposé par l'utilisateur. Déclarations identiques au bloc précédent. */
:root[data-theme="dark"] {
  color-scheme: dark;
  /* Fonds et surfaces : bruns de nuit, jamais noir pur */
  --bg:             #1b140e;
  --surface:        #231a12;
  --surface-2:      #2d2219;
  --surface-3:      #3a2d21;
  --surface-raised: #2a2017;
  --row-hover:      #2b2118;
  --topbar-bg:      rgba(35, 26, 18, .95);

  /* Texte et liens : tons parchemin */
  --text:         #efe5d5;
  --text-2:       #d8c9b4;
  --text-muted:   #b09d87;
  --placeholder:  #a39079;
  --link:         #dcb98d;
  --link-hover:   #f6ead8;
  --inverse-bg:   #efe5d5;
  --inverse-text: #1b140e;
  --mark-bg:      #5e4622;
  --mark-text:    #fff6e6;

  /* Accent bronze éclairci */
  --accent-text:     #d6b386;
  --accent:          #b8946b;
  --accent-line:     #8c6f51;
  --accent-bg:       #c9a67b;
  --accent-bg-hover: #dcbf98;
  --on-accent:       #1d140c;

  /* Bordures, champs, focus */
  --border:         #3d2f23;
  --border-strong:  #5c4a39;
  --input-bg:       #1d1610;
  --input-border:   #8a7560;
  --control-accent: #c9a67b;
  --select-arrow:   url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23d6b386' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  --focus-ring:     #e2c398;
  --focus-gap:      #231a12;
  --focus-halo:     rgba(226, 195, 152, .28);

  /* Progression */
  --track:         #3a2d21;
  --progress:      #c9a67b;
  --progress-from: #9c7a55;

  /* États */
  --ok:                 #93cf9c;
  --ok-bg:              #172619;
  --ok-border:          #305a37;
  --ok-border-soft:     #2a4a30;
  --ok-strong:          #bae5c0;
  --ok-solid:           #6fb57b;
  --on-ok:              #0e1a0f;
  --danger:             #f4a79d;
  --danger-bg:          #2e1613;
  --danger-border:      #6b2f28;
  --danger-border-soft: #5c2924;
  --danger-strong:      #fbcdc6;
  --danger-solid:       #b8433a;
  --danger-solid-hover: #9c362f;
  --on-danger:          #fff;
  --danger-tint:        #29150f;
  --warn:               #e9c27a;
  --warn-bg:            #2a2010;
  --warn-border:        #5f4a22;
  --warn-border-soft:   #54421f;
  --warn-strong:        #f5dca8;
  --info:               #d6b386;
  --info-bg:            #2c2218;
  --info-strong:        #e8cfab;
  --neutral:            #cfc1af;
  --neutral-bg:         #322a22;
  --neutral-border:     #4c4136;
  --pending-bg:         #2f251c;

  /* Rôles et avatar */
  --badge-admin-bg:   #120d08;
  --badge-admin-text: #d9bd95;
  --badge-dean-bg:    #6b4f34;
  --badge-dean-text:  #fff8ee;
  --avatar-bg:        #b08d66;
  --avatar-text:      #1a120b;

  /* Administration */
  --admin-bg: #140e09;

  /* Voiles sombres (le texte reste lisible sur la photo), atténuation, ombres, logo éclairci */
  --veil-welcome:       linear-gradient(calc(100deg * var(--dir-x)), rgba(35,26,18,.97) 0%, rgba(35,26,18,.9) 55%, rgba(27,20,14,.72) 100%);
  --veil-welcome-image: linear-gradient(calc(100deg * var(--dir-x)), rgba(35,26,18,.96) 0%, rgba(35,26,18,.92) 55%, rgba(27,20,14,.84) 100%);
  --veil-auth:          linear-gradient(180deg, rgba(27,20,14,.84) 0%, rgba(27,20,14,.74) 45%, rgba(27,20,14,.92) 100%);
  --backdrop:        rgba(8, 5, 3, .6);
  --backdrop-strong: rgba(8, 5, 3, .7);
  --shadow:    0 10px 30px -18px rgba(5, 3, 2, .7);
  --shadow-lg: 0 24px 60px -28px rgba(5, 3, 2, .8);
  --overlay-edge:  #8c6f51;             /* l'ombre ne se voit pas sur un fond presque noir */
  --media-outline: #5c4a39;             /* le lecteur, sombre, ne se fond pas dans la page */
  --logo-filter: brightness(1.55) saturate(.8);
  --scrollbar:   #5c4a39 #1b140e;
}

/* Impression : toujours le thème clair, quel que soit le thème affiché à l'écran
   (copie exacte du bloc « Thème clair » ci-dessus, plus deux jetons propres à l'impression). */
@media print {
  :root, :root:not([data-theme="light"]), :root[data-theme="dark"] {
    color-scheme: light;
    /* Fonds et surfaces */
    --bg:             var(--parchment);   /* fond de page */
    --surface:        var(--cream);       /* cartes, barre latérale, tableaux, dialogues */
    --surface-2:      var(--parchment);   /* zones en retrait : en-têtes de tableau, survols, pastilles */
    --surface-3:      var(--stone);       /* badge neutre, survol des boutons discrets */
    --surface-raised: #fff;               /* options de quiz, cadre PDF, champs en lecture seule */
    --row-hover:      #fffaf2;            /* survol d'une ligne, question ciblée */
    --topbar-bg:      rgba(255, 253, 249, .95);

    /* Texte et liens */
    --text:         var(--ink);
    --text-2:       var(--ink-2);
    --text-muted:   var(--muted);
    --placeholder:  #8d7d6b;
    --link:         var(--bronze-d);
    --link-hover:   var(--ink);
    --inverse-bg:   var(--ink);           /* lien d'évitement */
    --inverse-text: var(--cream);
    --mark-bg:      #f1dfbd;              /* surlignage des résultats de recherche */
    --mark-text:    var(--ink);

    /* Accent bronze */
    --accent-text:     var(--bronze-d);   /* étiquettes, chiffres, indicateurs de sélection */
    --accent:          var(--bronze);     /* pictogrammes, bordures d'accent */
    --accent-line:     var(--bronze-l);   /* filets décoratifs */
    --accent-bg:       var(--bronze-d);   /* aplat : bouton principal, page courante */
    --accent-bg-hover: var(--bronze-xd);
    --on-accent:       #fff;              /* texte sur l'aplat bronze */

    /* Bordures, champs, focus */
    --border:         var(--stone);
    --border-strong:  var(--stone-d);
    --input-bg:       var(--cream);
    --input-border:   var(--stone-d);
    --control-accent: var(--bronze-d);    /* cases à cocher et boutons radio (accent-color) */
    --select-arrow:   url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b4f34' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    --focus-ring:     var(--bronze-d);
    --focus-gap:      var(--cream);
    --focus-halo:     rgba(107, 79, 52, .18);

    /* Progression */
    --track:         var(--stone);
    --progress:      var(--bronze-d);
    --progress-from: var(--bronze);

    /* États : texte, fond, bordures (alerte / badge), texte appuyé, aplat */
    --ok:                 #2f6b3a;
    --ok-bg:              #eef5ef;
    --ok-border:          #b9d4bd;
    --ok-border-soft:     #c7dccb;
    --ok-strong:          #1f4a28;
    --ok-solid:           var(--ok);
    --on-ok:              #fff;
    --danger:             #9b2c2c;
    --danger-bg:          #fbefed;
    --danger-border:      #e6c0bb;
    --danger-border-soft: #ecc7c2;
    --danger-strong:      #6e1d1d;
    --danger-solid:       var(--danger);
    --danger-solid-hover: #7a1f1f;
    --on-danger:          #fff;
    --danger-tint:        #fffafa;        /* champ invalide, ligne en erreur */
    --warn:               #7a5200;
    --warn-bg:            #fbf3e2;
    --warn-border:        #e8d3a7;
    --warn-border-soft:   #ead7ad;
    --warn-strong:        #5a3d00;
    --info:               #6b4f34;
    --info-bg:            #f5efe6;
    --info-strong:        var(--bronze-xd);
    --neutral:            #5b4f43;        /* archivé, expiré, ancien */
    --neutral-bg:         #ece7e1;
    --neutral-border:     #d9d0c4;
    --pending-bg:         #f1ece4;        /* en attente, brouillon, non commencé */

    /* Rôles et avatar */
    --badge-admin-bg:   var(--ink);
    --badge-admin-text: var(--bronze-l);
    --badge-dean-bg:    var(--bronze-xd);
    --badge-dean-text:  var(--cream);
    --avatar-bg:        var(--bronze-l);
    --avatar-text:      var(--bronze-xd);

    /* Administration : seul le fond de la barre latérale change de thème */
    --admin-bg: var(--ink);

    /* Voiles sur photo, fonds d'atténuation, ombres, logo, barres de défilement */
    --veil-welcome:       linear-gradient(calc(100deg * var(--dir-x)), rgba(255,253,249,.97) 0%, rgba(255,253,249,.9) 55%, rgba(248,244,238,.72) 100%);
    --veil-welcome-image: linear-gradient(calc(100deg * var(--dir-x)), rgba(255,253,249,.97) 0%, rgba(255,253,249,.88) 55%, rgba(248,244,238,.55) 100%);
    --veil-auth:          linear-gradient(180deg, rgba(255,253,249,.80) 0%, rgba(248,244,238,.66) 45%, rgba(248,244,238,.9) 100%);
    --backdrop:        rgba(31, 23, 15, .45);
    --backdrop-strong: rgba(31, 23, 15, .55);
    --shadow:    0 10px 30px -18px rgba(46, 32, 18, .35);
    --shadow-lg: 0 24px 60px -28px rgba(46, 32, 18, .45);
    --overlay-edge:  transparent;         /* liseré du dialogue et du menu mobile sur le fond atténué */
    --media-outline: transparent;         /* contour du lecteur vidéo */
    --logo-filter: none;
    --scrollbar:   auto;
    --print-bg:     #fff;
    --print-border: #999;
  }
}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scrollbar-color: var(--scrollbar); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  overflow-wrap: break-word;
}

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; color: var(--text); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.75rem, 3.2vw, 2.4rem); font-weight: 400; }
h2 { font-size: clamp(1.35rem, 2.4vw, 1.7rem); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--link-hover); }
img, svg { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
small, .small { font-size: .85rem; }
code, pre { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: .9em; }
/* Passages en hébreu ou en araméen dans les contenus (police biblique, corps agrandi). Jamais sur <html> :
   l'interface en hébreu (1.5.0) garde ses polices et sa taille ; un passage imbriqué dans un autre
   ne cumule pas l'agrandissement. */
:not(html):is([lang="he"], [lang="hbo"], [lang="arc"]) { font-family: var(--hebrew); font-size: 1.15em; }
:not(html):is([lang="he"], [lang="hbo"], [lang="arc"]) :is([lang="he"], [lang="hbo"], [lang="arc"]) { font-size: 1em; }
[lang="grc"], [lang="el"] { font-family: var(--greek); }

:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius); }
/* Attribut hidden toujours respecté, même sur un élément qui fixe son display (.btn…) : un bouton
   « n'apparaît qu'avec JavaScript » reste masqué sans JavaScript (1.4.0). */
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; inset-inline-start: 1rem; top: -100px; z-index: 1000; background: var(--inverse-bg); color: var(--inverse-text); padding: .75rem 1rem; font-weight: 700; text-decoration: none; }
.skip-link:focus { top: 1rem; }
.skip-link:hover { color: var(--inverse-text); }

.icon { width: 1.15em; height: 1.15em; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }

/* ── Typographie IFTJ ─────────────────────────────────────────────────── */
.kicker {
  font-family: var(--caps); font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--accent-text); margin: 0 0 .5rem; font-weight: 400;
}
.lead { font-family: var(--serif); font-size: 1.25rem; font-style: italic; color: var(--text-2); line-height: 1.6; }
.muted { color: var(--text-muted); }
.serif { font-family: var(--serif); }
.divider { display: flex; align-items: center; gap: 1rem; max-width: 160px; margin: 1.5rem auto; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--accent-line); }
.divider span { width: 7px; height: 7px; background: var(--accent); transform: rotate(45deg); } /* rtl-ok : losange symétrique */

/* ── Boutons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 44px; padding: .65rem 1.4rem;
  font-family: var(--caps); font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; font-weight: 500;
  line-height: 1.2; text-decoration: none; text-align: center;
  border: 1px solid transparent; border-radius: var(--radius); cursor: pointer;
  transition: background .2s, color .2s, border-color .2s, transform .15s;
  background: var(--accent-bg); color: var(--on-accent);
}
.btn:hover { background: var(--accent-bg-hover); color: var(--on-accent); transform: translateY(-1px); }
.btn:active { transform: none; }
.btn--secondary { background: transparent; color: var(--accent-text); border-color: var(--accent); }
.btn--secondary:hover { background: var(--accent-bg); color: var(--on-accent); border-color: var(--accent-bg); }
.btn--ghost { background: transparent; color: var(--accent-text); border-color: transparent; padding-inline: .8rem; }
.btn--ghost:hover { background: var(--surface-3); color: var(--text); }
.btn--danger { background: var(--danger-solid); color: var(--on-danger); }
.btn--danger:hover { background: var(--danger-solid-hover); color: var(--on-danger); }
.btn--danger-outline { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn--danger-outline:hover { background: var(--danger-solid); color: var(--on-danger); }
.btn--small { min-height: 36px; padding: .4rem .9rem; font-size: 10.5px; }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.btn-row--end { justify-content: flex-end; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--link); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.inline-form { display: inline; margin: 0; }

/* ── Formulaires ───────────────────────────────────────────────────────── */
.form { display: grid; gap: 1.15rem; }
.form-grid { display: grid; gap: 1.15rem; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } /* champ sans aide : pas étiré à la hauteur de son voisin */
.form-grid .span-2 { grid-column: 1 / -1; }
.field { display: grid; gap: .4rem; }
.field > label, .field-label, fieldset > legend {
  font-size: .88rem; font-weight: 700; color: var(--text); letter-spacing: .01em;
}
.field .req { color: var(--danger); margin-inline-start: .15rem; }
.field .hint { font-size: .82rem; color: var(--text-muted); margin: 0; }
.field .error { display: flex; gap: .4rem; align-items: flex-start; font-size: .85rem; color: var(--danger); font-weight: 700; margin: 0; }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="url"], input[type="tel"],
input[type="number"], input[type="date"], input[type="datetime-local"], input[type="file"], select, textarea {
  width: 100%; min-height: 44px; padding: .65rem .85rem;
  font: inherit; font-size: 1rem; color: var(--text);
  background: var(--input-bg); border: 1px solid var(--input-border); border-radius: var(--radius);
  transition: border-color .2s, box-shadow .2s;
}
input[type="file"] { padding: .5rem; }
textarea { min-height: 140px; resize: vertical; line-height: 1.65; }
textarea.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9rem; min-height: 260px; }
input::placeholder, textarea::placeholder { color: var(--placeholder); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus-ring); box-shadow: 0 0 0 3px var(--focus-halo); }
/* Cases à cocher et boutons radio : leur bordure native ne change pas au focus, le halo seul est
   trop pâle (< 3:1) ; au clavier, ils reçoivent donc l'anneau de focus complet. */
input:is([type="checkbox"], [type="radio"]):focus-visible { box-shadow: var(--focus); }
/* background-color (et non background) : la flèche des listes déroulantes invalides reste visible. */
.field--invalid input, .field--invalid select, .field--invalid textarea { border-color: var(--danger); background-color: var(--danger-tint); }
.field--invalid :is(input, select, textarea):focus { border-color: var(--focus-ring); }
select { appearance: none; padding-inline-end: 2.4rem; background-image: var(--select-arrow); background-repeat: no-repeat; background-position: right .9rem center; } /* rtl-ok : flèche reportée à gauche en RTL (section « Sens de lecture ») */
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem 1.1rem; margin: 0; }
fieldset > legend { padding: 0 .4rem; }
.check { display: flex; gap: .65rem; align-items: flex-start; min-height: 32px; cursor: pointer; font-size: .95rem; }
.check input { width: 20px; height: 20px; margin: .15rem 0 0; accent-color: var(--control-accent); flex-shrink: 0; }
.checks { display: grid; gap: .5rem; }
.password-field { position: relative; }
.password-field input { padding-inline-end: 3.2rem; }
.password-toggle { position: absolute; inset-inline-end: 4px; top: 4px; bottom: 4px; width: 42px; display: inline-flex; align-items: center; justify-content: center; background: transparent; border: 0; color: var(--text-muted); cursor: pointer; border-radius: var(--radius); }
.password-toggle:hover { color: var(--text); background: var(--surface-2); }
.form-actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; padding-top: .5rem; }
.char-count { font-size: .78rem; color: var(--text-muted); text-align: end; }
/* Fichier choisi dans un champ data-max-bytes (portail.js) : nom et taille. */
.file-info { margin: .35rem 0 0; font-size: .85rem; color: var(--text-muted); overflow-wrap: anywhere; }

/* ── Alertes et messages ───────────────────────────────────────────────── */
.alert {
  display: flex; gap: .75rem; align-items: flex-start;
  padding: .9rem 1.1rem; border-radius: var(--radius); border: 1px solid; border-inline-start-width: 4px;
  font-size: .95rem; margin: 0 0 1.25rem;
}
.alert .icon { margin-top: .15rem; }
.alert p:last-child, .alert ul:last-child { margin-bottom: 0; }
.alert--success { background: var(--ok-bg); border-color: var(--ok-border); border-inline-start-color: var(--ok); color: var(--ok-strong); }
.alert--error   { background: var(--danger-bg); border-color: var(--danger-border); border-inline-start-color: var(--danger); color: var(--danger-strong); }
.alert--warning { background: var(--warn-bg); border-color: var(--warn-border); border-inline-start-color: var(--warn); color: var(--warn-strong); }
.alert--info    { background: var(--info-bg); border-color: var(--border-strong); border-inline-start-color: var(--info); color: var(--text); }
.flash-stack { margin-bottom: 1.25rem; }
.flash-stack--inline { margin: .25rem 0 .85rem; } /* message affiché dans la carte visée (1.4.0) */

/* ── Badges ────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .18rem .55rem; border-radius: 999px; border: 1px solid transparent;
  font-size: .74rem; font-weight: 700; letter-spacing: .03em; line-height: 1.4; white-space: nowrap;
  background: var(--surface-3); color: var(--text-2);
}
.badge--active, .badge--published, .badge--admitted, .badge--accepted, .badge--completed, .badge--sent, .badge--graded { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-border-soft); }
.badge--pending, .badge--draft, .badge--received, .badge--not_started, .badge--logged, .badge--empty { background: var(--pending-bg); color: var(--text-2); border-color: var(--border-strong); }
.badge--in_progress, .badge--under_review, .badge--late, .badge--access_suspended { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-border-soft); }
.badge--planned { background: var(--info-bg); color: var(--info); border-color: var(--border-strong); border-style: dashed; }
.badge--suspended, .badge--rejected, .badge--failed, .badge--withdrawn, .badge--overdue { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border-soft); }
.badge--archived, .badge--former, .badge--not_admitted { background: var(--neutral-bg); color: var(--neutral); border-color: var(--neutral-border); }
.badge--admin { background: var(--badge-admin-bg); color: var(--badge-admin-text); }
.badge--teacher { background: var(--accent-bg); color: var(--on-accent); }
.badge--dean { background: var(--badge-dean-bg); color: var(--badge-dean-text); }
.badge--student { background: var(--surface-2); color: var(--accent-text); border-color: var(--accent-line); }
.badge--count { background: var(--danger-solid); color: var(--on-danger); min-width: 1.4rem; justify-content: center; padding: .05rem .4rem; }

/* ── Cartes et grilles ─────────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: none;
}
.card + .card { margin-top: 1.25rem; }
.grid > .card + .card, .grid > * { margin-top: 0; }
.card--flush { padding: 0; }
.card__header { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.card__header h2, .card__header h3 { margin: 0; }
.card__footer { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.card--accent { position: relative; overflow: hidden; }
.card--accent::before { content: ''; position: absolute; inset-block: 0; inset-inline: 0 auto; width: 3px; background: var(--accent-line); transition: background .2s; }
.card--accent:hover::before { background: var(--accent); }
.card--interactive { transition: box-shadow .2s, transform .2s, border-color .2s; }
.card--interactive:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: var(--accent-line); }
.grid { display: grid; gap: 1.25rem; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid--main-side { grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); align-items: start; }
.stack > * + * { margin-top: 1.25rem; }
.stack-sm > * + * { margin-top: .6rem; }
.cluster { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }

/* Statistiques (style « rentrée » du site) */
.stat { background: var(--surface); border: 1px solid var(--border); padding: 1.15rem 1.25rem; border-radius: var(--radius); }
.stat__value { display: block; font-family: var(--serif); font-size: 2.4rem; line-height: 1; color: var(--accent-text); font-weight: 500; font-variant-numeric: tabular-nums; }
.stat__label { display: block; font-family: var(--caps); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-2); margin-top: .45rem; }
.stat__hint { display: block; font-size: .82rem; color: var(--text-muted); margin-top: .25rem; }

/* ── Progression ───────────────────────────────────────────────────────── */
.progress { display: grid; gap: .35rem; }
.progress__meta { display: flex; justify-content: space-between; gap: .75rem; font-size: .85rem; color: var(--text-2); }
.progress__meta strong { font-family: var(--serif); font-size: 1.1rem; color: var(--accent-text); font-weight: 600; }
progress {
  -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border: 0; border-radius: 999px;
  background: var(--track); color: var(--progress); overflow: hidden;
}
progress::-webkit-progress-bar { background: var(--track); border-radius: 999px; }
progress::-webkit-progress-value { background: linear-gradient(calc(90deg * var(--dir-x)), var(--progress-from), var(--progress)); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--progress); border-radius: 999px; }
.progress--lg progress { height: 12px; }
.lesson-state { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 700; color: var(--text-muted); }
.lesson-state--completed { color: var(--ok); }
.lesson-state--in_progress { color: var(--warn); }
.state-dot { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--input-border); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.state-dot--in_progress { border-color: var(--warn); background: linear-gradient(calc(90deg * var(--dir-x)), var(--warn-bg) 50%, var(--surface) 50%); }
.state-dot--completed { border-color: var(--ok-solid); background: var(--ok-solid); color: var(--on-ok); }
.state-dot--completed .icon { width: 12px; height: 12px; stroke-width: 2.4; }

/* ── Tableaux ──────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align: start; padding: .75rem .9rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.table thead th { font-family: var(--caps); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-2); font-weight: 500; background: var(--surface-2); white-space: nowrap; }
.table tbody tr:last-child td, .table tbody tr:last-child th { border-bottom: 0; }
.table tbody tr:hover { background: var(--row-hover); }
.table .num { text-align: end; font-variant-numeric: tabular-nums; }
.table .actions { text-align: end; white-space: nowrap; }
.table caption { text-align: start; padding: .75rem .9rem; font-weight: 700; }
@media (max-width: 720px) {
  .table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table--stack tr { display: block; padding: .6rem 0; border-bottom: 1px solid var(--border); }
  .table--stack td { display: grid; grid-template-columns: 40% 1fr; gap: .75rem; border: 0; padding: .3rem .9rem; }
  .table--stack td::before { content: attr(data-label); font-weight: 700; color: var(--text-2); font-size: .82rem; }
  .table--stack .actions { text-align: start; }
  .table--stack td.num { text-align: start; } /* tableau empilé : valeur numérique alignée avec les autres lignes */
}

/* Filtres / barre d'outils */
.toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; margin-bottom: 1.25rem; }
.toolbar .field { min-width: 180px; flex: 1 1 180px; }
.toolbar .field--wide { flex: 2 1 260px; }
.pagination { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; justify-content: center; margin-top: 1.25rem; }
.pagination a, .pagination span { min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 0 .75rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--text-2); font-size: .9rem; }
.pagination a:hover { border-color: var(--accent); color: var(--text); }
.pagination [aria-current="page"] { background: var(--accent-bg); color: var(--on-accent); border-color: var(--accent-bg); }
.pagination .disabled { opacity: .45; }

/* Listes */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: .85rem 0; border-bottom: 1px solid var(--border); }
.list > li:first-child { padding-top: 0; }
.list > li:last-child { border-bottom: 0; padding-bottom: 0; }
.list-item { display: flex; gap: .85rem; align-items: flex-start; }
.list-item__body { flex: 1; min-width: 0; }
.list-item__title { font-weight: 700; color: var(--text); text-decoration: none; }
a.list-item__title:hover { color: var(--link); text-decoration: underline; }
.list-item__meta { font-size: .82rem; color: var(--text-muted); }
.date-chip { flex-shrink: 0; width: 56px; text-align: center; border: 1px solid var(--border); background: var(--surface-2); padding: .35rem 0; border-radius: var(--radius); }
.date-chip__day { display: block; font-family: var(--serif); font-size: 1.55rem; line-height: 1; color: var(--accent-text); font-weight: 600; }
.date-chip__month { display: block; font-family: var(--caps); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-2); }
.notif--unread .list-item__title::before { content: ''; display: inline-block; width: 8px; height: 8px; background: var(--accent); border-radius: 50%; margin-inline-end: .45rem; vertical-align: .1em; }

/* État vide */
.empty {
  text-align: center; padding: 2.5rem 1.5rem; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface);
}
.empty__title { font-family: var(--serif); font-size: 1.3rem; font-style: italic; color: var(--text-2); margin-bottom: .35rem; }
.empty p { color: var(--text-muted); max-width: 52ch; margin-inline: auto; }

/* Fil d'Ariane */
.breadcrumbs { font-size: .85rem; margin-bottom: 1rem; }
.breadcrumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
/* « › » est un caractère miroir (Unicode Bidi_Mirrored) : il s'affiche « ‹ » de lui-même en RTL. */
.breadcrumbs li + li::before { content: '›'; color: var(--accent); margin-inline-end: .35rem; }
.breadcrumbs a { color: var(--text-2); }
.breadcrumbs [aria-current="page"] { color: var(--text-muted); }

/* En-tête de page */
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem 2rem; flex-wrap: wrap; margin-bottom: 1.75rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--border); }
.page-header h1 { margin: 0; }
.page-header .lead { margin: .35rem 0 0; font-size: 1.1rem; }

/* Onglets (liens) */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1.5rem; overflow-x: auto; }
.tabs a { padding: .7rem 1rem; text-decoration: none; color: var(--text-2); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 700; font-size: .9rem; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--accent-text); border-bottom-color: var(--accent-text); }

/* Description / définition */
.dl { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1.25rem; margin: 0; }
.dl dt { font-weight: 700; color: var(--text-2); font-size: .9rem; }
.dl dd { margin: 0; }

/* ── Texte riche (leçons, annonces) ───────────────────────────────────── */
.prose { font-size: 1.05rem; line-height: 1.8; color: var(--text-2); max-width: 72ch; }
.prose h2, .prose h3, .prose h4 { margin-top: 1.8em; color: var(--text); }
.prose h2 { font-size: 1.6rem; }
.prose h3 { font-size: 1.3rem; }
.prose ul, .prose ol { padding-inline-start: 1.4rem; }
.prose li + li { margin-top: .3rem; }
.prose blockquote { margin: 1.5rem 0; padding-block: .25rem; padding-inline: 1.4rem 0; border-inline-start: 2px solid var(--accent-line); font-family: var(--serif); font-size: 1.25rem; font-style: italic; color: var(--accent-text); }
.prose pre { background: var(--surface-2); border: 1px solid var(--border); padding: 1rem; overflow-x: auto; }
.prose table { border-collapse: collapse; width: 100%; margin: 1rem 0; font-size: .95rem; }
.prose th, .prose td { border: 1px solid var(--border); padding: .5rem .7rem; text-align: start; }
.prose [dir="rtl"] { unicode-bidi: isolate; }
.prose a[target="_blank"]::after { content: ' ↗'; font-size: .8em; } /* rtl-ok : flèche « ↖ » en RTL (section « Sens de lecture ») */

/* ── Leçon ─────────────────────────────────────────────────────────────── */
.lesson-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 2rem; align-items: start; }
.toc { position: sticky; top: 1.25rem; max-height: calc(100vh - 2.5rem); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.toc__module + .toc__module { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.toc__module-title { font-family: var(--caps); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-text); margin: 0 0 .5rem; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li a { display: flex; gap: .55rem; align-items: flex-start; padding: .45rem .5rem; border-radius: var(--radius); text-decoration: none; color: var(--text-2); font-size: .9rem; line-height: 1.4; }
.toc li a:hover { background: var(--surface-2); color: var(--text); }
.toc li a[aria-current="page"] { background: var(--surface-2); color: var(--text); font-weight: 700; box-shadow: inset calc(3px * var(--dir-x)) 0 0 var(--accent-text); }
.toc li a[aria-current="page"]:focus-visible { box-shadow: inset calc(3px * var(--dir-x)) 0 0 var(--accent-text), var(--focus); }
.toc .optional { font-size: .75rem; color: var(--text-muted); font-style: italic; }
.lesson-actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin: 1.5rem 0; }
.lesson-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2rem; }
.lesson-nav a { display: block; padding: 1rem 1.15rem; border: 1px solid var(--border); background: var(--surface); text-decoration: none; color: var(--text); border-radius: var(--radius); }
.lesson-nav a:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.lesson-nav .next { text-align: end; grid-column: 2; }
.lesson-nav small { display: block; font-family: var(--caps); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-text); }
.media-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; background: var(--media-bg); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); outline: 1px solid var(--media-outline); }
.media-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-facade { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; cursor: pointer; color: var(--media-text); background: radial-gradient(ellipse at center, var(--media-glow) 0%, var(--media-edge) 75%); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .9rem; font: inherit; }
.video-facade__play { width: 74px; height: 74px; border-radius: 50%; background: var(--media-accent); display: flex; align-items: center; justify-content: center; transition: transform .25s; }
.video-facade__play .icon { width: 30px; height: 30px; fill: var(--media-bg); stroke: none; margin-left: 4px; } /* rtl-ok : centrage optique du triangle de lecture, jamais retourné (commande de lecture) */
.video-facade:hover .video-facade__play { transform: scale(1.08); }
.video-facade__label { font-family: var(--caps); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; }
.video-facade__note { font-size: .8rem; color: var(--media-accent); max-width: 46ch; text-align: center; padding: 0 1rem; }
.pdf-frame { width: 100%; height: min(80vh, 900px); border: 1px solid var(--border); background: var(--surface-raised); border-radius: var(--radius); }
.notice { font-size: .85rem; color: var(--text-muted); border-inline-start: 2px solid var(--border-strong); padding-inline-start: .75rem; }
.file-card { display: flex; gap: 1rem; align-items: center; padding: 1rem 1.15rem; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); }
.file-card__icon { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: var(--surface-2); border: 1px solid var(--border); color: var(--accent-text); border-radius: var(--radius); }

/* ── Quiz ──────────────────────────────────────────────────────────────── */
.quiz-question { border: 1px solid var(--border); background: var(--surface); padding: 1.25rem 1.35rem; border-radius: var(--radius); }
.quiz-question + .quiz-question { margin-top: 1rem; }
.quiz-question legend { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; color: var(--text); padding: 0 .35rem; }
.quiz-question__meta { font-size: .8rem; color: var(--text-muted); margin: -.25rem 0 .9rem; }
.quiz-option { display: flex; gap: .75rem; align-items: flex-start; padding: .7rem .85rem; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; background: var(--surface-raised); }
.quiz-option + .quiz-option { margin-top: .5rem; }
.quiz-option:hover { border-color: var(--accent-line); background: var(--surface-2); }
.quiz-option input { width: 20px; height: 20px; margin-top: .1rem; accent-color: var(--control-accent); flex-shrink: 0; }
.quiz-option:has(input:checked) { border-color: var(--accent-text); background: var(--info-bg); }
.quiz-option--correct { border-color: var(--ok); background: var(--ok-bg); }
.quiz-option--wrong { border-color: var(--danger); background: var(--danger-bg); }
.quiz-verdict { font-weight: 700; font-size: .85rem; }
.quiz-verdict--ok { color: var(--ok); }
.quiz-verdict--ko { color: var(--danger); }
.score-ring { font-family: var(--serif); font-size: 3rem; color: var(--accent-text); line-height: 1; }

/* ── Mise en page applicative ──────────────────────────────────────────── */
.app { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--surface); border-inline-end: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 1.4rem 1rem 1rem;
}
.sidebar__brand { display: block; padding: 0 .5rem 1.1rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; text-decoration: none; }
.sidebar__brand img { display: block; width: 100%; max-width: 200px; height: auto; filter: var(--logo-filter); }
.sidebar__brand span { display: block; margin-top: .6rem; font-family: var(--caps); font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--accent-text); }
.nav { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav__section { font-family: var(--caps); font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--text-muted); padding: 1rem .75rem .35rem; }
.nav a {
  display: flex; align-items: center; gap: .75rem; min-height: 42px; padding: .5rem .75rem;
  color: var(--text-2); text-decoration: none; border-radius: var(--radius); font-size: .93rem; font-weight: 400;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current="page"] { background: var(--surface-2); color: var(--text); font-weight: 700; box-shadow: inset calc(3px * var(--dir-x)) 0 0 var(--accent-text); }
.nav a[aria-current="page"]:focus-visible { box-shadow: inset calc(3px * var(--dir-x)) 0 0 var(--accent-text), var(--focus); }
.nav a .icon { color: var(--accent); }
.nav a .badge { margin-inline-start: auto; }
.sidebar__footer { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--border); display: grid; gap: .5rem; }
.user-chip { display: flex; align-items: center; gap: .7rem; padding: .4rem .5rem; text-decoration: none; color: var(--text); border-radius: var(--radius); }
.user-chip:hover { background: var(--surface-2); }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--avatar-bg); color: var(--avatar-text); display: inline-flex; align-items: center; justify-content: center; font-family: var(--caps); font-size: 12px; font-weight: 500; flex-shrink: 0; }
.user-chip__name { display: block; font-weight: 700; font-size: .9rem; line-height: 1.25; }
.user-chip__role { display: block; font-size: .78rem; color: var(--text-muted); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.content { padding: 2.25rem clamp(1rem, 3vw, 3rem) 3rem; max-width: 1240px; width: 100%; }
.footer-legal { margin-top: auto; padding: 1.25rem clamp(1rem, 3vw, 3rem); font-size: .8rem; color: var(--text-muted); border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.footer-legal a { color: var(--text-muted); }

/* Variante administration : barre latérale sombre (rappel de la section Contact du site) */
.app--admin .sidebar { background: var(--admin-bg); border-inline-end-color: var(--admin-line); color: var(--admin-text); }
.app--admin .sidebar__brand { border-bottom-color: var(--admin-line); }
.app--admin .sidebar__brand span { color: var(--admin-accent); }
.app--admin .sidebar__brand img { filter: brightness(1.55) saturate(.8); }
.app--admin .nav__section { color: var(--admin-muted); }
.app--admin .nav a { color: var(--admin-text); }
.app--admin .nav a .icon { color: var(--admin-accent); }
.app--admin .nav a:hover { background: var(--admin-hover); color: var(--admin-strong); }
.app--admin .nav a[aria-current="page"] { background: var(--admin-hover); color: var(--admin-strong); box-shadow: inset calc(3px * var(--dir-x)) 0 0 var(--admin-accent); }
.app--admin .nav a[aria-current="page"]:focus-visible { box-shadow: inset calc(3px * var(--dir-x)) 0 0 var(--admin-accent), var(--focus); }
.app--admin .sidebar__footer { border-top-color: var(--admin-line); }
.app--admin .user-chip { color: var(--admin-text-2); }
.app--admin .user-chip:hover { background: var(--admin-hover); }
.app--admin .user-chip__role { color: var(--admin-text-muted); }
.app--admin .sidebar .btn--ghost { color: var(--admin-accent); }
.app--admin .sidebar .btn--ghost:hover { background: var(--admin-hover); color: var(--admin-strong); }

.search-form { display: flex; gap: .5rem; }
.search-form input { min-height: 40px; }

/* Bandeau d'accueil du tableau de bord */
.welcome {
  position: relative; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--veil-welcome), var(--bg);
  padding: 1.75rem 1.75rem 1.5rem; margin-bottom: 1.75rem;
}
.welcome--image { background-image: var(--veil-welcome-image), url('../img/jerusalem-portail.webp'); background-size: cover; background-position: center 60%; }
.welcome h1 { margin-bottom: .35rem; }
.welcome__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.25rem; align-items: flex-end; }

/* Cartes de cours */
.course-card { display: flex; flex-direction: column; gap: .75rem; height: 100%; }
.course-card__code { font-family: var(--caps); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--accent-text); }
.course-card__title { font-family: var(--serif); font-size: 1.3rem; font-weight: 500; line-height: 1.25; margin: 0; }
.course-card__title a { color: var(--text); text-decoration: none; }
.course-card__title a:hover { color: var(--link); }
.course-card__title a::after { content: ''; position: absolute; inset: 0; }
.course-card { position: relative; }
.course-card .btn, .course-card .badge { position: relative; z-index: 1; }
.course-card__footer { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: .75rem; font-size: .85rem; color: var(--text-muted); }

/* ── Pages d'accès (connexion, inscription…) ──────────────────────────── */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--surface); }
.auth__visual {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 2.5rem;
  background: var(--veil-auth), url('../img/jerusalem-portail.jpg') center / cover no-repeat;
  border-inline-end: 1px solid var(--border);
}
@supports (background-image: url('x.webp')) {
  .auth__visual { background-image: var(--veil-auth), url('../img/jerusalem-portail.webp'); }
}
.auth__logo img { width: min(360px, 80%); height: auto; display: block; filter: var(--logo-filter); }
.auth__tagline { font-family: var(--serif); font-style: italic; font-size: clamp(1.2rem, 2vw, 1.55rem); line-height: 1.6; color: var(--text-2); max-width: 30ch; }
.auth__site-link { font-family: var(--caps); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--link); text-decoration: none; }
.auth__site-link:hover { color: var(--link-hover); }
.auth__panel { display: flex; flex-direction: column; justify-content: center; padding: 2.5rem clamp(1.25rem, 5vw, 4.5rem); }
.auth__card { width: 100%; max-width: 440px; margin: 0 auto; animation: fadeUp .8s ease both; }
.auth__card h1 { font-size: clamp(1.8rem, 3vw, 2.3rem); }
.auth__links { margin-top: 1.5rem; font-size: .92rem; display: grid; gap: .45rem; }
.auth__legal { margin-top: 2rem; font-size: .8rem; color: var(--text-muted); }
.auth__legal a { color: var(--text-muted); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ── Mise en page minimale (installation, erreurs) ─────────────────────── */
.minimal { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 3rem 1rem; background: var(--bg); }
.minimal__brand img { width: 220px; height: auto; display: block; margin: 0 auto 2rem; filter: var(--logo-filter); }
.minimal__card { width: 100%; max-width: 760px; background: var(--surface); border: 1px solid var(--border); padding: clamp(1.25rem, 4vw, 2.5rem); border-radius: var(--radius); box-shadow: var(--shadow); }
.error-code { font-family: var(--serif); font-size: 4rem; line-height: 1; color: var(--accent-line); margin: 0; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: .6rem; align-items: flex-start; padding: .45rem 0; border-bottom: 1px solid var(--border); font-size: .92rem; }
.checklist .ok { color: var(--ok); font-weight: 700; }
.checklist .ko { color: var(--danger); font-weight: 700; }
.checklist .warn { color: var(--warn); font-weight: 700; }

/* Éditeur de texte riche (barre d'outils légère) */
.rte-toolbar { display: flex; flex-wrap: wrap; gap: .25rem; padding: .35rem; border: 1px solid var(--border-strong); border-bottom: 0; background: var(--surface-2); border-radius: var(--radius) var(--radius) 0 0; }
.rte-toolbar button { min-width: 36px; min-height: 34px; border: 1px solid transparent; background: transparent; border-radius: var(--radius); cursor: pointer; font: inherit; font-size: .85rem; color: var(--text-2); }
.rte-toolbar button:hover { background: var(--surface); border-color: var(--border-strong); }
.rte-toolbar + textarea { border-start-start-radius: 0; border-start-end-radius: 0; }

/* Arbre de contenu (administration) */
.tree { list-style: none; margin: 0; padding: 0; }
.tree > li { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); }
.tree > li + li { margin-top: 1rem; }
.tree__head { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: space-between; align-items: center; padding: .9rem 1.1rem; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.tree__head h3 { margin: 0; font-size: 1.15rem; }
.tree ol { list-style: none; margin: 0; padding: 0; }
.tree ol li { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: space-between; align-items: center; padding: .7rem 1.1rem; border-bottom: 1px solid var(--border); }
.tree ol li:last-child { border-bottom: 0; }

/* Dialogue de confirmation */
dialog.confirm { border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; max-width: 460px; width: calc(100% - 2rem); box-shadow: 0 0 0 1px var(--overlay-edge), var(--shadow-lg); background: var(--surface); color: var(--text); }
/* Valeur de repli : les navigateurs antérieurs à 2024 ne transmettent pas les jetons à ::backdrop. */
dialog.confirm::backdrop { background: var(--backdrop-strong, rgba(31, 23, 15, .55)); }
dialog.confirm h2 { font-size: 1.35rem; }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--main-side { grid-template-columns: minmax(0, 1fr); }
  .lesson-layout { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; max-height: none; }
}
@media (max-width: 1023px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; inset-block: 0; inset-inline: 0 auto; width: min(86vw, 320px); z-index: 60;
    transform: translateX(calc(-102% * var(--dir-x))); /* menu fermé hors de l'écran, du côté du début */ transition: transform .25s ease, visibility .25s; box-shadow: 0 0 0 1px var(--overlay-edge), var(--shadow-lg);
    visibility: hidden; /* menu fermé : ses liens ne reçoivent pas le focus clavier */
  }
  .sidebar.is-open { transform: none; visibility: visible; }
  .sidebar-backdrop { position: fixed; inset: 0; background: var(--backdrop); z-index: 55; }
  .sidebar-backdrop[hidden] { display: none; }
  .topbar {
    display: flex; position: sticky; top: 0; z-index: 50; height: var(--topbar-h);
    align-items: center; justify-content: space-between; gap: 1rem; padding: 0 1rem;
    background: var(--topbar-bg); border-bottom: 1px solid var(--border);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  }
  .topbar__brand img { height: 34px; width: auto; display: block; filter: var(--logo-filter); }
  .menu-button { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); border-radius: var(--radius); cursor: pointer; font: inherit; font-size: .85rem; padding: 0 .75rem; }
  .app--admin .topbar { background: var(--admin-bg); border-bottom-color: var(--admin-line); }
  .app--admin .topbar__brand img { filter: brightness(1.55) saturate(.8); }
  .app--admin .menu-button { background: var(--admin-hover); border-color: var(--admin-border); color: var(--admin-text-2); }
  .content { padding-top: 1.5rem; }
}
@media (max-width: 860px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth__visual { min-height: 210px; padding: 1.5rem; border-inline-end: 0; border-bottom: 1px solid var(--border); }
  .auth__tagline { display: none; }
  .auth__panel { padding: 2rem 1rem 3rem; justify-content: flex-start; }
}
@media (max-width: 720px) {
  body { font-size: 15.5px; }
  .grid--2, .grid--3, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .lesson-nav { grid-template-columns: minmax(0, 1fr); }
  .lesson-nav .next { grid-column: auto; }
  .card { padding: 1.15rem; }
  .welcome { padding: 1.25rem; }
  .dl { grid-template-columns: 1fr; gap: .15rem; }
  .dl dd { margin-bottom: .6rem; }
  .page-header { margin-bottom: 1.25rem; }
  .btn-row .btn { flex: 1 1 auto; }
}

/* Impression : les jetons du thème clair sont rétablis plus haut (bloc @media print :root). */
@media print {
  .sidebar, .topbar, .lesson-actions, .lesson-nav, .footer-legal, .btn { display: none !important; }
  .app { display: block; }
  body { background: var(--print-bg); }
  .card, .table-wrap { border-color: var(--print-border); }
}

/* ── Utilitaires ───────────────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-right { text-align: end; } /* nom historique : aligné sur la fin de ligne (à gauche en RTL) */
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: .75rem; }
.mt-2 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: .75rem; }
.mb-2 { margin-bottom: 1.5rem; }
.w-auto { width: auto; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.max-prose { max-width: 72ch; }
.max-form { max-width: 640px; }

/* Années d'études (1.3.0) : liste complète des inscriptions à masquer, sous « Je confirme ». */
.years-confirm-list { margin: .5rem 0 0; }
.years-confirm-list ul { max-height: 16rem; overflow-y: auto; margin: .5rem 0 0; padding-inline-start: 1.25rem; }

/* ── Sens de lecture : interface de droite à gauche (hébreu, 1.5.0) ─────────
   La mise en page se reflète d'elle-même (propriétés logiques, --dir-x). Ne restent ici que le jeton
   de sens, les pictogrammes orientés, les valeurs qui s'écrivent de gauche à droite, les contenus
   saisis par l'équipe (non traduits) et la typographie de l'interface en hébreu.
   Rien ne dépend ici du thème : les jetons de couleur sont les mêmes dans les deux sens. */
[dir="rtl"] { --dir-x: -1; }
[dir="ltr"] { --dir-x: 1; }

/* Pictogrammes orientés retournés (chevrons, « se déconnecter », lien externe) ; la lecture vidéo,
   l'horloge, les coches… ne le sont jamais. .flip-rtl : à poser sur une flèche écrite dans le texte
   (ex. <span class="flip-rtl" aria-hidden="true">←</span>). */
.flip-rtl { display: inline-block; }
[dir="rtl"] .icon:has(> use:is([href$="#chevron-left"], [href$="#chevron-right"], [href$="#logout"], [href$="#external"])),
[dir="rtl"] .flip-rtl { transform: scaleX(-1); } /* rtl-ok : miroir horizontal des pictogrammes orientés */
.prose a[target="_blank"]:dir(rtl)::after { content: ' ↖'; } /* rtl-ok : flèche de lien externe tournée vers le début de ligne */

/* Liste déroulante : la flèche passe du côté de la fin (à gauche). */
[dir="rtl"] select { background-position: left .9rem center; } /* rtl-ok : miroir de « right .9rem center » */

/* Valeurs qui s'écrivent de gauche à droite (adresse e-mail, URL, téléphone, nombre, note décimale,
   date, mot de passe) : saisies en LTR, alignées du côté du libellé. Le champ mot de passe garde ce
   sens quand « Afficher » le passe en texte clair. */
[dir="rtl"] :is(input:is([type="email"], [type="url"], [type="tel"], [type="number"], [type="password"], [type="date"], [type="datetime-local"], [type="time"]), input:is([inputmode="email"], [inputmode="url"], [inputmode="tel"], [inputmode="numeric"], [inputmode="decimal"]), .password-field input) {
  direction: ltr;
  text-align: right; /* rtl-ok : valeur LTR alignée à droite, sous son libellé */
}
[dir="rtl"] .password-field input { padding-left: 3.2rem; padding-right: .85rem; } /* rtl-ok : champ LTR, bouton « Afficher » à gauche */
/* Code, clés et données techniques : toujours de gauche à droite. */
[dir="rtl"] :is(textarea.code, .install-key input, pre, .audit-details) { direction: ltr; text-align: left; } /* rtl-ok : code et données techniques */
[dir="rtl"] code { direction: ltr; unicode-bidi: isolate; }

/* Contenus saisis par l'équipe (non traduits, souvent en français) et saisie libre : chaque paragraphe
   prend le sens de son propre texte (ponctuation finale à sa place, français aligné à gauche). */
[dir="rtl"] .prose :is(p, h2, h3, h4, blockquote, figcaption, td, th),
[dir="rtl"] :is(textarea, input[type="text"], input[type="search"]) { unicode-bidi: plaintext; }

/* Interface en hébreu : Lato, Cormorant et Cinzel n'ont pas de glyphes hébreux. Les piles d'origine
   (lettres latines inchangées : noms, titres des cours, chiffres) reçoivent, avant la famille générique,
   des polices système pourvues de l'hébreu : Segoe UI (Windows), police système (macOS, iOS),
   Arial Hebrew, Noto (Android, Linux). Arial Hebrew vient après la police système : ses lettres latines
   sont médiocres sur macOS. Les étiquettes en capitales passent à la police du texte. Les capitales
   espacées et l'italique n'existent pas en hébreu : petites étiquettes un peu plus grandes et peu
   espacées, italique remplacé par le romain. */
html:lang(he) {
  --sans:  'Lato', 'Segoe UI', system-ui, -apple-system, 'Arial Hebrew', 'Noto Sans Hebrew', Arial, sans-serif;
  --serif: 'Cormorant Garamond', 'Iowan Old Style', 'Palatino Linotype', Georgia, 'Noto Serif Hebrew', 'Frank Ruehl CLM', 'FrankRuehl', 'David', 'New Peninim MT', 'Times New Roman', serif;
  --caps:  var(--sans);
}
html:lang(he) :is(.kicker, .stat__label, .table thead th, .date-chip__month, .toc__module-title, .lesson-nav small, .video-facade__label, .sidebar__brand span, .nav__section, .auth__site-link, .ac-num, .st-num, .qz-num, .st-course-meta dt, .st-grade__label, .auth-subtitle) { font-size: 12px; letter-spacing: .02em; }
html:lang(he) .btn { font-size: 13px; letter-spacing: .02em; }
html:lang(he) .btn--small { font-size: 12px; }
html:lang(he) :is(.lead, .empty__title, .auth__tagline, .toc .optional, .st-lesson-item__meta .optional, .st-video__meta .optional) { font-style: normal; }
