/* ============================================================
   CARTOGRAPHIE PRÉSIDENTIELLE 2027 — ALLIANCE VITA
   Direction artistique : charte Vita 2026 (redfox.fr).
   Bordeaux #a50042, Bleu marine #0c0635, accents jaune/orange/vert.
   Display condensé (Anton) + corps IBM Plex Sans.
   ============================================================ */

:root {
  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 5rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Light mode — papier institutionnel Vita */
  --color-bg: #f7f5f3;             /* fond papier légèrement chaud */
  --color-surface: #ffffff;
  --color-surface-2: #ffffff;
  --color-surface-offset: #f1eeeb; /* bleu marine 5 % équivalent réchauffé */
  --color-divider: #e3dedb;
  --color-border: #d7d1cd;

  --color-text: #0c0635;           /* bleu marine Vita */
  --color-text-muted: #45406b;
  --color-text-faint: #8a86a3;
  --color-text-inverse: #ffffff;

  --color-primary: #0c0635;        /* bleu marine */
  --color-accent: #a50042;          /* bordeaux Vita — signature */
  --color-accent-soft: #f1d4dc;
  --color-yellow: #ffc300;         /* jaune Vita */
  --color-orange: #ff8940;         /* orange Vita */
  --color-green: #66cc99;          /* vert Vita */
  --color-yellow-soft: #fff0c2;
  --color-orange-soft: #ffd9c2;
  --color-green-soft: #d1ecdd;

  /* Familles politiques — charte Vita + bleu roi pour la droite */
  --color-fam-gauche: #a50042;      /* bordeaux Vita */
  --color-fam-centre: #ffc300;      /* jaune Vita */
  --color-fam-droite: #1d4ed8;      /* bleu roi */
  --color-fam-ed: #0c0635;          /* bleu marine Vita */

  --color-fam-gauche-soft: #f1d4dc;
  --color-fam-centre-soft: #fff0c2;
  --color-fam-droite-soft: #d6e0fb;
  --color-fam-ed-soft: #d1cfdb;

  /* Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-full: 9999px;

  --transition: 200ms cubic-bezier(0.16, 1, 0.3, 1);

  --shadow-sm: 0 1px 2px rgba(20, 20, 25, 0.06);
  --shadow-md: 0 4px 16px rgba(20, 20, 25, 0.08);
  --shadow-lg: 0 16px 40px rgba(20, 20, 25, 0.14);

  --content-wide: 1280px;
  --content-default: 1024px;

  /* Charte Vita : Herokid Bold Condensed remplacé par Anton (display condensé GFonts) */
  /* Corps : IBM Plex Sans — identique à la charte */
  --font-display: 'Anton', 'Oswald', 'Impact', 'Arial Narrow', sans-serif;
  --font-body: 'IBM Plex Sans', 'Helvetica Neue', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

[data-theme='dark'] {
  /* Dark mode Vita — fond bleu marine profond */
  --color-bg: #08041f;
  --color-surface: #110a32;
  --color-surface-2: #1a1240;
  --color-surface-offset: #221848;
  --color-divider: #2a2055;
  --color-border: #3a2f6a;

  --color-text: #f7f5f3;
  --color-text-muted: #b3aecf;
  --color-text-faint: #7a749a;
  --color-text-inverse: #0c0635;

  --color-primary: #f7f5f3;
  --color-accent: #e94777;          /* bordeaux Vita éclairci */
  --color-accent-soft: #3a0f24;
  --color-yellow: #ffd84a;
  --color-orange: #ffa066;
  --color-green: #7fd9ab;
  --color-yellow-soft: #3d2f08;
  --color-orange-soft: #3d2412;
  --color-green-soft: #133324;

  --color-fam-gauche: #e94777;
  --color-fam-centre: #ffd84a;
  --color-fam-droite: #6c92f5;      /* bleu roi éclairci pour dark */
  --color-fam-ed: #8a82d4;

  --color-fam-gauche-soft: #3a0f24;
  --color-fam-centre-soft: #3d2f08;
  --color-fam-droite-soft: #182a55;
  --color-fam-ed-soft: #1d1846;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.7);
}

/* ============================================================
   Base
   ============================================================ */

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: var(--space-16);
}

body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  transition: background var(--transition), color var(--transition);
}

img, svg, canvas { display: block; max-width: 100%; }

