/* =============================================================================
 * Deck SGPI CMA France 2030 : charte maison sur base DSFR (vendoré, offline).
 * Un slide = une section plein écran ; 3 zones : titre, texte, viz.
 * Les zones titre et texte sont des placeholders vides que l'auteur remplit.
 * ========================================================================== */

:root {
  --bf: #000091;                /* bleu France */
  --bf-hover: #1212a8;
  --ink: #1a1a24;
  --grey: #666;
  --grey-soft: #8a8a93;
  --grey-line: #ddd;
  --grey-axis: #b9b9c2;
  --alt: #f6f6f6;
  --ph: #9d9dc0;                /* teinte des placeholders a remplir */
  --open: #7f8fd4;              /* places ouvertes */
  --occ: #414f9c;               /* places occupees, effectifs reels */
  --top: #18753c;               /* vert DSFR, panneau Top */
  --flop: #c9191e;              /* rouge DSFR, panneau Flop */
}

html, body { height: 100%; margin: 0; }
body {
  font-family: Marianne, system-ui, sans-serif;
  color: var(--ink);
  background: #fff;
}

/* ===== Conteneur du deck : defilement par slide ============================ */
.deck {
  height: 100vh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
}
.slide {
  height: 100vh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  flex-direction: column;
  padding: 2.2rem 3.2rem 3.4rem;
  box-sizing: border-box;
  position: relative;
}

/* ===== En-tete de slide ===================================================== */
.slide-eyebrow {
  display: flex; align-items: center; gap: .7rem;
  margin-bottom: .55rem;
}
.slide-num {
  font-size: .78rem; font-weight: 700; letter-spacing: .14em;
  color: var(--bf); font-variant-numeric: tabular-nums;
}
.slide-eyebrow::after {
  content: ""; flex: 0 0 44px; height: 3px; background: var(--bf);
}

