/* ============================================================================
   LES CARTES DES COMMUNES - /cartes/

   Le parti pris : la commune vue du ciel. Derrière tout, une image aérienne
   réelle (la France satellite sur l'accueil, la commune elle-même quand elle
   est mise en scène), un voile pour la lecture, et devant, les tirages photo
   de ses projets. Deux vies pour une page : sur le site, un bandeau puis une
   page qui se lit ; sur le stand (body.is-kiosk), un seul écran sans
   défilement, où les scènes se relaient dans la même cellule de grille et où
   tout ce qui s'ouvre se pose PAR-DESSUS l'accueil.

   Tablette modeste : rien n'est animé hors transform et opacity, aucun flou de
   fond (backdrop-filter), une seule image par vue aérienne. Le seul mouvement
   continu est la dérive lente du ciel, un calque composé par la carte
   graphique, et le halo d'un point.

   Jetons : `--c-*` est la palette « cinéma » posée sur l'imagerie (blanc sur
   sombre par défaut ; en thème clair, un voile blanc et de l'encre). Les
   jetons sans préfixe sont ceux du corps de la page du site, toujours clair.
   ============================================================================ */

:root {
  --ground: #f3f6fa;
  --paper: #ffffff;
  --ink: #101014;
  --ink-2: #494955;
  --ink-3: #74747f;
  --line: rgba(16, 16, 20, 0.09);
  --line-strong: rgba(16, 16, 20, 0.17);
  --brand: #ff0037;
  --brand-ink: #c4002a;
  /* La commune mise en scène : posée par le rendu sur sa scène */
  --ville: var(--brand);
  --ville-texte: #ffffff;
  --shadow-tirage: 0 30px 70px -18px rgba(0, 0, 0, 0.35), 0 10px 24px -10px rgba(0, 0, 0, 0.2);
  --shadow-pill: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 14px rgba(0, 0, 0, 0.06);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-plongee: cubic-bezier(0.7, 0, 0.25, 1);
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  /* Palette cinéma (sombre) */
  --c-fond: #05070d;
  --c-ink: #ffffff;
  --c-ink-2: rgba(255, 255, 255, 0.84);
  --c-ink-3: rgba(255, 255, 255, 0.62);
  --c-verre: rgba(8, 11, 20, 0.6);
  --c-verre-fort: rgba(8, 11, 20, 0.82);
  --c-verre-bord: rgba(255, 255, 255, 0.16);
  --c-verre-reflet: rgba(255, 255, 255, 0.24);
  --c-contour: rgba(255, 255, 255, 0.55);
  --c-point: #ff4d6a;
  --c-ombre: 0 40px 90px -24px rgba(0, 0, 0, 0.8), 0 12px 30px -12px rgba(0, 0, 0, 0.6);
  --c-halo: 0 2px 30px rgba(0, 0, 0, 0.45);
  --c-voile:
    linear-gradient(90deg, rgba(5, 7, 13, 0.9) 0%, rgba(5, 7, 13, 0.64) 32%, rgba(5, 7, 13, 0.16) 60%, rgba(5, 7, 13, 0.3) 100%),
    linear-gradient(0deg, rgba(5, 7, 13, 0.94) 0%, rgba(5, 7, 13, 0.58) 24%, rgba(5, 7, 13, 0) 50%),
    linear-gradient(180deg, rgba(5, 7, 13, 0.5) 0%, rgba(5, 7, 13, 0) 24%);
  --c-nuit: rgba(5, 7, 13, 0.62);
}

/* Le thème clair du stand : un voile blanc sur l'imagerie, de l'encre dessus.
   theme.js retire l'attribut pour le clair ; le sombre est le premier réglage. */
html:not([data-theme='dark']) body.is-kiosk {
  --c-fond: #eef2f7;
  --c-ink: #101014;
  --c-ink-2: #3a3a46;
  --c-ink-3: #66666f;
  --c-verre: rgba(255, 255, 255, 0.74);
  --c-verre-fort: rgba(255, 255, 255, 0.92);
  --c-verre-bord: rgba(16, 16, 20, 0.12);
  --c-verre-reflet: rgba(255, 255, 255, 0.95);
  --c-contour: rgba(16, 16, 20, 0.45);
  --c-point: #c4002a;
  --c-ombre: 0 40px 90px -24px rgba(0, 0, 0, 0.35), 0 12px 30px -12px rgba(0, 0, 0, 0.2);
  --c-halo: none;
  --c-voile:
    linear-gradient(90deg, rgba(240, 244, 249, 0.94) 0%, rgba(240, 244, 249, 0.74) 32%, rgba(240, 244, 249, 0.28) 60%, rgba(240, 244, 249, 0.42) 100%),
    linear-gradient(0deg, rgba(240, 244, 249, 0.96) 0%, rgba(240, 244, 249, 0.66) 24%, rgba(240, 244, 249, 0) 50%),
    linear-gradient(180deg, rgba(240, 244, 249, 0.55) 0%, rgba(240, 244, 249, 0) 24%);
  --c-nuit: rgba(240, 244, 249, 0.7);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 6px; }

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

