/* ── Pages par commune (/trouve/communes/…) ───────────────────────────────────
   Feuille À PART : ces pages ne chargent pas style.css (pensé pour les jeux) et les
   jeux ne chargent pas celle-ci. Les jetons ci-dessous sont une COPIE de ceux de
   style.css ; tools/test_communes_pages.py vérifie que leurs valeurs restent identiques.
   Aucun style en ligne dans les pages : tout est ici. */
:root {
  --c-bg: #f4f6f8;
  --c-surface: #fff;
  --c-ink: #1c2a3a;
  --c-ink-2: #44505c;
  --c-muted: #6b7884;
  --c-line: #dde3ea;
  --c-green: #2b7;
  --c-green-deep: #178a55;
  --c-green-soft: #eafaf2;
  --c-green-line: #d7e9df;
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 16px;
  --shadow-card: 0 2px 12px rgba(0,0,0,.07);
  --font-display: "Nunito", system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: system-ui, sans-serif; font-size: 16px; line-height: 1.55; background: var(--c-bg); color: var(--c-ink); }
a { color: var(--c-green-deep); }
a:hover { color: var(--c-ink); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--c-green); outline-offset: 2px; }
main, .c-haut, .c-pied { width: min(1080px, 100% - 32px); margin-inline: auto; }
main { display: grid; gap: 16px; padding-bottom: 28px; }
h1, h2, .c-logo { font-family: var(--font-display); font-weight: 900; letter-spacing: -.01em; text-wrap: balance; }
h2 { font-size: 1.05rem; margin-bottom: 6px; }

/* En-tête : logo et fil d'Ariane */
.c-haut { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; padding: 14px 0 12px; }
.c-logo { font-size: 1.25rem; color: var(--c-ink); text-decoration: none; }
.c-fil { font-size: .875rem; color: var(--c-muted); }
.c-fil a { color: var(--c-ink-2); }

/* Boutons et cartes */
.btn { display: inline-block; padding: 9px 14px; border: 2px solid var(--c-green); border-radius: 10px; background: var(--c-green); color: #fff; font-weight: 700; font-size: .9375rem; line-height: 1.25; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--c-green-deep); border-color: var(--c-green-deep); color: #fff; }
.btn-alt { background: var(--c-surface); color: var(--c-ink); border-color: var(--c-line); }
.btn-alt:hover { background: var(--c-green-soft); border-color: var(--c-green); color: var(--c-ink); }
.c-carte { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-md); padding: 16px 18px; box-shadow: var(--shadow-card); }
.c-mention { font-size: .8125rem; color: var(--c-muted); margin-top: 8px; }
.c-boutons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.c-deux, .c-dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }

/* Le modèle en vedette */
.c-tete { position: relative; }
.c-vue { position: relative; aspect-ratio: 16 / 7; background: var(--c-bg); border: 1px solid var(--c-line); border-radius: var(--r-lg); overflow: hidden; }
.c-vue > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.c-vue.vue-active > img { visibility: hidden; }
.c-modele { position: absolute; inset: 0; width: 100%; height: 100%; background: var(--c-bg); }
.c-tourner { position: absolute; top: 12px; right: 12px; padding: 8px 14px; border: 0; border-radius: 999px; background: var(--c-ink); color: #fff; font: inherit; font-size: .875rem; font-weight: 700; cursor: pointer; }
.c-tourner:hover { background: var(--c-green-deep); }
.c-tourner:disabled { cursor: progress; opacity: .85; }
.c-titre { position: absolute; left: 14px; bottom: 14px; display: flex; align-items: center; gap: 14px; max-width: calc(100% - 28px); padding: 10px 18px 10px 12px; border-radius: var(--r-md); background: rgba(255,255,255,.94); box-shadow: var(--shadow-card); }
.c-ecu { flex: none; width: 56px; height: 64px; object-fit: contain; }
h1 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.125rem); line-height: 1.1; }
.c-titre p { font-size: .9375rem; color: var(--c-ink-2); margin-top: 2px; }
.c-intro { max-width: 68ch; font-size: 1.0625rem; color: var(--c-ink-2); }

