/* ==========================================================================
   Plateforme ODD — feuille de styles
   ========================================================================== */

:root {
  --maroon: #a30000;
  --maroon-dark: #7d0000;
  --ink: #1b1d21;
  --ink-soft: #414651;
  --muted: #6b7280;
  --line: #e2e5ea;
  --line-strong: #cfd4dc;
  --bg: #f3f5f8;
  --card: #ffffff;
  --green: #157347;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-md: 0 8px 24px rgba(16, 24, 40, .10);
  --wrap: 1180px;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  font-size: 16px;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
a { color: var(--maroon); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

.wrap {
  width: min(100% - 2.5rem, var(--wrap));
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  background: var(--maroon);
  color: #fff;
  padding: .6rem 1rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: top .15s ease;
}
.skip-link:focus { top: 0; }

:focus-visible {
  outline: 3px solid #1d4ed8;
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   En-tête
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 72px;
  padding-block: .5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: var(--ink);
  flex: 0 0 auto;
}
.brand:hover { text-decoration: none; }
.brand-logo {
  height: 62px;
  width: auto;
  /* Le logo contient trois écritures superposées : à 44 px, les libellés
     devenaient illisibles. Taille et rendu sont calés pour rester nets. */
  image-rendering: auto;
  flex: 0 0 auto;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 1.05rem; color: var(--maroon); letter-spacing: .02em; }
.brand-text small { font-size: .75rem; color: var(--muted); }

/* Logo officiel « Objectifs de Développement Durable » (wordmark bleu). */
/* Les logos du développement durable ramènent à l'accueil. Le lien n'occupe
   aucune place (`display: contents`) : les images restent des éléments directs
   de l'en-tête, donc leur positionnement automatique ne change pas. */
.sdg-brand,
.footer-brand { display: contents; }
.sdg-brand img,
.footer-brand img { cursor: pointer; }
.sdg-brand:focus-visible,
.footer-brand:focus-visible { outline: none; }
.sdg-brand:focus-visible img,
.footer-brand:focus-visible img {
  outline: 2px solid var(--maroon);
  outline-offset: 3px;
  border-radius: 4px;
}

.sdg-lockup {
  flex: 0 0 auto;
  height: 26px;
  width: auto;
  padding-left: 1.25rem;
  border-left: 1px solid var(--line);
}

/* Roue ODD seule : version compacte du logo pour les écrans étroits. */
.sdg-mark { display: none; flex: 0 0 auto; }

@media (max-width: 1080px) {
  /* L'en-tête se resserre : logo un peu plus petit, mais toujours affiché. */
  .sdg-lockup { height: 22px; padding-left: 1rem; }
}

.main-nav {
  display: flex;
  gap: .25rem;
  margin-left: auto;
}
.main-nav a {
  padding: .45rem .8rem;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: .92rem;
}
.main-nav a:hover { background: #f1f2f4; color: var(--ink); text-decoration: none; }
.main-nav a[aria-current="page"] { background: #fbecec; color: var(--maroon); }

.header-search {
  position: relative;
  flex: 0 1 360px;
}
.header-search input {
  width: 100%;
  padding: .62rem 2.5rem .62rem 2.4rem;
  border: 1px solid #d7dbe3;
  border-radius: 999px;
  font: inherit;
  font-size: .92rem;
  background: #f7f8fa;
  color: var(--ink);
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.header-search input::placeholder { color: #8b9199; }
.header-search input:hover { border-color: #bcc2cc; background: #fff; }
.header-search input:focus {
  outline: none;
  background: #fff;
  border-color: var(--maroon);
  box-shadow: 0 0 0 4px rgba(163, 0, 0, .1);
}
.header-search:focus-within .search-icon { stroke: var(--maroon); }
/* Rappel du raccourci clavier « / » ; s'efface dès qu'on écrit. */
.search-kbd {
  position: absolute;
  right: .5rem;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  min-width: 1.45rem;
  height: 1.45rem;
  padding: 0 .3rem;
  font-family: inherit;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1;
  color: #98a0ab;
  background: #fff;
  border: 1px solid #e3e6ec;
  border-radius: 5px;
  box-shadow: 0 1px 0 rgba(16, 24, 40, .05);
  pointer-events: none;
}
.header-search:focus-within .search-kbd,
.header-search input:not(:placeholder-shown) ~ .search-kbd { opacity: 0; }
.search-icon {
  position: absolute;
  left: .85rem;
  top: 50%;
  width: 16px; height: 16px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Structure générale
   -------------------------------------------------------------------------- */

main { padding-block: 1.75rem 3rem; min-height: 55vh; }
main:focus { outline: none; }

.loading, .empty, .hint {
  color: var(--muted);
  padding: 1rem 0;
}
.alert {
  background: #fff4f4;
  border: 1px solid #f3c9c9;
  color: #7d1111;
  padding: 1rem 1.15rem;
  border-radius: var(--radius-sm);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: .74rem;
  font-weight: 700;
  color: var(--maroon);
  margin-bottom: .5rem;
}

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  background:
    radial-gradient(115% 120% at 100% 0%, #f7e6e6 0%, rgba(247, 230, 230, 0) 58%),
    linear-gradient(135deg, #ffffff 0%, #fdfafa 48%, #f9f1f1 100%);
  border: 1px solid #e9dcdd;
  border-radius: 18px;
  padding: clamp(1.6rem, 4vw, 2.9rem) clamp(1.35rem, 4vw, 3rem) clamp(1.35rem, 3vw, 2.2rem);
  margin-bottom: 2.25rem;
  box-shadow:
    0 1px 2px rgba(16, 24, 40, .05),
    0 22px 44px -28px rgba(125, 0, 0, .32);
}
/* Filet supérieur : marque l'encadré sans alourdir le fond. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, #7d0000 0%, var(--maroon) 42%, #c98d8d 100%);
}
/* Halo discret en haut à droite, pour donner du relief au fond. */
.hero::after {
  content: "";
  position: absolute;
  top: -9rem;
  right: -7rem;
  width: 26rem;
  height: 26rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(163, 0, 0, .1) 0%, rgba(163, 0, 0, 0) 62%);
  pointer-events: none;
  z-index: -1;
}
.hero-main { grid-column: 1; }
.hero .hero-actions { margin-bottom: 0; }
.hero h1 {
  font-size: clamp(1.7rem, 3.2vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -.02em;
  max-width: 32ch;
  text-wrap: balance;
  color: #14161a;
  margin-bottom: .5em;
}
.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  margin-bottom: .7rem;
}
.hero .eyebrow::before {
  content: "";
  width: 24px;
  height: 2px;
  border-radius: 2px;
  background: var(--maroon);
}
.hero .lede {
  max-width: 62ch;
  color: #4a4f5a;
  font-size: 1.02rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-bottom: 1.75rem;
}
.hero-actions .btn,
.hero-actions .btn-ghost {
  padding: .7rem 1.15rem;
  font-size: .92rem;
  border-radius: 10px;
}
.hero-actions .btn-ghost { display: inline-flex; align-items: center; text-decoration: none; }
.hero-actions .btn-ghost:hover { text-decoration: none; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.section-head h2 { font-size: 1.35rem; margin: 0; }
.section-head p { margin: 0; color: var(--muted); font-size: .92rem; }

/* --------------------------------------------------------------------------
   Grille des objectifs
   -------------------------------------------------------------------------- */

.sdg-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1.1rem 1rem;
}

.sdg-tile {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  color: var(--ink);
  font-size: .9rem;
}
.sdg-tile:hover,
.sdg-tile:focus-visible { text-decoration: none; }
.sdg-tile img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease;
}
.sdg-tile:hover img,
.sdg-tile:focus-visible img {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.sdg-tile-meta {
  font-size: .78rem;
  line-height: 1.4;
  color: var(--ink-soft);
}

.home-resource { margin-top: 1.75rem; }
.home-resource a {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .9rem 1.1rem;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.home-resource a:hover,
.home-resource a:focus-visible {
  text-decoration: none;
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}
.home-resource img {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  object-fit: cover;
}
.home-resource-text { display: grid; gap: .1rem; }
.home-resource-text strong { font-size: .98rem; }
.home-resource-text span { font-size: .88rem; color: var(--ink-soft); }

#titre-objectifs { scroll-margin-top: 6.5rem; }

/* --------------------------------------------------------------------------
   Fil d'Ariane
   -------------------------------------------------------------------------- */

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .45rem;
  font-size: .86rem;
  color: var(--muted);
  margin-bottom: 1rem;
}
.breadcrumb a { color: var(--ink-soft); font-weight: 600; }
.breadcrumb [aria-current="page"] { color: var(--muted); }

.backlink {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .88rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* --------------------------------------------------------------------------
   Confort de navigation
   -------------------------------------------------------------------------- */

.goal-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem 1.25rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .8rem .9rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}
.target-menu { position: relative; }
.target-menu > summary { list-style: none; }
.target-menu > summary::-webkit-details-marker { display: none; }
.target-tag {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 2.35rem;
  padding: .35rem .8rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .86rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color .14s ease, color .14s ease, box-shadow .14s ease;
}
.target-tag:hover { border-color: var(--goal, var(--maroon)); color: var(--goal, var(--maroon)); }
.target-menu[open] .target-tag {
  border-color: var(--goal, var(--maroon));
  color: var(--goal, var(--maroon));
  box-shadow: var(--shadow-sm);
}
.target-tag-count {
  min-width: 1.4rem;
  padding: .05rem .35rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--goal, #a30000) 12%, #fff);
  color: var(--goal, var(--maroon));
  font-size: .72rem;
  font-weight: 700;
  text-align: center;
}
.target-tag-chevron { transition: transform .14s ease; }
.target-menu[open] .target-tag-chevron { transform: rotate(180deg); }
.target-panel {
  position: absolute;
  top: calc(100% + .4rem);
  left: 0;
  z-index: 30;
  width: min(26rem, calc(100vw - 2.5rem));
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  padding: .7rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}
.target-panel-item {
  font: inherit;
  font-size: .8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 3rem;
  min-height: 2.2rem;
  padding: .25rem .6rem;
  color: var(--goal, var(--maroon));
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--goal, #a30000) 35%, var(--line-strong));
  border-radius: 8px;
  cursor: pointer;
}
.target-panel-item:hover,
.target-panel-item:focus-visible {
  background: var(--goal, var(--maroon));
  border-color: var(--goal, var(--maroon));
  color: var(--fg, #fff);
}
.toggle {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .4rem .85rem;
  font-size: .86rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}
.toggle input { width: 1rem; height: 1rem; accent-color: var(--maroon); }
.goal-tools-note { margin: 0 0 0 auto; font-size: .82rem; color: var(--muted); }

.target { scroll-margin-top: 7.5rem; }
.target:focus { outline: none; }
.target.is-highlighted { border-left-width: 8px; box-shadow: var(--shadow-md); }

.back-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.9rem;
  height: 2.9rem;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink-soft);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}
.back-to-top:hover { color: var(--maroon); border-color: var(--maroon); }
.back-to-top[hidden] { display: none; }

/* --------------------------------------------------------------------------
   Page objectif
   -------------------------------------------------------------------------- */

.goal-hero {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  padding: 1.5rem 1.6rem;
  border-radius: var(--radius);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, .16), rgba(0, 0, 0, .14)),
    var(--goal, var(--maroon));
  color: var(--fg, #fff);
  margin-bottom: 1.75rem;
}
.goal-hero-icon {
  width: 82px;
  height: 82px;
  border-radius: 10px;
  flex: 0 0 auto;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
}
.goal-hero-kicker {
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: .74rem;
  font-weight: 700;
  opacity: .9;
  margin: 0 0 .25rem;
}
.goal-hero h1 { font-size: clamp(1.25rem, 2.4vw, 1.75rem); margin: 0 0 .4rem; max-width: 40ch; }
.goal-hero-meta { margin: 0; font-size: .86rem; opacity: .92; }

.targets { display: grid; gap: 1rem; }

.target {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 5px solid var(--goal, var(--maroon));
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow-sm);
}
.target-head {
  display: flex;
  gap: .75rem;
  align-items: baseline;
  margin-bottom: .8rem;
}
.target-code {
  flex: 0 0 auto;
  font-weight: 800;
  font-size: .88rem;
  color: var(--goal, var(--maroon));
  background: color-mix(in srgb, var(--goal, #a30000) 10%, #fff);
  border-radius: 6px;
  padding: .15rem .45rem;
}
.target h2 { font-size: 1rem; font-weight: 600; margin: 0; color: var(--ink); }

.indicator-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }

.indicator-row {
  display: grid;
  grid-template-columns: 5.5rem 1fr auto;
  align-items: center;
  gap: .85rem;
  padding: .6rem .7rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  color: var(--ink);
  font-size: .92rem;
}
.indicator-row:hover,
.indicator-row:focus-visible {
  background: #f7f8fa;
  border-color: var(--line);
  text-decoration: none;
}
.indicator-row .code {
  font-weight: 700;
  font-size: .82rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.indicator-row .label { line-height: 1.4; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .72rem;
  font-weight: 700;
  border-radius: 999px;
  padding: .16rem .55rem;
  white-space: nowrap;
}
.badge-ok { background: #e7f6ed; color: var(--green); }
.badge-ok::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-off { background: #eef0f3; color: #59606b; }

.goal-pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: .9rem;
  font-weight: 600;
}
.goal-pager a { display: inline-flex; flex-direction: column; gap: .1rem; max-width: 45%; }
.goal-pager .dir { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.goal-pager .next { text-align: right; margin-left: auto; }

/* --------------------------------------------------------------------------
   Page indicateur
   -------------------------------------------------------------------------- */

.indicator-head {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 6px solid var(--goal, var(--maroon));
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.indicator-head .kicker {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--goal, var(--maroon));
  margin: 0 0 .4rem;
}
.indicator-head h1 {
  font-size: clamp(1.2rem, 2.2vw, 1.55rem);
  margin: 0;
  max-width: 75ch;
  font-weight: 600;
  line-height: 1.35;
}
.indicator-code-inline {
  display: inline-block;
  font-weight: 800;
  color: var(--goal, var(--maroon));
  margin-right: .4rem;
  font-variant-numeric: tabular-nums;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
}
.card > h2 { font-size: 1.05rem; margin-bottom: .9rem; }

.data-card { border-top: 4px solid var(--goal, var(--maroon)); }

.metadata-card > h2 {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: 1.02rem;
  padding-bottom: .6rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.metadata-card > h2::before {
  content: "";
  width: 3px;
  height: 1.05em;
  border-radius: 2px;
  background: var(--maroon);
}

/* Deux colonnes : textes longs à gauche, caractéristiques courtes à droite
   (récupère l'espace laissé vide à droite des définitions). */
.meta-list {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 19.5rem);
  gap: 1.25rem 2.25rem;
  align-items: start;
}
.meta-list-single { grid-template-columns: minmax(0, 1fr); }
.meta-col { min-width: 0; }
.meta-col-main { display: flex; flex-direction: column; gap: 1.15rem; }
.meta-col-side {
  display: flex;
  flex-direction: column;
  gap: .8rem;
  padding-left: 1.5rem;
  border-left: 1px solid var(--line);
}
.meta-list-single .meta-col-side {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1.05rem 1.5rem;
  padding-left: 0;
  border-left: 0;
}
.meta-item {
  min-width: 0;
  border-top: 1px dashed var(--line);
  padding-top: .55rem;
}
.meta-list dt {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: .2rem;
}
.meta-list dd {
  margin: 0;
  font-size: .92rem;
  line-height: 1.6;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}
.meta-col-main dd { max-width: 82ch; }
/* Valeurs chiffrées ou unités : plus affirmées que le texte courant. */
.meta-col-side dd {
  font-size: .96rem;
  font-weight: 600;
  color: var(--ink);
}
.meta-col-side .meta-item-links dd { font-size: .88rem; font-weight: 400; line-height: 1.7; }

.data-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: .75rem;
}
.data-card-head h2 { font-size: 1.05rem; margin: 0; display: flex; align-items: center; gap: .55rem; }
.data-card-title { flex: 1 1 24rem; min-width: 0; }
.data-card-kicker {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .72rem;
  font-weight: 700;
  color: var(--goal, var(--maroon));
  margin: 0 0 .15rem;
}
.data-card-title h2 {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
  max-width: 72ch;
}
.unit-pill {
  font-size: .72rem;
  font-weight: 700;
  color: var(--ink-soft);
  background: #f1f2f4;
  border-radius: 999px;
  padding: .1rem .5rem;
}

.view-switch {
  display: inline-flex;
  background: #f1f2f4;
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.view-switch[hidden] { display: none; }
.switch-btn {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink-soft);
  padding: .35rem .8rem;
  border-radius: 999px;
  cursor: pointer;
}
.switch-btn.is-active { background: #fff; color: var(--maroon); box-shadow: var(--shadow-sm); }

.series-picker {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin: .35rem 0 .9rem;
}
.series-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 999px;
  padding: .28rem .7rem;
  font: inherit;
  font-size: .8rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}
.series-chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--chip, var(--maroon)); flex: 0 0 auto; }
.series-chip[aria-pressed="false"] { opacity: .5; }
.series-chip[aria-pressed="false"] .dot { background: #b9bec7; }
.series-chip:hover { border-color: var(--ink-soft); }

.data-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: .75rem 1rem;
  margin: .25rem 0 1rem;
  padding: .75rem .85rem;
  background: #f7f8fa;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.field {
  display: flex;
  flex-direction: column;
  gap: .28rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
}
.field select {
  font: inherit;
  font-size: .86rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  padding: .38rem .55rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
}
.toolbar-actions {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.btn-ghost {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink-soft);
  border-radius: 8px;
  padding: .42rem .8rem;
  font: inherit;
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-ghost:hover { border-color: var(--ink-soft); color: var(--ink); }
.btn-ghost:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost:disabled:hover { border-color: var(--line-strong); color: var(--ink-soft); }

.meta-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.meta-links a {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  max-width: 100%;
  padding: .34rem .75rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fafbfc;
  color: var(--ink);
  font-size: .85rem;
  font-weight: 600;
  overflow-wrap: anywhere;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.meta-links a::after { content: "↗"; font-size: .85em; color: var(--muted); }
.meta-links a:hover {
  background: #fbecec;
  border-color: #dfbaba;
  color: var(--maroon);
  text-decoration: none;
}
.meta-links a:hover::after { color: var(--maroon); }

.chart-wrap { overflow: hidden; }
.chart-canvas {
  position: relative;
  height: 380px;
}

.table-wrap {
  overflow: auto;
  max-height: min(70vh, 32rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .9rem;
}
.data-table th,
.data-table td {
  padding: .55rem .85rem;
  border-bottom: 1px solid var(--line);
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f2f4f7;
  border-bottom: 1px solid var(--line-strong);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  white-space: normal;
  vertical-align: bottom;
  min-width: 6.5rem;
  max-width: 11rem;
}
.data-table .col-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: .35rem;
  border-radius: 50%;
  vertical-align: middle;
}
.col-name {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.table-summary {
  position: sticky;
  left: 0;
  width: max-content;
  margin: 0;
  padding: .45rem .85rem;
  font-size: .78rem;
  color: var(--muted);
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.data-table tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  width: 6.5rem;
  min-width: 6.5rem;
  text-align: left;
  font-weight: 600;
  color: var(--ink-soft);
  background: #fff;
  border-right: 1px solid var(--line);
}
.data-table thead th:first-child { left: 0; z-index: 3; width: 6.5rem; min-width: 6.5rem; max-width: 6.5rem; }
.data-table tbody tr:nth-child(even) td,
.data-table tbody tr:nth-child(even) th { background: #fafbfc; }
.data-table tbody tr:hover td,
.data-table tbody tr:hover th { background: #f1f5f9; }
.data-table tbody tr:last-child th,
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .na { color: #9aa1ab; }

.notice {
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  background: #fff8e6;
  border: 1px solid #f2dfae;
  color: #6b4c05;
  margin-bottom: 1.25rem;
}
.notice h2 { font-size: 1rem; margin-bottom: .35rem; color: #5c4104; }
.notice p { margin: 0; font-size: .92rem; }

/* --------------------------------------------------------------------------
   Recherche
   -------------------------------------------------------------------------- */

/* Bloc de recherche */
.search-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(110% 120% at 100% 0%, #f8e8e8 0%, rgba(248, 232, 232, 0) 60%),
    linear-gradient(135deg, #ffffff 0%, #fdfafa 50%, #f9f1f1 100%);
  border: 1px solid #e9dcdd;
  border-radius: 18px;
  padding: clamp(1.4rem, 3.4vw, 2.3rem);
  margin-bottom: 1.6rem;
  box-shadow:
    0 1px 2px rgba(16, 24, 40, .05),
    0 20px 40px -32px rgba(125, 0, 0, .35);
}
.search-hero h1 {
  font-size: clamp(1.5rem, 2.6vw, 1.95rem);
  line-height: 1.15;
  letter-spacing: -.015em;
  margin-bottom: .4em;
}
.search-hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  margin-bottom: .45rem;
}
.search-hero .eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--maroon);
}
.search-hero .lede {
  color: #4a4f5a;
  font-size: .97rem;
  line-height: 1.55;
  max-width: 68ch;
  margin-bottom: 1.15rem;
}

.page-search {
  position: relative;
  display: flex;
  gap: .6rem;
  align-items: stretch;
  margin: 0;
}
.page-search-field {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
}
.page-search input {
  flex: 1;
  min-width: 0;
  padding: .8rem 1rem .8rem 2.75rem;
  border: 1.5px solid #d7dbe3;
  border-radius: 12px;
  font: inherit;
  font-size: 1rem;
  background: #fff;
  color: var(--ink);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.page-search input::placeholder { color: #8b9199; }
.page-search input:hover { border-color: #bcc2cc; }
.page-search input:focus {
  outline: none;
  border-color: var(--maroon);
  box-shadow: 0 0 0 4px rgba(163, 0, 0, .1);
}
.page-search .search-icon {
  left: 1rem;
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
  stroke: #7c828d;
}
.page-search:focus-within .search-icon { stroke: var(--maroon); }
.page-search .btn {
  padding: .8rem 1.5rem;
  border-radius: 12px;
  font-size: .95rem;
  box-shadow: 0 10px 20px -14px rgba(163, 0, 0, .9);
}

.search-suggestions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
  margin-top: 1rem;
  font-size: .82rem;
  color: var(--muted);
}
.search-suggestions[hidden] { display: none; }
.search-suggestions > span { font-weight: 600; margin-right: .15rem; }
.search-chip {
  border: 1px solid #e7d9da;
  background: #fff;
  color: var(--maroon);
  border-radius: 999px;
  padding: .25rem .75rem;
  font: inherit;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.search-chip:hover { background: #fbecec; border-color: #dfbaba; }

.btn {
  border: 1px solid var(--maroon);
  background: var(--maroon);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: .65rem 1.15rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { background: var(--maroon-dark); }

/* Résultats */
.result-count {
  margin: 0 0 1rem;
  color: var(--ink-soft);
  font-size: .92rem;
}
.result-count strong {
  color: var(--maroon);
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}
.result-group { margin-bottom: 1.6rem; }
.result-group h2 {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  margin: 0 0 .55rem;
}
.result-badge {
  background: #eceef2;
  color: var(--ink-soft);
  border-radius: 999px;
  padding: .05rem .45rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.result-list {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.result-list li + li { border-top: 1px solid var(--line); }
/* Colonne de texte bornée : au-delà de ~90 signes, les lignes de cible
   devenaient trop longues à lire sur grand écran. */
.result-link > span:nth-child(2) { max-width: 90ch; }
.result-link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 1rem;
  padding: .72rem 1.1rem;
  color: var(--ink);
  font-size: .92rem;
  line-height: 1.4;
  transition: background .15s ease;
}
.result-link:hover,
.result-link:focus-visible { background: #fbf6f6; text-decoration: none; }
.result-code {
  min-width: 3.2rem;
  margin-top: .1rem;
  text-align: center;
  font-size: .78rem;
  font-weight: 700;
  color: var(--ink-soft);
  background: #f1f2f4;
  border-radius: 7px;
  padding: .18rem .45rem;
  font-variant-numeric: tabular-nums;
}
.result-context { display: block; font-size: .76rem; color: var(--muted); margin-top: .15rem; }
.result-arrow {
  margin-top: .15rem;
  color: var(--muted);
  font-weight: 700;
  transition: transform .15s ease, color .15s ease;
}
.result-link:hover .result-arrow { transform: translateX(3px); }

/* États vides */
.search-empty {
  background: var(--card);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 1.75rem 1.4rem;
  text-align: center;
  color: var(--ink-soft);
}
.search-empty-title {
  margin: 0 0 .3rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}
.search-empty .hint { margin: 0 auto; max-width: 60ch; padding: 0; }

/* --------------------------------------------------------------------------
   Conditions d’utilisation
   -------------------------------------------------------------------------- */

.legal-page { max-width: 74ch; }
.legal-page h1 { margin-bottom: 1rem; }
.legal-body { line-height: 1.7; color: var(--ink-soft); }
.legal-body p { margin: 0 0 .95rem; }
.legal-body h2 {
  margin: 1.6rem 0 .5rem;
  font-size: 1.02rem;
  color: var(--ink);
}
.legal-body h2:first-of-type { margin-top: 1.2rem; }
.legal-body a { color: var(--maroon); }
.legal-source { margin-top: 1.4rem; font-size: .86rem; color: var(--muted); }

/* --------------------------------------------------------------------------
   Pied de page
   -------------------------------------------------------------------------- */

.site-footer {
  background: #232529;
  color: #e8eaee;
  padding: 1.5rem 0;
  font-size: .88rem;
}
.footer-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.footer-mark {
  flex: 0 0 auto;
  height: 40px;
  width: auto;
  opacity: .95;
}
.footer-text { min-width: 0; }
.site-footer p { margin: 0 0 .35rem; }
.site-footer .small { font-size: .78rem; color: #a9aeb8; }
.site-footer a { color: #f0c8c8; }

/* --------------------------------------------------------------------------
   Adaptations
   -------------------------------------------------------------------------- */

@media (max-width: 1000px) {
  .header-inner { flex-wrap: wrap; gap: .6rem 1rem; padding-block: .65rem; }
  /* Écran moyen : le wordmark passe à droite de la marque, au-dessus des onglets. */
  .sdg-lockup { height: 22px; margin-left: auto; padding-left: 1rem; }
  .brand { flex: 1 1 auto; }
  .brand-logo { height: 48px; }
  .main-nav { margin-left: 0; order: 3; }
  .header-search { flex: 1 1 100%; order: 4; }
  .header-search input { border-radius: var(--radius-sm); padding-right: 1rem; }
  .search-kbd { display: none; }
}

@media (max-width: 640px) {
  .wrap { width: min(100% - 1.5rem, var(--wrap)); }
  /* Téléphone : le wordmark ne tient plus, la roue ODD le remplace à droite du titre. */
  .sdg-lockup { display: none; }
  .sdg-mark {
    display: block;
    box-sizing: content-box;
    width: 38px;
    height: 38px;
    margin-left: auto;
    padding-left: 1rem;
    border-left: 1px solid var(--line);
  }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: .9rem; }
  .goal-hero { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .goal-hero-icon { width: 64px; height: 64px; }
  .indicator-row { grid-template-columns: 4.5rem 1fr; }
  .indicator-row .status { grid-column: 2; justify-self: start; }
  .goal-pager { flex-direction: column; }
  .goal-pager a { max-width: 100%; }
  .goal-pager .next { text-align: left; margin-left: 0; }
  .hero-actions .btn,
  .hero-actions .btn-ghost { flex: 1 1 100%; justify-content: center; text-align: center; }
  .hero > .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Sur mobile : une seule colonne, caractéristiques sur deux colonnes serrées. */
  .meta-list { grid-template-columns: minmax(0, 1fr); gap: 1.1rem; }
  .meta-col-side {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.25rem;
    padding-left: 0;
    border-left: 0;
  }
  .meta-col-side .meta-item-links { grid-column: 1 / -1; }
  .page-search { flex-wrap: wrap; }
  .page-search-field { flex: 1 1 100%; }
  .page-search input { flex: 1 1 100%; }
  .page-search .btn { flex: 1 1 100%; }
  .home-resource a { align-items: flex-start; }
  .home-resource img { width: 52px; height: 52px; }
  .chart-canvas { height: 300px; }
  .switch-btn,
  .series-chip,
  .btn-ghost,
  .toggle { min-height: 2.6rem; }
  .goal-tools { align-items: center; }
  .target-tag { min-height: 2.6rem; }
  .target-panel { width: calc(100vw - 3rem); max-height: 55vh; overflow-y: auto; }
  .target-panel-item { min-height: 2.4rem; }
  .toggle { border-radius: var(--radius-sm); }
  .goal-tools-note { margin: 0; }
}

@media (max-width: 1024px) {
  .sdg-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .sdg-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
  .sdg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .sdg-tile:hover img { transform: none; }
}

@media print {
  .site-header,
  .site-footer,
  .breadcrumb,
  .backlink,
  .view-switch,
  .series-picker,
  .data-toolbar,
  .goal-pager,
  .goal-tools,
  .back-to-top,
  .skip-link { display: none !important; }
  [data-panel="table"][hidden] { display: block !important; }
  .table-wrap { max-height: none; overflow: visible; border: 0; }
  .data-table thead th,
  .data-table tbody th { position: static; }
  .target { break-inside: avoid; scroll-margin-top: 0; }
  body { background: #fff; }
  main { padding: 0; }
  .card,
  .indicator-head,
  .target { box-shadow: none; border: 1px solid #c9ced6; }
  a { color: inherit; text-decoration: none; }
}
