/* Bilan du sondage (page Résultats, onglet « Bilan »). Mêmes jetons que napvote.css ; un seul parti pris : les marques de données
   (barres, sièges) se dessinent au fil du défilement. Sans prise en charge de animation-timeline, ou avec « réduire les animations »,
   la page s'affiche complète et immobile. */
:root{
  --hc0:#0F3D8A; --hc1:#C2410C; --hc2:#0F766E; --hc3:#7C3AED; --hc4:#A16207; --hc5:#BE185D; --hc6:#475569; --hcx:#9AA7B8;
  --on-band:#F2F6FC;
}
@media (prefers-color-scheme:dark){ :root:not([data-theme="light"]){ --hc0:#8DB4FF; --hc1:#FB923C; --hc2:#5EEAD4; --hc3:#C4B5FD; --hc4:#FACC15; --hc5:#F9A8D4; --hc6:#CBD5E1; --hcx:#5C6B82; } }
:root[data-theme="dark"]{ --hc0:#8DB4FF; --hc1:#FB923C; --hc2:#5EEAD4; --hc3:#C4B5FD; --hc4:#FACC15; --hc5:#F9A8D4; --hc6:#CBD5E1; --hcx:#5C6B82; }

/* ---- onglets ---- */
.bl-tabwrap{ padding-top:14px; }
.bl-tabs{ display:flex; gap:4px; border-bottom:1px solid var(--line); }
.bl-tabs button{ flex:1 1 0; min-height:48px; padding:0 14px; border:none; border-bottom:4px solid transparent; margin-bottom:-1px; background:none; color:var(--ink-2); font:inherit; font-weight:600; font-size:.9375rem; cursor:pointer; line-height:1.2; }
.bl-tabs button:hover{ color:var(--ink); background:var(--surface); }
.bl-tabs button[aria-selected="true"]{ color:var(--ink); font-weight:700; border-bottom-color:var(--brand); }
@media (min-width:640px){ .bl-tabs button{ flex:0 0 auto; padding:0 22px; font-size:1rem; } }

/* ---- ouverture ---- */
#bl-root ::selection{ background:var(--focus); color:#14243B; }
.bl-hero{ background:var(--band); color:var(--on-band); padding:clamp(40px,9vw,104px) 0 clamp(36px,7vw,80px); }
.bl-h1{ font-family:'Source Serif 4',Georgia,serif; font-weight:700; font-size:clamp(2rem,6.4vw,4rem); line-height:1.08; letter-spacing:-.02em; max-width:19em; text-wrap:balance; margin:0; }
.bl-key{ margin:clamp(20px,3vw,32px) 0 0; max-width:36em; font-size:clamp(1.125rem,2.2vw,1.3125rem); line-height:1.5; }
.bl-key2{ margin:14px 0 0; max-width:44em; font-size:.9375rem; color:color-mix(in srgb, var(--on-band) 78%, transparent); }
.bl-cta{ display:flex; flex-wrap:wrap; gap:12px; margin-top:clamp(22px,3vw,32px); }
.bl-hero .btn.primary, .bl-end .btn.primary{ background:#fff; border-color:#fff; color:#0B2447; }
.bl-hero .btn.primary:hover, .bl-end .btn.primary:hover{ background:#E6EBF2; }
.bl-hero .btn.ghost, .bl-end .btn.ghost{ background:transparent; border-color:#fff; color:#fff; }
.bl-hero .btn.ghost:hover, .bl-end .btn.ghost:hover{ background:rgba(255,255,255,.12); }
@media (max-width:560px){ .bl-cta .btn{ flex:1 1 100%; } }
.bl-err{ margin-top:20px; }

/* ---- chapitres : titre collé à gauche, données à droite (grand écran) ---- */
.bl-ch{ padding:clamp(40px,7vw,80px) 0; }
.bl-ch:nth-of-type(even){ background:var(--surface); }
.bl-grid{ display:grid; gap:28px 64px; align-items:start; }
@media (min-width:960px){ .bl-grid{ grid-template-columns:minmax(260px,5fr) minmax(0,7fr); } .bl-side{ position:sticky; top:24px; } }
.bl-side h2{ font-family:'Source Serif 4',Georgia,serif; font-weight:700; font-size:clamp(1.625rem,3.6vw,2.5rem); line-height:1.12; letter-spacing:-.015em; text-wrap:balance; margin:0 0 14px; }
.bl-side p{ max-width:34em; color:var(--ink-2); font-size:1.0625rem; line-height:1.55; }
.bl-side .note-s{ font-size:.875rem; color:var(--ink-3); }
.bl-h3{ font-family:'Source Serif 4',Georgia,serif; font-weight:700; font-size:1.25rem; line-height:1.25; margin:34px 0 4px; }
.bl-main > .bl-h3:first-child, .bl-fig > .bl-h3:first-child{ margin-top:0; }
.bl-fig{ margin:0 0 32px; }
.bl-fig figcaption{ margin-top:10px; font-size:.875rem; color:var(--ink-3); }

/* ---- lignes de classement ---- */
.bl-rk, .bl-ld, .bl-dp{ list-style:none; margin:0; padding:0; }
.bl-r{ display:grid; grid-template-columns:44px minmax(0,1fr) auto; grid-template-areas:"av nm v" "av b b"; column-gap:12px; row-gap:7px; align-items:center; padding:12px 0; border-bottom:1px solid var(--line); }
.bl-ch:nth-of-type(even) .bl-r, .bl-ch:nth-of-type(even) .bl-l{ border-bottom-color:var(--line); }
.bl-av{ grid-area:av; align-self:start; display:block; width:44px; height:44px; }
.bl-av .av{ display:flex; width:44px; height:44px; }
.bl-nm{ grid-area:nm; min-width:0; line-height:1.25; }
.bl-nm b{ display:block; font-weight:700; font-size:1.0625rem; overflow-wrap:anywhere; }
.bl-nm small{ display:block; color:var(--ink-3); font-size:.8125rem; margin-top:2px; }
.bl-nm em{ font-style:normal; color:var(--ok); font-weight:700; }
.bl-v{ grid-area:v; font-variant-numeric:tabular-nums; font-weight:700; font-size:1.125rem; white-space:nowrap; }
.bl-b{ grid-area:b; height:8px; background:var(--surface-2); border-radius:2px; overflow:hidden; }
.bl-b i{ display:block; height:100%; background:var(--brand); transform-origin:0 50%; transform:scaleX(var(--w)); }
.bl-r:first-child .bl-b i{ background:var(--hc0); }
.bl-more{ margin-top:6px; }
.bl-more .bl-rk{ margin-top:4px; }

/* ---- leaders par département ---- */
.bl-l{ display:grid; grid-template-columns:minmax(0,1fr) auto; gap:4px 12px; align-items:center; padding:11px 0; border-bottom:1px solid var(--line); }
.bl-ln{ grid-column:1 / -1; font-weight:700; font-size:.875rem; color:var(--ink-2); }
.bl-lw{ display:flex; align-items:center; gap:12px; min-width:0; line-height:1.25; }
.bl-lw .bl-av, .bl-lw .bl-av .av{ width:36px; height:36px; font-size:.8125rem; }
.bl-lw b{ display:block; overflow-wrap:anywhere; } .bl-lw small{ display:block; color:var(--ink-3); font-size:.8125rem; }
.bl-lv{ font-variant-numeric:tabular-nums; font-weight:700; }
@media (min-width:700px){ .bl-l{ grid-template-columns:130px minmax(0,1fr) auto; } .bl-ln{ grid-column:auto; } }

/* ---- participation par département : barre = réponses, trait = population ---- */
.bl-d{ display:grid; grid-template-columns:minmax(80px,.7fr) minmax(0,2fr); gap:2px 14px; align-items:center; padding:11px 0; border-bottom:1px solid var(--line); }
.bl-dn{ font-weight:700; grid-row:1 / 3; align-self:start; padding-top:1px; }
.bl-dbar{ position:relative; height:12px; background:var(--surface-2); border-radius:2px; margin:4px 0 2px; }
.bl-dbar i{ display:block; height:100%; background:var(--hc0); border-radius:2px; transform-origin:0 50%; transform:scaleX(var(--w)); }
.bl-tk{ position:absolute; top:-5px; bottom:-5px; width:3px; margin-left:-1px; background:var(--ink); border-radius:1px; }
.bl-dv{ grid-column:2; font-size:.8125rem; color:var(--ink-3); font-variant-numeric:tabular-nums; }

/* ---- bulletins par jour ---- */
.bl-dc{ display:grid; grid-template-columns:48px minmax(0,1fr); grid-template-rows:240px auto; column-gap:8px; }
.bl-dy{ display:flex; flex-direction:column; justify-content:space-between; text-align:right; font-size:.75rem; color:var(--ink-3); font-variant-numeric:tabular-nums; line-height:1; }
.bl-dz{ position:relative; border-bottom:2px solid var(--ink); background:linear-gradient(var(--line) 1px, transparent 1px) 0 0 / 100% 50% repeat-y; }
.bl-dbars{ position:absolute; inset:0; display:flex; align-items:flex-end; gap:2px; }
.bl-bar{ flex:1 1 0; height:calc(var(--h) * 100%); min-height:2px; background:var(--hc0); transform-origin:50% 100%; }
.bl-bar.pk{ background:var(--hc1); }
.bl-pk{ position:absolute; top:0; transform:translateX(-50%); font-size:.8125rem; font-weight:700; white-space:nowrap; color:var(--ink); background:var(--bg); padding:1px 6px; border-radius:2px; }
.bl-pk.r{ transform:translateX(-100%); }
.bl-ch:nth-of-type(even) .bl-pk{ background:var(--surface); }
.bl-dx{ grid-column:2; display:flex; justify-content:space-between; padding-top:6px; font-size:.75rem; color:var(--ink-3); }

/* ---- hémicycle ---- */
.bl-hm{ margin-bottom:18px; }
.bl-svg{ display:block; width:100%; height:auto; max-width:560px; }
.bl-svg circle{ transform-box:fill-box; transform-origin:center; }
.hc0{ fill:var(--hc0); background:var(--hc0); } .hc1{ fill:var(--hc1); background:var(--hc1); } .hc2{ fill:var(--hc2); background:var(--hc2); } .hc3{ fill:var(--hc3); background:var(--hc3); }
.hc4{ fill:var(--hc4); background:var(--hc4); } .hc5{ fill:var(--hc5); background:var(--hc5); } .hc6{ fill:var(--hc6); background:var(--hc6); } .hcx{ fill:var(--hcx); background:var(--hcx); }
.hcn{ fill:none; stroke:var(--ink-3); stroke-width:1.2; }
.bl-maj{ margin:6px 0 0; font-size:.9375rem; color:var(--ink-2); max-width:44em; }
.bl-leg{ list-style:none; margin:20px 0 18px; padding:0; display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:8px 20px; }
.bl-leg li{ display:flex; align-items:center; gap:8px; font-size:.9375rem; line-height:1.2; }
.bl-leg i{ flex:none; width:14px; height:14px; border-radius:50%; }
.bl-leg span{ margin-left:auto; color:var(--ink-3); font-variant-numeric:tabular-nums; white-space:nowrap; }

/* ---- chez vous ---- */
.bl-where{ margin:0 0 4px; font-size:1.0625rem; }
.bl-cb{ margin-top:6px; }
#bl-picker{ margin-top:18px; }

/* ---- fin : le sondage repart ---- */
.bl-end{ background:var(--band); color:var(--on-band); padding:clamp(44px,8vw,88px) 0; }
.bl-end-in h2{ font-family:'Source Serif 4',Georgia,serif; font-weight:700; font-size:clamp(1.75rem,4.4vw,2.875rem); line-height:1.1; letter-spacing:-.015em; text-wrap:balance; margin:0 0 16px; max-width:18em; }
.bl-end-in p{ max-width:38em; font-size:1.125rem; line-height:1.55; margin:0 0 12px; }

/* ---- fin : appel et partage ---- */
.bl-end-in .bl-go{ font-family:'Source Serif 4',Georgia,serif; font-weight:700; font-size:clamp(1.375rem,3vw,1.875rem); line-height:1.2; margin:18px 0 14px; }
.bl-share{ margin:22px 0 0; }

/* ---- chiffres par scrutin, notes de lecture ---- */
.bl-num{ display:inline-block; text-align:right; font-variant-numeric:tabular-nums; }
.bl-cnt{ list-style:none; margin:0; padding:0; }
.bl-k{ display:grid; grid-template-columns:minmax(0,1fr) auto; gap:6px 12px; align-items:baseline; padding:11px 0; border-bottom:1px solid var(--line); }
.bl-k > span:first-child{ font-weight:600; }
.bl-kv{ font-family:'Source Serif 4',Georgia,serif; font-size:1.375rem; font-variant-numeric:tabular-nums; text-align:right; display:inline-block; }
.bl-k .bl-b{ grid-column:1 / -1; }
.bl-notes{ padding:clamp(36px,6vw,64px) 0; background:var(--surface); }
.bl-notes-d{ border-top:3px solid var(--ink); }
.bl-notes-d > summary{ padding:14px 0; }
.bl-notes h2{ display:inline; font-family:'Source Serif 4',Georgia,serif; font-size:1.375rem; margin:0; }
.bl-nt{ margin:4px 0 0; padding-left:1.25em; max-width:62ch; color:var(--ink-2); font-size:.9375rem; line-height:1.55; }
.bl-nt li{ margin:0 0 10px; }
.bl-key2 .lnk{ color:var(--on-band); font-size:inherit; padding:0; }

/* ---- défilement : les marques se dessinent (une seule idée de mouvement pour toute la page) ---- */
.bl-prog{ display:none; }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion:no-preference) {
    @keyframes bl-prog{ to{ transform:scaleX(1); } }
    @keyframes bl-grow{ to{ transform:scaleX(var(--w)); } }
    @keyframes bl-rise{ to{ transform:scaleY(1); } }
    @keyframes bl-seat{ from{ opacity:0; transform:scale(.2); } to{ opacity:1; transform:scale(1); } }
    .bl-prog{ display:block; position:sticky; top:0; z-index:20; height:3px; }
    .bl-prog i{ display:block; height:100%; background:var(--focus); transform-origin:0 50%; transform:scaleX(0); animation:bl-prog linear both; animation-timeline:scroll(root); }
    .bl-b i, .bl-dbar i{ transform:scaleX(0); animation:bl-grow linear both; animation-timeline:view(); animation-range:entry 0% entry 85%; }
    #bl-daily{ view-timeline:--bldaily block; }
    .bl-bar{ transform:scaleY(0); animation:bl-rise linear both; animation-timeline:--bldaily; animation-range:entry calc(var(--i) * 1%) entry calc(55% + var(--i) * 1%); }
    #bl-hemi-dep{ view-timeline:--bldep block; } #bl-hemi-sen{ view-timeline:--blsen block; }
    #bl-hemi-dep circle{ animation:bl-seat linear both; animation-timeline:--bldep; animation-range:entry calc(var(--i) * .3%) entry calc(35% + var(--i) * .3%); }
    #bl-hemi-sen circle{ animation:bl-seat linear both; animation-timeline:--blsen; animation-range:entry calc(var(--i) * .8%) entry calc(40% + var(--i) * .8%); }
  }
}
@media print{ .bl-prog{ display:none; } }
