/* =============================================================================
   style.css — l'unique feuille de style du site (pas de framework, pas de build).
   Principe : on habille les BALISES (body, nav, h1, a…) plutôt que d'inventer
   des classes. Le HTML reste lisible et un nouveau contenu est stylé d'office.
   ========================================================================== */

/* 0. POLICE — Latin Modern Roman (la police de LaTeX), copiée dans
   site/fonts/latin-modern/ : licence libre GUST Font License (texte joint),
   fichiers OpenType de CTAN simplement passés au format woff2, sans retouche.
   « swap » : le texte s'affiche tout de suite, la police arrive ensuite. */
@font-face { font-family: "Latin Modern Roman"; src: url("../fonts/latin-modern/lmroman10-regular.woff2") format("woff2");
             font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Latin Modern Roman"; src: url("../fonts/latin-modern/lmroman10-italic.woff2") format("woff2");
             font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Latin Modern Roman"; src: url("../fonts/latin-modern/lmroman10-bold.woff2") format("woff2");
             font-weight: 600 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Latin Modern Roman"; src: url("../fonts/latin-modern/lmroman10-bolditalic.woff2") format("woff2");
             font-weight: 600 700; font-style: italic; font-display: swap; }

/* 1. VARIABLES — les « propriétés personnalisées » (--nom) centralisent les
   choix : changer une couleur ici la change partout. `color-scheme` prévient
   le navigateur que les deux thèmes existent (barres de défilement, lecteur
   <audio> et champs natifs s'accordent alors tout seuls). */
:root {
  color-scheme: light dark;
  /* Noir, blanc et gris ; deux couleurs seulement : le bleu des liens et le
     rouge des titres. */
  --fond: #ffffff;
  --texte: #141414;     /* presque noir                                       */
  --discret: #5e5e5e;   /* dates, légendes : 6,4:1 sur le blanc (seuil AA 4,5) */
  --accent: #141414;    /* boutons, repères : noir                            */
  --lien: #1846b8;      /* liens : bleu (7:1 sur le blanc)                    */
  --titre: #b3131b;     /* titres : rouge (6,3:1)                             */
  --filet: #dedede;     /* traits de séparation                               */
  /* Barre latérale : gris clair ; foncée quand on est connecté. */
  --barre-fond: #f1f1f1; --barre-texte: #1e1e1e; --barre-discret: #5a5a5a; --barre-actif: rgb(0 0 0 / .08);
  --police: "Latin Modern Roman", "Latin Modern", "CMU Serif", Georgia, serif;
  --mesure: 38rem;      /* largeur de colonne : ~70 caractères, lecture aisée */
}

/* 2. THÈME SOMBRE — on ne redéfinit QUE les variables ; aucune autre règle
   n'est à dupliquer. Le navigateur suit le réglage du système. */
@media (prefers-color-scheme: dark) {
  :root { --fond: #121212; --texte: #e8e8e8; --discret: #a6a6a6; --accent: #e8e8e8;
          --lien: #8fb3ff; --titre: #ff7b7b; --filet: #333333;
          --barre-fond: #1b1b1b; --barre-texte: #e4e4e4; --barre-discret: #a0a0a0; --barre-actif: rgb(255 255 255 / .08); }
}

/* 3. BASE — `border-box` : padding et bordure comptent DANS la largeur
   déclarée, ce qui évite les débordements sur petit écran. */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0 auto;                     /* auto à gauche/droite = colonne centrée */
  max-width: var(--mesure);
  padding: 1.5rem 1.25rem 4rem;       /* la marge latérale suffit au mobile :   */
  background: var(--fond);            /* aucune media query de mise en page     */
  color: var(--texte);
  /* Latin Modern (section 0), servie par le site lui-même : aucune requête
     à un tiers. Un peu plus petite à l'œil que les polices habituelles,
     d'où 1,15rem. */
  font: 1.15rem/1.6 var(--police);
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;     /* iOS ne grossit pas le texte en paysage */
}

/* 4. NAVIGATION — flex + wrap : les onglets passent à la ligne d'eux-mêmes
   quand la place manque ; inutile d'écrire un menu « burger » en JavaScript. */
nav { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem;
      padding-bottom: 1rem; border-bottom: 1px solid var(--filet);
      font: .9rem/1.4 var(--police); }  /* sans-serif = « interface » */
nav a { color: var(--discret); text-decoration: none; padding: .35rem 0; }
nav a:hover { color: var(--accent); }
/* La page courante porte aria-current="page" dans le HTML : l'attribut sert
   à la fois aux lecteurs d'écran ET de crochet CSS (pas de classe « active »). */
nav a[aria-current] { color: var(--texte); font-weight: 600; }
nav a:first-child { margin-right: auto; color: var(--texte); } /* le nom, à gauche */

/* 5. TEXTE */
main { margin-top: 3rem; }
h1, h2, h3, h4 { line-height: 1.25; font-weight: 600; text-wrap: balance; }
h1 { font-size: 1.9rem; margin: 0 0 1.5rem; }
h2 { font-size: 1.25rem; margin: 2.75rem 0 .75rem; }
h3 { font-size: 1.0625rem; margin: 1.75rem 0 .25rem; }
p, ul, dl { margin: 0 0 1rem; }

