/* ═══════════════════════════════════════════════════════════════
   BILAN PARC VÉHICULES – GRAND EST  |  feuille de style
   Compatibilité : bookdown::gitbook  +  Quarto html
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. MARIANNE (DSFR) ─────────────────────────────────────── */
@font-face {
  font-family: "Marianne";
  src: url("https://cdn.jsdelivr.net/npm/@gouvfr/dsfr@1.12.1/dist/fonts/Marianne-Regular.woff2")
       format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Marianne";
  src: url("https://cdn.jsdelivr.net/npm/@gouvfr/dsfr@1.12.1/dist/fonts/Marianne-Medium.woff2")
       format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Marianne";
  src: url("https://cdn.jsdelivr.net/npm/@gouvfr/dsfr@1.12.1/dist/fonts/Marianne-Bold.woff2")
       format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

/* ── 2. BASE ────────────────────────────────────────────────── */
body,
.book-body,
.page-inner,
.container-fluid {
  font-family: "Marianne", "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: #2a2a2a;
  background-color: #fafaf8;
}

/* ── 3. TITRES ──────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: "Marianne", sans-serif;
  font-weight: 700;
  color: #003189;
  line-height: 1.3;
}

/* Titre de chapitre principal */
h1 {
  font-size: 1.65em;
  margin-top: 2rem;
  margin-bottom: 0.6rem;
  padding-bottom: 0.35rem;
  border-bottom: 3px solid #003189;
}

/* Section */
h2 {
  font-size: 1.2em;
  font-weight: 500;
  color: #1a1a1a;
  margin-top: 1.8rem;
  margin-bottom: 0.4rem;
  padding-left: 0.75rem;
  border-left: 4px solid #00a3a6;
}

/* Sous-section */
h3 {
  font-size: 1.05em;
  font-weight: 500;
  color: #444;
  margin-top: 1.4rem;
}

/* ── 4. TEXTE COURANT ───────────────────────────────────────── */
p {
  margin-bottom: 1rem;
  max-width: 78ch;
}

/* ── 5. ENCART TITRE INFORMATIF ─────────────────────────────── */
/* Utilisé dans les Rmd avec  ::: {.titre} ... ::: */
.titre {
  font-family: "Marianne", sans-serif;
  font-size: 1.15em;
  font-weight: 700;
  color: #003189;
  background: #f0f4fb;
  border-left: 5px solid #003189;
  padding: 0.65rem 1rem;
  margin: 1.5rem 0 0.25rem 0;
  border-radius: 0 4px 4px 0;
  line-height: 1.4;
}

.sous-titre {
  font-family: "Marianne", sans-serif;
  font-size: 0.92em;
  color: #555;
  padding-left: 1.15rem;
  margin-bottom: 0.75rem;
  font-style: italic;
}

/* ── 6. BLOC SYNTHÈSE ───────────────────────────────────────── */
.callout-note,
.encart-synthese {
  font-family: "Marianne", sans-serif;
  background: #f0f4fb;
  border-left: 5px solid #003189;
  border-radius: 0 6px 6px 0;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

/* ── 7. FIGURES ─────────────────────────────────────────────── */
/* Container autour de chaque graphe */
.figure,
figure {
  background: #ffffff;
  border: 1px solid #e8e8e4;
  border-radius: 6px;
  padding: 1rem 1.25rem 0.75rem 1.25rem;
  margin: 1.25rem 0 2rem 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

/* Légende sous le graphe */
.figure .caption,
figcaption,
p.caption {
  font-family: "Marianne", sans-serif;
  font-size: 0.82em;
  color: #777;
  margin-top: 0.5rem;
  line-height: 1.5;
}

/* ── 8. PAGE DE GARDE ───────────────────────────────────────── */
.page-garde {
  padding: 3rem 0 2rem 0;
  border-bottom: 3px solid #003189;
  margin-bottom: 3rem;
}

.page-garde .badge-collection {
  display: inline-block;
  background: #003189;
  color: #fff;
  font-size: 0.82em;
  font-weight: 500;
  padding: 0.25rem 0.65rem;
  border-radius: 3px;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.page-garde .badge-theme {
  display: inline-block;
  background: #00a3a6;
  color: #fff;
  font-size: 0.82em;
  font-weight: 500;
  padding: 0.25rem 0.65rem;
  border-radius: 3px;
  letter-spacing: 0.04em;
  margin-left: 0.4rem;
  margin-bottom: 0.5rem;
}

.page-garde h1.titre-doc {
  font-size: 2em;
  color: #003189;
  border: none;
  padding: 0;
  margin: 0.75rem 0 0.5rem 0;
  line-height: 1.25;
}

.page-garde .meta {
  color: #555;
  font-size: 0.92em;
  margin-top: 0.9rem;
  line-height: 1.8;
}

.page-garde .lien-donnees {
  display: inline-block;
  margin-top: 1.25rem;
  padding: 0.6rem 1rem;
  background: #f0f4fb;
  border-left: 4px solid #003189;
  border-radius: 0 4px 4px 0;
  font-size: 0.88em;
  color: #003189;
}

/* ── 9. TABLE DES MATIÈRES (gitbook) ────────────────────────── */
.book-summary,
#TOC {
  font-family: "Marianne", sans-serif;
  font-size: 0.9em;
  background-color: #f5f7fc;
  border-right: 2px solid #003189;
}

/* Titre de la sidebar */
.book-summary .book-title a {
  color: #003189 !important;
  font-weight: 700;
  font-size: 1em;
  line-height: 1.3;
  text-decoration: none !important;
}

/* Liens du sommaire - SANS SOULIGNEMENT */
.book-summary ul.summary li a {
  color: #2a2a2a;
  font-weight: 400;
  padding: 4px 15px;
  transition: background 0.15s;
  text-decoration: none !important;
}

.book-summary ul.summary li a:hover {
  background: #e8edf7;
  color: #003189;
  text-decoration: none !important;
}

/* Numéros de chapitre en gras bleu */
.book-summary ul.summary li a b {
  color: #003189;
  font-weight: 700;
  font-size: 1em;
  margin-right: 3px;
}

/* Chapitre actif */
.book-summary ul.summary li.active > a {
  background: #003189 !important;
  color: #ffffff !important;
  font-weight: 600;
  text-decoration: none !important;
}

.book-summary ul.summary li.active > a b {
  color: #ffffff !important;
}

/* Sous-sections */
.book-summary ul.summary li ul li a {
  padding-left: 28px;
  font-size: 0.88em;
  color: #555;
  text-decoration: none !important;
}

.book-summary ul.summary li ul li.active > a {
  background: #dce6f5 !important;
  color: #003189 !important;
  font-weight: 600;
  text-decoration: none !important;
}

/* Séparateurs */
.book-summary ul.summary li.divider {
  border-top: 1px solid #d8dce8;
  margin: 6px 10px;
}

/* ── 10. LIENS ──────────────────────────────────────────────── */
a {
  color: #003189;
  text-decoration: underline;
  text-underline-offset: 2px;
}
a:hover {
  color: #00a3a6;
}

/* ── 11. SUPPRESSION HR AUTO-GÉNÉRÉS ────────────────────────── */
hr {
  display: none !important;
}

/* Désactive la bordure du h1 de la page de garde */
#repères-et-données-n-x > h1 {
  border-bottom: none !important;
  padding-bottom: 0 !important;
  margin-bottom: 1rem !important;
}

/* Supprime la bordure du titre principal de la page de garde (titre YAML) */
#header > h1.title {
  border-bottom: none !important;
  padding-bottom: 0 !important;
  margin-bottom: 1rem !important;
}