/* ============================================================
   Page /statistiques-poules-oeufs-france (et ses éditions) : tableau de bord, chapitres, graphiques.
   Chargée seulement sur ces pages ($extra_css du contrôleur). Couleurs de site.css (:root) ;
   séries validées : c1 bleu #1d6595, c2 ambre #c4701a, c3 vert #12a06b, c4 brun gris #6b5f55.
   ============================================================ */
.stats-page { --st-ligne: #e6dccb; --st-fond: #faf5ea; --st-muted: #6c6255; --st-faint: #887d6f; --st-carte: #fff;
  --st-ombre: 0 2px 10px rgba(60, 45, 20, .06); --st-entete: 59px; --st-r: 12px; --st-brun: #2b2723; --st-or: var(--yellow-d); }
.st-in { max-width: 1180px; margin: 0 auto; padding: 0 22px 40px; }
.stats-page h2 { font-size: clamp(1.35rem, 2.6vw, 1.7rem); margin: 1.9em 0 .55em; scroll-margin-top: calc(var(--st-entete) + 64px); }
.stats-page h3 { font-size: 1.1rem; }
.stats-page .st-in > h2[id] + p { font-size: 1.03rem; border-left: 4px solid var(--yellow); padding-left: 14px; max-width: 82ch; }
.stats-page p, .stats-page li { max-width: 88ch; }

/* ---------- en-tête ---------- */
.st-hero { background: #f6e6bf url('/assets/img/header-bg.jpg') center 30% / cover no-repeat; position: relative; margin-bottom: 0; }
.st-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(252, 238, 196, .98) 0%, rgba(252, 238, 196, .93) 55%, rgba(252, 238, 196, .7) 100%); }
.st-hero .st-in { position: relative; padding-top: 14px; padding-bottom: 64px; }
.st-hero .breadcrumb { padding-top: 0; }
.st-sur { font-weight: 700; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: #8a5d00; margin: 10px 0 .4rem; }
.st-hero h1 { max-width: 24ch; margin: 0 0 .5rem; }
.st-hero .phrase-cle { font-size: 1.08rem; max-width: 72ch; margin: 0 0 .7rem; }
.st-hero .byline, .st-hero .debutant { font-size: .9rem; color: var(--st-muted); margin: .25rem 0 0; }

/* ---------- tableau de bord ---------- */
.st-tuiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--st-ligne); border: 1px solid var(--st-ligne);
  border-radius: var(--st-r); overflow: hidden; margin: -38px 0 10px; position: relative; box-shadow: var(--shadow); }
