/* classement-esc.com — feuille de style unique */

:root {
  /* Charte : bleu marine #0B2D4A, or #F4B942, gris clair #ESE7EB, charbon #1F2937 */
  --papier: #f5f6f8;
  --surface: #ffffff;
  --encre: #0b2d4a;
  --encre-2: #4b5b6e;
  --trait: #cfd6df;
  --trait-doux: #e6eaf0;
  --cobalt: #0b2d4a;
  --cobalt-voile: #e3eaf2;
  --or: #f4b942;
  --etendue: #d5dfea;
  --sous: #fdf5e2;
  --titres: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --texte: "Inter", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --papier: #151c27;
    --surface: #1f2937;
    --encre: #eef2f7;
    --encre-2: #a9b5c4;
    --trait: #3a4758;
    --trait-doux: #2a3444;
    --cobalt: #9cc6f0;
    --cobalt-voile: #22344a;
    --etendue: #2c3d52;
    --sous: #2d2719;
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  background: var(--papier);
  color: var(--encre);
  font: 400 1.0625rem/1.65 var(--texte);
  font-optical-sizing: auto;
}

a { color: var(--cobalt); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:not(.logo):not(.menu a):hover { text-decoration-color: var(--or); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 2px; border-radius: 2px; }

.evitement {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--encre); color: var(--papier); padding: 0.5rem 0.9rem; font-family: var(--titres);
}
.evitement:focus { top: 1rem; }

/* ---------- En-tête ---------- */

.entete { border-bottom: 1px solid var(--trait); background: var(--surface); }
.entete-in {
  max-width: 72rem; margin: 0 auto; padding: 0.75rem 1rem;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem;
}
.logo { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--encre); text-decoration: none; }
.logo .mark { width: 2.1rem; height: 2.1rem; flex: none; }
.logo .mark .b { fill: var(--encre); }
.logo .mark .o { fill: var(--or); }
.logo .mot { font: 800 1.12rem/1 var(--titres); letter-spacing: -0.02em; white-space: nowrap; }
.logo .pt { color: var(--or); }
.logo .tld { font-weight: 400; }
.logo:focus-visible { border-radius: 4px; }
.menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; font: 500 0.98rem/1.2 var(--titres); }
.menu a { color: var(--encre-2); text-decoration: none; padding: 0.35rem 0; border-bottom: 2px solid transparent; }
.menu a:hover { color: var(--encre); }
.menu a[aria-current] { color: var(--encre); border-bottom-color: var(--or); }

/* ---------- Page ---------- */

main { padding: 0 1rem; }
.page { max-width: 72rem; margin: 0 auto; padding: 2rem 0 4rem; }
.tete, .corps { max-width: 44rem; }
.page.avec-sommaire { display: grid; grid-template-columns: minmax(0, 44rem) 14rem; column-gap: 4rem; align-items: start; }
.page.avec-sommaire .tete { grid-column: 1; }
.page.avec-sommaire .sommaire { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: 1.5rem; margin-top: 3.5rem; }
.page.avec-sommaire .corps { grid-column: 1; }

.ariane ol { list-style: none; margin: 0 0 1.25rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem; font: 500 0.88rem/1.4 var(--titres); color: var(--encre-2); }
.ariane li + li::before { content: "/"; margin-right: 0.3rem; color: var(--trait); }
.ariane a { color: var(--encre-2); }

h1, h2, h3, h4 { font-family: var(--titres); color: var(--encre); line-height: 1.15; letter-spacing: -0.02em; }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.1rem); font-weight: 800; margin: 0 0 1rem; text-wrap: balance; }
h2 { font-size: 1.55rem; font-weight: 700; margin: 2.75rem 0 0.8rem; scroll-margin-top: 1rem; }
h3 { font-size: 1.2rem; font-weight: 700; margin: 2rem 0 0.5rem; }
.chapo { font-size: 1.25rem; line-height: 1.5; color: var(--encre-2); margin: 0 0 1rem; }
.maj { font: 500 0.88rem/1.4 var(--titres); color: var(--encre-2); margin: 0 0 1.5rem; }
p, ul, ol { margin: 0 0 1.1rem; }
li { margin-bottom: 0.35rem; }
li::marker { color: var(--encre-2); }
strong { font-weight: 600; }

.callout {
  margin: 1.75rem 0; padding: 1rem 1.25rem;
  background: var(--cobalt-voile); border-left: 4px solid var(--cobalt); border-radius: 0 6px 6px 0;
}
.callout p:last-child { margin-bottom: 0; }

