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

:root {
  --papier: #f4f6f5;
  --surface: #ffffff;
  --encre: #16252b;
  --encre-2: #51636a;
  --trait: #c9d4d3;
  --trait-doux: #e1e8e7;
  --petrole: #123a44;
  --petrole-texte: #e8efed;
  --lien: #0d6273;
  --voile: #e3eeee;
  --or: #e0a53a;
  /* une couleur et une forme par classement */
  --ftmba: #3b43b5;
  --qs: #bf2d68;
  --bloomberg: #a8700c;
  --ftemba: #1d7a50;
  --titres: "Bricolage Grotesque", "Avenir Next", "Segoe UI", sans-serif;
  --texte: "Literata", Georgia, "Times New Roman", serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --papier: #0f1a1d;
    --surface: #152428;
    --encre: #e4ecea;
    --encre-2: #9fb1b2;
    --trait: #2c4045;
    --trait-doux: #1f3136;
    --petrole: #0b2a31;
    --lien: #6fc3d1;
    --voile: #1b3238;
    --ftmba: #8f97ff;
    --qs: #f07aa8;
    --bloomberg: #e2ad4b;
    --ftemba: #5fcf98;
    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.04rem/1.7 var(--texte);
}

a { color: var(--lien); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--or); 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 : bandeau pétrole ---------- */

.entete { background: var(--petrole); color: var(--petrole-texte); }
.entete-in {
  max-width: 72rem; margin: 0 auto; padding: 0.8rem 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(--petrole-texte); text-decoration: none; font: 800 1.2rem/1 var(--titres); letter-spacing: -0.02em; }
.logo svg { width: 1.75rem; height: 1.75rem; stroke: var(--petrole-texte); }
.logo .pt { fill: var(--or); stroke: none; }
.menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.4rem; font: 500 1rem/1.2 var(--titres); }
.menu a { color: #b9cccb; text-decoration: none; padding: 0.35rem 0; border-bottom: 2px solid transparent; }
.menu a:hover { color: var(--petrole-texte); }
.menu a[aria-current] { color: var(--petrole-texte); border-bottom-color: var(--or); }

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

main { padding: 0 1rem; }
.page { max-width: 72rem; margin: 0 auto; padding: 2.25rem 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.35rem; color: var(--encre-2); }
.ariane a { color: var(--encre-2); }

h1, h2, h3, h4 { font-family: var(--titres); color: var(--encre); line-height: 1.12; letter-spacing: -0.025em; }
h1 { font-size: clamp(2rem, 1.35rem + 2.8vw, 3.2rem); font-weight: 800; margin: 0 0 1rem; text-wrap: balance; }
h2 { font-size: 1.5rem; font-weight: 700; margin: 2.75rem 0 0.8rem; scroll-margin-top: 1rem; }
h3 { font-size: 1.18rem; font-weight: 700; margin: 2rem 0 0.5rem; }
.chapo { font-size: 1.2rem; line-height: 1.55; 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(--voile); border-left: 4px solid var(--petrole); border-radius: 0 6px 6px 0; }
@media (prefers-color-scheme: dark) { .callout { border-left-color: var(--lien); } }
.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(--lien); 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; }
thead th a { color: inherit; }
tbody th { font-weight: 600; }
tbody tr:last-child > * { border-bottom: 0; }
tbody tr:hover > * { background: var(--voile); }
.ea { text-decoration: none; color: var(--encre-2); margin-left: 0.1em; }
.nc { color: var(--encre-2); }
.evo { font-size: 0.82rem; font-weight: 700; color: var(--encre-2); margin-left: 0.2rem; }
.evo.up { color: var(--ftemba); }
.evo.down { color: var(--qs); }
.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(--or); 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; }

/* ---------- Graphique des rangs mondiaux : l'élément signature ---------- */

.monde { margin: 0.5rem 0 1.5rem; padding: 1.1rem 1rem 0.75rem; background: var(--surface); border: 1px solid var(--trait); border-radius: 10px; }
.monde ol { list-style: none; margin: 0; padding: 0; }
.monde li { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); align-items: center; column-gap: 0.75rem; margin: 0; min-height: 2rem; border-radius: 4px; }
.monde li:hover { background: var(--voile); }
.monde .nom { font: 600 0.95rem/1.2 var(--titres); color: var(--encre); text-decoration: none; padding-left: 0.4rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.monde .nom:hover { color: var(--lien); text-decoration: underline; }
.tete-axe { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); column-gap: 0.75rem; margin-bottom: 0.3rem; }
.tete-axe .axe { grid-column: 2; }
.note-graphe { display: block; font: 400 0.82rem/1.45 var(--titres); color: var(--encre-2); margin-top: 0.35rem; }