button {
  cursor: pointer;
  background: none;
  border: none;
  font: inherit;
  color: inherit;
}

a {
  color: var(--color-accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in oklab, var(--color-accent), transparent 70%);
  transition: border-color var(--transition), color var(--transition);
}
a:hover { border-bottom-color: var(--color-accent); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.005em;
  line-height: 1.02;
  text-wrap: balance;
  text-transform: uppercase;
}

/* Le corps des titres dans les fiches/cartes peut rester normal-case */
.scale-card h3,
.candidate-card__name,
.compare-card__name,
.detail-section__title,
.detail__name {
  text-transform: none;
  letter-spacing: -0.005em;
  line-height: 1.15;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.container {
  width: 100%;
  max-width: var(--content-wide);
  margin: 0 auto;
  padding-inline: clamp(var(--space-4), 4vw, var(--space-10));
}

/* ============================================================
   Header
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--color-bg), transparent 10%);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-divider);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding-block: var(--space-4);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  border: none;
  color: var(--color-text);
}

.brand__logo {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.brand__name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--color-accent);
}

.brand__sub {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 2px;
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: grid;
  place-items: center;
  color: var(--color-text-muted);
  transition: color var(--transition), background var(--transition);
}
.theme-toggle:hover {
  color: var(--color-text);
  background: var(--color-surface-offset);
}

/* ============================================================
   Hero
   ============================================================ */

.hero {
  position: relative;
  padding-block: clamp(var(--space-12), 8vw, var(--space-24)) clamp(var(--space-16), 12vw, var(--space-24));
  border-bottom: 1px solid var(--color-divider);
  overflow: hidden;
}

/* Courbe « Lien » — signature graphique Vita, ancrée en bas du hero */
.hero__lien {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: clamp(80px, 14vw, 160px);
  z-index: 0;
  opacity: 0.9;
  pointer-events: none;
}

.hero > .container {
  position: relative;
  z-index: 1;
}

[data-theme='dark'] .hero__lien {
  opacity: 0.7;
}

.hero__eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-size: var(--text-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  font-weight: 400;
  margin-bottom: var(--space-5);
}

.hero__title {
  font-size: var(--text-3xl);
  max-width: 14ch;
  margin-bottom: var(--space-6);
  color: var(--color-primary);
}

/* L'élément souligné reprend le bordeaux Vita + une courbe colorée dessous */
.hero__title em {
  font-style: normal;
  color: var(--color-accent);
  position: relative;
  display: inline-block;
  padding-inline: 0.05em;
}
.hero__title em::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.12em;
  height: 0.12em;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--color-green) 0%, var(--color-orange) 50%, var(--color-yellow) 100%);
  opacity: 0.9;
}

.hero__lede {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 60ch;
  line-height: 1.5;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-divider);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.hero__meta strong {
  color: var(--color-text);
  font-weight: 600;
}

/* ============================================================
   Section header
   ============================================================ */

.section {
  padding-block: clamp(var(--space-12), 6vw, var(--space-20));
}

.section + .section { border-top: 1px solid var(--color-divider); }

.section__header {
  margin-bottom: var(--space-10);
  max-width: 64rem;
}

.section__kicker {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-3);
  font-weight: 400;
}

.section__title {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-3);
  color: var(--color-primary);
}

.section__lede {
  color: var(--color-text-muted);
  font-size: var(--text-base);
}

/* ============================================================
   Filters
   ============================================================ */

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  margin-bottom: var(--space-8);
}

.controls__label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: 500;
  margin-right: var(--space-2);
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  transition: all var(--transition);
}

.filter-chip:hover {
  border-color: var(--color-text-muted);
  color: var(--color-text);
}

.filter-chip[aria-pressed="true"] {
  background: var(--chip-color, var(--color-text));
  border-color: var(--chip-color, var(--color-text));
  color: var(--color-text-inverse);
}

.filter-chip__dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--chip-color, var(--color-text));
}

.filter-chip[aria-pressed="true"] .filter-chip__dot { background: var(--color-text-inverse); }

/* ============================================================
   Cartography (SVG scatter)
   ============================================================ */

.cartography {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: clamp(var(--space-4), 3vw, var(--space-8));
  box-shadow: var(--shadow-sm);
}

.carto-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: 820px;
  margin: 0 auto;
}

.carto-svg { width: 100%; height: 100%; overflow: visible; }

