/* F4IOZ — the animated explanations' player (explique.js; docs/moteur-pedagogique.md). Only .ex-… classes. Its colours
   are the episodes' (--tu-…, tutos.css) when the page has them, else their own; the site's light and dark themes. */

.ex-lecteur {
  --ex-c0: var(--tu-ciel, #4FC3FF); --ex-c1: var(--tu-or, #FFC94D); --ex-c2: var(--tu-vert, #4FE08A); --ex-c3: var(--tu-rose, #FF6FAE); --ex-c4: var(--tu-orange, #FF9A4D); --ex-c5: var(--tu-violet, #A98BFF);
  --ex-fond: var(--tu-ecran, #0A1326); --ex-grille: var(--tu-grille, rgba(150, 185, 235, .16)); --ex-texte: var(--tu-texte, var(--text, #E8EEF6)); --ex-dim: var(--tu-dim, var(--text-dim, #9AA8BA));
  position: relative; display: flex; flex-direction: column; gap: 8px; height: 100%; min-height: 0; padding: 10px; border-radius: 16px;
  border: 1px solid var(--border-strong, #2F4150); background: var(--panel-2, #1A2530); color: var(--text, #E8F0F7); outline: none;
}
:root[data-theme="light"] .ex-lecteur:not(.tu-page *) { --ex-fond: #F4F8FD; --ex-grille: rgba(30, 60, 110, .13); --ex-texte: #14202E; --ex-dim: #5A6B80; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .ex-lecteur:not(.tu-page *) { --ex-fond: #F4F8FD; --ex-grille: rgba(30, 60, 110, .13); --ex-texte: #14202E; --ex-dim: #5A6B80; } }
.ex-lecteur:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #3FE0C8) 65%, transparent); }
.ex-cadre { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 2.3fr) minmax(220px, 1fr); gap: 12px; }
.ex-scene { position: relative; min-width: 0; min-height: 200px; border-radius: 12px; background: var(--ex-fond); overflow: hidden; }
.ex-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ex-calque { position: absolute; image-rendering: auto; border-radius: 4px; }
.ex-cote { display: flex; flex-direction: column; gap: 6px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.ex-numero { margin: 0; font-size: 12.5px; color: var(--ex-c1); letter-spacing: .03em; }
.ex-titre { margin: 0; font-size: 18px; line-height: 1.25; }
.ex-legende { margin: 0; font-size: 14.5px; line-height: 1.5; }
.ex-guide { margin-top: auto; }
.ex-guide .ma-guide { margin: 0; }
.ex-alt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.ex-note { margin: 0; font-size: 12.5px; color: var(--ex-dim); }
.ex-commandes { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ex-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; padding: 0; border-radius: 50%; border: 1px solid var(--border-strong, #2F4150); background: var(--panel, #131C24); color: var(--text, #E8F0F7); cursor: pointer; }
.ex-btn svg { width: 20px; height: 20px; fill: currentColor; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.ex-btn[data-ex="rejoue"] svg { fill: none; stroke-width: 2.2; }
.ex-btn:hover, .ex-btn:focus-visible { border-color: var(--accent, #3FE0C8); outline: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent, #3FE0C8) 45%, transparent); }
.ex-lire { width: 46px; height: 46px; background: color-mix(in srgb, var(--ex-c2) 22%, var(--panel, #131C24)); border-color: var(--ex-c2); }
.ex-lire .ex-i-pause, .ex-joue .ex-lire .ex-i-joue { display: none; }
.ex-joue .ex-lire .ex-i-pause { display: inline; }
.ex-fermer { width: auto; padding: 0 14px; border-radius: 999px; font: 650 13px var(--font-sans, sans-serif); }
.ex-piste { flex: 1 1 160px; min-width: 120px; display: flex; flex-direction: column; gap: 3px; }
.ex-curseur { width: 100%; accent-color: var(--ex-c1); margin: 0; }
.ex-barre { height: 4px; border-radius: 2px; background: var(--ex-grille); overflow: hidden; }
.ex-barre span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--ex-c0), var(--ex-c5)); }
.ex-vitesse { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ex-dim); }
.ex-vitesse select { min-height: 34px; border-radius: 8px; border: 1px solid var(--border-strong, #2F4150); background: var(--panel, #131C24); color: var(--text, #E8F0F7); font: inherit; }

/* ------------------------------------------------------------ the drawing */
.ex-el { transition: opacity .45s ease; }
.ex-el.ex-cache { opacity: 0; pointer-events: none; }
.ex-el.ex-surligne { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--ex-c1) 75%, transparent)); animation: ex-pouls 1.4s ease-in-out infinite; }
@keyframes ex-pouls { 50% { filter: drop-shadow(0 0 12px color-mix(in srgb, var(--ex-c1) 95%, transparent)); } }
.ex-c0 { color: var(--ex-c0); } .ex-c1 { color: var(--ex-c1); } .ex-c2 { color: var(--ex-c2); } .ex-c3 { color: var(--ex-c3); } .ex-c4 { color: var(--ex-c4); } .ex-c5 { color: var(--ex-c5); }
.ex-trait { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.ex-epais { stroke-width: 4.5; }
.ex-plein { fill: currentColor; stroke: none; }
.ex-anneau { fill: none; stroke: currentColor; stroke-width: 2; opacity: .5; }
.ex-front { fill: none; stroke: var(--ex-c0); stroke-width: 2.2; }
.ex-grille { fill: none; stroke: var(--ex-grille); stroke-width: 1.2; }
.ex-grille-forte { fill: none; stroke: var(--ex-dim); stroke-width: 1.4; }
.ex-cadre-carte { fill: none; stroke: var(--ex-grille); stroke-width: 1.5; }
.ex-cadran { fill: color-mix(in srgb, var(--ex-c0) 6%, transparent); stroke: var(--ex-dim); stroke-width: 1.5; }
.ex-empreinte { fill: color-mix(in srgb, var(--ex-c2) 18%, transparent); stroke: var(--ex-c2); stroke-width: 1.5; }
.ex-texte { fill: var(--ex-texte); font-family: var(--font-sans, sans-serif); font-size: 15px; }
.ex-petit { font-size: 13px; } .ex-moyen { font-size: 16px; } .ex-grand { font-size: 21px; font-weight: 800; }
.ex-texte.ex-c0, .ex-texte.ex-c1, .ex-texte.ex-c2, .ex-texte.ex-c3, .ex-texte.ex-c4, .ex-texte.ex-c5 { fill: currentColor; }
.ex-fort { font-weight: 800; } .ex-dim { fill: var(--ex-dim); } .ex-mono { font-family: var(--font-mono, monospace); }
.ex-sol { fill: var(--tu-terre, #2E7D4F); }
.ex-sur-sol { fill: #fff; }
.ex-couche { stroke: none; }
.ex-couche-D { fill: color-mix(in srgb, var(--ex-c4) 30%, transparent); } .ex-couche-E { fill: color-mix(in srgb, var(--ex-c1) 26%, transparent); }
.ex-couche-F1 { fill: color-mix(in srgb, var(--ex-c5) 24%, transparent); } .ex-couche-F2 { fill: color-mix(in srgb, var(--ex-c0) 24%, transparent); }
.ex-champ { fill: var(--panel, #131C24); stroke: var(--ex-dim); stroke-width: 1.2; }
.ex-champ.ex-lit { fill: color-mix(in srgb, var(--ex-c1) 30%, var(--panel, #131C24)); stroke: var(--ex-c1); stroke-width: 2.5; }
.ex-periode { stroke: none; } .ex-pair { fill: color-mix(in srgb, var(--ex-c0) 14%, transparent); } .ex-impair { fill: color-mix(in srgb, var(--ex-c1) 14%, transparent); }
.ex-periode.ex-lit { stroke: var(--ex-c3); stroke-width: 3; }
.ex-silence { fill: none; stroke: var(--ex-dim); stroke-width: 1.2; stroke-dasharray: 3 3; }
.ex-silence-lettre { stroke: var(--ex-c4); } .ex-silence-mot { stroke: var(--ex-c3); stroke-width: 1.8; }

/* ------------------------------------------------------------ in an episode, in a window */
.tu-scene > .ex-lecteur { flex: 1 1 auto; min-height: 360px; }
.tu-fenetre-anim > .ex-lecteur, .ex-fenetre-corps > .ex-lecteur { height: 100%; border: 0; padding: 4px; background: transparent; }
.ex-fenetre { width: min(1000px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border-radius: 18px; border: 1px solid var(--border-strong, #2F4150); background: var(--panel, #131C24); color: var(--text, #E8F0F7); box-shadow: var(--shadow-pop, 0 14px 40px rgba(0,0,0,.55)); overflow: hidden; }
.ex-fenetre[open] { display: flex; flex-direction: column; }
.ex-fenetre::backdrop { background: rgba(4, 8, 16, .62); }
.ex-fenetre-tete { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border, #22303B); }
.ex-fenetre-corps { height: min(600px, calc(100vh - 130px)); padding: 8px 10px; }

/* ------------------------------------------------------------ the workshop page (/decouverte/atelier-explications) */
@media (min-width: 860px) {
  body.ex-page .site-main > .ecran-reste.ex-reste { display: flex; flex-direction: column; overflow: hidden; }
  body.ex-page .ex-atelier { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
  body.ex-page .ex-hote { flex: 1; min-height: 0; }
}
.ex-onglets { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ex-onglet { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--border-strong, #2F4150); background: var(--panel-2, #1A2530); color: var(--text, #E8F0F7); font: 650 14px var(--font-sans, sans-serif); cursor: pointer; }
.ex-onglet[aria-selected="true"] { background: color-mix(in srgb, var(--accent, #3FE0C8) 22%, var(--panel-2, #1A2530)); border-color: var(--accent, #3FE0C8); }
.ex-voix { margin-left: auto; position: relative; }
.ex-voix > summary { cursor: pointer; min-height: 40px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border-strong, #2F4150); }
.ex-voix[open] > .mv-reglages { position: absolute; right: 0; top: 46px; z-index: 5; width: min(420px, 90vw); padding: 10px; border-radius: 12px; background: var(--panel, #131C24); border: 1px solid var(--border-strong, #2F4150); box-shadow: var(--shadow-pop, none); }

/* ------------------------------------------------------------ a phone: the caption under the picture */
@media (max-width: 859px) {
  .ex-lecteur { height: auto; }
  .ex-cadre { grid-template-columns: minmax(0, 1fr); }
  .ex-scene { aspect-ratio: 16 / 9; min-height: 0; }
  .ex-cote { overflow: visible; }
  .ex-btn { width: 44px; height: 44px; } .ex-lire { width: 48px; height: 48px; }
  .ex-vitesse select { min-height: 44px; }
  .ex-onglet { min-height: 44px; }
  .ex-voix { margin-left: 0; }
  /* The drawing is half as big: its words a little bigger in its own units. */
  .ex-texte { font-size: 19px; } .ex-texte.ex-petit { font-size: 19px; } .ex-texte.ex-moyen { font-size: 21px; } .ex-texte.ex-grand { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .ex-el { transition: none; }
  .ex-el.ex-surligne { animation: none; }
}