.axe { position: relative; height: 1rem; margin: 0 0.6rem; font: 500 0.76rem/1 var(--titres); color: var(--encre-2); }
.axe span { position: absolute; left: var(--x); transform: translateX(-50%); white-space: nowrap; }
.axe span:first-child { transform: none; }
.axe span:last-child { transform: translateX(-100%); }

.bande {
  position: relative; display: block; height: 1.3rem; margin: 0 0.6rem;
  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% / 99 * 24.75) 100% repeat-x;
}
.m {
  position: absolute; top: 50%; left: calc(var(--x) + var(--dx, 0) * 0.62rem); width: 0.72rem; height: 0.72rem;
  transform: translate(-50%, -50%); border-radius: 50%; background: var(--ftmba);
  box-shadow: 0 0 0 2px var(--surface);
}
.m-ftmba { background: var(--ftmba); z-index: 4; }
.m-qs { background: var(--qs); border-radius: 1px; z-index: 3; }
.m-bloomberg { background: var(--bloomberg); border-radius: 1px; transform: translate(-50%, -50%) rotate(45deg); z-index: 2; }
.m-ftemba { background: var(--surface); border: 2.5px solid var(--ftemba); z-index: 1; }
.m.hors::after { content: ""; position: absolute; left: 100%; top: 50%; width: 0.35rem; height: 2px; background: currentColor; transform: translateY(-50%); }
.m-qs.hors { color: var(--qs); }

.legende { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; margin: 0.9rem 0 0.15rem; font: 500 0.84rem/1.3 var(--titres); color: var(--encre-2); }
.cle { display: inline-flex; align-items: center; gap: 0.5rem; }
.cle .m { position: relative; top: auto; left: auto; transform: none; display: inline-block; flex: none; box-shadow: none; }
.cle .m-bloomberg { transform: rotate(45deg); width: 0.62rem; height: 0.62rem; }

.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-top: 0.45rem; }
.bande-large { height: 2.2rem; }
.bande-large .m { width: 1rem; height: 1rem; left: calc(var(--x) + var(--dx, 0) * 0.85rem); }

/* ---------- Faits sur un programme ---------- */

.faits { margin: 1rem 0 0.75rem; border-top: 1px solid var(--trait); }
.faits div { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 1rem; padding: 0.65rem 0; border-bottom: 1px solid var(--trait); }
.faits dt { font: 700 0.92rem/1.5 var(--titres); color: var(--encre-2); }
.faits dd { margin: 0; }

/* ---------- 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.96rem; line-height: 1.55; }
.guides a:hover .t { color: var(--lien); 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(--petrole); color: var(--petrole-texte); }

.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; text-align: right; max-width: 15rem; font: 600 0.84rem/1.35 var(--titres); color: var(--lien); font-variant-numeric: tabular-nums; }
.ecoles a:hover .nom { color: var(--lien); 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(--lien); }

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

.accueil .page { padding-top: 2.75rem; }
.accueil .tete, .accueil .corps { max-width: 54rem; }
.accueil h1 { font-size: clamp(2.3rem, 1.3rem + 4vw, 4.1rem); max-width: 16ch; line-height: 1.02; letter-spacing: -0.035em; }
.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; }
  .monde { padding: 0.9rem 0.4rem 0.5rem; }
  .monde li, .tete-axe { grid-template-columns: 4.6rem minmax(0, 1fr); column-gap: 0.3rem; }
  .monde .nom { font-size: 0.84rem; padding-left: 0.2rem; }
  .bande, .axe { margin: 0 0.45rem; }
  .axe span:nth-child(2), .axe span:nth-child(4) { display: none; }
  .faits div { grid-template-columns: 1fr; gap: 0.15rem; }
  .ecoles .sig { max-width: 9rem; }
  .voisins { grid-template-columns: 1fr; }
  .voisins a[rel="next"] { text-align: left; }
  h2 { font-size: 1.32rem; }
}

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