/* ═══════════════════════════════════════════════════════════════════════════
   LE CIEL
   ═══════════════════════════════════════════════════════════════════════════ */

.ciel {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--c-fond);
  color: var(--c-ink);
}
.ciel__calque {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.1s ease, transform 1.5s var(--ease-plongee);
  will-change: transform, opacity;
}
.ciel__calque.is-on { opacity: 1; }
/* La plongée : la France grossit vers la commune pendant qu'elle s'efface */
.ciel__calque--france { transform-origin: 50% 50%; }
.ciel__calque--france.is-plongee {
  transform: scale(3.4);
  opacity: 0;
  transition: transform 1.6s var(--ease-plongee), opacity 1.1s ease 0.35s;
}
/* La commune arrive d'un peu plus près et se pose */
.ciel__calque--ville { transform: scale(1.14); }
.ciel__calque--ville.is-on { transform: none; }
/* Sans image (service injoignable) : la teinte de la commune tient l'écran */
.ciel__calque--ville.is-sans-image { background: color-mix(in srgb, var(--ville) 28%, var(--c-fond)); }
.ciel__calque--ville.is-sans-image .ciel__image { visibility: hidden; }

/* Le cadre porte l'image ET la constellation, dimensionné par le script pour
   couvrir l'écran sans déformer (même rôle qu'object-fit: cover, mais partagé
   par les deux). Il dérive lentement : le seul mouvement continu de la page. */
.ciel__cadre {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
}
.ciel__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: derive 52s ease-in-out infinite alternate;
}
.ciel__calque--france .ciel__image { animation-duration: 70s; }
@keyframes derive {
  from { transform: scale(1.03) translate3d(-0.8%, 0.5%, 0); }
  to { transform: scale(1.12) translate3d(1%, -0.7%, 0); }
}
.constellation {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  animation: derive 70s ease-in-out infinite alternate;
}
.constellation__contour {
  fill: none;
  stroke: var(--c-contour);
  stroke-width: 1.4px;
  stroke-linejoin: round;
}
.point {
  fill: var(--c-point);
  opacity: 0.88;
  transition: opacity 0.4s ease, r 0.5s var(--ease-out);
}
.point.is-on {
  opacity: 1;
  r: 21000;
  stroke: var(--c-point);
  stroke-opacity: 0.3;
  animation: halo 1.6s ease-in-out infinite;
}
@keyframes halo {
  0%, 100% { stroke-width: 16000; }
  50% { stroke-width: 44000; }
}
.ciel__voile {
  position: absolute;
  inset: 0;
  background: var(--c-voile);
}
/* La nuit tombe un peu plus pour lire une scène de texte ou la saisie */
.ciel__nuit {
  position: absolute;
  inset: 0;
  background: var(--c-nuit);
  opacity: 0;
  transition: opacity 0.9s ease;
}
.ciel__nuit.is-on { opacity: 1; }
.ciel__credit {
  position: absolute;
  right: 12px;
  bottom: 8px;
  font-size: 11px;
  color: var(--c-ink-3);
}

/* Ce qui vit par-dessus le ciel */
.entete, .scene, .recherche, .communes { position: relative; z-index: 1; }

/* ═══════════════════════════════════════════════════════════════════════════
   EN-TÊTE ET COMMANDES
   ═══════════════════════════════════════════════════════════════════════════ */

.entete {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 26px 40px 8px;
  color: var(--c-ink);
}
.entete__logo {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 7px 12px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.5);
}
.entete__logo img { width: auto; height: 38px; }
.entete__nav {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-left: auto;
  font-size: 15px;
  font-weight: 500;
}
.entete__nav a { text-decoration: none; color: var(--c-ink-2); }
.entete__nav a:hover { color: var(--c-ink); }
.entete__demo {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--c-verre-bord);
  background: var(--c-verre);
  color: var(--c-ink) !important;
}
.commandes { display: none; gap: 10px; margin-left: auto; }
.commande {
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--c-verre-bord);
  background: var(--c-verre);
  color: var(--c-ink-3);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.commande:hover { color: var(--c-ink); }
