/* Le jugement majoritaire — feuille de style unique, thème clair / sombre selon le système. */

:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --ink: #1b1f27;
  --muted: #5d6573;
  --line: #e1ded6;
  --accent: #1d3557;
  --accent-2: #2b5c99;
  --accent-ink: #ffffff;
  --doux: #eef2f8;
  --ombre: 0 1px 2px rgba(29, 53, 87, .06), 0 8px 24px rgba(29, 53, 87, .08);
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  /* Mentions, de la meilleure (m6) à la pire (m0) */
  --m6: #1e7d4a; --m5: #44a35a; --m4: #9cc24a; --m3: #f2c94c;
  --m2: #f3a23b; --m1: #e3683a; --m0: #c23b3b;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11141a; --surface: #191d25; --ink: #e9ecf1; --muted: #a4abb8; --line: #2b313c;
    --accent: #1d3557; --accent-2: #8fb4ec; --doux: #1f2531;
    --ombre: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.65 var(--sans); }
a { color: var(--accent-2); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; }
h2 { font-size: clamp(24px, 3vw, 30px); margin: 0 0 18px; }
h3 { font-size: 20px; margin: 28px 0 10px; }
.cadre { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 600px) { .cadre { padding: 0 16px; } body { font-size: 16px; } }
.invisible { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.evitement { position: absolute; left: -999px; }
.evitement:focus { left: 16px; top: 8px; z-index: 30; background: var(--surface); padding: 8px 12px; }

/* Bandeau */
.bandeau { position: sticky; top: 0; z-index: 20; background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 2px 12px rgba(0, 0, 0, .15); }
.bandeau-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 58px; flex-wrap: wrap; }
.marque { color: #fff; text-decoration: none; font: 700 18px var(--serif); display: flex; align-items: center; gap: 10px; }
.bandeau nav { display: flex; gap: 4px; flex-wrap: wrap; }
.bandeau nav a { color: #dbe4f2; text-decoration: none; padding: 6px 12px; border-radius: 999px; font-size: 15px; font-weight: 500; }
.bandeau nav a:hover { background: rgba(255, 255, 255, .12); }
.bandeau nav a[aria-current] { background: #fff; color: var(--accent); }
@media (max-width: 720px) { .bandeau { position: static; } .bandeau-in { padding-top: 10px; padding-bottom: 10px; } }

/* Introduction de page */
.intro { background: linear-gradient(180deg, var(--doux), var(--bg)); padding: 48px 0 28px; border-bottom: 1px solid var(--line); }
.intro h1 { font-size: clamp(30px, 5vw, 46px); margin: 0 0 14px; }
.intro-accueil { padding: 72px 0 40px; }
.chapeau { font-size: 1.15em; color: var(--muted); max-width: 760px; margin: 0 0 22px; }
.sommaire { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.sommaire a { font-size: 14px; text-decoration: none; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink); }
.sommaire a:hover { border-color: var(--accent-2); }

.section { padding: 40px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 64px; }
.section p, .liste { max-width: 780px; }

/* Boutons */
.bouton { display: inline-block; font: 600 15px var(--sans); padding: 9px 18px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--accent-2); background: var(--surface); color: var(--accent-2); text-decoration: none; }
.bouton:hover { background: var(--doux); }
.bouton-fort { background: var(--accent-2); color: #fff; }
.bouton-fort:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.bouton-discret { border-color: var(--line); color: var(--muted); }
.bouton-icone { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 50%;
  width: 32px; height: 32px; cursor: pointer; }
.bouton-icone:hover { color: var(--m0); border-color: var(--m0); }
.bouton:focus-visible, .bouton-icone:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid var(--m3); outline-offset: 2px; }

/* Blocs de contenu */
.liste li { margin-bottom: 6px; }
.encadre { border-left: 4px solid var(--accent-2); background: var(--surface); padding: 14px 20px; margin: 20px 0;
  border-radius: 0 10px 10px 0; box-shadow: var(--ombre); max-width: 820px; }
.encadre p { margin: 6px 0; }
.encadre-titre { font-weight: 700; font-family: var(--serif); font-size: 18px; }
.encadre-attention { border-left-color: var(--m1); }
.encadre-cle { border-left-color: var(--m6); }
.citation { margin: 24px 0; max-width: 780px; }
.citation blockquote { margin: 0; font: italic 20px/1.5 var(--serif); }
.citation blockquote p::before { content: "« "; } .citation blockquote p::after { content: " »"; }
.citation figcaption { color: var(--muted); font-size: 14px; }

.cartes { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.carte { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; box-shadow: var(--ombre);
  display: flex; flex-direction: column; }
.carte h3 { margin: 0 0 8px; font-size: 19px; }
.carte p { margin: 0 0 10px; }
.carte-lien { margin-top: auto !important; font-weight: 600; }

.etapes { list-style: none; counter-reset: etape; padding: 0; display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.etapes li { counter-increment: etape; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 18px 16px 62px; position: relative; }
.etapes li::before { content: counter(etape); position: absolute; left: 16px; top: 14px; width: 34px; height: 34px;
  border-radius: 50%; background: var(--accent-2); color: #fff; font: 700 17px/34px var(--serif); text-align: center; }
.etapes strong { display: block; font-family: var(--serif); font-size: 18px; }

.defilant { overflow-x: auto; margin: 16px 0; }
.tableau { border-collapse: collapse; width: 100%; background: var(--surface); font-size: 15px; }
.tableau caption { text-align: left; color: var(--muted); font-size: 14px; padding-bottom: 6px; caption-side: top; }
.tableau th, .tableau td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: middle; }
.tableau thead th { background: var(--doux); font-size: 14px; }
.tableau .rang { text-align: center; font-weight: 700; }
.tableau .retire { opacity: .3; }
.nombres td { text-align: center; font-variant-numeric: tabular-nums; }

.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 18px; margin-bottom: 10px; max-width: 820px; }
.faq summary { font-weight: 600; cursor: pointer; }
.faq p { margin: 10px 0 0; }
.sources { padding-left: 20px; }
.sources li { margin-bottom: 12px; max-width: 820px; }
.sources-auteur { font-weight: 600; }
.sources-note { color: var(--muted); font-size: 15px; }

/* Mentions */
.m6 { --c: var(--m6); } .m5 { --c: var(--m5); } .m4 { --c: var(--m4); } .m3 { --c: var(--m3); }
.m2 { --c: var(--m2); } .m1 { --c: var(--m1); } .m0 { --c: var(--m0); }
.pastille { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap;
  background: var(--c); color: #fff; }
.pastille.m3, .pastille.m4 { color: #1b1f27; }
.echelle { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.echelle .pastille { font-size: 15px; padding: 6px 16px; }
.legende { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.legende i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; background: var(--c); }
.legende i.trait { width: 3px; background: var(--ink); }

/* Profil de mérite et classement */
svg.merite { display: block; width: 100%; min-width: 220px; height: 26px; border-radius: 5px; }
svg.merite rect { fill: var(--c); }
svg.merite .mediane { stroke: var(--ink); stroke-width: 3; }
.classement .col-merite { width: 42%; }
.classement tr.elu th { color: var(--m6); }
.classement tr.elu .rang::before { content: "★ "; color: var(--m3); }
.signe { font-weight: 700; }
.departage small { color: var(--muted); display: block; }
.exemple { margin: 20px 0; }
.exemple figcaption { color: var(--muted); font-size: 14px; }

/* Bulletin */
.bulletin { border-collapse: collapse; background: var(--surface); border: 2px solid var(--ink); font-size: 14px; }
.bulletin th, .bulletin td { padding: 8px 10px; border-bottom: 1px dashed var(--line); text-align: center; }
.bulletin tbody th { text-align: left; font-size: 16px; }
.bulletin input { width: 18px; height: 18px; accent-color: var(--accent-2); }

/* Outils interactifs */
.outil { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px 24px; box-shadow: var(--ombre); }
@media (max-width: 600px) { .outil { padding: 16px; } }
.outil h3:first-child { margin-top: 0; }
.barre-outil { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0; }
.barre-outil fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 6px 14px 10px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.barre-outil legend { font-size: 14px; color: var(--muted); padding: 0 4px; }
select, input[type="text"], input[type="number"] { font: inherit; font-size: 15px; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.urne input[type="text"] { width: 150px; }
.urne input[type="number"] { width: 72px; text-align: right; }
.case { white-space: nowrap; }
.scenario { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 4px; }
.scenario h3 { margin: 10px 0 4px; }
.scenario-resume { font-weight: 600; }
.portraits { padding-left: 20px; margin: 6px 0 12px; max-width: 820px; }
.portraits li { margin-bottom: 2px; }
.observations li { margin-bottom: 8px; }
.message { background: var(--doux); border-radius: 8px; padding: 8px 14px; margin: 10px 0; }
.aide { color: var(--muted); font-size: 15px; margin: 4px 0; max-width: 820px; }
.lecture { font-size: 15px; margin: 8px 0; padding: 6px 12px; border-left: 3px solid var(--m3); background: var(--doux); max-width: 820px; }
.urne th .pastille { font-size: 12px; padding: 2px 8px; }
.verdict { font: 600 20px/1.4 var(--serif); }
.verdict small { font: 14px var(--sans); color: var(--muted); }
.face-a-face { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 18px 0 8px; }
@media (max-width: 720px) { .face-a-face { grid-template-columns: 1fr; } }
.camp { border: 1px solid var(--line); border-top: 6px solid var(--muted); border-radius: 12px; padding: 14px 18px; background: var(--bg); }
.camp-actuel { border-top-color: var(--accent-2); }
.camp-jm { border-top-color: var(--m6); }
.camp p { margin: 4px 0; }
.camp-titre { font: 700 19px/1.3 var(--serif); }
.camp-elu { font-size: 20px; margin-top: 10px !important; }
.camp-detail { font-size: 14px; color: var(--muted); }
.verdict-comparaison { font: 600 18px/1.4 var(--serif); padding: 10px 16px; border-radius: 10px; margin: 0 0 18px;
  background: var(--doux); border-left: 5px solid var(--m6); }
.verdict-comparaison.different { border-left-color: var(--m1); }
.resultats .vainqueur { font-weight: 700; white-space: nowrap; }
.resultats tr.ecart .vainqueur { color: var(--m1); }

/* Pied de page */
.pied { padding: 32px 0 48px; color: var(--muted); font-size: 14px; }
.pied-in { display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; }
.pied p { max-width: 560px; margin: 0; }
.pied nav { display: flex; flex-wrap: wrap; gap: 6px 16px; }
