/* ═══════════════════════════════════════════════════════════
   FARM Observatoire — CSS public
   Palette fidèle à la maquette Tailwind (couleurs hardcodées)
   Police : Inter via Google Fonts (chargée dans le layout)
   ═══════════════════════════════════════════════════════════ */

/* ─── Variables ──────────────────────────────────────────── */
:root {
  --teal:         #0f4d4a;
  --teal-mid:     #1d6e64;
  --teal-light:   #e1f5ee;
  --teal-accent:  #5dcaa5;
  --teal-300:     #448078;   /* couleur graphiques DPAA / PTF */
  --blue-chart:   #2092ba;   /* couleur graphiques consommation / output */
  --amber-chart:  #cd9f28;   /* couleur graphiques services collectifs */
  --red-chart:    #a92a3f;   /* couleur graphiques SPM négatif / infrastructure */
  --purple-chart: #8b5cf6;
  --orange-chart: #f97316;
  --gray-chart:   #94a3b8;
  --sand:         #f4ebd0;
  --sand-border:  #e6d8b3;
  --slate-50:     #f8fafc;
  --slate-100:    #f1f5f9;
  --slate-200:    #e2e8f0;
  --slate-400:    #94a3b8;
  --slate-500:    #64748b;
  --slate-700:    #334155;
  --slate-800:    #1e293b;
  --gray-100:     #f3f4f6;
  --gray-200:     #e5e7eb;
  --gray-400:     #9ca3af;
  --gray-500:     #6b7280;
  --gray-700:     #374151;
  --gray-800:     #1f2937;
  --white:        #ffffff;
  --yellow-50:    #fefce8;
  --yellow-100:   #fef9c3;
  --yellow-600:   #ca8a04;

  --radius-sm:    8px;
  --radius:       12px;
  --radius-lg:    16px;
  --radius-xl:    24px;
  --radius-2xl:   32px;

  --shadow-sm:    0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:       0 4px 12px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.04);
  --shadow-md:    0 8px 24px rgba(0,0,0,.10), 0 4px 8px rgba(0,0,0,.06);

  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, monospace;

  --max-w: 80rem;       /* 1280px */
  --page-px: 2rem;
  --section-gap: 3rem;
}

/* ─── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--slate-50);
  color: var(--gray-800);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
select { font-family: inherit; }

/* ─── Layout page ────────────────────────────────────────── */
.page-wrapper {
  min-height: 100vh;
  padding: var(--page-px);
}
.page-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
}

/* ═══════════════════════════════════════════════════════════
   EN-TÊTE PAYS
   ═══════════════════════════════════════════════════════════ */
.country-header {
  background: var(--sand);
  border: 1px solid var(--sand-border);
  border-radius: var(--radius-2xl);
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  position: relative;
  overflow: hidden;
}

.country-header__left { display: flex; flex-direction: column; gap: 1.25rem; }
.country-header__title-row { display: flex; align-items: center; gap: 1.25rem; }

.country-name {
  font-size: clamp(2.5rem, 8vw, 3.75rem);
  font-weight: 900;
  color: var(--teal);
  letter-spacing: -.03em;
  line-height: 1;
}

.country-flag {
  width: 4rem;
  height: auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--sand-border);
}

.country-badges { display: flex; flex-wrap: wrap; gap: .75rem; }
.country-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: rgba(255,255,255,.7);
  border: 1px solid var(--sand-border);
  color: var(--teal);
  padding: .6rem 1.25rem;
  border-radius: 999px;
  font-size: .875rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: background .15s;
}
.country-badge:hover { background: var(--white); }
.country-badge svg { flex-shrink: 0; }

/* Sélecteur de pays */
.country-selector { display: flex; flex-direction: column; gap: .5rem; }
.country-selector label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: rgba(15,77,74,.6);
}
.country-selector__wrap { position: relative; width: 16rem; max-width: 100%; }
.country-select {
  appearance: none;
  width: 100%;
  background: var(--white);
  border: 1px solid var(--sand-border);
  color: var(--teal);
  font-size: 1.1rem;
  font-weight: 700;
  padding: .75rem 3rem .75rem 1.25rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.country-select:hover  { border-color: var(--teal); }
.country-select:focus  { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15,77,74,.15); }
.country-selector__chevron {
  pointer-events: none;
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--teal);
}