.carto-axis-line { stroke: var(--color-border); stroke-width: 1.5; }
.carto-grid-line { stroke: var(--color-divider); stroke-width: 1; stroke-dasharray: 2 3; }

.carto-axis-label {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  fill: var(--color-text);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.carto-axis-tick {
  font-family: var(--font-body);
  font-size: 10px;
  fill: var(--color-text-muted);
}

.carto-quadrant-label {
  font-family: var(--font-display);
  font-size: 13px;
  font-style: italic;
  fill: var(--color-text-faint);
}

.carto-dot {
  cursor: pointer;
}

.carto-dot circle {
  stroke: var(--color-surface-2);
  stroke-width: 2;
  transition: stroke var(--transition), stroke-width var(--transition);
}

/* Anneau au hover — pas de scale qui ferait sauter le point */
.carto-dot:hover circle {
  stroke: var(--color-text);
  stroke-width: 3.5;
}

.carto-dot--selected circle {
  stroke: var(--color-text);
  stroke-width: 3.5;
}

.carto-dot--compare circle {
  stroke: var(--color-accent);
  stroke-width: 3.5;
}

.carto-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  fill: var(--color-text);
  pointer-events: none;
  paint-order: stroke;
  stroke: var(--color-surface);
  stroke-width: 3px;
  stroke-linejoin: round;
}

.carto-dot--hidden { display: none; }

/* Tooltip — ne doit JAMAIS intercepter les clics */
.tooltip {
  position: absolute;
  background: var(--color-text);
  color: var(--color-text-inverse);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  pointer-events: none !important;
  z-index: 10;
  white-space: nowrap;
  opacity: 0;
  transition: opacity var(--transition);
  transform: translate(-50%, calc(-100% - 14px));
}

.tooltip.is-visible { opacity: 1; }

.tooltip strong { display: block; font-size: 13px; margin-bottom: 2px; }
.tooltip span { color: color-mix(in oklab, var(--color-text-inverse), transparent 30%); }

/* ============================================================
   Legend
   ============================================================ */

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-4) var(--space-8);
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-divider);
  font-size: var(--text-sm);
}

.legend__item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-muted);
}

.legend__dot {
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
}

/* ============================================================
   Scale Explanation
   ============================================================ */

.scale-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-6);
}

.scale-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}

.scale-card h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-4);
}

.scale-card__bar {
  display: flex;
  height: 8px;
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-4);
  background: var(--color-surface-offset);
}

.scale-card__bar-step {
  flex: 1;
}

.scale-list {
  list-style: none;
  display: grid;
  gap: var(--space-2);
}

.scale-list li {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
}

.scale-list .score {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--color-text);
  font-size: var(--text-xs);
  padding: 2px 6px;
  background: var(--color-surface-offset);
  border-radius: var(--radius-sm);
  text-align: center;
  align-self: start;
  height: fit-content;
}

/* ============================================================
   Candidate Detail Panel
   ============================================================ */

.detail-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(560px, 100vw);
  height: 100dvh;
  background: var(--color-surface);
  border-left: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 320ms cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.detail-panel.is-open { transform: translateX(0); }

/* Quand le panneau de détail est ouvert sur desktop, on réserve la place
   du panneau (560px) côté droit pour qu'aucun élément cliquable (points
   de la carto, chips du sélecteur, cartes du comparateur) ne soit recouvert.
   Sur mobile/tablette (≤ 1024px), le panneau passe en plein écran : pas de décalage. */
main {
  transition: padding var(--transition);
}

@media (min-width: 1025px) {
  [data-panel-open] main {
    padding-right: 560px;
  }
}

.detail-panel__header {
  position: sticky;
  top: 0;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-divider);
  padding: var(--space-6);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  z-index: 2;
}

.detail-panel__title {
  font-size: var(--text-xl);
  margin-bottom: var(--space-2);
}

.detail-panel__party {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.detail-panel__family-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
  margin-top: var(--space-2);
  background: var(--badge-bg, var(--color-surface-offset));
  color: var(--badge-color, var(--color-text));
}

.detail-panel__close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: grid;
  place-items: center;
  color: var(--color-text-muted);
  flex-shrink: 0;
}
.detail-panel__close:hover { background: var(--color-surface-offset); color: var(--color-text); }

.detail-panel__body { padding: var(--space-6); flex: 1; }