.commande svg { width: 22px; height: 22px; }
.commande[hidden] { display: none; }
.commande__soleil { display: none; }
html[data-theme='dark'] .commande__lune { display: none; }
html[data-theme='dark'] .commande__soleil { display: block; }

/* ═══════════════════════════════════════════════════════════════════════════
   TYPOGRAPHIE
   ═══════════════════════════════════════════════════════════════════════════ */

.titre {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(40px, 5.4vw, 96px);
  line-height: 0.96;
  letter-spacing: -0.035em;
  text-wrap: balance;
  max-width: 14ch;
}
.titre--2 { font-size: clamp(32px, 4vw, 64px); max-width: 18ch; }
.titre--3 { font-size: clamp(26px, 2.8vw, 40px); max-width: none; letter-spacing: -0.02em; }

.scene__sous {
  margin: 24px 0 0;
  font-size: clamp(17px, 1.35vw, 22px);
  line-height: 1.5;
  max-width: 46ch;
}
.scene__compte {
  margin: 18px 0 0;
  font-size: clamp(15px, 1.1vw, 19px);
  max-width: 50ch;
}
.scene__compte b { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ═══════════════════════════════════════════════════════════════════════════
   BOUTONS
   ═══════════════════════════════════════════════════════════════════════════ */

.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: clamp(16px, 1.15vw, 20px);
  font-weight: 600;
  line-height: 1.1;
  padding: 15px 26px;
  min-height: 54px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s var(--ease-out), background-color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.bouton:active { transform: scale(0.97); }
.bouton--principal {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 12px 34px -12px rgba(255, 0, 55, 0.7);
}
.bouton--principal:hover { background: var(--brand-ink); }
.bouton--ville {
  background: var(--ville);
  color: var(--ville-texte);
  box-shadow: 0 14px 40px -14px var(--ville), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.bouton--retour {
  border-color: var(--c-verre-bord);
  background: var(--c-verre);
  color: var(--c-ink);
}
.bouton--emporter {
  background: var(--c-ink);
  color: var(--c-fond);
}

/* ═══════════════════════════════════════════════════════════════════════════
   LE SITE : BANDEAU, PUIS LA PAGE QUI SE LIT
   ═══════════════════════════════════════════════════════════════════════════ */

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: min(100vh, 960px);
  padding-bottom: 72px;
  color: var(--c-ink);
}
.scene--accueil {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 40px 32px;
  align-self: center;
}
.scene--accueil .scene__texte { max-width: 60%; }
.scene--accueil .titre { text-shadow: var(--c-halo); }
.scene--accueil .scene__sous { color: var(--c-ink-2); }
.scene--accueil .scene__compte { color: var(--c-ink-3); }
.scene--accueil .scene__compte b { color: var(--c-ink); }

.principal {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 40px;
}
.scene { position: relative; }
.scene__texte { min-width: 0; }

/* ─── La recherche ─── */

.recherche {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(960px, calc(100% - 80px));
  margin: 0 auto;
  padding: 8px;
  background: var(--c-verre);
  border: 1px solid var(--c-verre-bord);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 var(--c-verre-reflet), 0 30px 80px -30px rgba(0, 0, 0, 0.7);
  color: var(--c-ink);
  z-index: 3;
}
.recherche__champ { flex: 1 1 auto; min-width: 0; display: flex; }
.recherche__champ input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--c-ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(19px, 1.7vw, 28px);
  padding: 14px 24px;
  outline: none;
}
.recherche__champ input::placeholder { color: var(--c-ink-3); font-weight: 500; }
.recherche .bouton { flex: 0 0 auto; }

