/* ==========================================================================
   Espace formations — élémentaire du Lycée International Balzac
   Feuille de style commune : accueil + pages de thème.
   ========================================================================== */

:root {
  --fond:        #fbf9f5;
  --fond-carte:  #ffffff;
  --fond-doux:   #f4f0e8;
  --encre:       #241f1a;
  --encre-doux:  #6e655b;
  --filet:       #e3dcd1;
  --filet-fort:  #cdc3b4;

  --accent:      #1f5c8b;
  --accent-clair:#eef4fa;

  --serif: "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --sans:  "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;

  --mesure: 68ch;
  --rayon: 3px;
  --ombre: 0 1px 2px rgba(36, 31, 26, .05), 0 8px 24px -16px rgba(36, 31, 26, .25);
}

/* Accents par thème — posés sur <body data-theme="…"> */
body[data-theme="vocabulaire"] { --accent: #1f5c8b; --accent-clair: #eaf2f9; }
body[data-theme="fluence"]     { --accent: #b85c07; --accent-clair: #fdf1e2; }
body[data-theme="flsco"]       { --accent: #1e6b4f; --accent-clair: #e6f3ed; }
body[data-theme="inclusion"]   { --accent: #6c4a86; --accent-clair: #f2ecf7; }
body[data-theme="one"]         { --accent: #0b5d6b; --accent-clair: #e6f1f3; }
body[data-theme="evaluations"] { --accent: #0f4c5c; --accent-clair: #e7f0f2; }

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

html { scroll-behavior: smooth; scroll-padding-top: 78px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

.enveloppe { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.colonne   { max-width: var(--mesure); }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 1.4rem + 2.6vw, 3.3rem); line-height: 1.08; letter-spacing: -.015em; margin: 0; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.1vw, 2rem); line-height: 1.18; margin: 0 0 .5rem; }
h3 { font-size: 1.2rem; line-height: 1.3; margin: 0 0 .35rem; }
h4 { font-size: 1.02rem; margin: 0 0 .25rem; font-family: var(--sans); font-weight: 700; }
p  { margin: 0 0 1rem; }
a  { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px;
}

/* ---------- Étiquettes, chapeaux ---------- */
.etiquette {
  display: inline-block;
  font-size: .705rem; font-weight: 700; letter-spacing: .13em;
  text-transform: uppercase; color: var(--accent);
}
.chapeau {
  font-family: var(--serif); font-size: 1.22rem; line-height: 1.5;
  color: var(--encre-doux); max-width: 62ch;
}

/* ---------- Barre supérieure ---------- */
.barre {
  position: sticky; top: 0; z-index: 20;
  background: rgba(251, 249, 245, .93);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--filet);
}
.barre .enveloppe {
  display: flex; align-items: center; gap: 20px;
  min-height: 56px; flex-wrap: wrap;
}
.barre .marque {
  font-family: var(--serif); font-weight: 600; font-size: 1.02rem;
  color: var(--encre); text-decoration: none; white-space: nowrap;
}
.barre .marque span { color: var(--accent); }
.barre nav { margin-left: auto; display: flex; gap: 18px; flex-wrap: wrap; }
.barre nav a {
  font-size: .86rem; color: var(--encre-doux); text-decoration: none;
  padding: 4px 0; border-bottom: 2px solid transparent;
}
.barre nav a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- Bandeau de tête ---------- */
.tete { padding: 62px 0 44px; border-bottom: 1px solid var(--filet); }
.tete .etiquette { margin-bottom: 14px; }
.tete h1 { margin-bottom: 18px; }
.devise {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(1.15rem, 1rem + .6vw, 1.5rem); line-height: 1.45;
  color: var(--accent); margin: 26px 0 0;
  padding-left: 20px; border-left: 3px solid var(--accent);
}

/* ---------- Sections ---------- */
section { padding: 52px 0; border-bottom: 1px solid var(--filet); }
section:last-of-type { border-bottom: 0; }
.section-tete { margin-bottom: 28px; }
.section-tete .etiquette { display: block; margin-bottom: 8px; }

/* ---------- Grille de cartes ---------- */
.grille {
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(268px, 1fr));
}
.carte {
  display: flex; flex-direction: column;
  background: var(--fond-carte);
  border: 1px solid var(--filet);
  border-top: 3px solid var(--carte-accent, var(--accent));
  border-radius: var(--rayon);
  padding: 22px 22px 20px;
  box-shadow: var(--ombre);
  text-decoration: none; color: inherit;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
a.carte:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(36,31,26,.06), 0 14px 30px -18px rgba(36,31,26,.4); }
.carte h3 { font-size: 1.32rem; margin-bottom: .4rem; }
.carte p { font-size: .95rem; color: var(--encre-doux); margin-bottom: 1rem; }
.carte ul { margin: 0; padding-left: 1.05rem; font-size: .875rem; color: var(--encre-doux); }
.carte li { margin-bottom: .28rem; }
.carte .pied {
  margin-top: auto; padding-top: 16px;
  font-size: .82rem; font-weight: 600; color: var(--carte-accent, var(--accent));
}
.jeton {
  display: inline-block; align-self: flex-start;
  font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 100px; margin-bottom: 12px;
}
.jeton--ouvert   { background: var(--carte-accent, var(--accent)); color: #fff; }
.jeton--chantier { background: var(--fond-doux); color: var(--encre-doux); border: 1px solid var(--filet-fort); }

/* ---------- Frise des périodes ---------- */
.frise { display: grid; gap: 0; margin-top: 8px; }
.periode {
  display: grid; grid-template-columns: 128px 1fr; gap: 24px;
  padding: 22px 0; border-top: 1px solid var(--filet);
}
.periode:last-child { border-bottom: 1px solid var(--filet); }
.periode--phare { background: linear-gradient(90deg, var(--accent-clair), transparent 62%); }
.periode .quand { position: relative; }
.periode .quand .num {
  font-family: var(--serif); font-size: 1.55rem; font-weight: 600;
  color: var(--accent); line-height: 1;
}
.periode .quand .date { display: block; font-size: .82rem; color: var(--encre-doux); margin-top: 4px; }
.periode .quand .duree {
  display: inline-block; margin-top: 8px; font-size: .74rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--encre-doux);
  background: var(--fond-doux); border: 1px solid var(--filet); border-radius: 100px;
  padding: 2px 8px;
}
.periode .quoi h3 { font-size: 1.16rem; }
.periode .quoi p { margin-bottom: .5rem; font-size: .95rem; }
.periode .apport {
  font-size: .875rem; color: var(--encre-doux);
  border-left: 2px solid var(--filet-fort); padding-left: 14px; margin-top: 10px;
}
.periode .apport b { color: var(--encre); }
@media (max-width: 620px) {
  .periode { grid-template-columns: 1fr; gap: 8px; }
}

/* ---------- Tableaux ---------- */
.tableau-boite { overflow-x: auto; margin: 0 0 8px; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 520px; }
caption { text-align: left; font-size: .84rem; color: var(--encre-doux); padding-bottom: 8px; }
th {
  text-align: left; font-family: var(--sans); font-weight: 700;
  font-size: .74rem; letter-spacing: .09em; text-transform: uppercase;
  color: #fff; background: var(--accent);
  padding: 9px 12px; vertical-align: bottom;
}
td { padding: 10px 12px; vertical-align: top; border-bottom: 1px solid var(--filet); }
tbody tr:nth-child(even) td { background: #faf8f4; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: 2px solid var(--accent); }

/* ---------- Encadrés ---------- */
.encadre {
  background: var(--accent-clair);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--rayon) var(--rayon) 0;
  padding: 18px 22px; margin: 22px 0;
}
.encadre p:last-child { margin-bottom: 0; }
.encadre h4 { color: var(--accent); }
.note {
  font-size: .87rem; color: var(--encre-doux);
  border-top: 1px solid var(--filet); padding-top: 12px; margin-top: 20px;
}

/* ---------- Dépliants (supports) ---------- */
details.support {
  background: var(--fond-carte); border: 1px solid var(--filet);
  border-radius: var(--rayon); margin-bottom: 10px;
}
details.support[open] { border-color: var(--filet-fort); }
details.support > summary {
  cursor: pointer; list-style: none; padding: 14px 18px;
  display: flex; align-items: baseline; gap: 14px;
}
details.support > summary::-webkit-details-marker { display: none; }
details.support > summary::after {
  content: "+"; margin-left: auto; color: var(--accent);
  font-size: 1.2rem; line-height: 1;
}
details.support[open] > summary::after { content: "–"; }
details.support > summary .ref {
  font-family: var(--serif); font-weight: 600; color: var(--accent);
  min-width: 5.2em;
}
details.support > summary .quoi { font-weight: 600; }
details.support .corps { padding: 0 18px 18px; }
details.support .corps p { font-size: .95rem; }
details.support .corps p:last-child { margin-bottom: 0; }
.quand-support {
  display: inline-block; font-size: .72rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--encre-doux); background: var(--fond-doux);
  border: 1px solid var(--filet); border-radius: 100px; padding: 2px 9px;
  margin-left: 8px;
}

/* ---------- Boutons ---------- */
.bouton {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--accent); color: #fff; text-decoration: none;
  font-weight: 600; font-size: .93rem;
  padding: 11px 20px; border-radius: var(--rayon);
  border: 1px solid var(--accent);
  transition: filter .16s ease;
}
.bouton:hover { filter: brightness(1.12); }
.bouton--creux { background: transparent; color: var(--accent); }
.bouton--creux:hover { background: var(--accent-clair); filter: none; }
.boutons { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }

/* ---------- Liste des sources ---------- */
.sources { font-size: .9rem; }
.sources li { margin-bottom: .55rem; }
.sources .quoi { color: var(--encre-doux); }

/* ---------- Pied de page ---------- */
footer.pied {
  background: var(--fond-doux); border-top: 1px solid var(--filet);
  padding: 34px 0; font-size: .87rem; color: var(--encre-doux);
}
footer.pied a { color: var(--encre-doux); }
footer.pied .rangee { display: flex; gap: 26px; flex-wrap: wrap; align-items: baseline; }

/* ---------- Impression ---------- */
@media print {
  .barre, .boutons, footer.pied { display: none; }
  body { background: #fff; font-size: 11pt; }
  section { padding: 14pt 0; border: 0; page-break-inside: avoid; }
  details.support { border: 0; }
  details.support > summary::after { content: ""; }
  .carte { box-shadow: none; }
  a { color: inherit; text-decoration: none; }
}

/* thèmes ajoutés le 09/09/2026 */
[data-theme="explicite"]   { --accent: #8a3b2e; --accent-clair: #f7ebe8; }
[data-theme="ia"]          { --accent: #3b4a8a; --accent-clair: #eaedf7; }