.detail-section { margin-bottom: var(--space-8); }
.detail-section:last-child { margin-bottom: 0; }

.detail-section__title {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-divider);
}

.score-bar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-3);
}

.score-bar__label {
  font-size: var(--text-sm);
  font-weight: 600;
  flex-shrink: 0;
  min-width: 80px;
}

.score-bar__track {
  position: relative;
  flex: 1;
  height: 8px;
  background: var(--color-surface-offset);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.score-bar__track::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 1px;
  background: var(--color-border);
  z-index: 1;
}

.score-bar__fill {
  position: absolute;
  top: 0; bottom: 0;
  background: var(--score-color);
  border-radius: var(--radius-full);
}

.score-bar__value {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-text);
  min-width: 28px;
  text-align: right;
}

.position-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-3);
}

.position-summary {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: var(--space-5);
}

.quote {
  position: relative;
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-3);
  background: var(--color-surface-2);
  border-left: 3px solid var(--color-accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--color-text);
}

.quote__source {
  display: block;
  margin-top: var(--space-3);
  font-family: var(--font-body);
  font-style: normal;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.quote__source a { font-weight: 600; }

.votes-list {
  list-style: none;
  display: grid;
  gap: var(--space-2);
}

.votes-list li {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-3);
  background: var(--color-surface-2);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
}

.votes-list .vote-label { color: var(--color-text-muted); flex: 1; }
.votes-list .vote-value {
  font-weight: 600;
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  white-space: nowrap;
}

/* Add to compare button */
.compare-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  background: var(--color-text);
  color: var(--color-text-inverse);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
  margin-top: var(--space-4);
  transition: all var(--transition);
}

.compare-btn:hover { background: var(--color-accent); }

.compare-btn[aria-pressed="true"] {
  background: var(--color-accent);
}

.compare-btn[aria-pressed="true"]::before {
  content: "✓";
}

/* Backdrop — léger, non-bloquant : permet de cliquer un autre point sans fermer d'abord */
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 25, 0.15);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
  z-index: 90;
}

.backdrop.is-visible { opacity: 1; }
/* sur mobile uniquement, le backdrop redevient bloquant + plus opaque */
@media (max-width: 768px) {
  .backdrop {
    background: rgba(20, 20, 25, 0.4);
    backdrop-filter: blur(2px);
  }
  .backdrop.is-visible { pointer-events: auto; }
}

/* ============================================================
   Selector (sélection directe des candidats à comparer)
   ============================================================ */

.selector {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-6);
}

.selector__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.selector__counter {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--color-text);
  background: var(--color-surface-offset);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  letter-spacing: 0;
}

.selector__counter.is-full {
  background: var(--color-accent);
  color: var(--color-text-inverse);
}

.selector__grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.selector-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3) var(--space-2) var(--space-2);
  border-radius: var(--radius-full);
  border: 1.5px solid var(--color-border);
  background: var(--color-surface-2);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-text);
  transition: all var(--transition);
  cursor: pointer;
  user-select: none;
}

.selector-chip:hover {
  border-color: var(--chip-color, var(--color-text));
  transform: translateY(-1px);
}

.selector-chip[aria-pressed="true"] {
  background: var(--chip-color);
  border-color: var(--chip-color);
  color: var(--color-text-inverse);
}

.selector-chip[aria-pressed="true"] .selector-chip__dot {
  background: var(--color-text-inverse);
}

.selector-chip[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}
.selector-chip[disabled]:hover { transform: none; border-color: var(--color-border); }

.selector-chip__dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--chip-color);
  flex-shrink: 0;
}

.selector-chip__check {
  display: none;
  width: 14px;
  height: 14px;
}

.selector-chip[aria-pressed="true"] .selector-chip__dot { display: none; }
.selector-chip[aria-pressed="true"] .selector-chip__check { display: block; }

/* ============================================================
   Comparator
   ============================================================ */

.comparator {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: clamp(var(--space-4), 3vw, var(--space-8));
}

.comparator__empty {
  text-align: center;
  padding: var(--space-12) var(--space-6);
  color: var(--color-text-muted);
}

.comparator__empty svg {
  margin: 0 auto var(--space-4);
  color: var(--color-text-faint);
}

.comparator__hint {
  font-size: var(--text-sm);
  margin-top: var(--space-2);
}