.suggestions {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 8px;
  list-style: none;
  background: var(--c-verre-fort);
  border: 1px solid var(--c-verre-bord);
  border-radius: 22px;
  box-shadow: var(--c-ombre);
  z-index: 20;
}
.suggestions li,
.saisie__suggestions li {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 18px;
  color: var(--c-ink);
}
.suggestions li:hover,
.suggestions li.is-selected,
.saisie__suggestions li:hover,
.saisie__suggestions li.is-selected { background: rgba(127, 127, 140, 0.18); }
.s-nom { font-weight: 600; }
.s-dep { color: var(--c-ink-3); font-size: 0.85em; }
.s-etat {
  margin-left: auto;
  flex: 0 0 auto;
  font-size: 0.78em;
  font-weight: 600;
  padding: 5px 13px;
  border-radius: 999px;
  white-space: nowrap;
  color: #ffb3c1;
  background: rgba(255, 0, 55, 0.18);
}
.s-etat--existe { color: #8fe6b6; background: rgba(43, 197, 120, 0.18); }
html:not([data-theme='dark']) body.is-kiosk .s-etat { color: var(--brand-ink); background: rgba(255, 0, 55, 0.1); }
html:not([data-theme='dark']) body.is-kiosk .s-etat--existe { color: #0b7a4a; background: rgba(11, 122, 74, 0.12); }
.suggestions li.is-vide,
.saisie__suggestions li.is-vide { color: var(--c-ink-3); cursor: default; }
.suggestions li.is-vide:hover,
.saisie__suggestions li.is-vide:hover { background: transparent; }

/* ─── Une commune mise en scène ─── */

.scene--ville {
  --col: 40vw;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  column-gap: 48px;
  align-items: center;
  padding: 72px 0 40px;
}
.ville__genere {
  margin: 0 0 14px;
  font-size: clamp(15px, 1.1vw, 19px);
  font-weight: 500;
  color: var(--ink-3);
}
.ville__nom {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  /* La taille se règle sur le nom : le mot le plus long tient sur la ligne,
     le nom entier tient en deux lignes au plus (largeur en caractères ≈ 0,58 em) */
  font-size: clamp(44px, min(6.2vw, calc(var(--col) / var(--mot, 8) / 0.6), max(calc(var(--col) / var(--n, 8) / 0.6), min(calc(2 * var(--col) / var(--n, 8) / 0.6), 72px))), 132px);
  line-height: 0.98;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.ville__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.82em;
  height: 0.82em;
  padding: 0.09em;
  margin-right: 0.22em;
  vertical-align: -0.1em;
  background: #fff;
  border-radius: 0.16em;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.5);
}
.ville__logo img { width: 100%; height: 100%; object-fit: contain; }
.ville__sous {
  margin: 22px 0 0;
  font-size: clamp(17px, 1.35vw, 22px);
  line-height: 1.45;
  color: var(--ink-2);
  max-width: 44ch;
}
.ville__action { margin: 28px 0 0; }

/* Les tirages : trois photos réelles, posées comme des tirages sur une table */
.scene__tirages {
  --tirage-w: clamp(240px, 26vw, 460px);
  position: relative;
  height: calc(var(--tirage-w) * 0.62 + 110px + 40px);
  min-width: 0;
}
.tirage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--tirage-w);
  padding: 10px 10px 0;
  background: #fff;
  border-radius: 10px;
  box-shadow: var(--shadow-tirage);
  color: #101014;
  text-decoration: none;
  transform: translate(-50%, -50%) translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(var(--sc));
  -webkit-tap-highlight-color: transparent;
}
.tirage:nth-child(1) { --dx: -36%; --dy: 10%; --rot: -6deg; --sc: 0.9; z-index: 1; }
.tirage:nth-child(2) { --dx: 0%; --dy: -6%; --rot: 1.5deg; --sc: 1; z-index: 3; }
.tirage:nth-child(3) { --dx: 36%; --dy: 12%; --rot: 5deg; --sc: 0.9; z-index: 2; }
.tirage__image {
  display: block;
  aspect-ratio: 800 / 496;
  border-radius: 5px;
  overflow: hidden;
  background: #e6e9ef;
}
.tirage__image img { width: 100%; height: 100%; object-fit: cover; }
.tirage__titre {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  padding: 12px 6px 14px;
  font-size: clamp(14px, 1.1vw, 20px);
  font-weight: 600;
  line-height: 1.28;
  min-height: calc(2 * 1.28em + 26px);
}

/* ─── Comment la carte se construit ─── */

.scene--comment { padding: 72px 0 40px; }
.scene__texte--large { max-width: none; }
.etapes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
}
.etapes li { display: grid; grid-template-rows: auto 1fr; gap: 10px; }
.etapes__n {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(44px, 4.4vw, 72px);
  line-height: 1;
  color: var(--brand);
  letter-spacing: -0.04em;
}
.etapes p {
  margin: 0;
  font-size: clamp(17px, 1.35vw, 22px);
  line-height: 1.4;
  color: var(--ink-2);
  max-width: 32ch;
}
.regles {
  margin: 36px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: clamp(15px, 1.1vw, 18px);
  line-height: 1.55;
  color: var(--ink-3);
  max-width: 78ch;
}

/* ─── Toutes les communes ─── */