/* ═══════════════════════════════════════════════════════════
   TITRE DE SECTION
   ═══════════════════════════════════════════════════════════ */
.section-title { margin-bottom: 1.5rem; }
.section-title h2 {
  display: inline-block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--slate-800);
  border-bottom: 2px solid var(--teal);
  padding-bottom: .4rem;
}
.section-title p {
  margin-top: .5rem;
  font-size: .875rem;
  color: var(--slate-500);
}

/* ═══════════════════════════════════════════════════════════
   CARTE SECTION (fond blanc, ombre)
   ═══════════════════════════════════════════════════════════ */
.section-card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

/* ─── Source bas de section ──────────────────────────────── */
.section-source {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--slate-100);
  font-size: .75rem;
  color: var(--slate-400);
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════════
   S2 — KPI CARDS
   ═══════════════════════════════════════════════════════════ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
@media (min-width: 640px)  { .kpi-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .kpi-grid { grid-template-columns: repeat(6, 1fr); } }

.kpi-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .25s, box-shadow .25s;
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--teal), var(--teal-accent));
  opacity: 0;
  transition: opacity .25s;
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.kpi-card:hover::before { opacity: 1; }

.kpi-card__icon {
  color: var(--teal-accent);
  margin-bottom: .75rem;
  opacity: .85;
  line-height: 1;
}
.kpi-card[data-empty="true"] .kpi-card__icon { opacity: .3; }

.kpi-card__value {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--teal-mid);
  line-height: 1;
  transition: transform .2s;
}
.kpi-card:hover .kpi-card__value { transform: scale(1.05); }
.kpi-card[data-empty="true"] .kpi-card__value { color: var(--gray-400); font-size: 2.25rem; }

.kpi-card__unit {
  font-size: .875rem;
  font-weight: 500;
  color: var(--teal-mid);
  vertical-align: middle;
  opacity: .7;
}

.kpi-card__label {
  font-size: .8rem;
  font-weight: 500;
  color: var(--gray-500);
  margin-top: .5rem;
  transition: color .15s;
  line-height: 1.3;
}
.kpi-card:hover .kpi-card__label { color: var(--gray-700); }

.kpi-card__source {
  font-size: .625rem;
  color: var(--gray-400);
  margin-top: .5rem;
  font-style: italic;
  line-height: 1.4;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════
   GRAPHIQUES — Wrapper & Titres
   ═══════════════════════════════════════════════════════════ */
.chart-wrap { position: relative; }
.chart-title {
  text-align: center;
  font-size: .875rem;
  font-weight: 700;
  color: var(--slate-800);
  margin-bottom: .25rem;
}
.chart-subtitle {
  text-align: center;
  font-size: .75rem;
  color: var(--slate-500);
  margin-bottom: 1.5rem;
}
.chart-canvas-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;   /* évite que Chart.js force le canvas hors du conteneur */
}
/* Hauteurs fixes selon contexte */
.chart-h-400 { height: 400px; }
.chart-h-350 { height: 350px; }
.chart-h-320 { height: 320px; }
.chart-h-280 { height: 280px; }
.chart-h-240 { height: 240px; }

/* ─── Légende manuelle (colorée) ────────────────────────── */
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .75rem 1.5rem;
  margin-top: 1rem;
  font-size: .75rem;
  color: var(--gray-700);
}
.chart-legend__item { display: flex; align-items: center; gap: .4rem; }
.chart-legend__dot {
  width: 12px; height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
}
.chart-legend__dot--circle { border-radius: 50%; }

/* ─── Grilles de graphiques ────────────────────────────── */
.chart-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 1024px) {
  .chart-grid-2 { grid-template-columns: 1fr 1fr; }
}

.chart-grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 768px)  { .chart-grid-3 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .chart-grid-3 { grid-template-columns: 1fr 1fr 1fr; } }

/* ─── Filtre année (select inline) ─────────────────────── */
.chart-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.chart-filter-row h3 {
  font-size: .875rem;
  font-weight: 600;
  color: var(--gray-800);
  flex: 1;
}
.chart-year-select {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: .25rem .75rem;
  font-size: .875rem;
  background: var(--white);
  color: var(--gray-800);
  outline: none;
  transition: border-color .15s;
}
.chart-year-select:focus { border-color: var(--teal); }

