/* =========================================================================
   Festival Sciences tout court(s) — feuille de style commune (socle)
   -------------------------------------------------------------------------
   Ce fichier définit la mise en page et tous les composants.
   Les couleurs propres à chaque thématique sont définies dans
   assets/css/themes/<thematique>.css, sous forme de variables.
   Toute modification ici s'applique aux six thématiques et au portail.
   ========================================================================= */

/* ---- Polices auto-hébergées (licence SIL OFL, voir polices/OFL-*.txt) ----
   Pour changer de police sur tout le site : modifier --police plus bas. */
@font-face { font-family: "Andika"; src: url("../polices/andika-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Andika"; src: url("../polices/andika-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Andika"; src: url("../polices/andika-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Andika"; src: url("../polices/andika-latin-700-italic.woff2") format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Lexend"; src: url("../polices/lexend-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Lexend"; src: url("../polices/lexend-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

/* ---- Variables par défaut (surchargées par chaque thème) ---------------- */
:root {
  --texte: #1c1f23;
  --texte-doux: #4b525b;
  --fond: #ffffff;
  --fond-doux: #f2f4f6;
  --bordure: #8a939d;          /* 3:1 minimum sur fond blanc */
  --primaire: #33295e;         /* couleur principale du thème */
  --primaire-fond: #ecebf3;    /* teinte très claire de la couleur principale */
  --sur-primaire: #ffffff;     /* texte posé sur la couleur principale */
  --accent: #a3321f;           /* couleur secondaire, pour les repères */
  --lien: var(--primaire);
  --focus: #1c1f23;
  --bandeau: linear-gradient(90deg, var(--primaire), var(--accent));

  --police: "Andika", Verdana, Tahoma, sans-serif;   /* alternative : "Lexend" */
  --mesure: 80ch;      /* longueur de ligne maximale recommandée pour la lecture */
  --largeur: 74rem;    /* largeur de la zone centrale (en-tête, menu, contenu) */
  --rayon: 0.25rem;
  --espace: 1.5rem;
}

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

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--police);
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--texte);
  background: var(--fond);
  overflow-wrap: break-word;
}

img, svg, video, iframe { max-width: 100%; }
img { height: auto; }

h1, h2, h3, h4 {
  line-height: 1.2;
  margin: 2em 0 0.6em;
  font-weight: 700;
}
h1 { font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem); margin-top: 0.5em; color: var(--primaire); }
/* Équilibre les lignes des titres (évite le mot isolé en fin de titre).
   À ne pas appliquer aux paragraphes : cela raccourcirait leurs lignes. */
h1, h2, h3, .entete__theme { text-wrap: balance; }
p { text-wrap: pretty; }
h2 { font-size: clamp(1.35rem, 1.2rem + 0.8vw, 1.7rem); }
h3 { font-size: 1.25rem; }
h1 + *, h2 + *, h3 + * { margin-top: 0; }

p, ul, ol, dl, figure, table { margin: 0 0 1em; }
ul, ol { padding-left: 1.5em; }
li + li { margin-top: 0.35em; }

a { color: var(--lien); text-decoration-thickness: 0.08em; text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 0.18em; }

/* Focus clavier : toujours visible, double contour lisible sur tout fond */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--fond);
}
main:focus { outline: none; box-shadow: none; }

.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;
}

.conteneur {
  width: 100%;
  max-width: var(--largeur);
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
}

/* ---- Liens d'évitement --------------------------------------------------- */
.evitement a {
  position: absolute;
  left: 1rem; top: -10rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--texte);
  color: #ffffff;
  font-weight: 700;
}
.evitement a:focus { top: 1rem; }