.communes { padding: 56px 0 24px; content-visibility: auto; contain-intrinsic-size: auto 800px; }
.communes .titre--3 { margin-bottom: 22px; }
.communes__liste {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(236px, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.commune { --ville: var(--brand); }
.commune__lien {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px 10px 10px;
  min-height: 66px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  text-decoration: none;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.2s ease, transform 0.2s var(--ease-out);
}
.commune__lien:hover { border-color: var(--ville); }
.commune__lien:active { transform: scale(0.98); }
.commune__logo {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 3px;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
}
.commune__logo--vide {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ville);
}
.commune__texte { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.commune__nom { font-weight: 600; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.commune__n { font-size: 13.5px; color: var(--ink-3); margin-top: 3px; }

/* ─── La Métropole de Lyon ─── */

.lyon { padding: 24px 0 48px; content-visibility: auto; contain-intrinsic-size: auto 600px; }
.lyon__inner {
  --col: 36vw;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  column-gap: 48px;
  align-items: center;
  padding: 48px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 28px;
}

/* ─── Pied de page ─── */

.pied {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 40px 64px;
  color: var(--ink-3);
  font-size: 16px;
}
.pied__appel { margin: 0 0 12px; font-size: 18px; color: var(--ink-2); }
.pied__appel a { color: var(--ink); font-weight: 600; }
.pied__liens { margin: 0; display: flex; flex-wrap: wrap; gap: 20px; align-items: baseline; }
.pied__liens a { text-decoration: none; color: var(--ink-3); }
.pied__liens a:hover { color: var(--ink); }
.pied__credit { font-size: 13px; }

/* ─── Petits écrans (site) ─── */

@media (max-width: 900px) {
  .entete { padding: 20px 20px 4px; }
  .entete__nav { gap: 16px; font-size: 14px; }
  .entete__nav a:not(.entete__demo) { display: none; }
  .hero { padding-bottom: 40px; }
  .scene--accueil { padding: 24px 20px 20px; }
  .scene--accueil .scene__texte { max-width: none; }
  .principal { padding: 0 20px; }
  .recherche { width: calc(100% - 40px); flex-direction: column; border-radius: 28px; padding: 10px; }
  .recherche__champ input { font-size: 17px; padding: 14px 16px; }
  .recherche .bouton { width: 100%; }
  .scene--ville, .lyon__inner { --col: 84vw; grid-template-columns: minmax(0, 1fr); row-gap: 28px; }
  .lyon__inner { padding: 28px 22px; }
  .scene__tirages { --tirage-w: clamp(200px, 58vw, 340px); }
  .etapes { grid-template-columns: minmax(0, 1fr); gap: 24px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   LE STAND - body.is-kiosk
   Un seul écran : en-tête, la scène en cours, la recherche, le ruban des
   communes. Aucun défilement. Les scènes partagent la même cellule de grille
   et se relaient par opacité ; le ciel est fixé derrière tout.
   ═══════════════════════════════════════════════════════════════════════════ */

.is-kiosk { height: 100%; overflow: hidden; }
body.is-kiosk {
  height: 100dvh;
  display: grid;
  /* minmax(0, 1fr) : sans ce plancher à zéro, le ruban des communes (16 000 px
     de large à faire défiler) élargirait la colonne, donc l'écran entier */
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  grid-template-areas: 'entete' 'scene' 'recherche' 'communes';
  row-gap: 1.5vh;
  padding: 0 3vw 1.6vh;
  overflow: hidden;
  background: var(--c-fond);
  color: var(--c-ink);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
body.is-kiosk .hero,
body.is-kiosk .principal { display: contents; }
body.is-kiosk .ciel { position: fixed; inset: 0; z-index: 0; }
body.is-kiosk .entete { grid-area: entete; max-width: none; width: 100%; margin: 0; padding: 2vh 0 0; gap: 16px; }
body.is-kiosk .entete__logo img { height: clamp(34px, 4.4vh, 52px); }
body.is-kiosk .entete__nav { display: none; }
body.is-kiosk .commandes { display: flex; }
body.is-kiosk .commande { width: clamp(46px, 6vh, 60px); height: clamp(46px, 6vh, 60px); }
body.is-kiosk .pied,
body.is-kiosk .lyon,
body.is-kiosk .communes .titre--3 { display: none; }

body.is-kiosk .scene {
  grid-area: scene;
  display: grid;
  grid-template-columns: minmax(0, 46fr) minmax(0, 54fr);
  column-gap: 3vw;
  align-items: center;
  min-height: 0;
  max-width: none;
  margin: 0;
  padding: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.7s ease, visibility 0s linear 0.7s;
}
body.is-kiosk .scene.is-active {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}
/* Le texte d'une scène monte en place à son arrivée, les tirages se distribuent */
body.is-kiosk .scene.is-active .scene__texte { animation: monter-texte 0.9s var(--ease-out) both 0.25s; }
body.is-kiosk .scene.is-active .tirage {
  animation: distribuer 1s var(--ease-out) both;
  animation-delay: calc(0.5s + var(--i, 0) * 150ms);
}
@keyframes monter-texte {
  from { opacity: 0; transform: translate3d(0, 28px, 0); }
  to { opacity: 1; transform: none; }
}
@keyframes distribuer {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) translate(var(--dx), calc(var(--dy) + 40%)) rotate(calc(var(--rot) * 0.4)) scale(calc(var(--sc) * 0.9));
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(var(--sc));
  }
}
body.is-kiosk .scene--accueil .scene__texte { max-width: none; }
body.is-kiosk .scene--comment { grid-template-columns: minmax(0, 1fr); }
body.is-kiosk .scene__texte--large { max-width: 92vw; }
body.is-kiosk .titre { font-size: clamp(44px, 5.4vw, 110px); text-shadow: var(--c-halo); }
body.is-kiosk .titre--2 { font-size: clamp(38px, 4.4vw, 88px); }
body.is-kiosk .scene__sous { font-size: clamp(19px, 1.5vw, 30px); margin-top: 2.4vh; color: var(--c-ink-2); }
body.is-kiosk .scene__compte { font-size: clamp(16px, 1.2vw, 24px); margin-top: 2vh; color: var(--c-ink-3); }
body.is-kiosk .scene__compte b { color: var(--c-ink); }

body.is-kiosk .scene--ville { --col: 41vw; padding: 0; }
body.is-kiosk .ville__genere { font-size: clamp(16px, min(1.2vw, 2.2vh), 24px); margin-bottom: min(14px, 1.4vh); color: var(--c-ink-3); }
body.is-kiosk .ville__nom {
  /* Trois plafonds : la largeur de l'écran, la hauteur (deux lignes au plus),
     et le nom lui-même (son plus long mot tient sur une ligne, l'ensemble en
     deux lignes ; 0,6 em par caractère est la largeur prudente de la fonte) */
  font-size: clamp(52px, min(8.6vw, 11vh, calc(var(--col) / var(--mot, 8) / 0.6), max(calc(var(--col) / var(--n, 8) / 0.6), min(calc(2 * var(--col) / var(--n, 8) / 0.6), 7vh))), 176px);
  color: var(--c-ink);
  text-shadow: var(--c-halo);
}
body.is-kiosk .ville__sous { font-size: clamp(18px, min(1.45vw, 2.6vh), 29px); margin-top: min(22px, 2.2vh); max-width: 46ch; color: var(--c-ink-2); }
body.is-kiosk .ville__action { margin-top: min(28px, 3vh); }
body.is-kiosk .scene__tirages { --tirage-w: min(26vw, 44vh); box-shadow: none; }
body.is-kiosk .tirage { box-shadow: var(--c-ombre); }
body.is-kiosk .tirage__titre { font-size: clamp(16px, 1.25vw, 23px); }

body.is-kiosk .etapes { gap: 3vw; margin-top: 4vh; }
body.is-kiosk .etapes__n { font-size: clamp(56px, 5.6vw, 112px); color: var(--c-point); }
body.is-kiosk .etapes p { font-size: clamp(20px, 1.55vw, 31px); color: var(--c-ink-2); }
body.is-kiosk .regles { display: none; }

body.is-kiosk .bouton {
  font-size: clamp(19px, 1.45vw, 27px);
  min-height: clamp(60px, 7.2vh, 80px);
  padding: 14px 34px;
}

body.is-kiosk .recherche {
  grid-area: recherche;
  width: min(1080px, 92vw);
  margin: 0 auto;
  padding: 0.8vh;
  z-index: 2;
}
body.is-kiosk .recherche__champ input {
  font-size: clamp(22px, 1.9vw, 34px);
  padding: 1.4vh 30px;
  /* Sur le stand, le champ ouvre la saisie plein écran : pas de clavier ici */
  cursor: pointer;
}
body.is-kiosk .suggestions { display: none; }

/* Le ruban des communes */
body.is-kiosk .communes {
  grid-area: communes;
  min-width: 0;
  padding: 0;
  content-visibility: visible;
  contain-intrinsic-size: none;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 2.5%, #000 96%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 2.5%, #000 96%, transparent);
}
body.is-kiosk .communes__liste {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 6px 2px 8px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
body.is-kiosk .communes__liste::-webkit-scrollbar { display: none; }
body.is-kiosk .commune { flex: 0 0 auto; scroll-snap-align: start; }
body.is-kiosk .commune__lien {
  min-height: clamp(64px, 8.2vh, 88px);
  padding: 8px 22px 8px 8px;
  border-radius: 999px;
  background: var(--c-verre);
  border-color: var(--c-verre-bord);
  color: var(--c-ink);
  box-shadow: inset 0 1px 0 var(--c-verre-reflet);
}
body.is-kiosk .commune__logo { width: clamp(44px, 6vh, 60px); height: clamp(44px, 6vh, 60px); border-radius: 999px; border: 0; }
body.is-kiosk .commune__nom { font-size: clamp(17px, 1.3vw, 23px); }
body.is-kiosk .commune__n { font-size: clamp(13px, 1vw, 17px); color: var(--c-ink-3); }

/* Portrait (totem) : les tirages en haut, le texte en dessous, le ciel voilé
   par le bas, la recherche et le ruban à hauteur de main. */
@media (orientation: portrait) {
  body.is-kiosk {
    --c-voile:
      linear-gradient(0deg, rgba(5, 7, 13, 0.94) 0%, rgba(5, 7, 13, 0.78) 34%, rgba(5, 7, 13, 0.3) 58%, rgba(5, 7, 13, 0.2) 100%),
      linear-gradient(180deg, rgba(5, 7, 13, 0.5) 0%, rgba(5, 7, 13, 0) 18%);
  }
  html:not([data-theme='dark']) body.is-kiosk {
    --c-voile:
      linear-gradient(0deg, rgba(240, 244, 249, 0.96) 0%, rgba(240, 244, 249, 0.82) 34%, rgba(240, 244, 249, 0.38) 58%, rgba(240, 244, 249, 0.3) 100%),
      linear-gradient(180deg, rgba(240, 244, 249, 0.5) 0%, rgba(240, 244, 249, 0) 18%);
  }
  body.is-kiosk .scene { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; align-content: end; row-gap: 3vh; }
  body.is-kiosk .scene--accueil { align-content: end; padding-bottom: 2vh; }
  body.is-kiosk .titre { font-size: clamp(44px, 8.2vw, 96px); }
  body.is-kiosk .scene__sous { max-width: none; }
  body.is-kiosk .scene--ville { --col: 88vw; align-content: center; }
  body.is-kiosk .scene--ville .scene__texte { order: 2; }
  body.is-kiosk .scene--ville .scene__tirages { order: 1; --tirage-w: min(56vw, 34vh); }
  /* En portrait l'éventail se resserre : la largeur manque, pas la hauteur */
  body.is-kiosk .tirage:nth-child(1) { --dx: -26%; --dy: 12%; }
  body.is-kiosk .tirage:nth-child(3) { --dx: 26%; --dy: 14%; }
  body.is-kiosk .ville__nom { font-size: clamp(44px, min(9.4vw, 6.4vh, calc(var(--col) / var(--mot, 8) / 0.6), max(calc(var(--col) / var(--n, 8) / 0.6), min(calc(2 * var(--col) / var(--n, 8) / 0.6), 4.2vh))), 120px); }
  body.is-kiosk .etapes { grid-template-columns: minmax(0, 1fr); gap: 2.4vh; }
  body.is-kiosk .etapes li { grid-template-columns: auto 1fr; grid-template-rows: none; column-gap: 20px; align-items: start; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   LA COUCHE : une carte ouverte par-dessus l'accueil
   ═══════════════════════════════════════════════════════════════════════════ */

.couche {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: var(--c-fond);
  color: var(--c-ink);
}
.couche[hidden] { display: none; }
.couche__barre {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 1.2vh 2vw;
  background: var(--c-verre-fort);
  border-bottom: 1px solid var(--c-verre-bord);
}
.couche__identite {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  min-width: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(20px, 1.8vw, 32px);
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.couche__identite img { width: auto; height: clamp(32px, 4.4vh, 48px); padding: 4px; background: #fff; border-radius: 8px; }
.couche__cadre { width: 100%; height: 100%; border: 0; background: #f3f6fa; }

/* Emporter la carte */
.emporter {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  align-items: end;
  justify-items: center;
  background: rgba(5, 7, 13, 0.55);
}
.emporter[hidden] { display: none; }
.emporter__panneau {
  position: relative;
  width: min(960px, 100%);
  padding: 4vh 5vw 5vh;
  background: var(--c-verre-fort);
  border: 1px solid var(--c-verre-bord);
  border-bottom: 0;
  border-radius: 28px 28px 0 0;
  box-shadow: inset 0 1px 0 var(--c-verre-reflet), 0 -24px 80px rgba(0, 0, 0, 0.5);
  animation: monter 0.5s var(--ease-out) both;
}
html[data-theme='dark'] .emporter__panneau { background: #10141f; }
@keyframes monter {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.emporter__fermer {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--c-verre-bord);
  background: var(--c-verre);
  color: var(--c-ink);
  cursor: pointer;
}
.emporter__fermer svg { width: 22px; height: 22px; }
.emporter__titre {
  margin: 0 56px 3vh 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(26px, 2.6vw, 44px);
  letter-spacing: -0.025em;
  line-height: 1.05;
}
.emporter__colonnes {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
.emporter__qr { margin: 0; text-align: center; max-width: 260px; }
.emporter__qr img {
  width: 240px;
  height: 240px;
  padding: 10px;
  background: #fff;
  border-radius: 18px;
}
.emporter__qr figcaption { margin-top: 12px; font-size: 15px; color: var(--c-ink-3); line-height: 1.4; }
.emporter__label { display: block; font-weight: 600; font-size: clamp(18px, 1.4vw, 24px); margin-bottom: 12px; }
.emporter__champ {
  display: flex;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--c-verre-bord);
  border-radius: 999px;
  background: var(--c-verre);
}
.emporter__champ input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--c-ink);
  font-size: clamp(18px, 1.4vw, 24px);
  padding: 12px 20px;
  outline: none;
}
.emporter__champ input::placeholder { color: var(--c-ink-3); }
.emporter__erreur { margin: 12px 0 0; color: #ff8ea3; font-weight: 500; }
.emporter__merci { margin: 12px 0 0; color: #8fe6b6; font-weight: 600; }
html:not([data-theme='dark']) body.is-kiosk .emporter__erreur { color: var(--brand-ink); }
html:not([data-theme='dark']) body.is-kiosk .emporter__merci { color: #0b7a4a; }
.emporter__mention { margin: 14px 0 0; font-size: 14px; color: var(--c-ink-3); line-height: 1.45; }
.emporter.is-sans-mail .emporter__form { display: none; }
.emporter.is-sans-mail .emporter__colonnes { grid-template-columns: auto; justify-content: center; }

/* ═══════════════════════════════════════════════════════════════════════════
   LA SAISIE PLEIN ÉCRAN (stand)
   ═══════════════════════════════════════════════════════════════════════════ */

.saisie {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 2vh;
  padding: 3vh 5vw 3vh;
  color: var(--c-ink);
}
.saisie[hidden] { display: none; }
/* Pendant la saisie, seul le ciel reste : la scène, la recherche, le ruban et
   l'en-tête s'effacent sous elle (le ciel est fixé derrière, il reste visible) */
body.is-saisie .entete,
body.is-saisie .scene,
body.is-saisie .scene.is-active,
body.is-saisie .recherche,
body.is-saisie .communes { visibility: hidden; }
.saisie__haut { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.saisie__titre {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(28px, 3.2vw, 56px);
  letter-spacing: -0.03em;
  line-height: 1.05;
  text-shadow: var(--c-halo);
}
.saisie__champ {
  width: 100%;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 3.2vw, 52px);
  padding: 2vh 32px;
  border: 1px solid var(--c-verre-bord);
  border-radius: 26px;
  background: var(--c-verre-fort);
  color: var(--c-ink);
  outline: none;
  box-shadow: inset 0 1px 0 var(--c-verre-reflet), 0 0 0 8px rgba(255, 0, 55, 0.12);
}
.saisie__champ:focus { border-color: var(--brand); }
.saisie__champ::placeholder { color: var(--c-ink-3); font-weight: 500; }
.saisie__suggestions {
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.saisie__suggestions li {
  padding: 2.2vh 28px;
  font-size: clamp(20px, 1.8vw, 32px);
  background: var(--c-verre);
  border: 1px solid var(--c-verre-bord);
  border-radius: 20px;
  box-shadow: inset 0 1px 0 var(--c-verre-reflet);
}
.saisie__suggestions .s-etat { font-size: 0.68em; padding: 8px 16px; }
.saisie__aide { margin: 0; font-size: clamp(16px, 1.3vw, 24px); color: var(--c-ink-3); }

/* ─── Le rappel avant le retour à l'accueil ─── */

.veille {
  position: fixed;
  left: 50%;
  bottom: 4vh;
  z-index: 60;
  margin: 0;
  padding: 16px 28px;
  border-radius: 999px;
  background: var(--c-verre-fort);
  border: 1px solid var(--c-verre-bord);
  color: var(--c-ink);
  font-size: clamp(17px, 1.3vw, 24px);
  font-weight: 500;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 var(--c-verre-reflet), 0 20px 50px -14px rgba(0, 0, 0, 0.6);
  transform: translateX(-50%);
  animation: monter 0.4s var(--ease-out) both;
}
.veille[hidden] { display: none; }
.veille b { font-weight: 700; }

/* ─── Mouvement réduit ─── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .ciel__image, .constellation { animation: none; }
  .point.is-on { animation: none; }
}