.comparator__count {
  display: inline-block;
  margin-left: var(--space-3);
  padding: 2px 10px;
  background: var(--color-accent);
  color: var(--color-text-inverse);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  font-family: var(--font-body);
}

.comparator__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.compare-card {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-top: 4px solid var(--card-color, var(--color-text));
  border-radius: var(--radius-md);
  padding: var(--space-5);
  position: relative;
}

.compare-card__remove {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  display: grid;
  place-items: center;
  color: var(--color-text-muted);
  font-size: 14px;
}
.compare-card__remove:hover { background: var(--color-surface-offset); color: var(--color-text); }

.compare-card__name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  margin-bottom: 2px;
  padding-right: var(--space-6);
}

.compare-card__party {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

.compare-card__metric {
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-divider);
}
.compare-card__metric:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

.compare-card__metric-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.compare-card__metric-value {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.compare-card__metric-summary {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.5;
}

.compare-clear {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  background: transparent;
  transition: all var(--transition);
}
.compare-clear:hover { color: var(--color-text); border-color: var(--color-text-muted); }

/* ============================================================
   Comparator visual chart — radar
   ============================================================ */

.compare-chart {
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-divider);
}

.compare-chart__title {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.compare-chart__caption {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.5;
  max-width: 60ch;
  margin-bottom: var(--space-4);
}

.radar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}

.radar__svg {
  width: 100%;
  max-width: 460px;
  height: auto;
  display: block;
  overflow: visible;
}

/* Grille */
.radar__ring {
  fill: none;
  stroke: var(--color-border);
  stroke-width: 1;
  opacity: 0.55;
}
.radar__ring--zero {
  stroke: var(--color-text-muted);
  stroke-width: 1.25;
  opacity: 0.85;
}
.radar__axis {
  stroke: var(--color-border);
  stroke-width: 1;
  opacity: 0.7;
}

/* Labels d’axe */
.radar__label {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  fill: var(--color-text);
  letter-spacing: 0.02em;
}
.radar__pole {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.radar__pole--high { fill: var(--color-text-muted); }
.radar__pole--low  { fill: var(--color-text-muted); opacity: 0.85; font-style: italic; }

/* Polygones candidats */
.radar__polygon {
  fill: var(--series-color);
  fill-opacity: 0.14;
  stroke: var(--series-color);
  stroke-width: 1.75;
  stroke-linejoin: round;
  transition: fill-opacity 180ms ease, stroke-width 180ms ease;
}
.radar__series:hover .radar__polygon {
  fill-opacity: 0.28;
  stroke-width: 2.25;
}
.radar__dot {
  fill: var(--dot-color);
  stroke: var(--color-surface);
  stroke-width: 1.5;
}
.radar__nd-dot {
  fill: none;
  stroke: var(--color-text-muted);
  stroke-dasharray: 2 2;
  stroke-width: 1;
}

/* Légende des pôles −2 (centre du radar) */
.radar-poles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2) var(--space-4);
  font-size: 11px;
  color: var(--color-text-muted);
  padding: var(--space-2) var(--space-3);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  max-width: 520px;
  text-align: center;
}
.radar-poles__item strong {
  color: var(--color-text);
  font-weight: 600;
}

/* Légende candidats */
.radar-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3) var(--space-5);
  font-size: var(--text-xs);
  color: var(--color-text);
}
.radar-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.radar-legend__swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}
.radar-legend__name {
  font-weight: 600;
  color: var(--color-text);
}
.radar-legend__family {
  color: var(--color-text-muted);
  font-weight: 400;
}

/* ============================================================
   Footer
   ============================================================ */

.site-footer {
  border-top: 1px solid var(--color-divider);
  padding-block: var(--space-12) var(--space-8);
  margin-top: var(--space-16);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: var(--space-8);
  margin-bottom: var(--space-8);
}

.site-footer h4 {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text);
  margin-bottom: var(--space-3);
}

.site-footer p { line-height: 1.6; max-width: 50ch; }

.site-footer__bottom {
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-divider);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  font-size: var(--text-xs);
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 768px) {
  .hero__title { font-size: var(--text-xl); }
  .site-footer__grid { grid-template-columns: 1fr; }
  .detail-panel { width: 100vw; }
  .carto-axis-label { font-size: 10px; }
  .compare-chart__bar { grid-template-columns: 80px 1fr 32px; }
  .compare-chart__bar-name { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