a { color: var(--lien); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
/* Accessibilité : contour net pour la navigation au clavier uniquement
   (:focus-visible ne se déclenche pas au clic de souris). */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* <time> et <small> = informations secondaires (dates, durées, mentions). */
time, small { color: var(--discret); font: .85rem/1.4 var(--police);
              font-variant-numeric: tabular-nums; } /* chiffres de même largeur */

/* 6. LISTES — les listes de <main> servent d'inventaires (CV, ressources,
   archives) : pas de puce, un filet entre les lignes. */
main ul { list-style: none; padding: 0; }
main li { padding: .6rem 0; border-top: 1px solid var(--filet); }
main li > time { display: block; }   /* la date au-dessus de l'intitulé */

/* 7. PODCASTS — un épisode = un <article>. Le lecteur natif <audio> s'étire
   sur toute la colonne ; c'est le navigateur qui le dessine. */
article { padding: 1.5rem 0; border-top: 1px solid var(--filet); }
article h2, article h4 { margin: .15rem 0 .5rem; font-size: 1.0625rem; }
h1, h2, h3 { color: var(--titre); }  /* titres en rouge */
figure { margin: 0 0 1.5rem; }       /* annule la marge latérale par défaut */
/* <details> : dépliant natif. On ne stylise que le libellé cliquable. */
summary { cursor: pointer; color: var(--lien); margin-bottom: 1rem;
          font: .9rem/1.4 var(--police); }
audio { display: block; width: 100%; margin-top: 1rem; }
img { max-width: 100%; height: auto; }  /* une image ne déborde jamais */

/* 8. PIED DE PAGE */
footer { margin-top: 4rem; padding-top: 1rem; border-top: 1px solid var(--filet);
         color: var(--discret); font: .85rem/1.5 var(--police); }

/* 9. LIEN D'ÉVITEMENT — premier élément de chaque page : hors écran, il
   n'apparaît qu'au premier appui sur Tab, pour sauter la navigation. */
.evitement { position: absolute; left: -999rem; }
.evitement:focus { left: 1rem; top: 1rem; padding: .5rem .75rem; background: var(--fond); }

/* 12. ONGLET DE LANGUE — en haut à droite, seulement sur les pages qui
   existent en plusieurs langues (fabriqué par le serveur, voir pages.py). */
nav.langues { justify-content: flex-end; gap: .25rem; border-bottom: 0; padding: 0 0 .5rem; }
nav.langues a, nav.langues a:first-child { margin: 0; padding: .2rem .6rem; border: 1px solid var(--filet);
  border-radius: 999px; color: var(--discret); font-size: .8rem; }
nav.langues a[aria-current] { border-color: var(--accent); color: var(--accent); font-weight: 600; }

/* 13. ARTICLES DU CMS — listes, corps enrichi (images, sons, vidéos, lecteurs
   de podcast), aperçu sur les réseaux. */
article.resume { overflow: hidden; }
article.resume h2 { font-size: 1.15rem; margin: .25rem 0 .4rem; }
article.resume h2 a { color: var(--titre); text-decoration: none; }
article.resume h2 a:hover { color: var(--accent); }
img.vignette { float: right; width: 7rem; aspect-ratio: 1; object-fit: cover; margin: 0 0 .5rem 1rem; border-radius: 4px; }
article.article { border-top: 0; padding-top: 0; }
article.article h1 { margin-bottom: .5rem; }
.meta { margin-bottom: 1.5rem; }
.chapo { font-size: 1.15rem; line-height: 1.55; color: var(--discret); }
figure.une img { width: 100%; border-radius: 4px; }
.corps h2 { margin-top: 2.25rem; }
.corps figure { margin: 2rem 0; }
.corps figcaption { margin-top: .4rem; color: var(--discret); font: .85rem/1.4 var(--police); }
.corps img, .corps video { max-width: 100%; height: auto; border-radius: 4px; }
.corps video, .corps audio { display: block; width: 100%; }
.corps iframe { display: block; max-width: 100%; border: 0; }
.corps iframe[src*="youtube"], .corps iframe[src*="vimeo"], .corps iframe[src*="peertube"] { width: 100%; height: auto; aspect-ratio: 16/9; }
.corps blockquote { margin: 1.5rem 0; padding-left: 1rem; border-left: 3px solid var(--filet); color: var(--discret); }
.corps pre { overflow-x: auto; padding: 1rem; background: var(--filet); border-radius: 4px; font-size: .85rem; }
.corps table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.corps th, .corps td { border-bottom: 1px solid var(--filet); padding: .4rem .5rem; text-align: left; }
.corps ul { list-style: disc; padding-left: 1.4rem; }
.corps ul li { border: 0; padding: .15rem 0; }
nav.partage { display: block; margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--filet); border-bottom: 0; }
nav.partage a, nav.partage a:first-child { display: inline-block; margin: 0 .6rem 0 0; color: var(--lien); }