.sommaire { font: 500 0.92rem/1.4 var(--titres); }
.sommaire p { margin: 0 0 0.5rem; color: var(--encre-2); font-weight: 700; }
.sommaire ol { list-style: none; margin: 0; padding: 0 0 0 0.9rem; border-left: 2px solid var(--trait); }
.sommaire li { margin: 0 0 0.45rem; }
.sommaire a { color: var(--encre); text-decoration: none; }
.sommaire a:hover { color: var(--cobalt); text-decoration: underline; }

/* ---------- Tableaux ---------- */

.table-wrap { overflow-x: auto; margin: 1.25rem 0 1.5rem; border: 1px solid var(--trait); border-radius: 8px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font: 400 0.95rem/1.35 var(--titres); font-variant-numeric: tabular-nums; }
th, td { padding: 0.55rem 0.75rem; text-align: left; border-bottom: 1px solid var(--trait-doux); vertical-align: top; }
thead th { font-weight: 700; font-size: 0.86rem; color: var(--encre-2); background: var(--papier); border-bottom: 1px solid var(--trait); white-space: nowrap; }
tbody th { font-weight: 600; }
.triable tbody th { white-space: nowrap; }
tbody tr:last-child > * { border-bottom: 0; }
tbody tr:hover > * { background: var(--cobalt-voile); }
tr.sous > * { background: var(--sous); }
.ea { text-decoration: none; color: var(--encre-2); margin-left: 0.1em; }
.nc { color: var(--encre-2); }
.note-table { font: 400 0.9rem/1.5 var(--titres); color: var(--encre-2); }

th[data-tri] { padding: 0; }
th[data-tri] button {
  all: unset; box-sizing: border-box; display: block; width: 100%; padding: 0.55rem 0.75rem; cursor: pointer;
}
th[data-tri] button:focus-visible { outline: 3px solid var(--cobalt); outline-offset: -3px; }
th[data-tri] button::after { content: ""; display: inline-block; width: 0.9em; margin-left: 0.25em; }
th[aria-sort="ascending"] button::after { content: "▲"; font-size: 0.7em; }
th[aria-sort="descending"] button::after { content: "▼"; font-size: 0.7em; }

/* ---------- Bande de dispersion : l'élément signature ---------- */