/* ─── Commerce : 2 graphiques côte à côte ───────────────── */
/* ─── S6 : grille 50/25/25 (SPM | Export | Import) ─────── */
.s6-grid {
  display: grid;
  grid-template-columns: 1fr;          /* mobile : 1 colonne */
  gap: 1.5rem;
  min-width: 0;
  overflow: hidden;
}
@media (min-width: 768px) {
  .s6-grid { grid-template-columns: 1fr 1fr; }  /* tablette : 2 cols */
}
@media (min-width: 1024px) {
  .s6-grid { grid-template-columns: 2fr 1fr 1fr; } /* desktop : 50/25/25 */
}

.s6-col {
  min-width: 0;          /* empêche le dépassement dans la grille CSS */
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.s6-trade-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .75rem;
  min-height: 2.5rem;    /* alignement vertical avec le sélecteur de la col 2 */
}
.s6-trade-header h3 {
  font-size: .8rem;
  font-weight: 600;
  color: var(--gray-800);
  flex: 1;
  line-height: 1.3;
}
.s6-trade-header--hidden {
  visibility: hidden;    /* spacer invisible : conserve l'espace, masque le contenu */
}

/* Héritage : trade-grid conservé pour rétrocompatibilité éventuelle */
.trade-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  min-width: 0;
}
@media (max-width: 640px) { .trade-grid { grid-template-columns: 1fr; } }

.trade-label {
  text-align: center;
  font-size: .75rem;
  font-weight: 700;
  margin-bottom: .5rem;
}

/* ═══════════════════════════════════════════════════════════
   S7 — BARRES DE PROGRESSION SÉCURITÉ ALIMENTAIRE
   ═══════════════════════════════════════════════════════════ */
.secu-panel {
  background: var(--slate-50);
  border: 1px solid var(--slate-100);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-height: 320px;
}

.secu-item__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .75rem;
  margin-bottom: .5rem;
}
.secu-item__label {
  font-size: .875rem;
  font-weight: 700;
  color: var(--gray-800);
  display: block;
  line-height: 1.3;
}
.secu-item__desc {
  font-size: .625rem;
  color: var(--gray-500);
  display: block;
  margin-top: .25rem;
  line-height: 1.4;
}
.secu-item__score {
  font-size: .875rem;
  font-weight: 700;
  color: var(--teal-mid);
  white-space: nowrap;
  flex-shrink: 0;
}
.progress-track {
  width: 100%;
  background: var(--gray-200);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--teal-300);
  border-radius: 999px;
  transition: width .6s cubic-bezier(.4,0,.2,1);
}

/* ─── S7 grille PTF + secu ──────────────────────────────── */
.s7-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 1.5rem;
}
@media (min-width: 1024px) {
  .s7-grid { grid-template-columns: 2fr 1fr; }
}

/* ═══════════════════════════════════════════════════════════
   S8 — POLITIQUES PUBLIQUES
   ═══════════════════════════════════════════════════════════ */
.policy-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.policy-card {
  background: var(--yellow-50);
  border: 1px solid var(--yellow-100);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.policy-card__icon { color: var(--yellow-600); margin-bottom: 1rem; }
.policy-card__label {
  font-size: .8rem;
  color: var(--gray-500);
  font-weight: 500;
  margin-bottom: .25rem;
}
.policy-card__value { font-size: 1rem; font-weight: 700; color: var(--gray-800); }

/* ─── Accordéon Focus politique ─────────────────────────── */
.accordion {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}
.accordion__btn {
  width: 100%;
  background: var(--teal);
  color: var(--white);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: none;
  transition: background .15s;
  text-align: left;
}
.accordion__btn:hover { background: var(--teal-mid); }
.accordion__btn.is-open { background: var(--teal-mid); }

.accordion__btn-left { display: flex; align-items: center; gap: .75rem; }
.accordion__surtitre { font-size: .875rem; font-weight: 600; color: rgba(255,255,255,.8); display: block; }
.accordion__titre    { font-size: 1.125rem; font-weight: 700; display: block; }
.accordion__chevron  { width: 36px; height: 36px; background: rgba(0,0,0,.2); border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: transform .25s; }
.accordion__chevron.is-open { transform: rotate(180deg); }

.accordion__body {
  display: none;
  padding: 2rem;
  background: var(--slate-50);
  border-top: 1px solid var(--gray-100);
}
.accordion__body.is-open { display: block; }
.accordion__inner { max-width: 64rem; margin: 0 auto; display: flex; flex-direction: column; gap: 2.5rem; }

.focus-context h4 {
  font-size: 1.125rem;
  font-weight: 700;
  color: #0c3b39;
  margin-bottom: .75rem;
}
.focus-context p { color: var(--gray-700); line-height: 1.7; margin-bottom: 1rem; }
.focus-context strong { color: var(--teal-mid); }

/* Grille media */
.focus-media { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 640px) { .focus-media { grid-template-columns: 1fr; } }

.media-photo-wrap {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  aspect-ratio: 16/9;
}
.media-photo-wrap img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s;
}
.media-photo-wrap:hover img { transform: scale(1.04); }
.media-photo-caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(0,0,0,.75), transparent);
  padding: 1rem;
  color: var(--white);
  font-size: .875rem;
  font-weight: 500;
}