/* 14. FORMULAIRES (connexion, mot de passe, compte) et AVIS */
.formulaire { display: grid; gap: 1rem; max-width: 24rem; margin-bottom: 1.5rem; }
.formulaire label { display: grid; gap: .3rem; font: .9rem/1.4 var(--police); }
.formulaire label.case { display: flex; gap: .5rem; align-items: center; }
.formulaire input:not([type=checkbox]) { padding: .6rem .7rem; border: 1px solid var(--filet); border-radius: 6px;
  background: var(--fond); color: var(--texte); font: 1rem var(--police); }
.formulaire input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
button { font: 600 .95rem var(--police); padding: .6rem 1rem; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--accent); background: var(--accent); color: var(--fond); justify-self: start; }
button.lien { border: 0; background: none; padding: 0; color: var(--lien); font-weight: 400; text-decoration: underline; }
.avis { padding: .75rem 1rem; border-left: 3px solid var(--accent); background: var(--filet); border-radius: 0 4px 4px 0;
  font: .95rem/1.5 var(--police); }
.avis.erreur { border-left-color: #b3261e; }
form.compte { display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: baseline; justify-content: flex-end;
  margin: -2rem 0 2rem; font: .85rem var(--police); }
form.compte button.lien { font-size: .85rem; }
dl { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; }
dt { color: var(--discret); } dd { margin: 0; }
section.encart { padding: 1rem 1.25rem; border: 1px solid var(--filet); border-radius: 6px; }
section.encart h2 { margin-top: 0; }

/* 10. ÉCRANS LARGES — seule media query de mise en page (« mobile d'abord » :
   les règles ci-dessus valent pour le téléphone, on enrichit au-delà de 40rem).
   Dans les inventaires, la date passe en colonne à gauche de l'intitulé. */
@media (min-width: 40rem) {
  body { padding-top: 3rem; }
  main li:has(> time) { display: grid; grid-template-columns: 7rem 1fr; gap: 1rem; }
}

/* 15. BARRE LATÉRALE — fabriquée par le serveur pour chaque visiteur
   (server/pages.py, barre_laterale) : le site ; une fois connecté, en plus,
   les modules de l'intranet de sa catégorie ; en bas, « Se connecter » ou
   « Connecté en tant que … ». Connecté, elle passe en gris foncé.
   Sur téléphone, c'est un bandeau en haut ; à partir de 60rem, une colonne
   fixe à gauche. `body:has(> header)` : seulement les pages du site (pas le
   contenu de l'éditeur du CMS, qui charge aussi cette feuille). */
body.connecte { --barre-fond: #232323; --barre-texte: #f1f1f1; --barre-discret: #b4b4b4; --barre-actif: rgb(255 255 255 / .13); }
@media (prefers-color-scheme: dark) { body.connecte { --barre-fond: #2f2f2f; } }
:root { --barre: 14rem; --dispo: calc(100vw - 2.5rem); }
body > header { margin: -1.5rem -1.25rem 1rem; padding: 1rem 1.25rem .75rem; background: var(--barre-fond); color: var(--barre-texte); }
header nav { border: 0; padding: 0; }
header nav a { color: var(--barre-texte); }
header nav a:hover { color: var(--barre-texte); text-decoration: underline; }
header nav a[aria-current] { font-weight: 700; color: var(--barre-texte); }
header nav a.nom-site, header nav a:first-child { color: var(--barre-texte); }
header nav a.nom-site[aria-current] { background: none; }
header .titre-barre { flex-basis: 100%; margin: .6rem 0 0; color: var(--barre-discret); font: 600 .7rem/1.4 var(--police);
                      text-transform: uppercase; letter-spacing: .08em; }
header .compte-barre { margin-top: .75rem; padding-top: .6rem; border-top: 1px solid var(--barre-actif);
                       font: .85rem/1.45 var(--police); display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1rem; }
header .compte-barre p { margin: 0; color: var(--barre-discret); flex-basis: 100%; }
header .compte-barre strong { color: var(--barre-texte); }
header .compte-barre a, header .compte-barre button.lien { color: var(--barre-texte); }
header .compte-barre form { margin: 0; }
header .bouton-connexion { display: inline-block; padding: .45rem .9rem; border: 1px solid var(--barre-texte); border-radius: 6px;
                           color: var(--barre-texte); text-decoration: none; font-weight: 600; }
header .bouton-connexion:hover { background: var(--barre-texte); color: var(--barre-fond); }
@media (min-width: 40rem) { body > header { margin-top: -3rem; padding-top: 1.25rem; } }
@media (min-width: 60rem) {
  :root { --dispo: calc(100vw - var(--barre) - 5rem); }
  body:has(> header) { max-width: none; margin: 0; padding: 3rem 2.5rem 4rem calc(var(--barre) + 2.5rem); }
  body:has(> header) > main, body:has(> header) > footer { max-width: var(--mesure); margin-left: auto; margin-right: auto; }
  body:has(> header) > main { margin-top: 0; }
  body > header { position: fixed; top: 0; bottom: 0; left: 0; width: var(--barre); margin: 0; overflow-y: auto;
                  display: flex; flex-direction: column; padding: 2.5rem 1rem 1.25rem 1.1rem; }
  header nav:not(.langues) { flex-direction: column; flex-wrap: nowrap; gap: .1rem; }
  header nav:not(.langues) a { margin: 0; padding: .38rem .65rem; border-radius: 6px; }
  header nav:not(.langues) a:hover { background: var(--barre-actif); text-decoration: none; }
  header nav:not(.langues) a[aria-current] { background: var(--barre-actif); }
  header nav a.nom-site, header nav:not(.langues) a:first-child { margin: 0 0 1.25rem; font: 600 1.1rem/1.3 var(--police); }
  header nav.intranet { margin-top: 1.25rem; }
  header nav.intranet a:first-child { margin: 0; font: inherit; }
  header .titre-barre { margin: 0 0 .3rem .65rem; }
  header .compte-barre { margin-top: auto; padding: 1rem .65rem 0; }
  /* L'onglet de langue reste en haut à droite de la page. */
  nav.langues { position: fixed; top: 1.25rem; right: 1.5rem; z-index: 2; padding: 0; }
}

/* 15 bis. ARTICLE SPÉCIAL — une application occupe tout l'écran (cadre) ;
   le bouton « Menu », en haut à gauche, ouvre la barre du site et la
   présentation de l'article par-dessus (élément <details> : sans script). */
body.special { max-width: none; margin: 0; padding: 0; overflow: hidden; }
.appli-speciale { position: fixed; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.menu-special { position: fixed; top: .75rem; left: .75rem; z-index: 10; }
.menu-special > summary { list-style: none; display: inline-flex; align-items: center; gap: .4rem; margin: 0;
  padding: .45rem .8rem; border-radius: 999px; background: rgb(20 20 20 / .82); color: #fff;
  font: 600 .85rem/1 var(--police); box-shadow: 0 2px 10px rgb(0 0 0 / .35); cursor: pointer; }
.menu-special > summary::-webkit-details-marker { display: none; }
.menu-special[open] > summary { background: #fff; color: #141414; }
.panneau-special { position: fixed; top: 3.5rem; left: .75rem; bottom: .75rem; width: min(24rem, calc(100vw - 1.5rem));
  overflow-y: auto; background: var(--fond); color: var(--texte); border-radius: 12px; box-shadow: 0 12px 40px rgb(0 0 0 / .45); }
.panneau-special > header { position: static !important; width: auto !important; margin: 0 !important; display: block !important;
  padding: 1.1rem 1rem 1rem !important; border-radius: 12px 12px 0 0; }
.panneau-special header nav:not(.langues) { flex-direction: column; flex-wrap: nowrap; gap: .1rem; }
.panneau-special header nav a { padding: .3rem .5rem; border-radius: 6px; }
.panneau-special header nav a.nom-site { margin: 0 0 .75rem; font: 600 1.05rem/1.3 var(--police); }
.panneau-special header nav.intranet { margin-top: .75rem; }
.panneau-special header .titre-barre { margin: 0 0 .2rem .5rem; }
.panneau-special header .compte-barre { margin-top: .75rem; }
.panneau-special nav.langues { position: static; padding: .75rem 1rem 0; justify-content: flex-start; }
.panneau-special .apropos { padding: 1rem 1.25rem 1.25rem; }
.panneau-special .apropos h1 { font-size: 1.35rem; margin: 0 0 .5rem; }
.panneau-special .apropos .chapo { font-size: 1rem; }

/* 15 ter. PODCASTS — séries (/podcasts/), épisodes, lecteur (Plyr). */
.fil { margin: 0 0 1rem; font: .85rem var(--police); color: var(--discret); }
main ul.tuiles-podcasts { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
main ul.tuiles-podcasts li { padding: 0; border: 0; }
.tuile-podcast { display: flex; gap: .9rem; align-items: flex-start; padding: .9rem; border: 1px solid var(--filet); border-radius: 10px;
  color: var(--texte); text-decoration: none; height: 100%; }
.tuile-podcast:hover { border-color: var(--texte); }
.tuile-podcast img { width: 6rem; height: 6rem; border-radius: 6px; object-fit: cover; flex: none; }
.tuile-podcast strong { display: block; color: var(--titre); font-size: 1.15rem; }
.tuile-podcast small { display: block; margin: .15rem 0 .4rem; }
.tuile-podcast .accroche { font-size: .92rem; line-height: 1.45; }
.tete-serie { display: flex; gap: 1.25rem; align-items: center; margin-bottom: 1rem; }
.tete-serie .jaquette { width: 8.5rem; height: 8.5rem; border-radius: 8px; object-fit: cover; flex: none; }
.tete-serie h1 { margin: 0 0 .4rem; }
.tete-serie .chapo { margin: 0; }
main ol.liste-episodes { list-style: none; padding: 0; margin: 0; }
main ol.liste-episodes li { padding: 0; }
.episode-resume a { display: grid; grid-template-columns: 4.5rem 1fr; gap: .9rem; padding: .85rem 0; color: var(--texte); text-decoration: none; }
.episode-resume a:hover strong { text-decoration: underline; }
.episode-resume img { width: 4.5rem; height: 4.5rem; border-radius: 6px; object-fit: cover; }
.episode-resume .meta { display: block; font: .8rem var(--police); color: var(--discret); }
.episode-resume strong { display: block; color: var(--titre); font-size: 1.05rem; margin: .1rem 0 .2rem; }
.episode-resume .resume { display: block; font-size: .95rem; line-height: 1.5; color: var(--discret); }
.episode-resume.perdu { opacity: .5; }
.episode-resume.perdu img { filter: grayscale(1); }
.episode-resume.perdu strong { color: var(--discret); }
.pastille-perdu { padding: .05rem .4rem; border: 1px solid currentColor; border-radius: 999px; font-size: .72rem; }
.episode h1 .numero { color: var(--discret); font-weight: 400; }
article.episode { border-top: 0; padding-top: 0; }
.episode > .meta { font-size: .9rem; color: var(--discret); }
.image-episode { margin: 0 0 1.25rem; }
.image-episode img { display: block; width: 100%; max-height: 28rem; object-fit: cover; border-radius: 10px; }
.jaquette-episode { margin: 0 0 1rem; }
.jaquette-episode img { width: 12.5rem; height: 12.5rem; border-radius: 8px; object-fit: cover; box-shadow: 0 6px 24px rgb(0 0 0 / .18); }
.lecteur-podcast { margin: 1rem 0 1.5rem; --plyr-color-main: var(--texte); --plyr-audio-controls-background: var(--fond);
  --plyr-audio-control-color: var(--texte); --plyr-font-family: var(--police); border: 1px solid var(--filet); border-radius: 10px; overflow: hidden; }
.lecteur-podcast audio { width: 100%; }
.lecteur-podcast .telecharger { margin: 0; padding: .4rem .9rem .55rem; font: .8rem var(--police); }
.sommaire { margin: 1.5rem 0; padding: .75rem 1rem; border-left: 3px solid var(--filet); }
.sommaire summary { margin-bottom: .4rem; }
.sommaire ol { margin: 0; padding-left: 1.2rem; font-size: .95rem; }
main .sommaire li { padding: .1rem 0; border: 0; }
.transcription h2 { font-size: 1.15rem; margin: 2.25rem 0 .6rem; scroll-margin-top: 1rem; }
.presentation-episode { margin: 1rem 0 1.5rem; }
.transcription-repli { margin: 2rem 0; border-top: 1px solid var(--filet); padding-top: 1rem; }
.transcription-repli > summary { display: inline-block; padding: .5rem 1rem; border: 1px solid var(--texte); border-radius: 6px;
  color: var(--texte); font-weight: 600; cursor: pointer; list-style: none; }
.transcription-repli > summary::-webkit-details-marker { display: none; }
.transcription-repli > summary::before { content: "▸ "; }
.transcription-repli[open] > summary::before { content: "▾ "; }
.avis-ia { margin: 1rem 0; padding: .6rem .9rem; border-left: 3px solid var(--titre); background: var(--filet); font-size: .9rem; }
nav.sommaire { display: block; border: 0; }
nav.sommaire p { margin: 0 0 .3rem; font-weight: 600; }
.notes-episode { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--filet); font-size: .95rem; }
.notes-episode h2 { font-size: 1rem; }
main .notes-episode li { padding: .25rem 0; border: 0; }
.episodes-voisins { display: flex; justify-content: space-between; gap: 1rem; margin-top: 2.5rem; padding-top: 1rem;
  border-top: 1px solid var(--filet); font: .9rem/1.4 var(--police); }
.episodes-voisins a[rel=next] { margin-left: auto; text-align: right; }
@media print { .lecteur-podcast, .episodes-voisins, .sommaire { display: none; } }

/* 15 quater. GRAPHIQUES DES ARTICLES (images SVG faites dans le CMS avec d3) */
figure.graphique-d3 { margin: 1.75rem 0; }
figure.graphique-d3 img { display: block; width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--filet); }
figure.graphique-d3 figcaption { margin-top: .4rem; color: var(--discret); font-size: .85rem; }

/* 15 quinquies. MES CLASSES (lycées, classes, invitations) */
.page-classes { max-width: 60rem; }
.bloc-classes { margin: 1.5rem 0 2rem; padding-top: .5rem; border-top: 1px solid var(--filet); }
.bloc-classes h2 { margin-bottom: .4rem; }
.discret { color: var(--discret); font-size: .92em; }
.liste-classes { list-style: none; padding: 0; margin: .6rem 0; display: grid; gap: .4rem; }
.liste-classes.cliquable button { width: 100%; text-align: left; font: inherit; padding: .55rem .8rem; border: 1px solid var(--filet);
  border-radius: 6px; background: transparent; color: var(--texte); cursor: pointer; }
.liste-classes.cliquable button:hover, .liste-classes.cliquable button[aria-current] { border-color: var(--texte); background: var(--filet); }
.page-classes .formulaire.en-ligne, .page-classes .en-ligne { max-width: none; display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; }
.page-classes .formulaire.en-ligne label { flex: 1 1 12rem; margin: 0; }
.page-classes .formulaire.en-ligne button { flex: 0 0 auto; }
.page-classes fieldset { border: 1px solid var(--filet); border-radius: 6px; margin: .6rem 0; }
.page-classes label.case { display: block; font-weight: normal; }
.page-classes .boutons { display: flex; flex-wrap: wrap; gap: .6rem; }
.page-classes button.danger { border-color: var(--titre); color: var(--titre); background: transparent; }
.page-classes button.petit { font-size: .85rem; padding: .2rem .55rem; }
.carte-classe { margin-top: 1rem; padding: 1rem 1.2rem; border: 1px solid var(--texte); border-radius: 8px; }
.carte-classe > header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.carte-classe h3 { margin: 0; }
.carte-classe h4 { margin: 1.4rem 0 .4rem; }
.code-classe { margin: 1rem 0; padding: .8rem 1rem; background: var(--filet); border-radius: 6px; }

/* 15 sexies. COURRIER (boîte contact@ dans l'intranet) */
.page-courrier { max-width: 64rem; }
.courrier-barre, .courrier-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-end; margin: .5rem 0; }
.courrier-barre .dossier { flex: 0 1 16rem; margin: 0; }
.courrier-barre .recherche { flex: 1 1 16rem; display: flex; gap: .4rem; margin: 0; }
.courrier-barre .recherche input { flex: 1; min-width: 0; }
.courrier-actions .deplacer { margin: 0; font-weight: 400; }
.page-courrier select, .page-courrier input[type=search] { font: inherit; padding: .45rem .5rem; border: 1px solid var(--discret);
  border-radius: 6px; background: var(--fond); color: var(--texte); max-width: 100%; }
.page-courrier button:not(.principal):not(.lien) { background: transparent; color: var(--texte); border-color: var(--discret); }
.page-courrier button:disabled { opacity: .45; cursor: default; }
.page-courrier .courrier-actions button.danger { border-color: var(--titre); color: var(--titre); background: transparent; }
.adresse-boite { margin: 0 0 .8rem; }
.courrier-liste { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--filet); }
.courrier-liste li { border-bottom: 1px solid var(--filet); }
.courrier-liste a { display: grid; grid-template-columns: minmax(8rem, 14rem) 1fr auto; gap: .2rem 1rem; padding: .55rem .4rem;
  color: var(--texte); text-decoration: none; }
.courrier-liste a:hover, .courrier-liste a:focus-visible { background: var(--filet); }
.courrier-liste .qui, .courrier-liste .objet { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.courrier-liste time { color: var(--discret); font-size: .9em; white-space: nowrap; }
.courrier-liste li.non-lu .qui, .courrier-liste li.non-lu .objet { font-weight: 700; }
.courrier-liste li.non-lu a { box-shadow: inset 3px 0 0 var(--lien); }
.courrier-liste .drapeau { color: var(--titre); }
@media (max-width: 40rem) {
  .courrier-liste a { grid-template-columns: 1fr auto; }
  .courrier-liste .objet { grid-column: 1 / -1; grid-row: 2; }
}
.pagination { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin: 1rem 0; }
.courrier-message h2 { margin: 1rem 0 .5rem; overflow-wrap: anywhere; }
.courrier-message .entetes { display: grid; grid-template-columns: auto 1fr; gap: .15rem .8rem; margin: 0 0 1rem; font-size: .92rem; }
.courrier-message .entetes dt { color: var(--discret); }
.courrier-message .entetes dd { margin: 0; overflow-wrap: anywhere; }
.courrier-message .pieces { list-style: none; padding: .5rem .8rem; margin: 0 0 1rem; background: var(--filet); border-radius: 6px;
  display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; }
.courrier-message .note-images { margin: 0 0 .4rem; font-size: .85rem; }
.courrier-message iframe.corps-html { width: 100%; min-height: 12rem; border: 1px solid var(--filet); border-radius: 6px; background: #fff; display: block; }
.courrier-message .corps-texte { white-space: pre-wrap; overflow-wrap: anywhere; font: .95rem/1.5 ui-monospace, Menlo, monospace;
  padding: .8rem 1rem; border: 1px solid var(--filet); border-radius: 6px; margin: 0; }
.courrier-redaction { max-width: none; }
.courrier-redaction textarea { font: .95rem/1.5 ui-monospace, Menlo, monospace; width: 100%; padding: .6rem .7rem;
  border: 1px solid var(--filet); border-radius: 6px; background: var(--fond); color: var(--texte); }
.courrier-redaction h2 { margin: .5rem 0 0; }
.courrier-redaction details { margin: -.4rem 0 0; }
.code-classe span { display: block; font-size: .85rem; color: var(--discret); }
.code-classe strong { font-family: ui-monospace, Menlo, monospace; font-size: 1.6rem; letter-spacing: .12em; margin-right: 1rem; }
.code-classe p { margin: .4rem 0 0; }
.membres { margin: .3rem 0; }
.table-defile { overflow-x: auto; }
.tableau-eleves { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tableau-eleves th, .tableau-eleves td { text-align: left; padding: .35rem .5rem; border-bottom: 1px solid var(--filet); vertical-align: top; }
.tableau-eleves td.actions { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: flex-end; }
.resultat-invitation code { word-break: break-all; }

/* 16. LIENS ENTRE ARTICLES ET CARTE DES IDÉES (/articles/carte) */
.corps a.lien-interne { text-decoration-style: dotted; }
.lien-absent { color: var(--discret); border-bottom: 1px dashed var(--discret); cursor: help; }
section.liens { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--filet);
                display: grid; gap: 0 2rem; }
section.liens h2 { margin: 0 0 .25rem; color: var(--discret); font: 600 .75rem/1.4 var(--police);
                   text-transform: uppercase; letter-spacing: .06em; }
section.liens li { padding: .3rem 0; }
section.liens p { grid-column: 1 / -1; margin: .75rem 0 0; font: .9rem var(--police); }
@media (min-width: 40rem) { section.liens:has(> div + div) { grid-template-columns: 1fr 1fr; } }

body:has(.pleine-largeur) { overflow-x: clip; }
.pleine-largeur { width: min(72rem, var(--dispo)); margin-left: calc((100% - min(72rem, var(--dispo))) / 2); }
.carte { position: relative; height: min(62vh, 50rem); border: 1px solid var(--filet); border-radius: 8px;
         overflow: hidden; touch-action: none; }
.carte canvas { display: block; cursor: grab; }
.carte canvas.saisi { cursor: grabbing; }
.carte-vide { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--discret); }
.carte-vide[hidden] { display: none; }
.carte-bulle { position: absolute; max-width: 250px; padding: .5rem .7rem; pointer-events: none;
               background: var(--fond); border: 1px solid var(--filet); border-radius: 6px;
               box-shadow: 0 4px 16px rgb(0 0 0 / .12); font: .8rem/1.4 var(--police); }
.carte-bulle strong { display: block; }
.carte-bulle span { color: var(--discret); }
.carte-outils { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; margin: 1.5rem 0 1rem;
                font: .9rem var(--police); }
.carte-outils input[type=search] { flex: 1 1 16rem; padding: .5rem .7rem; border: 1px solid var(--filet);
                border-radius: 6px; background: var(--fond); color: var(--texte); font: inherit; }
.carte-outils label { display: flex; align-items: center; gap: .35rem; }
main ul.carte-legende { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; margin: .75rem 0 0;
                        font: .8rem var(--police); color: var(--discret); }
main ul.carte-legende li { padding: 0; border: 0; }
.carte-legende button { display: inline-flex; align-items: center; padding: .2rem .5rem; border: 1px solid var(--filet); border-radius: 999px;
  background: var(--fond); color: var(--texte); font: inherit; cursor: pointer; }
.carte-legende button[aria-pressed="false"] { opacity: .4; text-decoration: line-through; }
.carte-legende button.tout { border-style: dashed; color: var(--lien); }
.carte-trouves { color: var(--discret); font-size: .85rem; }
.carte-legende .pastille { display: inline-block; width: .7rem; height: .7rem; margin-right: .35rem;
                           border-radius: 50%; vertical-align: -.05rem; }
.carte-liste { margin-top: 1.5rem; }
.bascule-vue { display: inline-flex; border: 1px solid var(--filet); border-radius: 8px; overflow: hidden; margin-left: auto; }
.bascule-vue button { padding: .35rem .8rem; border: 0; background: var(--fond); color: var(--texte); font: 600 .85rem var(--police); cursor: pointer; }
.bascule-vue button[aria-pressed="true"] { background: var(--accent); color: var(--fond); }
.carte-3d { position: absolute; inset: 0; }
.carte.chargement::after { content: "Chargement de la vue 3D…"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--discret);
  font: .9rem var(--police); }
.carte-bulle-3d { max-width: 260px; padding: .45rem .65rem; border-radius: 6px; background: rgb(20 20 20 / .88); color: #fff;
  font: .8rem/1.4 var(--police); text-align: left; }
.carte-bulle-3d strong { display: block; }
.carte-bulle-3d span { opacity: .8; }
@media (min-width: 60rem) { .carte { height: min(75vh, 50rem); } }

/* 17. NOTES DE BAS DE PAGE — appel numéroté dans le texte, liste « Notes » en
   fin d'article (lien ↩ pour revenir). Sur un très grand écran, chaque note
   apparaît en plus dans la marge droite, en face de son appel (à la manière
   des « notes latérales » des livres d'Edward Tufte). */
sup.appel-note { line-height: 0; margin-left: .05em; font: 600 .72em var(--police); }
sup.appel-note a { padding: 0 .1em; text-decoration: none; }
.note-marge { display: none; }
section.notes { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--filet);
                font-size: .92rem; line-height: 1.55; }
section.notes h2 { margin: 0 0 .5rem; color: var(--discret); font: 600 .75rem/1.4 var(--police);
                   text-transform: uppercase; letter-spacing: .06em; }
section.notes ol { margin: 0; padding-left: 1.6rem; }
main section.notes li { padding: .2rem 0; border: 0; }
section.notes li::marker { color: var(--discret); font: .85em var(--police); }
section.notes a[role=doc-backlink] { text-decoration: none; }
section.notes li:target, sup.appel-note a:target {
  background: color-mix(in srgb, var(--accent) 14%, transparent); border-radius: 3px; }
/* 18. SONDAGES — formulaire de vote, puis résultats (camembert ou
   histogramme dessinés par /js/sondages.js ; sans script, des barres CSS). */
.visuellement-cache { position: absolute !important; width: 1px; height: 1px; overflow: hidden;
                      clip-path: inset(50%); white-space: nowrap; }
section.sondage { margin: 2rem 0; padding: 1.25rem 1.4rem; border: 1px solid var(--filet); border-radius: 10px;
                  background: color-mix(in srgb, var(--filet) 22%, var(--fond)); }
.sondage-seul section.sondage { margin-top: 0; }
.sondage-etiquette { margin: 0; color: var(--accent); font: 600 .72rem/1.4 var(--police);
                     text-transform: uppercase; letter-spacing: .08em; }
.corps h2.sondage-titre, h2.sondage-titre { margin: .25rem 0 .5rem; font-size: 1.3rem; }
.sondage-question { margin: 0 0 .5rem; font-weight: 600; }
.sondage-explication { margin: 0 0 .75rem; color: var(--discret); }
.sondage-message { padding: .5rem .75rem; border-left: 3px solid var(--accent); background: var(--filet); border-radius: 0 4px 4px 0; }
.sondage-statut { color: var(--discret); font: .9rem var(--police); }
.sondage-attente { color: var(--discret); font-style: italic; }
form.sondage-vote fieldset { margin: .5rem 0 1rem; padding: 0; border: 0; }
form.sondage-vote legend { padding: 0; margin-bottom: .5rem; font-weight: 600; }
form.sondage-vote label { display: flex; align-items: flex-start; gap: .6rem; margin: .3rem 0; padding: .55rem .75rem;
                          border: 1px solid var(--filet); border-radius: 8px; background: var(--fond); cursor: pointer; }
form.sondage-vote label:hover { border-color: var(--accent); }
form.sondage-vote label:has(input:checked) { border-color: var(--accent);
                          background: color-mix(in srgb, var(--accent) 8%, var(--fond)); }
form.sondage-vote input { margin-top: .35rem; accent-color: var(--accent); }
form.sondage-vote button { padding: .55rem 1.2rem; border: 1px solid var(--accent); border-radius: 6px;
                           background: var(--accent); color: var(--fond); font: 600 .95rem var(--police); cursor: pointer; }
form.sondage-vote button:disabled { opacity: .6; cursor: wait; }
/* Résultats sans script : un tableau à barres. */
.sondage-table { width: 100%; border-collapse: collapse; font: .9rem/1.4 var(--police); }
.sondage-table caption { text-align: left; color: var(--discret); padding-bottom: .4rem; }
.sondage-table th, .sondage-table td { padding: .35rem .4rem; border-bottom: 1px solid var(--filet); text-align: left; }
.sondage-table thead th { color: var(--discret); font-weight: 500; }
.sondage-table th[scope=row] { font-weight: 400; }
.sondage-table tr.mien th { font-weight: 600; }
.sondage-barre { width: 40%; }
.sondage-barre span { display: block; height: .7rem; min-width: 2px; border-radius: 3px; background: var(--accent); }
/* Résultats dessinés par d3 */
.sondage-graphique { margin-top: .5rem; }
.sondage-camembert { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem; }
.sondage-camembert svg { flex: none; max-width: 100%; height: auto; }
.sondage-camembert .part { cursor: default; transition: transform .2s, opacity .2s; }
main ul.sondage-legende { flex: 1 1 14rem; margin: 0; font: .9rem/1.4 var(--police); }
main ul.sondage-legende li { display: grid; grid-template-columns: .8rem 1fr auto; align-items: baseline; gap: .6rem;
                             padding: .35rem .4rem; border: 0; border-radius: 6px; }
ul.sondage-legende li.eclaire { background: var(--filet); }
ul.sondage-legende li.mien .libelle { font-weight: 600; }
ul.sondage-legende .pastille { width: .8rem; height: .8rem; border-radius: 3px; align-self: center; }
ul.sondage-legende .chiffres { color: var(--discret); white-space: nowrap; font-variant-numeric: tabular-nums; }
.sondage-histogramme { display: block; overflow: visible; }
.sondage-total { margin: .75rem 0 0; color: var(--discret); font: .85rem var(--police); }

/* 19. BOUTON PDF d'un article (dans la ligne de date) */
a.lien-pdf { font: .85rem/1.4 var(--police); white-space: nowrap; }
a.lien-pdf::before { content: "⇩ "; }

@media (min-width: 90rem) {
  body:has(> header) .note-marge { display: block; float: right; clear: right; position: relative;
    width: 14rem; margin: .2rem -16.5rem .6rem 0; color: var(--discret); font: .8rem/1.45 var(--police); }
  .note-marge > sup { margin-right: .2rem; color: var(--accent); font-weight: 600; }
}

/* 11. MOUVEMENT ET IMPRESSION — défilement doux vers les ancres, sauf si la
   personne a demandé moins d'animations ; à l'impression (utile pour le CV),
   ni navigation ni pied de page, encre noire sur papier blanc. */
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
@media print {
  header, nav, footer, .evitement, form.compte, .carte-outils, .carte, a.lien-pdf { display: none; }
  body, body:has(> header) { max-width: none; padding: 0; --fond: #fff; --texte: #000; --accent: #000; }
}