.dispersion { margin: 0.5rem 0 1.5rem; padding: 1.25rem 1rem 0.75rem; background: var(--surface); border: 1px solid var(--trait); border-radius: 10px; }
.dispersion ol { list-style: none; margin: 0; padding: 0; }
.dispersion li { display: grid; grid-template-columns: 1.9rem 8.5rem minmax(0, 1fr); align-items: center; column-gap: 0.75rem; margin: 0; }
.dispersion li { min-height: 1.85rem; border-radius: 4px; }
.dispersion li:hover { background: var(--cobalt-voile); }
.dispersion .rs { font: 700 0.85rem/1 var(--titres); color: var(--encre-2); text-align: right; font-variant-numeric: tabular-nums; }
.dispersion .nom { font: 600 0.95rem/1.2 var(--titres); color: var(--encre); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dispersion .nom:hover { color: var(--cobalt); text-decoration: underline; }
.axe { display: flex; justify-content: space-between; font: 500 0.78rem/1 var(--titres); color: var(--encre-2); }
.dispersion .axe { margin: 0 0 0.35rem; padding: 0 0.4rem 0 calc(1.9rem + 8.5rem + 1.5rem + 0.4rem); }

.bande {
  position: relative; display: block; height: 1.25rem; margin: 0 0.4rem;
  background:
    linear-gradient(var(--trait), var(--trait)) center / 100% 1px no-repeat,
    linear-gradient(to right, var(--trait-doux) 1px, transparent 1px) 0 0 / calc(100% / 22 * 5) 100% repeat-x;
}
.bande .etendue {
  position: absolute; top: 50%; height: 0.5rem; transform: translateY(-50%);
  left: var(--a); width: calc(var(--b) - var(--a)); min-width: 2px;
  background: var(--etendue); border-radius: 999px;
}
.m { position: absolute; top: 50%; left: var(--x); width: 2px; height: 0.8rem; transform: translate(-50%, -50%); background: var(--encre-2); border-radius: 1px; }
.m-sigem { width: 0.6rem; height: 0.6rem; background: var(--cobalt); border-radius: 1px; transform: translate(-50%, -50%) rotate(45deg); z-index: 2; }
.med { position: absolute; top: 50%; left: var(--x); width: 0.8rem; height: 0.8rem; transform: translate(-50%, -50%); border: 2px solid var(--encre); border-radius: 50%; background: transparent; z-index: 3; }

.legende { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; margin: 0.9rem 0 0.25rem; font: 500 0.82rem/1.3 var(--titres); color: var(--encre-2); }
.cle { display: inline-flex; align-items: center; gap: 0.5rem; }
.cle .m, .cle .med { position: relative; top: auto; left: auto; transform: none; display: inline-block; flex: none; }
.cle .m-sigem { transform: rotate(45deg); }
.cle .m-autre { height: 0.8rem; }

.bande-ecole { margin: 1.5rem 0; padding: 1.25rem 1rem 0.75rem; background: var(--surface); border: 1px solid var(--trait); border-radius: 10px; }
.bande-ecole .axe { margin: 0.4rem 0.4rem 0; }
.fiche td:last-child { white-space: nowrap; }
.bande-large { height: 2.25rem; }
.bande-large .etendue { height: 0.8rem; }
.bande-large .m { height: 1.3rem; width: 3px; }
.bande-large .m-sigem { width: 0.85rem; height: 0.85rem; }
.bande-large .med { width: 1.1rem; height: 1.1rem; }

/* ---------- Listes ---------- */

.guides { list-style: none; margin: 1rem 0 2rem; padding: 0; border-top: 1px solid var(--trait); }
.guides li { margin: 0; border-bottom: 1px solid var(--trait); }
.guides a { display: block; padding: 1rem 0.25rem; text-decoration: none; }
.guides .t { display: block; font: 700 1.12rem/1.3 var(--titres); color: var(--encre); letter-spacing: -0.01em; }
.guides .d { display: block; margin-top: 0.25rem; color: var(--encre-2); font-size: 0.98rem; line-height: 1.5; }
.guides a:hover .t { color: var(--cobalt); text-decoration: underline; }

.filtre-ecoles { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin: 0.5rem 0 1rem; font: 500 0.92rem/1 var(--titres); color: var(--encre-2); }
.filtre-ecoles [role="group"] { display: inline-flex; border: 1px solid var(--trait); border-radius: 999px; overflow: hidden; background: var(--surface); }
.filtre-ecoles button { font: 600 0.9rem/1 var(--titres); color: var(--encre); background: none; border: 0; padding: 0.55rem 0.95rem; cursor: pointer; }
.filtre-ecoles button + button { border-left: 1px solid var(--trait); }
.filtre-ecoles button[aria-pressed="true"] { background: var(--encre); color: var(--papier); }

.ecoles { list-style: none; margin: 0 0 1.5rem; padding: 0; border-top: 1px solid var(--trait); }
.ecoles li { margin: 0; border-bottom: 1px solid var(--trait); }
.ecoles li[hidden] { display: none; }
.ecoles a { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "nom sig" "info sig"; column-gap: 1rem; padding: 0.75rem 0.25rem; text-decoration: none; }
.ecoles .nom { grid-area: nom; font: 700 1.05rem/1.3 var(--titres); color: var(--encre); }
.ecoles .info { grid-area: info; font: 400 0.9rem/1.4 var(--titres); color: var(--encre-2); }
.ecoles .sig { grid-area: sig; align-self: center; font: 700 0.85rem/1 var(--titres); color: var(--cobalt); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ecoles a:hover .nom { color: var(--cobalt); text-decoration: underline; }

.voisins { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 2.5rem 0 0; }
.voisins a { display: block; padding: 0.85rem 1rem; border: 1px solid var(--trait); border-radius: 8px; background: var(--surface); text-decoration: none; font: 700 1rem/1.3 var(--titres); color: var(--encre); }
.voisins a[rel="next"] { text-align: right; }
.voisins a span { display: block; font-weight: 500; font-size: 0.82rem; color: var(--encre-2); margin-bottom: 0.2rem; }
.voisins a:hover { border-color: var(--cobalt); }

/* ---------- Accueil ---------- */

.accueil .page { padding-top: 2.5rem; }
.accueil .tete, .accueil .corps { max-width: 52rem; }
.accueil h1 { font-size: clamp(2.2rem, 1.4rem + 3.6vw, 3.8rem); max-width: 18ch; }
.accueil .chapo { max-width: 38rem; }

/* ---------- Pied ---------- */

.pied { border-top: 1px solid var(--trait); background: var(--surface); }
.pied-in { max-width: 72rem; margin: 0 auto; padding: 1.75rem 1rem 2.5rem; font: 400 0.92rem/1.55 var(--titres); color: var(--encre-2); }
.pied-in p { max-width: 44rem; }
.pied-in ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; }
.pied-in a { color: var(--encre); }
.pied-consent { font: inherit; color: var(--encre); background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; }

/* ---------- Écrans étroits ---------- */

@media (max-width: 62rem) {
  .page.avec-sommaire { display: block; }
  .page.avec-sommaire .sommaire { position: static; margin: 0 0 1.5rem; padding: 1rem; background: var(--surface); border: 1px solid var(--trait); border-radius: 8px; }
}
@media (max-width: 34rem) {
  body { font-size: 1rem; }
  .dispersion { padding: 1rem 0.5rem 0.5rem; }
  .dispersion li { grid-template-columns: 1.4rem 5.6rem minmax(0, 1fr); column-gap: 0.4rem; }
  .dispersion .axe { padding: 0 0.3rem 0 calc(1.4rem + 5.6rem + 0.8rem + 0.3rem); }
  .dispersion .nom { font-size: 0.85rem; }
  .bande { margin: 0 0.3rem; }
  .voisins { grid-template-columns: 1fr; }
  .voisins a[rel="next"] { text-align: left; }
  h2 { font-size: 1.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* ---------- Historique ---------- */

.matrice { width: auto; min-width: 100%; font-size: 0.88rem; }
.matrice th, .matrice td { padding: 0.35rem 0.5rem; white-space: nowrap; }
.matrice td { text-align: center; }
.matrice thead th { text-align: center; vertical-align: bottom; }
.matrice thead th:first-child { text-align: left; }
.matrice thead a { color: var(--encre); }
.matrice .sous-titre { display: block; font-weight: 400; font-size: 0.75rem; color: var(--encre-2); }
.matrice th[scope="row"], .matrice thead th:first-child {
  position: sticky; left: 0; z-index: 1; background: var(--surface); border-right: 1px solid var(--trait-doux);
}
.matrice thead th:first-child { background: var(--papier); }
.matrice tr.groupe th {
  position: static; text-align: left; background: var(--papier); color: var(--encre-2);
  font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding-top: 0.6rem;
}
.matrice tbody tr:hover > th[scope="row"] { background: var(--cobalt-voile); }
.devenu { color: var(--encre-2); font-weight: 400; font-size: 0.85em; }

.edition { margin: 0 0 1.4rem; }
.edition h3 { margin-bottom: 0.3rem; scroll-margin-top: 1rem; }
.edition p { margin: 0 0 0.35rem; }
.edition .source { font: 400 0.92rem/1.5 var(--titres); color: var(--encre-2); }
.edition:target h3 { color: var(--cobalt); }

.historique-ecole td { font-size: 0.9rem; }
.historique-ecole th[scope="row"] { white-space: nowrap; }
.serie { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.2rem 0.9rem; }
.serie li { margin: 0; white-space: nowrap; }
.serie a { color: var(--encre-2); }
.ancien { margin: 0.5rem 0 0.15rem; font-size: 0.85rem; color: var(--encre-2); font-style: italic; }
.ancien:first-child { margin-top: 0; }
.page.historique { display: block; }
.page.historique .sommaire { position: static; margin: 0 0 1.5rem; max-width: 44rem; }
.page.historique .corps { max-width: none; }
.page.historique .corps > :not(.table-wrap):not(.note-table) { max-width: 44rem; }

/* ---------- Graphiques d'évolution ---------- */

.graphe { margin: 1.25rem 0 1.75rem; padding: 1rem 1rem 0.75rem; background: var(--surface); border: 1px solid var(--trait); border-radius: 8px; }
.graphe-titre { margin: 0 0 0.5rem; font: 700 0.98rem/1.3 var(--titres); color: var(--encre); }
.graphe-svg { display: block; width: 100%; height: auto; overflow: visible; }
.graphe-svg .grille { stroke: var(--trait-doux); stroke-width: 1; }
.graphe-svg .axe-y, .graphe-svg .axe-x { font: 500 11px var(--titres); fill: var(--encre-2); }
.graphe-svg .axe-y { text-anchor: end; }
.graphe-svg .axe-x { text-anchor: middle; }
.graphe-svg .trace { fill: none; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.graphe-svg .point { stroke: var(--surface); stroke-width: 1.2; }
.graphe-svg .etiquette { font: 700 11px var(--titres); }
.graphe figcaption { margin-top: 0.6rem; font: 400 0.84rem/1.45 var(--titres); color: var(--encre-2); }
.graphe .legende-graphe { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; }
.graphe .cle { display: inline-flex; align-items: center; gap: 0.35rem; white-space: nowrap; }
.graphe .trait { display: inline-block; width: 1.1rem; height: 3px; border-radius: 2px; }
.graphe .note-graphe { display: block; margin-top: 0.4rem; }

/* ---------- Barres et points par école ---------- */

.barres { margin: 1.25rem 0 1.75rem; padding: 1rem; background: var(--surface); border: 1px solid var(--trait); border-radius: 8px; }
.barres ol { list-style: none; margin: 0; padding: 0; }
.barres li { display: grid; grid-template-columns: minmax(7rem, 12rem) minmax(0, 1fr) 4.2rem; gap: 0.6rem; align-items: center; padding: 0.22rem 0; font: 500 0.9rem/1.2 var(--titres); }
.barres .lib { color: var(--encre); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barres a.lib:hover { text-decoration: underline; text-decoration-color: var(--or); }
.barres .piste { position: relative; height: 0.85rem; background: var(--trait-doux); border-radius: 3px; }
.barres .seg { position: absolute; left: 0; width: var(--w); top: 0; bottom: 0; background: var(--c); border-radius: 3px; }
.barres .seg.haut { top: 0; bottom: 50%; }
.barres .seg.bas { top: 50%; bottom: 0; }
.barres .val { color: var(--encre-2); text-align: right; font-variant-numeric: tabular-nums; }
.barres.large li { grid-template-columns: minmax(7rem, 12rem) minmax(0, 1fr) 6.5rem; }
.barres .axe { display: flex; justify-content: space-between; margin: 0 0 0.3rem 12.6rem; font: 500 0.78rem var(--titres); color: var(--encre-2); }
.points-rangs .piste { height: 1rem; background: linear-gradient(var(--trait), var(--trait)) center / 100% 1px no-repeat var(--surface); }
.points-rangs .pt-rang { position: absolute; top: 50%; left: var(--x); width: 0.75rem; height: 0.75rem; transform: translate(-50%, -50%); border-radius: 50%; background: var(--c); border: 2px solid var(--surface); }
.points-rangs .axe { margin-left: 12.6rem; }
.barres figcaption { margin-top: 0.6rem; font: 400 0.84rem/1.45 var(--titres); color: var(--encre-2); }
.barres .cle { display: inline-flex; align-items: center; gap: 0.35rem; margin-right: 0.9rem; }
.barres .rond { width: 0.7rem; height: 0.7rem; border-radius: 50%; display: inline-block; }
.barres .legende-graphe { display: flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; }
.barres .note-graphe { display: block; margin-top: 0.35rem; }
@media (max-width: 600px) {
  .barres li { grid-template-columns: 5.6rem minmax(0, 1fr) 3rem; gap: 0.4rem; font-size: 0.82rem; }
  .barres.large li { grid-template-columns: 5.6rem minmax(0, 1fr) 5.2rem; }
  .barres .axe, .points-rangs .axe { margin-left: 6rem; }
}
.points-rangs .axe { margin-right: 4.8rem; }

/* ---------- Partage sur les réseaux ---------- */
.partage { margin: 2.5rem 0 1.5rem; padding-top: 1.1rem; border-top: 1px solid var(--trait); }
.partage-titre { margin: 0 0 0.6rem; font-weight: 700; }
.partage ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.45rem; }
.partage li { margin: 0; padding: 0; }
.partage li::before { content: none; }
.partage a, .partage button {
  display: inline-flex; align-items: center; min-height: 2.5rem; padding: 0.4rem 0.95rem; border: 1px solid var(--trait); border-radius: 999px;
  background: var(--surface); color: var(--encre); font: inherit; font-size: 0.93rem; font-weight: 600; line-height: 1; text-decoration: none; cursor: pointer;
}
.partage a:hover, .partage button:hover { border-color: var(--cobalt); background: color-mix(in srgb, var(--cobalt) 10%, var(--surface)); }
.partage-etat { margin: 0.5rem 0 0; min-height: 1.2em; font-size: 0.9rem; font-weight: 700; color: var(--cobalt); }