/* ---- En-tête ------------------------------------------------------------- */
.entete { background: var(--primaire); color: var(--sur-primaire); }
.entete__bandeau { height: 0.6rem; background: var(--bandeau); }
.entete__interieur {
  padding-top: 1.25rem; padding-bottom: 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
}
.entete__panneau > :first-child { margin-top: 0; }
.entete a { color: inherit; }
.entete__site { margin: 0; }
.entete__site a { text-decoration: none; font-weight: 700; }
.entete__site a:hover { text-decoration: underline; }
/* Logo officiel, posé sur une pastille claire comme sur les affiches */
.entete__logo { display: block; height: clamp(4rem, 7vw, 6rem); width: auto; padding: 0.5rem 0.9rem; background: #ffffff; border-radius: var(--rayon); }
.entete__theme {
  margin: 0.2em 0 0;
  font-size: clamp(1.4rem, 1.1rem + 1.6vw, 2.2rem);
  font-weight: 700;
  line-height: 1.15;
  max-width: 30ch;
}
.entete__theme a { text-decoration: none; }
.entete__theme a:hover { text-decoration: underline; }
.entete__meta { margin: 0.5em 0 0; font-size: 1rem; }
.entete :focus-visible { outline-color: var(--sur-primaire); box-shadow: 0 0 0 6px var(--primaire); }

/* ---- Menu principal ------------------------------------------------------ */
.menu { background: var(--fond); border-bottom: 1px solid var(--bordure); }
.menu__liste {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-wrap: wrap;
  gap: 0 0.25rem;
}
.menu__item { margin: 0; }
.menu__item a {
  display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 3.5rem;
  padding: 0.6rem 0.75rem;
  color: var(--texte);
  text-decoration: none;
  border-bottom: 0.3rem solid transparent;
}
.menu__item a:hover { border-bottom-color: var(--bordure); }
.menu__item a[aria-current] { border-bottom-color: var(--accent); font-weight: 700; }
.menu__titre { line-height: 1.25; }
.menu__etape {
  font-size: 0.8rem;
  color: var(--texte-doux);
  font-weight: 400;
}

/* Le parcours du festival : chaque étape porte un repère, plein pour l'étape en cours */
.menu__item--etape { position: relative; }
.menu__item--etape .menu__etape::before {
  content: "";
  display: inline-block;
  width: 12px; height: 12px;      /* taille fixe : un cercle plus petit se rend mal */
  margin-right: 0.4rem;
  border: 2px solid var(--primaire);
  border-radius: 50%;
  vertical-align: -0.1em;
}
.menu__item--etape a[aria-current] .menu__etape::before { background: var(--primaire); }
.menu__item--edition { margin-left: auto; }
.menu__item--edition a { color: var(--primaire); font-weight: 700; }

.mention-avenir { font-size: 0.85em; font-weight: 400; color: var(--texte-doux); }

/* Menu repliable sur petit écran (uniquement si JavaScript est actif) */
.menu__bouton {
  margin: 0.6rem 0;
  padding: 0.5rem 1rem;
  font: inherit; font-weight: 700;
  color: var(--texte);
  background: var(--fond);
  border: 2px solid var(--texte);
  border-radius: var(--rayon);
  cursor: pointer;
}
.menu__bouton[aria-expanded="true"] { background: var(--primaire-fond); }
@media (max-width: 47.99rem) {
  .js .menu__liste.est-replie { display: none; }
  .menu__liste { flex-direction: column; padding-bottom: 0.5rem; }
  .menu__item a { min-height: 0; border-bottom: 0; border-left: 0.3rem solid transparent; }
  .menu__item a[aria-current] { border-left-color: var(--accent); }
  .menu__item--edition { margin-left: 0; }
}
@media (min-width: 48rem) {
  .menu__bouton { display: none !important; }
}

/* ---- Fil d'Ariane -------------------------------------------------------- */
.ariane ol {
  list-style: none;
  margin: 1.25rem 0 0; padding: 0;
  display: flex; flex-wrap: wrap;
  font-size: 0.95rem;
  color: var(--texte-doux);
}
.ariane li { margin: 0; }
.ariane li + li::before { content: "/"; margin: 0 0.5rem; color: var(--bordure); }
.ariane a { color: var(--texte-doux); }

/* ---- Mise en page : menu de rubrique + contenu --------------------------- */
.mise-en-page { padding-bottom: 3rem; }
.contenu { max-width: var(--mesure); }
/* Pages sans menu de rubrique : la colonne de lecture est centrée. */
.page:not(.page--laterale) > .ariane,
.page:not(.page--laterale) .contenu { max-width: var(--mesure); margin-inline: auto; }
.contenu--portail { padding-bottom: 3rem; }

@media (min-width: 60rem) {
  .mise-en-page--laterale {
    display: grid;
    grid-template-columns: 16rem minmax(0, 1fr);
    gap: 2.5rem;
  }
  /* Le menu de rubrique suit le contenu dans le code (lecture et clavier),
     mais s'affiche à gauche sur grand écran. */
  .mise-en-page--laterale .sous-menu { grid-column: 1; grid-row: 1; position: sticky; top: 1rem; align-self: start; margin-top: 1.5rem; }
  .mise-en-page--laterale .contenu { grid-column: 2; grid-row: 1; }
}

.sous-menu {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background: var(--fond-doux);
  border-left: 0.3rem solid var(--primaire);
}
.sous-menu__titre { margin: 0 0 0.5rem; font-weight: 700; color: var(--primaire); }
.sous-menu ul { list-style: none; margin: 0; padding: 0; }
.sous-menu li { margin: 0; }
.sous-menu a {
  display: block;
  padding: 0.35rem 0;
  color: var(--texte);
  text-decoration: none;
  line-height: 1.35;
}
.sous-menu a:hover { text-decoration: underline; }
.sous-menu a[aria-current="page"] { font-weight: 700; color: var(--primaire); }
.sous-menu a[aria-current="page"]::before { content: "▸ "; }

/* ---- Blocs de contenu ---------------------------------------------------- */
.chapeau { font-size: 1.25rem; line-height: 1.5; }

.bouton {
  display: inline-block;
  padding: 0.7rem 1.25rem;
  font: inherit; font-weight: 700;
  line-height: 1.3;
  color: var(--sur-primaire);
  background: var(--primaire);
  border: 2px solid var(--primaire);
  border-radius: var(--rayon);
  text-decoration: none;
  cursor: pointer;
}
.bouton:hover { text-decoration: underline; }
.bouton--secondaire { color: var(--primaire); background: var(--fond); }

.encart {
  padding: 1rem 1.25rem;
  background: var(--fond-doux);
  border-left: 0.3rem solid var(--bordure);
}
.encart--retenir { background: var(--primaire-fond); border-left-color: var(--primaire); }
.encart__titre { margin: 0 0 0.35rem; font-weight: 700; }
.encart > :last-child { margin-bottom: 0; }

.a-venir {
  margin: 0 0 1.5rem;
  padding: 1rem 1.25rem;
  border: 2px dashed var(--bordure);
  border-radius: var(--rayon);
}
.a-venir__titre { margin: 0 0 0.25rem; font-weight: 700; }
.a-venir p:last-child { margin-bottom: 0; }

/* Liste de documents : espacée, et répartie en colonnes dès qu'il y a des aperçus */
.documents { list-style: none; padding: 0; }
.documents li + li { margin-top: 0.9rem; }
.documents:has(.document-apercu) {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 1.75rem 1.5rem;
  align-items: start;
}
.documents:has(.document-apercu) li { margin-top: 0; }
.document { font-weight: 700; }
.document::before { content: "↓ "; font-weight: 400; }
.document__format { font-weight: 400; color: var(--texte-doux); }

.calendrier { list-style: none; padding: 0; margin-left: 0.5rem; border-left: 2px solid var(--primaire); }
.calendrier li {
  position: relative;
  margin: 0;
  padding: 0 0 1rem 1.5rem;
}
.calendrier li::before {
  content: "";
  position: absolute;
  left: -0.5rem; top: 0.4rem;
  width: 0.8rem; height: 0.8rem;
  background: var(--fond);
  border: 2px solid var(--primaire);
  border-radius: 50%;
}
.calendrier__periode { display: block; font-weight: 700; }

.fiche-film {
  display: flex; flex-wrap: wrap;
  gap: 0.5rem 2rem;
  padding: 1rem 0;
  border-top: 1px solid var(--bordure);
  border-bottom: 1px solid var(--bordure);
}
.fiche-film:not(:has(div)) { display: none; }
.fiche-film dt { font-size: 0.9rem; color: var(--texte-doux); }
.fiche-film dd { margin: 0; font-weight: 700; }

.etapes { counter-reset: etape; list-style: none; padding: 0; }
.etapes > li { counter-increment: etape; position: relative; padding-left: 2.5rem; }
.etapes > li::before {
  content: counter(etape);
  position: absolute; left: 0; top: 0;
  width: 1.8rem; height: 1.8rem;
  display: grid; place-items: center;
  font-weight: 700;
  color: var(--sur-primaire);
  background: var(--primaire);
  border-radius: 50%;
}

.question {
  padding: 1rem 1.25rem;
  border: 2px solid var(--accent);
  border-radius: var(--rayon);
}
.question__titre { margin: 0 0 0.35rem; font-weight: 700; color: var(--accent); }
.question > :last-child { margin-bottom: 0; }

.figure img { display: block; border: 1px solid var(--fond-doux); }
.figure figcaption { margin-top: 0.5rem; font-size: 0.95rem; color: var(--texte-doux); }

@media (min-width: 40rem) {
  .colonnes { display: grid; grid-template-columns: 1fr 1fr; gap: var(--espace); }
}
.colonnes > * > :first-child { margin-top: 0; }

.inscription { padding: 1rem 1.25rem; background: var(--primaire-fond); }
.inscription > :last-child { margin-bottom: 0; }
.bloc-territoire { margin-bottom: 1.5rem; }

/* ---- Vidéo : lecteur chargé à la demande -------------------------------- */
.video { margin: 0 0 1.5rem; }
.video__ecran {
  position: relative;
  aspect-ratio: 16 / 9;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  text-align: center;
  color: #ffffff;
  background-color: #1c1f23;
  background-image: var(--bandeau);
  background-size: 100% 0.5rem;
  background-repeat: no-repeat;
  background-position: bottom;
}
.video__titre { margin: 0; font-size: clamp(1.1rem, 0.9rem + 1vw, 1.6rem); font-weight: 700; max-width: 30ch; }
.video__actions { margin: 0; display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }
.video__note { margin: 0; font-size: 0.9rem; max-width: 45ch; }
.video__ecran .bouton--secondaire { color: #ffffff; background: transparent; border-color: #ffffff; }
.video__ecran .bouton:not(.bouton--secondaire) { color: #1c1f23; background: #ffffff; border-color: #ffffff; }
.video__ecran :focus-visible { outline-color: #ffffff; box-shadow: 0 0 0 6px #1c1f23; }
.video__ecran iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video__credit { margin-top: 0.5rem; font-size: 0.95rem; color: var(--texte-doux); display: flex; flex-direction: column; }

/* ---- Tableaux ------------------------------------------------------------ */
.tableau-defilant { overflow-x: auto; margin-bottom: 1.5rem; }
.tableau { width: 100%; border-collapse: collapse; }
.tableau caption { text-align: left; font-weight: 700; margin-bottom: 0.5rem; }
.tableau th, .tableau td { padding: 0.6rem 0.75rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--bordure); }
.tableau thead th { border-bottom: 2px solid var(--texte); }
.mention { font-size: 0.9em; color: var(--texte-doux); }

/* ---- Choix du territoire ------------------------------------------------- */
.choix-territoire { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.choix-territoire li { margin: 0; }
.choix-territoire__lien {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  font-weight: 700;
  color: var(--primaire);
  background: var(--fond);
  border: 2px solid var(--primaire);
  border-radius: var(--rayon);
  text-decoration: none;
}
.choix-territoire__lien:hover { background: var(--primaire-fond); text-decoration: underline; }
.choix-territoire__lien.est-memorise::after { content: " (votre territoire)"; font-weight: 400; }

/* ---- Accueil du portail : l'édition en cours ----------------------------- */
.edition-une {
  margin: 2rem 0 2.5rem;
  border: 2px solid var(--primaire);
  background: var(--primaire-fond);
}
.edition-une__bandeau { height: 0.6rem; background: var(--bandeau); }
.edition-une__corps { padding: 1.25rem 1.5rem 0.5rem; }
.edition-une h2 { margin-top: 0; color: var(--primaire); }
.edition-une__academie { margin: 1rem 0 0.5rem; font-weight: 700; }

/* ---- Page précédente / suivante ----------------------------------------- */
.parcours { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--bordure); }
.parcours ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }
.parcours li { margin: 0; max-width: 48%; }
.parcours__suivant { margin-left: auto !important; text-align: right; }
.parcours a { display: block; font-weight: 700; text-decoration: none; }
.parcours a:hover { text-decoration: underline; }
.parcours__sens { display: block; font-size: 0.9rem; font-weight: 400; color: var(--texte-doux); }
.parcours__precedent .parcours__sens::before { content: "← "; }
.parcours__suivant .parcours__sens::after { content: " →"; }
@media (max-width: 30rem) { .parcours li { max-width: 100%; } }

/* ---- Catalogue de blocs -------------------------------------------------- */
.catalogue { margin: 2rem 0 3rem; }
.catalogue__rendu { padding: 1.25rem; border: 1px solid var(--bordure); border-radius: var(--rayon); }
.catalogue__rendu > :last-child { margin-bottom: 0; }
.catalogue pre {
  margin: 0.75rem 0 0;
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.45;
  background: var(--fond-doux);
  border-radius: var(--rayon);
}
code { font-family: ui-monospace, Consolas, "Liberation Mono", monospace; font-size: 0.92em; }

/* ---- Pied de page -------------------------------------------------------- */
.pied { margin-top: 2rem; padding: 2rem 0; background: var(--fond-doux); border-top: 0.3rem solid var(--primaire); }
.pied__nom { font-weight: 700; margin-bottom: 0.5rem; }
.pied__liens { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.pied__liens li { margin: 0; }
.pied__liens a { color: var(--texte); }
.pied__hebergement { margin: 0; font-size: 0.95rem; color: var(--texte-doux); }

/* ---- Préférences de l'utilisateur ---------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media (forced-colors: active) {
  .menu__item a[aria-current], .sous-menu a[aria-current="page"] { text-decoration: underline; }
  .a-venir, .encart, .question { border: 2px solid CanvasText; }
}

@media print {
  .evitement, .menu, .sous-menu, .parcours, .pied, .ariane, .video__actions { display: none; }
  .entete { background: none; color: #000000; border-bottom: 2px solid #000000; }
  .entete__bandeau { display: none; }
  body { font-size: 11pt; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; }
}

/* ---- Bandeau de la thématique ------------------------------------------
   Grand écran : le bandeau occupe tout l'en-tête, le titre se place dans la
   zone calme à droite, sur un panneau opaque qui garantit le contraste.
   Petit écran : bande recadrée sur le visuel, sous le titre. */
/* L'image n'est jamais rognée : c'est elle qui donne sa hauteur à l'en-tête. */
.entete__visuel img { display: block; width: 100%; height: auto; }
.entete__scene { display: flex; flex-direction: column-reverse; }
@media (min-width: 48rem) {
  .entete--visuel .entete__scene { display: block; position: relative; }
  .entete--visuel .entete__interieur { position: absolute; inset: 0; z-index: 1; justify-content: flex-end; }
  .entete--visuel .entete__panneau { width: min(30rem, 52%); margin-left: auto; padding: 1.25rem 1.5rem; background: color-mix(in srgb, var(--primaire) 90%, transparent); }
}
.edition-une__visuel { display: block; width: 100%; height: auto; }

/* ---- Affiche et description détaillée ----------------------------------- */
.affiche { margin: 0 0 1.5rem; }
.affiche img { display: block; width: 100%; max-width: 28rem; height: auto; border: 1px solid var(--bordure); }
.affiche figcaption { margin-top: 0.75rem; }
.description-longue { margin-bottom: 0.75rem; }
.description-longue summary { cursor: pointer; font-weight: 700; color: var(--primaire); }
.description-longue[open] { padding: 0 0 0.5rem 1rem; border-left: 0.3rem solid var(--primaire-fond); }
.description-longue[open] summary { margin-bottom: 0.5rem; }

/* ---- Page Festival d'un film (consigne adressée aux élèves) --------------- */
.consigne { padding-left: 1.25em; font-size: 1.2rem; }
.question { margin: 1.5rem 0; }
h2.question__titre { font-size: 1.1rem; margin: 0 0 0.35rem; }
.consigne-fin { margin-top: 1.5rem; font-weight: 700; }

/* ---- Document avec aperçu ------------------------------------------------ */
.document-apercu { display: flex; flex-direction: column; gap: 0.45rem; max-width: 16rem; font-weight: 700; text-decoration: none; }
.document-apercu img { display: block; width: 100%; height: auto; border: 1px solid var(--bordure); box-shadow: 0 2px 6px rgb(0 0 0 / 0.15); }
.document-apercu:hover .document-apercu__titre { text-decoration: underline; }
.documents-apercus { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 1.5rem; }
.documents-apercus li { margin: 0; }

/* ---- Piste audio avec transcription -------------------------------------- */
.audio { margin: 0 0 1.5rem; }
.audio__titre { font-weight: 700; margin-bottom: 0.5rem; }
.audio audio { display: block; width: 100%; max-width: 32rem; margin-bottom: 0.5rem; }

.mention-droits { font-size: 0.95rem; color: var(--texte-doux); font-style: italic; }

@media (max-width: 47.99rem) {
  .entete__interieur { flex-direction: column-reverse; align-items: flex-end; }
  .entete__panneau { width: 100%; }
}

/* ---- Vidéos présentées deux par ligne (productions d'élèves…) ------------- */
.videos-paire { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1.5rem; margin-bottom: 1.5rem; }
.videos-paire .video { margin: 0; }
.videos-paire .video__titre { font-size: 1rem; }
.videos-paire .video__ecran { gap: 0.6rem; padding: 1rem; }
.videos-paire .video__note { font-size: 0.8rem; }
.videos-paire .bouton { padding: 0.5rem 0.9rem; font-size: 0.95rem; }

.lien-secondaire { margin: 0.35rem 0 0; font-size: 0.95rem; }

/* Image d'attente du lecteur vidéo, avec voile sombre pour garder le texte lisible */
.video__ecran--vignette { background-size: cover; background-position: center; position: relative; }
.video__ecran--vignette::before { content: ""; position: absolute; inset: 0; background: rgb(12 14 18 / 0.7); }
.video__ecran--vignette > * { position: relative; }

/* ---- Code QR et cadres d'application ------------------------------------- */
.figure--qr img, .figure--qr svg { width: 15rem; max-width: 100%; height: auto; border: 1px solid var(--bordure); background: #ffffff; padding: 0.5rem; }
iframe { max-width: 100%; border-radius: var(--rayon); }

/* Titre de l'édition en une : l'année sur sa propre ligne */
.edition-une__annee { display: block; font-size: 0.75em; font-weight: 400; margin-bottom: 0.15em; }
.rappel-thematique { font-size: 1.15rem; font-weight: 700; color: var(--primaire); }

/* ---- Repère visuel des liens ouvrant un nouvel onglet --------------------- */
/* Dessiné en fond, donc jamais annoncé par les lecteurs d'écran : la mention
   « (nouvel onglet) » du texte s'en charge déjà. */
a[target="_blank"]:not(.document-apercu)::after {
  content: "";
  display: inline-block;
  width: 0.7em; height: 0.7em;
  margin-left: 0.25em;
  vertical-align: baseline;
  background-color: currentColor;
  -webkit-mask: var(--icone-externe) center / contain no-repeat;
  mask: var(--icone-externe) center / contain no-repeat;
}
:root {
  --icone-externe: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13 4h7v7'/%3E%3Cpath d='M20 4L10 14'/%3E%3Cpath d='M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5'/%3E%3C/svg%3E");
}

/* Intertitre regroupant des pages dans le menu de rubrique */
.sous-menu__groupe { margin-top: 0.6rem; font-weight: 700; font-size: 0.95rem; color: var(--texte-doux); }
.sous-menu__sous-page a { padding-left: 0.9rem; }

/* ---- Glossaire ----------------------------------------------------------- */
.glossaire dt { font-weight: 700; margin-top: 0.9rem; }
.glossaire dd { margin: 0.15rem 0 0; }

/* ---- Fiche d'activité (règles, matériel, tâche) --------------------------- */
.fiche-activite { padding: 1rem 1.25rem; background: var(--fond-doux); border-left: 0.3rem solid var(--primaire); }
.fiche-activite dt { font-weight: 700; color: var(--primaire); }
.fiche-activite dd { margin: 0.1rem 0 0.8rem; }
.fiche-activite dd:last-child { margin-bottom: 0; }

/* Cartouche « Objectif » sous le titre des pages de la rubrique scientifique */
.objectif { margin: 0 0 1.5rem; padding: 0.6rem 1rem; border-left: 4px solid var(--primaire); background: var(--primaire-fond); }
.objectif__titre { display: block; font-weight: 700; color: var(--primaire); }
.contacts { padding-left: 1.25rem; }

/* Points de contrôle de l'édition (page « État du site ») : l'état est écrit en toutes lettres,
   la couleur ne fait que le souligner. */
.controle th[scope="row"] { font-weight: 400; text-align: left; }
.controle--manque td:nth-child(3) { font-weight: 700; color: var(--accent); }
.controle--a-verifier td:nth-child(3) { font-weight: 700; }

/* Bouton « Revenir en haut de la page » : affiché par site.js quand la page a défilé */
.haut-de-page {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  width: 3rem; height: 3rem; border-radius: 50%;
  background: var(--primaire); color: #fff; border: 2px solid #fff;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.3);
}
.haut-de-page[hidden] { display: none; }
.haut-de-page:hover { background: var(--accent); }
.haut-de-page:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
#haut:focus { outline: none; }
@media print { .haut-de-page { display: none !important; } }

/* Page « État du site » : tableau de bord et sections repliables */
.tdb { margin: 1.5rem 0 2.5rem; }
.tdb h3 { font-size: 1rem; margin: 1.25rem 0 0.5rem; color: var(--texte-doux, inherit); }
.tdb__liste { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); }
.tdb__carte a { display: block; height: 100%; padding: 0.6rem 0.8rem; border: 1px solid var(--bordure); border-radius: var(--rayon, 6px); text-decoration: none; color: inherit; }
.tdb__carte a:hover, .tdb__carte a:focus-visible { border-color: var(--primaire); }
.tdb__carte--a-traiter a { border-left: 5px solid var(--accent); }
.tdb__nombre { display: block; font-size: 1.6rem; font-weight: 700; line-height: 1.1; color: var(--primaire); }
.tdb__titre { font-weight: 700; }
.tdb__etat { display: block; font-size: 0.9rem; }
details.rapport { border: 1px solid var(--bordure); border-radius: var(--rayon, 6px); margin: 0 0 0.75rem; padding: 0 1rem; }
details.rapport > summary { cursor: pointer; padding: 0.75rem 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; align-items: baseline; }
details.rapport[open] > summary { border-bottom: 1px solid var(--bordure); margin-bottom: 1rem; }
.rapport__titre { font-weight: 700; font-size: 1.1rem; color: var(--primaire); }
.rapport__compteur { font-size: 0.95rem; }
details.rapport--secondaire { margin-top: 1rem; }
details.rapport--secondaire .rapport__titre { font-size: 1rem; }
.tableau th[scope="row"] { font-weight: 400; text-align: left; }
.tdb__liste > li { margin: 0; }

/* Sections repliables : flèche indiquant l'état ouvert ou fermé */
details.rapport > summary { list-style: none; }
details.rapport > summary::-webkit-details-marker { display: none; }
details.rapport > summary::before {
  content: ""; flex: none; align-self: center; width: 0.55rem; height: 0.55rem; margin-right: 0.25rem;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg); transition: transform 0.15s;
}
details.rapport[open] > summary::before { transform: rotate(45deg); }
details.rapport > summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { details.rapport > summary::before { transition: none; } }
