/* Charte Open Investigation : fond blanc, Montserrat (corps), Playfair Display (titres),
   boutons carrés, accent bleu #1e3a8a. Calqué sur conseil-constitutionnel.open-investigation.org */

:root {
  --bg: #ffffff;
  --bg-soft: #f7f7f8;
  --line: #c4c8d0;
  --ink: #14161a;
  --body: #2a2e35;
  --muted: #4b4f58;
  --accent: #1e3a8a;
  --accent-soft: #eef1f8;
  --good: #2e7d32;
  --bad: #b3261e;
  --gold: #c08a1e;
  --radius: 0;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Montserrat', sans-serif;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--body);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: 'Playfair Display', serif; color: var(--ink); line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 800; margin: 0 0 1rem; }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.3rem); font-weight: 700; margin: 0 0 1.2rem; }
h3 { font-size: 1.15rem; font-weight: 600; margin: 0 0 .5rem; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
p { margin: 0 0 1rem; }
strong { font-weight: 600; color: var(--ink); }

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ── Boutons ── */
.btn {
  font-family: inherit; font-size: .95rem; font-weight: 600;
  background: var(--accent); color: #fff; border: 0;
  padding: 10px 18px; cursor: pointer; border-radius: var(--radius);
  display: inline-block; text-decoration: none;
}
.btn:hover { background: #16306e; text-decoration: none; }

/* ── Header ── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px; gap: 16px;
}
.brand { display: flex; flex-direction: column; line-height: 1.15; }
.brand-title { font-family: 'Playfair Display', serif; font-weight: 800; font-size: 1.15rem; color: var(--ink); }
.brand-sub { font-size: .72rem; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.site-nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.site-nav a { color: var(--body); font-size: .92rem; font-weight: 500; }
.site-nav a:hover { color: var(--accent); text-decoration: none; }
.site-nav a.active { color: var(--accent); font-weight: 700; }
.burger { display: none; background: none; border: 0; font-size: 1.6rem; cursor: pointer; color: var(--ink); line-height: 1; padding: 4px 8px; }

/* ── Hero ── */
.hero {
  padding: 64px 24px 48px; max-width: 1080px; margin: 0 auto;
  background: linear-gradient(135deg, var(--accent-soft) 0%, #fff 55%);
  border-bottom: 3px solid var(--accent);
}
.kicker { color: var(--accent); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; font-size: .85rem; margin-bottom: 12px; }
.lead { font-size: 1.15rem; color: var(--body); max-width: 780px; }
.hero-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 32px; }
.stat {
  display: block; border: 1px solid var(--line); border-top: 4px solid var(--accent);
  padding: 20px 22px; background: var(--bg-soft); text-decoration: none; color: inherit;
  transition: box-shadow .15s, border-color .15s;
}
.stat:hover { box-shadow: 0 4px 16px rgba(30, 58, 138, .12); text-decoration: none; }
.stat-num { display: block; font-family: 'Playfair Display', serif; font-size: 2.1rem; font-weight: 800; color: var(--accent); }
.stat-label { font-size: .95rem; color: var(--ink); font-weight: 600; display: block; margin-top: 4px; }
.stat-plain { font-size: .96rem; color: var(--body); display: block; margin-top: 8px; line-height: 1.55; }
.stat-detail { font-size: .86rem; color: var(--muted); display: block; margin-top: 8px; line-height: 1.5; }
.stat-cta { font-size: .82rem; color: var(--accent); font-weight: 700; display: block; margin-top: 12px; }
.stat:hover .stat-cta { text-decoration: underline; }

/* ── Sections ── */
.section { padding: 48px 24px; max-width: 1080px; margin: 0 auto; }
.section-sub { color: var(--muted); max-width: 720px; font-size: 1.02rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.card { border: 1px solid var(--line); padding: 22px; background: var(--bg-soft); font-size: 1.02rem; line-height: 1.6; }
.card-good { border-top: 4px solid var(--good); }
.card-bad { border-top: 4px solid var(--bad); }
.card-accent { border-top: 4px solid var(--accent); }
.fact-list { margin: 0; padding-left: 1.1rem; }
.fact-list li { margin-bottom: .6rem; }

/* ── Cards de navigation (accueil) ── */
.nav-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; margin-top: 30px; }
.nav-card { border: 1px solid var(--line); border-top: 4px solid var(--accent); padding: 22px; background: var(--bg-soft); transition: box-shadow .15s; }
.nav-card:hover { box-shadow: 0 4px 16px rgba(30, 58, 138, .12); text-decoration: none; }
.nav-card h4 { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 1.1rem; color: var(--ink); margin-bottom: 8px; }
.nav-card p { font-size: .98rem; color: var(--muted); margin: 0; }

/* ── Barres pays avec drapeaux ── */
.flag-bars { display: flex; flex-direction: column; gap: 14px; margin: 20px 0; }
.flag-bar { display: grid; grid-template-columns: 28px 110px 1fr 56px; align-items: center; gap: 12px; }
.flag { font-size: 1.3rem; }
.flag-country { font-size: .88rem; font-weight: 600; color: var(--ink); }
.flag-track { background: var(--bg-soft); height: 20px; border: 1px solid var(--line); overflow: hidden; }
.flag-fill { display: block; height: 100%; background: var(--gold); }
.flag-pct { font-size: .88rem; font-weight: 700; color: var(--accent); text-align: right; }
@media (max-width: 560px) { .flag-bar { grid-template-columns: 24px 80px 1fr 44px; gap: 8px; } }

/* ── Timeline (événements) ── */
.timeline { border-left: 3px solid var(--line); padding-left: 24px; display: flex; flex-direction: column; gap: 18px; }
.tl-item { position: relative; cursor: pointer; }
.tl-item::before { content: ''; position: absolute; left: -31px; top: 6px; width: 11px; height: 11px; background: var(--accent); border-radius: 50%; }
.tl-item.contextuel::before { background: var(--muted); }
.tl-year { font-family: 'Playfair Display', serif; font-weight: 800; color: var(--accent); margin-right: 10px; }
.tl-item.contextuel .tl-year { color: var(--muted); }
.tl-title { font-weight: 600; color: var(--ink); }
.tl-badge { display: inline-block; font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 2px 9px; margin-left: 8px; color: #fff; border-radius: var(--radius); vertical-align: middle; }
.tl-badge.causal { background: var(--accent); }
.tl-badge.contextuel { background: var(--muted); }
.tl-detail { display: none; margin-top: 10px; font-size: 1rem; color: var(--body); background: var(--bg-soft); padding: 14px 16px; border-left: 3px solid var(--accent); line-height: 1.6; }
.tl-item.contextuel .tl-detail { border-left-color: var(--muted); }
.tl-item.open .tl-detail { display: block; }
.tl-hint { font-size: .9rem; color: var(--muted); margin-left: 8px; }
.tl-item.with-img { display: flex; gap: 18px; align-items: flex-start; }
.tl-img { width: 120px; height: 90px; object-fit: cover; object-position: top; flex-shrink: 0; border: 1px solid var(--line); }
.tl-item.with-img .tl-body { flex: 1; }
@media (max-width: 560px) { .tl-item.with-img { flex-direction: column; } .tl-img { width: 100%; height: 160px; } }

/* ── Encart méthodologie ── */
.methodo-box { background: var(--accent-soft); border-left: 4px solid var(--accent); padding: 20px 22px; margin: 24px 0; font-size: 1.02rem; line-height: 1.6; color: var(--ink); }
.methodo-box strong { color: var(--accent); }

/* ── Graphiques SVG ── */
.chart-container { border: 1px solid var(--line); background: var(--bg-soft); padding: 24px 28px; margin: 24px 0; }
.chart-title { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 1.2rem; color: var(--ink); margin-bottom: 4px; }
.chart-subtitle { font-size: .98rem; color: var(--muted); margin-bottom: 18px; line-height: 1.5; }
.chart-note { font-size: .92rem; color: var(--muted); margin-top: 14px; line-height: 1.6; }
.chart-container svg { max-width: 100%; height: auto; display: block; }
.axis-label { font-size: 11px; fill: var(--muted); }
.year-label { font-size: 11px; fill: var(--body); }
.value-label { font-size: 12px; font-weight: 600; fill: var(--ink); }
.event-label { font-size: 10.5px; fill: var(--muted); }
.gridline { stroke: var(--line); stroke-width: 1; }
.baseline { stroke: #c3c2b7; stroke-width: 1; }
.gap-line { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 3 4; opacity: 0.5; }

/* ── Slider détenteurs ── */
.slider-container { margin: 20px 0; }
.slider-input { width: 100%; height: 6px; border-radius: 3px; background: var(--line); outline: none; -webkit-appearance: none; accent-color: var(--accent); }
.slider-input::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); cursor: pointer; }
.slider-input::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); cursor: pointer; border: none; }
.slider-labels { display: flex; justify-content: space-between; margin-top: 12px; font-size: .82rem; color: var(--muted); font-weight: 600; }

/* ── Présidents ── */
.presidents { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.president-card { border: 1px solid var(--line); background: var(--bg-soft); overflow: hidden; }
.president-card img { width: 100%; aspect-ratio: 4/5; object-fit: cover; display: block; background: var(--bg-soft); }
.president-body { padding: 14px 16px; }
.president-name { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 1rem; color: var(--ink); margin: 0 0 2px; }
.president-years { color: var(--accent); font-weight: 600; font-size: .82rem; display: block; margin-bottom: 8px; }
.president-dette { font-size: .95rem; color: var(--muted); }
.president-dette strong { color: var(--ink); }
.tag { display: inline-block; font-size: .66rem; font-weight: 700; color: #fff; padding: 2px 8px; margin-bottom: 8px; border-radius: var(--radius); text-transform: uppercase; letter-spacing: .03em; }
.tag-gaulliste { background: #1e3a8a; }
.tag-centriste { background: #6b7280; }
.tag-socialiste { background: #b3261e; }
.tag-lrem { background: #d4a017; }

@media (max-width: 900px) { .presidents { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .presidents { grid-template-columns: 1fr; } }

/* ── Footer ── */
.site-footer { border-top: 1px solid var(--line); padding: 32px 24px; max-width: 1080px; margin: 0 auto; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 10px; }
.footer-links a { font-size: .88rem; color: var(--body); }
.footer-note { font-size: .8rem; color: var(--muted); margin: 0; }

@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .hero-stats, .grid-3, .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .burger { display: block; }
  .site-nav {
    display: none; flex-direction: column; align-items: flex-start; gap: 0;
    position: absolute; top: 100%; left: 0; right: 0; background: #fff;
    border-bottom: 1px solid var(--line); padding: 8px 24px 16px; z-index: 49;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 10px 0; width: 100%; border-bottom: 1px solid var(--line); }
  .site-nav a:last-child { border-bottom: 0; }
}
