@font-face { font-family: "Ecole"; src: url("../fonts/schola-regular.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Ecole"; src: url("../fonts/schola-bold.woff") format("woff"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Ecole"; src: url("../fonts/schola-italic.woff") format("woff"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --fond: #f3f5f8;
  --papier: #ffffff;
  --encre: #1a2433;
  --gris: #4f5b68;
  --trait: #d3dae3;
  --seyes: #dde5ef;
  --bord: #707c89;
  --stylo: #1d4fa3;
  --stylo-fonce: #163d7f;
  --stylo-pale: #e8eef9;
  --marge: #c8352e;
  --jaune: #e9b910;
  --vert: #2f7a4d;
  --ok: #1f6b3a;
  --ok-fond: #e5f3e9;
  --erreur: #a3271b;
  --erreur-fond: #fbe7e4;
  --todo: #fff1b8;
  --corps: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ecole: "Ecole", "Century Schoolbook", "New Century Schoolbook", Georgia, serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body { margin: 0; background: var(--fond); color: var(--encre); font: 400 1rem/1.6 var(--corps); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--stylo); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--stylo-fonce); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--stylo); outline-offset: 2px; }
strong { font-weight: 650; }
[hidden] { display: none !important; }

.saut { position: absolute; left: 8px; top: -60px; z-index: 20; background: var(--encre); color: #fff; padding: 10px 14px; }
.saut:focus { top: 8px; color: #fff; }
.cadre { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 700px) { .cadre { padding: 0 32px; } }
.cadre > *, .une > *, .offre > *, .legal > * { min-width: 0; }

/* En tete : la double bande reprend les deux ceintures */
.entete { background: var(--papier); border-bottom: 1px solid var(--trait); position: relative; }
.entete::after { content: ""; position: absolute; left: 0; right: 0; bottom: -5px; height: 4px;
  background: linear-gradient(90deg, var(--jaune) 0 50%, var(--vert) 50% 100%); }
.entete .cadre { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 28px; padding-top: 14px; padding-bottom: 14px; }
.marque { display: inline-flex; align-items: center; gap: 10px; color: var(--encre); text-decoration: none; font: 700 1.4rem/1 var(--ecole); }
.marque:hover { color: var(--encre); }
.marque svg { width: 30px; height: 30px; flex: none; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 20px; }
.nav a { display: inline-block; padding: 8px 0; color: var(--encre); text-decoration: none; font-weight: 500; }
.nav a:hover { text-decoration: underline; }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.4em; }

main { display: block; padding: 48px 0 80px; }
h1, h2, h3, .question-texte { font-family: var(--ecole); font-weight: 700; line-height: 1.15; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); max-width: 20ch; letter-spacing: -0.005em; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.1rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; max-width: 66ch; }
.chapo { font-size: 1.15rem; color: var(--gris); max-width: 50ch; }
.bloc { margin-top: 80px; }
.mention { font-size: 0.92rem; color: var(--gris); }
.icone { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* Ceintures : un repère de couleur, toujours accompagné du nom */
.ceinture { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.ceinture::before { content: ""; width: 22px; height: 8px; border-radius: 1px; background: var(--c, var(--jaune)); box-shadow: inset 0 0 0 1px rgba(26, 36, 51, 0.25); }
.ceinture.verte { --c: var(--vert); }
.ceinture.jaune { --c: var(--jaune); }

.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 18px; border: 2px solid var(--stylo); border-radius: 4px;
  background: var(--stylo); color: #fff; font: 600 1rem/1.2 var(--corps); text-decoration: none; cursor: pointer;
}
.bouton:hover { background: var(--stylo-fonce); border-color: var(--stylo-fonce); color: #fff; }
.bouton.second { background: var(--papier); color: var(--stylo); }
.bouton.second:hover { background: var(--stylo-pale); color: var(--stylo-fonce); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.actions.marge-haut { margin-top: 24px; }

/* Accueil */
.une { display: grid; gap: 40px; align-items: center; }
@media (min-width: 940px) { .une { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 64px; } }
.departs { display: grid; gap: 12px; margin: 28px 0 14px; max-width: 460px; }
.depart {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 12px;
  padding: 16px 18px; background: var(--papier); border: 1px solid var(--trait); border-left: 8px solid var(--c);
  border-radius: 4px; color: var(--encre); text-align: left; font: inherit; cursor: pointer; width: 100%;
}
.depart:hover { border-color: var(--bord); border-left-color: var(--c); }
.depart strong { font-family: var(--ecole); font-size: 1.2rem; }
.depart small { grid-column: 1; color: var(--gris); font-size: 0.92rem; }
.depart .icone { grid-row: 1 / span 2; grid-column: 2; color: var(--stylo); }
.depart.jaune { --c: var(--jaune); }
.depart.verte { --c: var(--vert); }

/* La copie d'examen : lignes Seyès et marge rouge. Seul élément décoratif du site */
.copie {
  position: relative; background-color: var(--papier);
  background-image:
    linear-gradient(90deg, transparent 47px, var(--marge) 47px, var(--marge) 49px, transparent 49px),
    repeating-linear-gradient(180deg, transparent 0 31px, var(--seyes) 31px 32px);
  border: 1px solid var(--trait); border-radius: 3px;
  padding: 24px 22px 26px 68px;
  box-shadow: 0 1px 0 var(--trait), 0 8px 0 -4px var(--papier), 0 8px 0 -3px var(--trait);
}
@media (max-width: 520px) {
  .copie { padding-left: 46px; background-image:
    linear-gradient(90deg, transparent 29px, var(--marge) 29px, var(--marge) 31px, transparent 31px),
    repeating-linear-gradient(180deg, transparent 0 31px, var(--seyes) 31px 32px); }
}
.copie .entete-copie { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; color: var(--gris); font-size: 0.92rem; margin-bottom: 14px; }
.question-texte { font-size: clamp(1.35rem, 3vw, 1.7rem); line-height: 1.3; max-width: 34ch; margin-bottom: 18px; }
.copie ol.apercu { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.copie ol.apercu li { background: var(--papier); border: 1.5px solid var(--trait); border-radius: 4px; padding: 10px 14px; }

.note-marge {
  position: absolute; left: 6px; top: 18px; width: 40px; text-align: center;
  font: italic 400 1.05rem/1 var(--ecole); color: var(--marge);
}
@media (max-width: 520px) { .note-marge { left: 0; width: 30px; font-size: 0.9rem; } }

/* QCM */
.zone { max-width: 780px; }
.choix-groupe { border: 0; padding: 0; margin: 0 0 20px; min-width: 0; }
.choix-groupe legend { padding: 0; }
.reglages { display: grid; gap: 0 24px; }
@media (min-width: 760px) { .reglages { grid-template-columns: 1fr 1fr; } }
.reglages legend { font: 700 1.2rem/1.2 var(--ecole); margin-bottom: 12px; }
.option {
  display: flex; gap: 12px; align-items: flex-start; background: var(--papier);
  border: 1.5px solid var(--trait); border-radius: 4px; padding: 13px 16px; margin-bottom: 10px; cursor: pointer;
}
.option:hover { border-color: var(--bord); }
.option input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--stylo); }
.option:has(input:checked) { border-color: var(--stylo); box-shadow: inset 0 0 0 1px var(--stylo); background: var(--stylo-pale); }
.option:has(input:focus-visible) { outline: 3px solid var(--stylo); outline-offset: 2px; }
.option small { display: block; color: var(--gris); font-size: 0.9rem; }
.option.juste, .option.juste:has(input:checked) { border-color: var(--ok); background: var(--ok-fond); box-shadow: inset 0 0 0 1px var(--ok); }
.option.faux, .option.faux:has(input:checked) { border-color: var(--erreur); background: var(--erreur-fond); box-shadow: inset 0 0 0 1px var(--erreur); }
.option:has(input:disabled) { cursor: default; }
.option .verdict { display: block; margin-top: 4px; font-size: 0.9rem; font-weight: 700; color: var(--gris); }
.option.juste .verdict { color: var(--ok); }
.option.faux .verdict { color: var(--erreur); }
.progression { height: 6px; background: var(--trait); border-radius: 2px; overflow: hidden; margin: 0 0 22px; }
.progression span { display: block; height: 100%; width: 0; background: var(--stylo); }
.msg { color: var(--erreur); font-weight: 600; margin: 0 0 12px; }
.msg:empty { display: none; }
.correction { background: var(--papier); border: 1px solid var(--trait); border-left: 5px solid var(--stylo); padding: 16px 18px; margin: 0 0 20px; }
.correction.ok { border-left-color: var(--ok); }
.correction.ko { border-left-color: var(--erreur); }
.correction h3 { font: 700 1.05rem/1.3 var(--corps); margin: 0 0 6px; }
.correction p { margin: 0; }

/* Copie corrigée : la note est écrite à l'encre rouge, comme sur une vraie copie */
.note {
  font: italic 400 clamp(3rem, 9vw, 4.4rem)/1 var(--ecole); color: var(--marge);
  margin: 0 0 6px; max-width: none;
}
.note small { font-size: 0.5em; }
.themes { width: 100%; border-collapse: collapse; margin: 16px 0 0; font-variant-numeric: tabular-nums; }
.themes th, .themes td { text-align: left; padding: 8px 0; border-bottom: 1px solid var(--trait); }
.themes th { color: var(--gris); font-weight: 500; }
.themes td:last-child, .themes th:last-child { text-align: right; }
.themes .a-revoir { color: var(--marge); font-weight: 600; }
.revue article { background: var(--papier); border: 1px solid var(--trait); padding: 16px 18px; margin-bottom: 12px; }
.revue h3 { font: 600 1.05rem/1.4 var(--corps); }
.revue p { margin: 6px 0 0; }
.revue .bonne { font-weight: 650; color: var(--ok); }

/* Offre et programme */
.offre { display: grid; gap: 32px; align-items: start; }
@media (min-width: 900px) { .offre { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 56px; } }
.achat { background: var(--papier); border: 1px solid var(--trait); border-top: 4px solid var(--stylo); border-radius: 3px; padding: 24px; }
.prix { font: 700 2.6rem/1 var(--ecole); margin: 0 0 6px; }
.liste-coche { list-style: none; padding: 0; margin: 16px 0 20px; }
.liste-coche li { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px; }
.liste-coche .icone { width: 20px; height: 20px; color: var(--stylo); margin-top: 2px; }
.programme { display: grid; gap: 20px; }
@media (min-width: 760px) { .programme { grid-template-columns: 1fr 1fr; } }
.programme article { background: var(--papier); border: 1px solid var(--trait); border-top: 6px solid var(--c); padding: 20px 22px; }
.programme .jaune { --c: var(--jaune); }
.programme .verte { --c: var(--vert); }
.programme table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.programme td { padding: 7px 0; border-bottom: 1px solid var(--trait); }
.programme td:last-child { text-align: right; color: var(--gris); }
.faq dt { font-weight: 700; margin-top: 18px; }
.faq dd { margin: 4px 0 0; max-width: 66ch; }

/* Pages légales */
.legal { display: grid; gap: 32px; }
@media (min-width: 1000px) { .legal { grid-template-columns: 220px minmax(0, 1fr); gap: 56px; } }
.sommaire { font-size: 0.95rem; }
.sommaire h2 { font: 700 0.95rem/1.3 var(--corps); margin: 0 0 8px; }
.sommaire ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--trait); }
.sommaire a { display: block; padding: 5px 0 5px 14px; color: var(--encre); text-decoration: none; }
.sommaire a:hover { text-decoration: underline; }
@media (min-width: 1000px) { .sommaire > div { position: sticky; top: 16px; } }
@media (max-width: 999px) { .sommaire { background: var(--papier); border: 1px solid var(--trait); padding: 16px; } }
.prose { max-width: 70ch; }
.prose h2 { font-size: 1.45rem; margin-top: 44px; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: 6px; }
.maj { color: var(--gris); font-size: 0.95rem; }
.todo { background: var(--todo); outline: 1px dashed #8a6d00; padding: 0 3px; }

.pied { background: var(--papier); border-top: 1px solid var(--trait); padding: 40px 0; font-size: 0.95rem; }
.pied .cadre { display: grid; gap: 24px; }
@media (min-width: 900px) { .pied .cadre { grid-template-columns: 1.2fr 1fr 1fr; } }
.pied p { margin: 0; color: var(--gris); max-width: 40ch; }
.pied h2 { font: 700 0.95rem/1.3 var(--corps); margin: 0 0 8px; }
.pied ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pied a { color: var(--encre); }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
@media print { .entete, .pied, .actions, .departs { display: none !important; } body { background: #fff; } }
[data-espace="12"] { margin-top: 12px; }
[data-espace="16"] { margin-top: 16px; }
.programme caption { caption-side: bottom; text-align: left; padding-top: 10px; }
.offre ol { padding-left: 1.3em; margin: 0; }
.offre ol li { margin-bottom: 8px; }
.copie .question-texte { font-weight: 400; }
.themes th:last-child { white-space: nowrap; }

/* ---------- Guide */
.texte p, .texte li, .texte dd { font-family: var(--ecole); font-size: 1.08rem; line-height: 1.72; }
.texte .chapo { font-family: var(--corps); font-size: 1.15rem; line-height: 1.6; }
.texte section { margin-top: 8px; }
.texte h2 { scroll-margin-top: 16px; }
.texte cite { font-style: italic; }
.texte ol, .texte ul { padding-left: 1.3em; }
.texte li { margin-bottom: 8px; }
.texte .colonnes { columns: 2; column-gap: 32px; }
@media (max-width: 520px) { .texte .colonnes { columns: 1; } }
.sommaire .retour { margin: 14px 0 0; padding-left: 14px; font-size: 0.95rem; }

/* Frise : l'année est écrite dans la marge rouge, comme sur une copie */
.frise { list-style: none; padding: 0 !important; margin: 0 0 8px; }
.frise li { display: grid; grid-template-columns: 76px 1fr; gap: 0 20px; margin: 0; padding: 12px 0; position: relative; }
.frise li::before { content: ""; position: absolute; left: 86px; top: 0; bottom: 0; width: 2px; background: var(--marge); }
.frise .annee { font: italic 400 1.35rem/1.2 var(--ecole); color: var(--marge); text-align: right; }
.frise .annee small { display: block; font-size: 0.72em; }
.frise li > div { padding-left: 12px; font-family: var(--ecole); font-size: 1.08rem; line-height: 1.7; }
@media (max-width: 520px) {
  .frise li { grid-template-columns: 58px 1fr; gap: 0 14px; }
  .frise li::before { left: 65px; }
  .frise .annee { font-size: 1.15rem; }
}

/* Échelle des ceintures */
.echelle { list-style: none; padding: 0 !important; margin: 20px 0 0; display: grid; gap: 12px; }
.echelle li { display: grid; grid-template-columns: 64px 1fr; gap: 16px; align-items: start; margin: 0;
  background: var(--papier); border: 1px solid var(--trait); border-radius: 4px; padding: 16px 18px; }
.echelle h3 { margin: 0 0 2px; font-size: 1.25rem; }
.echelle .role { font-family: var(--corps) !important; font-size: 0.95rem !important; color: var(--gris); margin: 0 0 6px; font-weight: 600; }
.echelle p { margin: 0; }
.noeud { position: relative; display: block; height: 14px; margin-top: 8px; border-radius: 2px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(26, 36, 51, 0.35); }
.noeud::after { content: ""; position: absolute; left: 50%; top: -5px; width: 14px; height: 24px; margin-left: -7px; border-radius: 3px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(26, 36, 51, 0.35); }
.echelle .blanche { --c: #ffffff; }
.echelle .jaune { --c: var(--jaune); }
.echelle .verte { --c: var(--vert); }
.echelle .noire { --c: var(--encre); }
.echelle .maitre { --c: var(--encre); }
.echelle .maitre .noeud { box-shadow: inset 0 -4px 0 var(--marge); }
.echelle .maitre .noeud::after { box-shadow: inset 0 -4px 0 var(--marge); }

/* Définitions */
.definitions { margin: 0; }
.definitions dt { font-family: var(--corps); font-weight: 700; margin-top: 16px; }
.definitions dd { margin: 4px 0 0; }
.glossaire dt { font-family: var(--ecole); font-size: 1.15rem; scroll-margin-top: 16px; }

/* Tableaux */
.tableau-cadre { margin: 12px 0 8px; }
.tableau { width: 100%; border-collapse: collapse; background: var(--papier); border: 1px solid var(--trait); font-size: 0.97rem; }
.tableau caption { caption-side: bottom; text-align: left; padding: 10px 0 0; color: var(--gris); font-size: 0.9rem; }
.tableau th, .tableau td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--trait); font-family: var(--corps); line-height: 1.5; }
.tableau thead th { background: var(--stylo-pale); font-weight: 700; }
.tableau tbody th { font-weight: 650; }
.tableau td { font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .tableau.empile thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tableau.empile tr { display: block; border-bottom: 2px solid var(--trait); padding: 6px 0; }
  .tableau.empile th, .tableau.empile td { display: block; border: 0; padding: 4px 12px; }
  .tableau.empile tbody th { font-size: 1.02rem; padding-top: 8px; }
  .tableau.empile td::before { content: attr(data-label); display: block; font-size: 0.85rem; font-weight: 700; color: var(--gris); }
}

.testez { margin: 48px 0 0; }
.testez h2 { margin-top: 0 !important; font-size: 1.35rem; }
.testez p { font-family: var(--corps) !important; }
.sources { margin-top: 40px; }
.sources h2 { font-size: 1.2rem; }
.sources li { font-family: var(--corps) !important; font-size: 0.95rem !important; line-height: 1.5 !important; margin-bottom: 6px; }
.suite { margin-top: 32px; }

/* Sommaire du guide (accueil et page Comprendre) */
.guide-tete { margin-bottom: 28px; }
.sommaire-guide { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; counter-reset: guide; }
@media (min-width: 760px) { .sommaire-guide { grid-template-columns: 1fr 1fr; } }
.sommaire-guide li { counter-increment: guide; }
.sommaire-guide a { display: grid; grid-template-columns: 34px 24px 1fr; align-items: start; gap: 12px; height: 100%;
  padding: 16px 18px; background: var(--papier); border: 1px solid var(--trait); border-radius: 4px; color: var(--encre); text-decoration: none; }
.sommaire-guide a::before { content: counter(guide); font: italic 400 1.4rem/1 var(--ecole); color: var(--marge); text-align: right; }
.sommaire-guide a:hover { border-color: var(--bord); }
.sommaire-guide a:hover strong { text-decoration: underline; }
.sommaire-guide .icone { color: var(--stylo); margin-top: 2px; }
.sommaire-guide strong { display: block; font-family: var(--ecole); font-size: 1.15rem; }
.sommaire-guide small { display: block; color: var(--gris); font-size: 0.93rem; margin-top: 2px; }
@media (min-width: 900px) { .pied .cadre { grid-template-columns: 1.3fr 1fr 1fr 1fr; } }

/* ---------- SEO : fil d'Ariane et pages QCM par niveau */
.fil { margin: -24px 0 24px; font-size: 0.92rem; color: var(--gris); }
.fil ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 0; }
.fil li + li::before { content: "/"; margin: 0 8px; color: var(--bord); }
.fil a { color: var(--gris); }
.fil [aria-current] { color: var(--encre); }
.zone-niveau { max-width: 820px; }
.zone-niveau .actions { margin-top: 8px; }
.lien-niveau { margin: 12px 0 0; font-weight: 600; }
.exemples { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 16px; counter-reset: ex; }
.exemple { background: var(--papier); border: 1px solid var(--trait); border-left: 4px solid var(--marge); border-radius: 3px; padding: 18px 20px; counter-increment: ex; }
.exemple-theme { margin: 0 0 4px; color: var(--gris); font-size: 0.9rem; }
.exemple-theme::before { content: "Q" counter(ex) ", "; font: italic 400 1rem/1 var(--ecole); color: var(--marge); }
.exemple h3 { font-family: var(--ecole); font-size: 1.2rem; line-height: 1.35; margin: 0 0 12px; }
.choix-exemple { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.choix-exemple li { display: flex; gap: 10px; align-items: baseline; }
.choix-exemple .lettre { flex: none; width: 1.7em; height: 1.7em; display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--bord); border-radius: 3px; font-weight: 700; font-size: 0.85rem; }
.exemple details { border-top: 1px solid var(--trait); padding-top: 10px; }
.exemple summary { cursor: pointer; font-weight: 650; color: var(--stylo); }
.exemple summary:hover { text-decoration: underline; }
.exemple details p { margin: 8px 0 0; }
.espace-haut { margin-top: 12px; }
.acces-niveau { background: var(--papier); border: 1px solid var(--trait); border-top: 4px solid var(--stylo); padding: 20px 22px; }
@media (min-width: 1000px) { .pied .cadre { grid-template-columns: 1.4fr repeat(4, 1fr); gap: 28px; } }