.tuile { background: var(--st-carte); padding: 18px 18px 15px; display: flex; flex-direction: column; gap: 3px; color: var(--ink); text-decoration: none; position: relative; }
.tuile::after { content: ""; position: absolute; left: 18px; right: 18px; bottom: 0; height: 3px; background: var(--yellow); transform: scaleX(0); transform-origin: left; transition: transform .2s; }
.tuile:hover { background: #fffcf4; color: var(--ink); text-decoration: none; }
.tuile:hover::after, .tuile:focus-visible::after { transform: scaleX(1); }
.t-val { font-weight: 800; font-size: clamp(1.45rem, 2.4vw, 1.95rem); line-height: 1.1; color: var(--st-brun); white-space: nowrap; }
.t-val small { font-size: .5em; color: var(--st-muted); font-weight: 600; }
.t-lab { font-size: .93rem; line-height: 1.35; }
.t-src { font-size: .76rem; color: var(--st-faint); margin-top: auto; padding-top: 6px; }
details.en-phrases, details.donnees { font-size: .95rem; }
details.en-phrases summary, details.donnees summary { cursor: pointer; font-weight: 600; color: #8a5d00; list-style: none; display: inline-flex; align-items: center; gap: 8px; padding: 6px 0; }
details.en-phrases summary::-webkit-details-marker, details.donnees summary::-webkit-details-marker { display: none; }
details.en-phrases summary::before, details.donnees summary::before { content: "+"; display: inline-grid; place-items: center; width: 20px; height: 20px;
  border: 2px solid currentColor; border-radius: 5px; font-weight: 700; line-height: 1; }
details[open].en-phrases summary::before, details[open].donnees summary::before { content: "−"; }
details.en-phrases ul { margin: 6px 0 0; padding-left: 1.2em; }
details.en-phrases li { margin: .4em 0; }
details.donnees { margin: -10px 0 20px; }

/* ---------- téléchargements ---------- */
.telecharger { display: grid; grid-template-columns: 1fr auto; gap: 12px 26px; align-items: center; background: var(--st-brun); color: #fff; border-radius: var(--st-r); padding: 22px 24px; margin: 22px 0; }
.telecharger h2 { color: #fff; margin: 0 0 4px; font-size: 1.25rem; }
.telecharger p { margin: 0; color: #d8cfc2; font-size: .95rem; }
.telecharger .boutons { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.telecharger .btn { text-align: center; }
.telecharger .btn-ghost { color: #fff; border-color: rgba(245, 179, 1, .7); }
.telecharger .btn-ghost:hover { background: var(--yellow); color: var(--ink); }
.telecharger .dl-json { color: #e9dcc4; font-size: .88rem; text-align: center; }

/* ---------- sommaire et chapitres ---------- */
.programme { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; margin: 26px 0 0; padding: 22px 0; border-top: 1px solid var(--st-ligne); border-bottom: 1px solid var(--st-ligne); }
.pg-titre { display: flex; align-items: baseline; gap: 8px; font-weight: 800; font-size: 1.05rem; color: var(--st-brun); text-decoration: none; line-height: 1.25; }
.pg-titre span { font-size: 1.5rem; color: var(--st-or); }
.programme p { font-size: .86rem; color: var(--st-muted); margin: 4px 0 8px; }
.programme ul { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.programme li { padding: 2px 0; }
.ch-nav { position: sticky; top: var(--st-entete); z-index: 20; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none;
  background: #fffaf0; border-bottom: 1px solid var(--st-ligne); margin: 0 -22px; padding: 0 22px; }
.ch-nav::-webkit-scrollbar { display: none; }
.ch-nav a { flex: none; display: flex; align-items: center; gap: 6px; padding: 12px 10px 10px; font-weight: 600; font-size: .9rem; color: var(--st-muted);
  border-bottom: 3px solid transparent; white-space: nowrap; text-decoration: none; }
.ch-nav a span { font-size: .78rem; color: var(--st-faint); }
.ch-nav a:hover { color: var(--st-brun); text-decoration: none; }
.ch-nav a[aria-current="true"] { color: var(--st-brun); border-bottom-color: var(--yellow); }
.ch-nav .ch-nav-dl { margin-left: auto; color: #8a5d00; }
.chapitre { display: flex; align-items: center; gap: 22px; background: var(--st-brun); color: #fff; border-radius: var(--st-r); padding: 24px 28px; margin: 56px 0 24px;
  scroll-margin-top: calc(var(--st-entete) + 54px); border-left: 6px solid var(--yellow); }
.ch-num { font-weight: 800; font-size: 3.2rem; line-height: 1; color: var(--yellow); min-width: 1ch; }
.ch-kicker { margin: 0; font-weight: 700; font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: #bfae92; }
.ch-titre { margin: 2px 0 4px; font-weight: 800; font-size: 1.65rem; line-height: 1.15; color: #fff; }
.ch-resume { margin: 0; color: #dcd2c3; font-size: 1rem; }

/* ---------- graphiques : cadre ---------- */
.graph { --c1: #1d6595; --c2: #c4701a; --c3: #12a06b; --c4: #6b5f55; background: var(--st-carte); border: 1px solid var(--st-ligne); border-top: 4px solid var(--st-brun);
  border-radius: var(--st-r); padding: 22px 22px 14px; margin: 18px 0 28px; box-shadow: var(--st-ombre); scroll-margin-top: calc(var(--st-entete) + 54px); }
.c1 { --c: var(--c1); } .c2 { --c: var(--c2); } .c3 { --c: var(--c3); } .c4 { --c: var(--c4); }
.g-eyebrow { display: inline-block; font-weight: 700; font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: #8a5d00; margin-bottom: 4px; text-decoration: none; }
.g-titre strong { display: block; font-weight: 800; font-size: 1.15rem; line-height: 1.25; color: var(--st-brun); }
.g-titre span { display: block; font-size: .88rem; color: var(--st-muted); margin-top: 2px; }
.g-retenir { margin: 12px 0 4px; padding: 10px 14px; background: #fff6dc; border-left: 4px solid var(--yellow); border-radius: 0 8px 8px 0; font-size: .95rem; line-height: 1.45; }
.g-retenir strong { display: block; font-weight: 700; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: #8a5d00; margin-bottom: 2px; }
.g-lire { margin-top: 14px; font-size: .9rem; }
.g-lire summary { cursor: pointer; font-weight: 600; color: #8a5d00; list-style: none; display: inline-flex; align-items: center; gap: 8px; }
.g-lire summary::-webkit-details-marker { display: none; }
.g-lire summary::before { content: "?"; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--st-brun); color: #fff; font-size: .75rem; font-weight: 700; }
.g-lire p { margin: 6px 0 0; color: var(--st-muted); line-height: 1.5; }
.g-legende { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .86rem; margin: 12px 0 6px; }
.g-legende span { display: flex; align-items: center; gap: 7px; }
.g-legende i { width: 14px; height: 10px; border-radius: 2px; background: var(--c); display: inline-block; }
.g-legende i.g-itrait { width: 2px; height: 14px; background: var(--st-muted); border-radius: 0; }
.g-legende i.g-itrait.pointille { background: none; width: 0; border-left: 2px dashed var(--st-muted); }
.g-pied { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; font-size: .8rem; color: var(--st-faint); border-top: 1px solid var(--st-ligne); margin-top: 14px; padding-top: 9px; }
.g-pied strong { color: var(--st-muted); font-weight: 600; }
.g-pied a { color: #8a5d00; }
.g-dl { font-weight: 600; text-decoration: none; }
.g-dl::before { content: "↓ "; }
.g-dls { display: flex; gap: 14px; flex-wrap: wrap; }
.g-note { font-size: .83rem; color: var(--st-muted); margin: 10px 0 0; }
.g-explic { margin: 10px 0 0; font-size: .9rem; color: var(--st-muted); }
[data-leg][hidden] { display: none; }
.g-bulle { position: fixed; z-index: 160; max-width: 300px; background: var(--st-brun, #2b2723); color: #fff; font-size: .85rem; line-height: 1.4; padding: 8px 11px; border-radius: 8px;
  pointer-events: none; box-shadow: 0 10px 30px rgba(43, 39, 35, .3); white-space: pre-line; }
.graph [tabindex]:focus-visible { outline: 2px solid var(--st-brun); outline-offset: 2px; }

/* barres horizontales */
.g-barres { margin-top: 12px; }
.g-ligne { display: grid; grid-template-columns: minmax(8rem, 14rem) 1fr 4.8rem; gap: 10px; align-items: center; padding: 3px 0; font-size: .9rem; }
.g-ligne:hover { background: var(--st-fond); }
.g-lab { text-align: right; line-height: 1.2; }
.g-num { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.g-piste { position: relative; height: 20px; }
.g-barre { position: absolute; left: 0; top: 3px; bottom: 3px; background: var(--c); border-radius: 0 4px 4px 0; }
.g-accent .g-lab { font-weight: 700; color: #9a540f; }
.g-repere { position: absolute; top: -3px; bottom: -3px; width: 0; border-left: 2px solid var(--st-muted); }
.g-ref { padding: 0; height: 18px; }
.g-ref:hover { background: none; }
.g-ref .g-piste { height: 18px; }
.g-ref .g-piste em { position: absolute; bottom: 0; transform: translateX(-50%); font-style: normal; font-size: .76rem; color: var(--st-muted); white-space: nowrap; }
.g-empile .g-ligne { grid-template-columns: minmax(7rem, 12rem) 1fr 4.8rem; }
.g-entete { padding: 0; }
.g-entete:hover { background: none; }
.g-entete .g-num { font-size: .74rem; color: var(--st-muted); font-weight: 600; }
.g-pile-h { display: flex; height: 26px; gap: 2px; }
.g-pile-h .seg { display: flex; align-items: center; justify-content: center; min-width: 0; overflow: hidden; }
.g-pile-h .seg:first-child { border-radius: 4px 0 0 4px; }
.g-pile-h .seg:last-child { border-radius: 0 4px 4px 0; }
.g-pile-h .seg em { font-weight: 700; font-size: .76rem; font-style: normal; color: #fff; }
/* colonnes */
.g-colonnes { position: relative; display: flex; justify-content: space-around; align-items: flex-end; height: 250px; margin: 30px 0 34px 46px; border-bottom: 1px solid var(--st-ligne); gap: 6px; }
.g-colonnes.g-serre { gap: 3px; }
.g-grille { position: absolute; left: 0; right: 0; border-top: 1px solid var(--st-ligne); height: 0; }
.g-grille em { position: absolute; right: 100%; margin-right: 8px; transform: translateY(-50%); font-style: normal; font-size: .76rem; color: var(--st-muted); white-space: nowrap; }
.g-col { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; flex: 1 1 0; min-width: 0; }
.g-col:hover .seg { filter: brightness(1.08); }
.g-pile { width: min(54px, 80%); display: flex; flex-direction: column; position: relative; }
.g-pile .seg { display: block; border-radius: 4px 4px 0 0; }
.g-val { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 4px; font-weight: 700; font-size: .84rem; white-space: nowrap; }
.g-x { position: absolute; top: 100%; left: -4px; right: -4px; margin-top: 6px; font-weight: 600; font-size: .86rem; color: var(--st-brun); text-align: center; white-space: nowrap; }
.g-serre .g-x { font-size: .74rem; }
.g-ech .g-x { font-size: .74rem; white-space: normal; line-height: 1.1; }
/* courbes */
.g-lignes { position: relative; margin: 22px 72px 30px 44px; }
.g-zone { position: relative; height: 250px; }
.g-zone svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.g-zone polyline { fill: none; stroke: var(--c); stroke-width: 2.4px; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.g-zone .g-pt { position: absolute; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px #fff; z-index: 2; opacity: 0; }
.g-zone .g-pt::after { content: ""; position: absolute; inset: -6px; }
.g-zone .g-pt:hover, .g-zone .g-pt:focus, .g-zone .g-pt.g-dernier { opacity: 1; }
.g-fin { position: absolute; left: 100%; margin-left: 10px; transform: translateY(-50%); font-weight: 700; font-size: .84rem; color: var(--c); white-space: nowrap; }
.g-reforme { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px dashed var(--st-faint); z-index: 1; }
.g-reforme em { position: absolute; top: -18px; transform: translateX(-50%); font-style: normal; font-size: .72rem; color: var(--st-muted); white-space: nowrap; background: rgba(255, 255, 255, .92); padding: 0 3px; }
.g-xs { position: relative; height: 20px; margin-top: 10px; }
.g-xs em { position: absolute; transform: translateX(-50%); font-style: normal; font-size: .78rem; color: var(--st-muted); white-space: nowrap; }
/* carte */
.g-carte svg { display: block; width: 100%; max-width: 620px; height: auto; margin: 10px auto 0; }
.g-carte path { stroke: #fff; stroke-width: .6; stroke-linejoin: round; outline: none; cursor: default; }
.g-carte path:hover, .g-carte path:focus { stroke: var(--st-brun); stroke-width: 1.4; }
.g-bascule { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.g-bascule button { font: 600 .88rem var(--font); border: 2px solid var(--st-ligne); background: #fff; color: var(--st-brun); border-radius: 999px; padding: 5px 14px; cursor: pointer; }
.g-bascule button[aria-pressed="true"] { background: var(--st-brun); border-color: var(--st-brun); color: #fff; }

/* ---------- frise, tableaux ---------- */
.frise { list-style: none; margin: 18px 0 8px; padding: 0 0 0 22px; border-left: 3px solid var(--st-ligne); }
.frise li { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; padding: 8px 0 12px; max-width: none; }
.frise li::before { content: ""; position: absolute; left: -31px; top: 13px; width: 15px; height: 15px; border-radius: 50%; background: #fff; border: 3px solid var(--yellow-d); }
.f-date { font-weight: 800; font-size: 1rem; color: var(--st-brun); min-width: 9.5rem; }
.f-txt { flex: 1 1 24rem; font-weight: 600; }
.f-txt em { display: block; font-style: normal; font-weight: 400; color: var(--st-muted); font-size: .92rem; }
.tableau-scroll { overflow-x: auto; margin: 10px 0; border-radius: var(--st-r); border: 1px solid var(--st-ligne); background: #fff; }
.stats-page table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.stats-page thead th { background: var(--st-fond); font-weight: 700; font-size: .74rem; text-transform: uppercase; letter-spacing: .03em; color: var(--st-muted); text-align: left; padding: 11px 12px; }
.stats-page tbody td { padding: 8px 12px; border-top: 1px solid var(--st-ligne); }
.stats-page tbody tr:hover td { background: #fffaf0; }
.stats-page td.num, .stats-page th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stats-page tr.total td { background: #fff6dc; font-weight: 600; }
.stats-page caption { caption-side: bottom; text-align: left; font-size: .82rem; color: var(--st-faint); padding: 10px 12px; }
.deux-tableaux { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.petit { color: var(--st-faint); font-size: .85em; }

/* ---------- comprendre et réutiliser ---------- */
.lexique { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; margin: 14px 0 8px; }
.lexique > div { background: #fff; border: 1px solid var(--st-ligne); border-radius: var(--st-r); padding: 14px 16px; box-shadow: var(--st-ombre); min-width: 0; }
.lexique dt { font-weight: 800; font-size: 1.05rem; color: var(--st-brun); margin-bottom: 4px; scroll-margin-top: calc(var(--st-entete) + 60px); }
.lexique dd { margin: 0; font-size: .92rem; line-height: 1.5; }
.lexique .ex { display: block; margin-top: 6px; color: var(--st-muted); font-size: .86rem; }
.encart { border: 1px solid var(--st-ligne); border-left: 4px solid var(--st-brun); background: #fff; border-radius: var(--st-r); padding: 14px 18px; margin: 14px 0; }
.encart.alerte { border-left-color: var(--yellow); background: #fff9e8; }
.encart.info { border-left-color: var(--green); background: #f1f7ef; }
.encart h3 { margin: 0 0 .3rem; font-size: 1.05rem; }
.encart p { margin: 0; }
.stats-page .faq details { background: #fff; border: 1px solid var(--st-ligne); border-radius: var(--st-r); padding: 12px 16px; margin-bottom: 10px; }
.stats-page .faq summary { font-weight: 700; font-size: 1rem; color: var(--st-brun); cursor: pointer; }
.stats-page .faq details p { margin: .5rem 0 0; }
.source { font-size: .85rem; color: var(--st-faint); margin: 8px 0 24px; }
.source strong { color: var(--st-muted); }
.source a, ul.sources a, .g-note a { color: #8a5d00; }
ul.sources li { margin: .5em 0; }
.citer { background: #fff; border: 1px solid var(--st-ligne); border-radius: var(--st-r); padding: 16px 18px; margin: 16px 0; }
.citer blockquote { overflow-wrap: anywhere; margin: 8px 0 12px; padding: 10px 12px; background: var(--st-fond); border-radius: 8px; font-size: .92rem; }
.liste-images { columns: 2; column-gap: 28px; margin: 8px 0 0; padding-left: 1.1em; font-size: .92rem; }
.liste-images li { margin: .25em 0; break-inside: avoid; }
.verifiee { font-size: .86rem; color: var(--st-faint); border-top: 1px solid var(--st-ligne); padding-top: 12px; margin-top: 28px; }
.editions td .petit { display: block; }

@media (max-width: 980px) {
  .st-tuiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .programme { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .deux-tableaux { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .st-in { padding-left: 16px; padding-right: 16px; }
  .ch-nav { margin: 0 -16px; padding: 0 16px; }
  .g-ligne, .g-empile .g-ligne { grid-template-columns: 1fr 4.2rem; gap: 2px 8px; font-size: .85rem; padding: 4px 0; }
  .g-ligne .g-lab { grid-column: 1 / -1; text-align: left; }
  .g-ref .g-lab, .g-entete .g-lab { display: none; }
  .g-lignes { margin: 26px 12px 30px 36px; }
  .g-zone { height: 210px; }
  .g-fin { left: auto; right: 0; margin: 0; transform: translateY(-140%); font-size: .76rem; background: rgba(255, 255, 255, .9); padding: 0 3px; }
  .g-xs em:nth-child(even) { display: none; }
  .g-colonnes { height: 210px; margin-left: 38px; }
  .g-val { font-size: .7rem; }
  .g-serre .g-val { display: none; }
  .g-serre .g-x { font-size: .62rem; }
  .g-ech .g-x { font-size: .6rem; }
  .telecharger { grid-template-columns: 1fr; }
  .graph { padding: 16px 13px 12px; }
}
@media (max-width: 560px) {
  .tuile { padding: 14px 12px; }
  .t-lab { font-size: .85rem; }
  .programme { gap: 14px 12px; padding: 16px 0; }
  .programme p, .programme ul { display: none; }
  .pg-titre { font-size: .95rem; }
  .chapitre { padding: 18px; gap: 14px; margin-top: 40px; }
  .ch-num { font-size: 2.3rem; }
  .ch-titre { font-size: 1.25rem; }
  .ch-nav a { padding: 11px 8px 9px; font-size: .86rem; }
  .lexique { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; margin: 14px -16px 8px; padding: 0 16px 10px; }
  .lexique > div { flex: 0 0 82%; scroll-snap-align: start; }
  .liste-images { columns: 1; }
  .g-reforme em { font-size: .64rem; }
  .f-date { min-width: 0; }
  .st-hero .st-in { padding-bottom: 54px; }
}
.editions td { vertical-align: top; }