.media-video-wrap {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: #1e293b;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  aspect-ratio: 16/9;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.media-video-wrap img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: .5;
  transition: opacity .3s;
}
.media-video-wrap:hover img { opacity: .3; }
.media-video-wrap__play { position: relative; z-index: 1; text-align: center; color: var(--white); }
.media-video-wrap__play svg { transition: transform .3s; filter: drop-shadow(0 2px 8px rgba(0,0,0,.5)); }
.media-video-wrap:hover .media-video-wrap__play svg { transform: scale(1.1); }
.media-video-wrap__label { font-size: .875rem; font-weight: 500; margin-top: .5rem; }

/* ─── Paroles d'acteurs ─────────────────────────────────── */
.actors-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 768px) { .actors-grid { grid-template-columns: 1fr 1fr; } }

.actor-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}
.actor-card__quote-icon {
  position: absolute; top: 1rem; right: 1rem;
  color: rgba(15,77,74,.08);
}
.actor-card__quote {
  font-style: italic;
  font-size: .875rem;
  color: var(--gray-700);
  line-height: 1.7;
  margin-bottom: 1rem;
  position: relative;
}
.actor-video-thumb {
  position: relative; border-radius: var(--radius-sm);
  overflow: hidden; border: 1px solid var(--gray-200);
  aspect-ratio: 16/9; background: #1e293b; cursor: pointer;
  box-shadow: var(--shadow-sm); margin-bottom: 1rem;
}
.actor-video-thumb img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: .8; transition: opacity .3s;
}
.actor-video-thumb:hover img { opacity: .6; }
.actor-video-thumb__play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
}
.actor-video-thumb__play svg { filter: drop-shadow(0 2px 4px rgba(0,0,0,.4)); }
.actor-video-thumb:hover .actor-video-thumb__play svg { transform: scale(1.1); transition: transform .25s; }
.actor-video-thumb__duration {
  position: absolute; bottom: .5rem; right: .5rem;
  background: rgba(0,0,0,.7); color: var(--white);
  font-size: .7rem; font-weight: 600; padding: .15rem .4rem; border-radius: 4px;
}
.actor-identity { display: flex; align-items: center; gap: .75rem; }
.actor-identity__icon {
  background: var(--teal-light); border: 1px solid rgba(15,77,74,.15);
  border-radius: 50%; width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.actor-identity__name { font-size: .875rem; font-weight: 700; color: var(--teal); }
.actor-identity__role { font-size: .75rem; color: var(--gray-500); }

/* Interview card */
.interview-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  display: flex; flex-direction: column; justify-content: space-between;
}
.interview-card:hover { border-color: var(--teal-accent); box-shadow: var(--shadow); }
.interview-badge { background: #ffe4e6; color: #be123c; font-size: .7rem; font-weight: 700; padding: .2rem .6rem; border-radius: 4px; display: inline-block; }
.interview-format { font-size: .75rem; color: var(--gray-400); margin-left: .5rem; }
.interview-title { font-size: 1rem; font-weight: 700; color: var(--gray-800); line-height: 1.3; margin: .75rem 0 .5rem; }
.interview-card:hover .interview-title { color: var(--teal-mid); }
.interview-desc { font-size: .875rem; color: var(--gray-600); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.interview-footer { display: flex; align-items: center; gap: 1rem; border-top: 1px solid var(--gray-100); padding-top: 1rem; margin-top: 1rem; }
.interview-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.interview-footer__name { font-size: .875rem; font-weight: 700; color: var(--gray-800); }
.interview-footer__role { font-size: .75rem; color: var(--gray-500); }
.interview-play-btn {
  margin-left: auto; flex-shrink: 0;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--teal-light); color: var(--teal);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.interview-card:hover .interview-play-btn { background: var(--teal); color: var(--white); }

/* ─── Documents ─────────────────────────────────────────── */
.docs-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 640px) { .docs-grid { grid-template-columns: 1fr 1fr; } }

.doc-link {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem; border-radius: var(--radius);
  border: 1px solid var(--gray-200); background: var(--white);
  transition: border-color .15s, box-shadow .15s;
}
.doc-link:hover { border-color: var(--teal-accent); box-shadow: var(--shadow-sm); }
.doc-link__icon {
  padding: .75rem; border-radius: var(--radius-sm); flex-shrink: 0;
  transition: background .15s;
}
.doc-link--pdf  .doc-link__icon { background: #fef2f2; }
.doc-link--word .doc-link__icon { background: #eff6ff; }
.doc-link:hover .doc-link__icon { filter: brightness(.95); }
.doc-link__name { font-size: .875rem; font-weight: 700; color: var(--gray-800); transition: color .15s; display: block; }
.doc-link:hover .doc-link__name { color: var(--teal-mid); }
.doc-link__meta { font-size: .75rem; color: var(--gray-500); margin-top: .25rem; }

/* ─── Citation FARM ─────────────────────────────────────── */
.farm-quote {
  background: linear-gradient(135deg, #1d4d4a 0%, #2d3748 100%);
  border: 1px solid #1a3d3a;
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  box-shadow: inset 0 2px 8px rgba(0,0,0,.2);
}
.farm-quote__text {
  font-size: 1.125rem;
  color: var(--white);
  font-style: italic;
  font-weight: 300;
  line-height: 1.6;
  margin-bottom: 1rem;
}
.farm-quote__author { font-size: .875rem; font-weight: 600; color: var(--teal-accent); }

/* ─── Bouton téléchargement final ──────────────────────── */
.download-btn-wrap { display: flex; justify-content: center; padding: 1rem 0 2rem; }
.download-btn {
  display: inline-flex; align-items: center; gap: .75rem;
  background: var(--teal);
  color: var(--white);
  padding: 1rem 2rem;
  border-radius: var(--radius);
  font-size: 1.125rem;
  font-weight: 700;
  border: none;
  box-shadow: var(--shadow);
  transition: background .15s, transform .2s, box-shadow .2s;
}
.download-btn:hover { background: var(--teal-mid); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.download-btn svg { transition: transform .3s; }
.download-btn:hover svg { transform: translateY(2px); }

/* ═══════════════════════════════════════════════════════════
   ÉTATS : CHARGEMENT / ERREUR / VIDE
   ═══════════════════════════════════════════════════════════ */
.state-loading {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 3rem; gap: 1rem; color: var(--gray-400);
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin  { to { transform: rotate(360deg); } }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .45; }
}

.state-unavailable {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 2.5rem; gap: .5rem;
  color: var(--gray-400); font-size: .875rem; text-align: center;
}
.state-unavailable svg { opacity: .4; margin-bottom: .25rem; }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE TWEAKS
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  :root {
    --page-px: 1rem;
    --section-gap: 2rem;
  }
  .country-header { padding: 1.5rem; }
  .country-name { font-size: 2.5rem; }
  .country-selector__wrap { width: 100%; }
  .section-card { padding: 1rem; }
  .chart-h-400 { height: 280px; }
  .chart-h-350 { height: 260px; }
  .chart-h-320 { height: 220px; }
  .accordion__body { padding: 1rem; }
  .focus-media { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .chart-filter-row { flex-direction: column; align-items: flex-start; gap: .5rem; }
}

/* ─── Scrollbar fine ────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ─── Focus visible ─────────────────────────────────────── */
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