/* Zones a remplir par l'auteur : vides, marquage discret, editables */
.ph { outline: none; border-radius: 4px; }
.ph:empty::before { content: attr(data-ph); color: var(--ph); font-style: italic; font-weight: 400; }
.ph:hover, .ph:focus { box-shadow: inset 0 0 0 1px #cdcde8; }
.slide-title {
  font-size: 1.75rem; font-weight: 700; line-height: 1.2;
  margin: 0 0 .5rem; min-height: 2.1rem; max-width: 30ch;
}
.slide-text {
  font-size: .98rem; line-height: 1.5; color: #3a3a3a;
  margin: 0 0 1.1rem; min-height: 1.4rem; max-width: 78ch;
}

/* ===== Zone viz ============================================================= */
.slide-viz {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; overflow-x: hidden;
}
.viz-placeholder {
  height: 100%; box-sizing: border-box;
  border: 1.5px dashed var(--grey-axis); border-radius: 10px;
  background: var(--alt);
  display: flex; align-items: center; justify-content: center;
  padding: 2rem;
}
.viz-placeholder p {
  margin: 0; max-width: 62ch; text-align: center;
  color: var(--grey); font-size: .95rem; line-height: 1.55;
}
.viz-placeholder p strong { color: #3a3a3a; }

/* ===== Pied de slide (fixe dans chaque section) ============================ */
.slide-foot {
  position: absolute; left: 3.2rem; right: 3.2rem; bottom: 1.15rem;
  display: flex; justify-content: space-between; align-items: center;
  font-size: .74rem; color: var(--grey-soft);
  pointer-events: none;
}
.slide-foot .foot-brand { letter-spacing: .06em; }

/* ===== Couverture =========================================================== */
.slide-cover { background: var(--bf); color: #fff; justify-content: center; }
.slide-cover .cover-brand {
  font-size: .82rem; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; color: #aeaee6; margin-bottom: 2.6rem;
}
.slide-cover .cover-rule { width: 64px; height: 4px; background: #fff; margin-bottom: 1.6rem; }
.slide-cover .slide-title {
  color: #fff; font-size: 2.6rem; max-width: 26ch; min-height: 3rem; margin-bottom: .9rem;
}
.slide-cover .slide-text { color: #cfd0f2; font-size: 1.1rem; max-width: 60ch; }
.slide-cover .ph:empty::before { color: #7c7ccb; }
.slide-cover .ph:hover, .slide-cover .ph:focus { box-shadow: inset 0 0 0 1px #4a4ab8; }
.slide-cover .cover-date { font-size: .85rem; color: #aeaee6; margin-top: 2.4rem; }
.slide-cover .slide-foot { color: #8f8fd8; }

/* ===== Navigation (pagination globale) ===================================== */
.deck-nav {
  position: fixed; right: 1.05rem; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: .45rem; z-index: 30;
}
.deck-nav button {
  width: 9px; height: 9px; border-radius: 50%;
  border: 1px solid var(--grey-axis); background: transparent;
  padding: 0; cursor: pointer;
}
.deck-nav button.active { background: var(--bf); border-color: var(--bf); }
.deck-counter {
  position: fixed; right: 3.2rem; bottom: 1.15rem; z-index: 30;
  font-size: .74rem; color: var(--grey-soft); font-variant-numeric: tabular-nums;
}
.deck-counter.on-cover { color: #8f8fd8; }

/* ===== Controles de viz (selects DSFR compactes) =========================== */
.viz-controls {
  display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; align-items: flex-end;
  margin: 0 0 .9rem;
}
.viz-controls .fr-label { font-size: .8rem; margin-bottom: .15rem; }
.viz-controls .fr-select { font-size: .85rem; padding-top: .35rem; padding-bottom: .35rem; }
.viz-perim { font-size: .8rem; color: #444; margin: 0 0 .6rem; max-width: 100ch; }

/* ===== Graphique SVG (slide 2, mecanique places) =========================== */
.svg-chart {
  width: 100%; max-width: 1040px; height: auto; display: block;
  font-family: Marianne, system-ui, sans-serif;
}
.svg-chart text { fill: var(--ink); }
.svg-chart .axis-label { fill: var(--grey-soft); font-size: 11px; }
.svg-chart .bar-label { font-weight: 700; font-size: 13px; }
.svg-chart .cat-label { font-size: 13px; }
.svg-chart .taux-label { fill: #555; font-size: 11.5px; }
.pl-legend { display: flex; gap: 1.4rem; flex-wrap: wrap; margin: 0 0 .5rem; color: #3a3a3a; font-size: .85rem; }
.pl-legend > span { display: inline-flex; align-items: center; gap: .4rem; }
.pl-swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; flex: 0 0 auto; }
.viz-note {
  max-width: 1040px; margin: .4rem 0 0; color: #555; font-size: .78rem; line-height: 1.45;
  border-left: 3px solid var(--grey-axis); padding-left: .8rem;
}
.viz-source { color: #888; font-size: .72rem; margin: .7rem 0 0; max-width: 1040px; }

/* ===== Top 5 / Flop 5 (slide 6, version allegee) =========================== */
.tf-frame { color: #3a3a3a; margin: 0 0 .8rem; font-size: .85rem; max-width: 100ch; }
.tf-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.tf-panel { border: 1px solid #e3e3e8; border-radius: 8px; padding: .85rem 1rem .4rem; background: #fff; min-width: 0; }
.tf-top { border-top: 4px solid var(--top); }
.tf-flop { border-top: 4px solid var(--flop); }
.tf-head { font-size: .95rem; margin: 0 0 .25rem; }
.tf-top-txt { color: var(--top); }
.tf-flop-txt { color: var(--flop); }
.tf-list { list-style: none; margin: 0; padding: 0; }
.tf-row { display: flex; gap: .65rem; align-items: flex-start; padding: .55rem 0 .5rem; border-top: 1px solid #f0f0f4; }
.tf-row:first-child { border-top: none; }
.tf-rank { flex: 0 0 2.1rem; font-weight: 700; color: #55555f; font-size: .95rem; text-align: right; padding-top: .05rem; }
.tf-main { flex: 1 1 auto; min-width: 0; }
.tf-name { margin: 0; font-weight: 600; font-size: .9rem; line-height: 1.3; }
.tf-flag { font-weight: 700; }
.tf-bar { height: 6px; background: #f0f0f4; border-radius: 3px; margin: .3rem 0; overflow: hidden; }
.tf-bar span { display: block; height: 100%; border-radius: 3px; }
.tf-top-fill { background: var(--top); }
.tf-flop-fill { background: var(--flop); }
.tf-nums { margin: 0; font-size: .8rem; color: #3a3a3a; line-height: 1.45; }
.tf-warn { margin: .1rem 0 0; font-size: .73rem; line-height: 1.4; }
.tf-pct { flex: 0 0 auto; font-weight: 700; font-size: 1.05rem; padding-top: .05rem; }
.tf-top-txt2 { color: var(--top); }
.tf-flop-txt2 { color: var(--flop); }

/* Etat d'erreur de chargement */
.viz-error {
  border: 1px solid var(--flop); border-radius: 6px; background: #fbe9e5;
  color: #6e0b0e; padding: .8rem 1rem; font-size: .9rem;
}

/* ===== Responsive =========================================================== */
@media (max-width: 900px) {
  .slide { padding: 1.4rem 1.3rem 3rem; }
  .slide-foot { left: 1.3rem; right: 1.3rem; }
  .deck-counter { right: 1.3rem; }
  .slide-title { font-size: 1.35rem; }
  .slide-cover .slide-title { font-size: 1.8rem; }
  .tf-wrap { grid-template-columns: 1fr; }
  .deck-nav { display: none; }
}