/* Les chiffres */
.c-chiffres { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.c-chiffres li { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-md); padding: 12px 16px; }
.c-chiffres strong { display: block; font-family: var(--font-display); font-size: 1.5rem; font-weight: 900; line-height: 1.2; font-variant-numeric: tabular-nums; }
.c-chiffres span { font-size: .875rem; color: var(--c-muted); }

/* Histoire, rangs, voisines, situation */
blockquote p { max-width: 62ch; }
.c-rangs { width: 100%; border-collapse: collapse; font-size: .9375rem; font-variant-numeric: tabular-nums; }
.c-rangs th, .c-rangs td { padding: 7px 0; border-bottom: 1px solid var(--c-line); text-align: right; font-weight: 400; }
.c-rangs thead th { font-size: .8125rem; color: var(--c-muted); font-weight: 700; }
.c-rangs th[scope="row"] { text-align: left; color: var(--c-ink-2); }
.c-rangs tbody tr:last-child th, .c-rangs tbody tr:last-child td { border-bottom: 0; }
.c-rangs tbody td { font-weight: 700; }
.c-voisines { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.c-voisines li { border: 1.5px solid var(--c-line); border-radius: 999px; font-size: .9375rem; background: var(--c-surface); }
.c-voisines li, .c-voisines a { display: inline-block; }
.c-voisines li:not(:has(a)), .c-voisines a { padding: 4px 12px; }
.c-voisines a { color: var(--c-ink); text-decoration: none; border-radius: 999px; }
.c-voisines li:has(a):hover { border-color: var(--c-green); background: var(--c-green-soft); }
.c-situation { display: flex; align-items: center; gap: 16px; }
.c-situation svg { flex: none; width: 130px; height: auto; }
.sit-canton { fill: #dfe6ee; stroke: #aab6c4; stroke-width: 1; }
.sit-commune { fill: var(--c-green); stroke: var(--c-green-deep); stroke-width: 1; }
.sit-repere { fill: none; stroke: var(--c-green-deep); stroke-width: 1.5; }

/* Appel au jeu et pied de page */
.c-jeu { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 16px 18px; border: 1px solid var(--c-green-line); border-radius: var(--r-md); background: var(--c-green-soft); }
.c-jeu p { font-size: .9375rem; color: var(--c-ink-2); }
.c-pied { padding: 4px 0 36px; font-size: .8125rem; color: var(--c-muted); }
.c-pied p + p { margin-top: 6px; }

/* Page d'entrée */
.page-communes h1 { margin-top: 6px; }
.c-districts { display: flex; flex-wrap: wrap; gap: 8px; }
.c-districts a { padding: 5px 12px; border: 1.5px solid var(--c-line); border-radius: 999px; background: var(--c-surface); color: var(--c-ink); font-size: .9375rem; text-decoration: none; }
.c-districts a:hover { border-color: var(--c-green); background: var(--c-green-soft); }
.c-liste { list-style: none; columns: 4 190px; column-gap: 24px; margin-top: 10px; font-size: .9375rem; }
.c-liste li { break-inside: avoid; padding: 2px 0; color: var(--c-muted); }
.page-communes section[id] { scroll-margin-top: 12px; }

@media (max-width: 640px) {
  .c-titre { position: static; max-width: none; margin-top: 10px; box-shadow: none; border: 1px solid var(--c-line); background: var(--c-surface); }
  .c-vue { aspect-ratio: 3 / 2; }
  .c-vue > img { object-fit: contain; }
  .c-vue.vue-active { aspect-ratio: 4 / 3; }
  .c-tourner { top: auto; bottom: 10px; right: 10px; }
  .c-situation svg { width: 96px; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .c-tourner, .c-voisines li, .c-districts a { transition: background-color .12s, border-color .12s; }
}
