/* ============================================================
   Pages générées — communes, fiches, programmes, départements, blog.
   ------------------------------------------------------------
   Feuille volontairement légère : ces pages sont lues par des moteurs et
   des visiteurs de passage, pas par l'application.

   Principes : les filets et l'espace font la hiérarchie, pas les cartes.
   Bordure + ombre ne restent que sur ce qui flotte (menus, panneau de fiche)
   ou invite (appel de fin d'article). Les jetons vivent dans base.css ;
   aucune couleur n'est écrite ici, pour que le thème sombre tienne.
   ============================================================ */

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--panel-2); color: var(--text);
  font: 400 var(--t-base)/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .14em; }
a:hover { color: var(--accent-dark); }
h1, h2, h3, h4 { font-family: var(--font); font-weight: 650; color: var(--text); text-wrap: balance; }
img { max-width: 100%; height: auto; }

/* ---------- Bandeau ---------- */

.bandeau {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 8px 16px;
  padding: 10px 24px; background: var(--bandeau-fond); color: var(--bandeau-texte);
  border-bottom: 1px solid var(--bandeau-trait);
}
.marque {
  display: flex; align-items: center; gap: 10px;
  color: var(--bandeau-texte); text-decoration: none;
  font-weight: 650; font-size: var(--t-base); letter-spacing: -.01em;
}
.marque:hover { color: var(--bandeau-texte); }
.marque img { border-radius: var(--radius-sm); display: block; }

.bandeau-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }

.lien-bandeau {
  color: var(--bandeau-texte-2); text-decoration: none;
  font-size: var(--t-sm); font-weight: 500;
  padding: 7px 11px; border-radius: var(--radius-sm);
}
.lien-bandeau:hover { background: var(--bandeau-survol); color: var(--bandeau-texte); }

/* L'appel vers la carte : un phare sur l'encre, pas un bouton de plus. */
.vers-carte {
  background: var(--bandeau-texte); color: var(--bg); text-decoration: none;
  padding: 7px 14px; border-radius: var(--radius-sm);
  font-size: var(--t-sm); font-weight: 650; white-space: nowrap;
}
.vers-carte:hover { background: var(--accent); color: var(--accent-contraste); }

/* Menu des communes : <details> natif, sans JavaScript. */
.menu-villes { position: relative; }
.menu-villes summary, .menu-pays-page summary {
  list-style: none; cursor: pointer; user-select: none;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 11px; border-radius: var(--radius-sm);
  color: var(--bandeau-texte-2); font-size: var(--t-sm); font-weight: 500;
  white-space: nowrap;
}
.menu-villes summary::-webkit-details-marker,
.menu-pays-page summary::-webkit-details-marker { display: none; }
.menu-villes summary:hover, .menu-pays-page summary:hover,
.menu-villes[open] summary, .menu-pays-page[open] summary {
  background: var(--bandeau-survol); color: var(--bandeau-texte);
}
.menu-villes summary span, .menu-pays-page summary span { font-size: .6rem; opacity: .8; }

.menu-villes-panneau {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 40;
  width: min(440px, calc(100vw - 32px));
  background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 14px 16px;
}
.menu-villes-titre {
  margin: 0 0 8px; font-size: var(--t-xs); font-weight: 650;
  text-transform: uppercase; letter-spacing: .06em; color: var(--text-3);
}
.menu-villes-panneau ul {
  list-style: none; padding: 0; margin: 0 0 10px;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px 12px;
}
.menu-villes-panneau li a {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 5px 7px; border-radius: var(--radius-sm);
  font-size: var(--t-sm); text-decoration: none; color: var(--text);
}
.menu-villes-panneau li a:hover { background: var(--accent-soft); color: var(--text); }
.menu-villes-panneau li a[aria-current] { background: var(--accent-soft); font-weight: 650; }
.menu-villes-panneau li b { color: var(--text-3); font-weight: 500; }
.menu-villes-toutes {
  display: block; padding-top: 10px; border-top: 1px solid var(--border);
  font-size: var(--t-sm); font-weight: 650; text-decoration: none;
}
.menu-villes-toutes:hover { text-decoration: underline; }

/* Sélecteur de pays du bandeau. */
.menu-pays-page { position: relative; }
.menu-pays-page-panneau {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 40;
  min-width: 180px; padding: 6px;
  display: flex; flex-direction: column; gap: 1px;
  background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.menu-pays-page-panneau a {
  padding: 7px 10px; border-radius: var(--radius-sm);
  font-size: var(--t-sm); text-decoration: none; color: var(--text);
}
.menu-pays-page-panneau a:hover { background: var(--accent-soft); color: var(--text); }

@media (max-width: 620px) {
  /* Sous 620 px le panneau devient `fixed` : son `top` se résout alors contre
     la fenêtre, plus contre le <details>. Sans le réinitialiser, il tombait
     à 100vh + 8px, invisible. */
  .menu-villes-panneau {
    position: fixed;
    top: 64px; left: 16px; right: 16px; width: auto;
    max-height: calc(100vh - 80px); max-height: calc(100dvh - 80px);
    overflow-y: auto;
  }
  .menu-villes-panneau ul { grid-template-columns: 1fr; }
}

/* ---------- Structure de page ---------- */

.fil {
  max-width: 1040px; margin: 0 auto; padding: 16px 24px 0;
  font-size: var(--t-xs); font-weight: 500; letter-spacing: .02em;
  color: var(--text-3);
}
.fil a { color: var(--text-2); text-decoration: none; }
.fil a:hover { color: var(--accent); text-decoration: underline; }
.fil span { margin: 0 .2em; opacity: .7; }
.fil strong { font-weight: 500; color: var(--text); }

main { max-width: 1040px; margin: 0 auto; padding: 4px 24px 64px; }

h1 {
  font-size: clamp(1.625rem, 1.15rem + 2vw, var(--t-3xl));
  line-height: 1.15; letter-spacing: -.02em;
  margin: 18px 0 10px; max-width: 30ch;
}
h2 { font-size: var(--t-2xl); line-height: 1.2; letter-spacing: -.01em; margin: 44px 0 16px; }
h3 { font-size: var(--t-xl); line-height: 1.25; margin: 0; }

/* Le titre de section porte un filet qui court jusqu'au bord : c'est lui qui
   sépare les blocs, pas des cartes. */
main > h2, .region > h2 {
  display: flex; align-items: center; gap: 16px;
}
main > h2::after, .region > h2::after {
  content: ""; flex: 1; height: 1px; background: var(--border); min-width: 24px;
}

.chapeau {
  font-family: var(--font-lecture); font-size: var(--t-lg); line-height: 1.55;
  color: var(--text-2); margin: 0 0 22px; max-width: 68ch;
}
main p a { color: var(--accent); }
main > p { max-width: 68ch; }

/* Dans un texte en Literata, le gras est une grotesque : la Literata n'a
   qu'une graisse embarquée et le gras de synthèse est coupé (base.css). */
.chapeau b, .chapeau strong,
.article-corps b, .article-corps strong,
.station-contexte b, .station-contexte strong,
.faits-division b, .faits-division strong,
.encadre-programme b, .encadre-programme strong,
.eau-regle b, .eau-regle strong,
.signalement-intro b, .signalement-intro strong {
  font-family: var(--font); font-weight: 650; font-size: .94em;
}
.sous-titre { margin: -8px 0 14px; font-size: var(--t-sm); color: var(--text-3); }

/* ---------- Indicateurs et répartition ---------- */

/* Chiffres dérivés des stations de la commune, en ligne : ils orientent,
   ils ne sont pas le sujet. Séparés par des filets, sans tuile. */
.indicateurs {
  display: flex; flex-wrap: wrap; gap: 6px 0;
  list-style: none; padding: 0; margin: 0 0 22px;
}
.indicateurs li {
  display: flex; flex-direction: column; gap: 1px;
  padding: 4px 22px 4px 0; margin-right: 22px;
  border-right: 1px solid var(--border);
}
.indicateurs li:last-child { border-right: 0; margin-right: 0; }
.indicateurs b {
  font-size: var(--t-2xl); font-weight: 650; line-height: 1.1; letter-spacing: -.02em;
  color: var(--text);
}
.indicateurs span { font-size: var(--t-xs); color: var(--text-3); letter-spacing: .01em; }

.repartition { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 26px; }
.repartition li {
  font-size: var(--t-sm); padding: 4px 11px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--border); color: var(--text-2);
}
.repartition b { color: var(--text); margin-right: 2px; }
.repartition li a { text-decoration: none; color: inherit; }
.repartition li:has(a) { border-color: var(--border-strong); }
.repartition li:has(a):hover { border-color: var(--accent); color: var(--accent-dark); }

/* ---------- Liste des stations ---------- */

.stations { display: grid; gap: 0; border-top: 1px solid var(--border); }
.station { padding: 20px 0 22px; border-bottom: 1px solid var(--border); }
.station h3 { font-size: var(--t-xl); line-height: 1.25; margin: 0; }
.station h3 a { color: var(--text); text-decoration: none; }
.station h3 a:hover { color: var(--accent); text-decoration: underline; }
.station-type { margin: 3px 0 10px; font-size: var(--t-sm); color: var(--text-3); }
.station-adresse { margin: 0 0 10px; font-size: var(--t-md); color: var(--text-2); }
.station-adresse span + span { margin-left: 4px; }

/* Données : libellé en petites capitales grotesques, valeur en face. */
.station-infos {
  display: grid; grid-template-columns: 104px 1fr; gap: 5px 16px;
  margin: 0; font-size: var(--t-md);
}
.station-infos dt {
  color: var(--text-3); font-size: var(--t-xs); font-weight: 500;
  text-transform: uppercase; letter-spacing: .05em; padding-top: .2em;
}
.station-infos dd { margin: 0; }

.station-services { display: flex; flex-wrap: wrap; gap: 5px; list-style: none; padding: 0; margin: 12px 0 0; }
.station-services li {
  font-size: var(--t-xs); padding: 3px 9px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--border); color: var(--text-2);
}
.station-services.grande { gap: 7px; }
.station-services.grande li { font-size: var(--t-sm); padding: 5px 12px; }

.station-liens { margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 16px; font-size: var(--t-sm); font-weight: 650; }

/* ---------- Voisinage, communes, régions ---------- */

.voisines, .voisines-stations, .communes {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 0 28px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  border-top: 1px solid var(--border);
}
.voisines-stations { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.communes { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 24px; }
.voisines li, .voisines-stations li, .communes li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding: 9px 0; font-size: var(--t-md);
  border-bottom: 1px solid var(--border);
}
.voisines li a, .voisines-stations li a, .communes li a { text-decoration: none; }
.voisines li a:hover, .voisines-stations li a:hover, .communes li a:hover { text-decoration: underline; }
.voisines span, .voisines-stations span { font-size: var(--t-xs); color: var(--text-3); white-space: nowrap; }
.voisines-stations .sans-lien { color: var(--text-2); font-size: var(--t-md); white-space: normal; }
.communes b { color: var(--text-3); font-weight: 500; font-size: var(--t-sm); }
.communes.compacte li { font-size: var(--t-sm); padding: 7px 0; }

.region { scroll-margin-top: 16px; }
.region h2 span { font-size: var(--t-sm); font-weight: 400; letter-spacing: 0; color: var(--text-3); }

.raccourcis { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 28px; }
.raccourcis a {
  font-size: var(--t-sm); text-decoration: none; color: var(--text-2);
  padding: 5px 12px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--border-strong);
}
.raccourcis a:hover { border-color: var(--accent); color: var(--accent-dark); }

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

footer {
  max-width: 1040px; margin: 0 auto; padding: 26px 24px 48px;
  border-top: 1px solid var(--border); font-size: var(--t-sm); color: var(--text-2);
}
.pied-liens { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 14px; }
.pied-liens a { font-size: var(--t-sm); color: var(--text-2); text-decoration: none; }
.pied-liens a:hover { color: var(--accent); text-decoration: underline; }
.mentions { font-size: var(--t-xs); color: var(--text-3); max-width: 80ch; line-height: 1.5; }

/* Sélecteur de pays : discret, mais toujours atteignable en bas de page. */
.pied-pays {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 16px; padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.pied-pays a {
  padding: 4px 11px; border: 1px solid var(--border-strong); border-radius: 999px;
  font-size: var(--t-xs); font-weight: 500; text-decoration: none; color: var(--text-2);
}
.pied-pays a:hover { border-color: var(--accent); color: var(--accent-dark); }

/* ---------- Page station ---------- */

/* La fiche n'est pas une carte : un filet d'accent en tête, comme une ligne
   d'eau, et les données dessous. */
.fiche-station {
  padding: 18px 0 20px; margin-bottom: 12px;
  border-top: 2px solid var(--accent); border-bottom: 1px solid var(--border);
}
.fiche-station .station-infos { grid-template-columns: 124px 1fr; gap: 10px 18px; font-size: var(--t-base); }
.fiche-station .station-infos dd { line-height: 1.5; }

.fiche-actions-page {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border);
}
.bouton-carte, .bouton-secondaire-lien {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-sm);
  font-size: var(--t-md); font-weight: 650; text-decoration: none; line-height: 1.2;
  transition: background-color .12s, border-color .12s, color .12s;
}
.bouton-carte { background: var(--accent); color: var(--accent-contraste); border: 1px solid var(--accent); }
.bouton-carte:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: var(--accent-contraste); }
.bouton-secondaire-lien { background: var(--panel); border: 1px solid var(--border-strong); color: var(--text); }
.bouton-secondaire-lien:hover { border-color: var(--accent); color: var(--accent-dark); }

.actions-programme { margin: 0 0 20px; }

/* Galerie d'une fiche station : une photo réelle est ce qui distingue la page
   de celles qu'un concurrent peut produire à partir des mêmes sources. */
.galerie-page { margin: 0 0 1.4rem; }
.galerie-page-grille {
  display: grid; gap: 6px;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.galerie-page-grille img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: var(--radius); background: var(--panel);
}
@media (min-width: 620px) {
  .galerie-page-grille img:first-child { grid-column: span 2; grid-row: span 2; }
}
.galerie-page figcaption { margin-top: 8px; font-size: var(--t-xs); color: var(--text-3); }

/* Contexte local : des constats indépendants, en liste, en Literata. */
.station-contexte {
  list-style: none; margin: 0 0 1.4rem; padding: 0;
  display: flex; flex-direction: column; gap: 8px; max-width: 68ch;
}
.station-contexte li {
  position: relative; padding-left: 1.2rem;
  font-family: var(--font-lecture); color: var(--text-2); font-size: var(--t-base); line-height: 1.55;
}
.station-contexte li::before {
  content: ""; position: absolute; left: 0; top: .62em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}

/* Maillage : les liens que les données de la page désignent. Le <li> porte
   la pastille, car le compte est un frère du lien, pas son enfant ; le
   pseudo-élément étend la zone cliquable à toute la pastille. */
.maillage {
  list-style: none; margin: 0 0 1.6rem; padding: 0;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.maillage li {
  position: relative; display: inline-flex; align-items: baseline; gap: 6px;
  padding: 6px 13px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--panel);
  font-size: var(--t-sm); font-weight: 500;
  transition: background-color .12s, border-color .12s;
}
.maillage a { text-decoration: none; color: var(--text-2); }
.maillage a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.maillage li:hover { border-color: var(--accent); background: var(--accent-soft); }
.maillage li:hover a { color: var(--accent-dark); }
.maillage a:focus-visible::after { outline: 2px solid var(--accent); outline-offset: 2px; }
.maillage a:focus-visible { outline: none; }
.maillage span { color: var(--text-3); font-size: var(--t-xs); }

/* ---------- Pages programme ---------- */

.encadre-programme {
  margin: 0 0 24px; padding: 4px 0 4px 18px; max-width: 68ch;
  border-left: 3px solid var(--accent);
}
.encadre-programme p { margin: 0; font-family: var(--font-lecture); font-size: var(--t-lg); line-height: 1.55; color: var(--text-2); }
.encadre-programme .conseil { margin-top: 10px; font-size: var(--t-base); }
.encadre-programme .conseil b { color: var(--text); font-family: var(--font); font-weight: 650; }

.faits-division {
  font-family: var(--font-lecture); font-size: var(--t-base); line-height: 1.6;
  color: var(--text-2); max-width: 68ch; margin: 0 0 24px;
}

.grille-programmes {
  display: grid; gap: 0 32px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
}
.carte-programme { padding: 16px 0 20px; border-top: 1px solid var(--border); }
.carte-programme h2 { font-size: var(--t-xl); margin: 0 0 4px; }
.carte-programme h2 a { text-decoration: none; color: var(--text); }
.carte-programme h2 a:hover { color: var(--accent); text-decoration: underline; }
.compte-programme { margin: 0 0 8px; font-size: var(--t-xs); color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.carte-programme p:last-child { margin: 0; font-size: var(--t-md); color: var(--text-2); line-height: 1.5; }

/* ---------- Blog ---------- */

.grille-articles { display: grid; gap: 0 32px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.carte-article { padding: 18px 0 22px; border-top: 1px solid var(--border); }
.carte-article h2 { font-size: var(--t-xl); margin: 6px 0 8px; line-height: 1.25; }
.carte-article h2 a { text-decoration: none; color: var(--text); }
.carte-article h2 a:hover { color: var(--accent); text-decoration: underline; }
.carte-article p:last-child { margin-bottom: 0; }
.carte-article > p { font-family: var(--font-lecture); font-size: var(--t-md); color: var(--text-2); line-height: 1.55; margin: 0; }

.article-meta { font-size: var(--t-xs); color: var(--text-3); margin: 0 0 4px; text-transform: uppercase; letter-spacing: .04em; }
.etiquette-tag {
  display: inline-block; font-size: var(--t-xs); padding: 2px 9px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-dark); margin-right: 4px;
  text-transform: none; letter-spacing: 0;
}
.article-tags { margin: 10px 0 0 !important; }

.article { max-width: 720px; }
.article-entete { margin-bottom: 28px; }
.article-entete h1 { margin: 6px 0 12px; }
.article .chapeau { font-size: var(--t-lg); line-height: 1.6; }

.sommaire { padding: 2px 0 2px 18px; border-left: 1px solid var(--border-strong); margin-bottom: 32px; }
.sommaire p { margin: 0 0 7px; font-size: var(--t-xs); font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.sommaire ol { margin: 0; padding-left: 18px; }
.sommaire li { font-size: var(--t-md); margin-bottom: 4px; }

.article-corps { font-family: var(--font-lecture); font-size: var(--t-lg); line-height: 1.7; }
.article-corps h2 { font-family: var(--font); font-size: var(--t-2xl); margin: 40px 0 14px; scroll-margin-top: 16px; }
.article-corps h3 { font-family: var(--font); font-size: var(--t-xl); margin: 28px 0 10px; }
.article-corps p { margin: 0 0 18px; }
.article-corps ul, .article-corps ol { margin: 0 0 20px; padding-left: 22px; }
.article-corps li { margin-bottom: 7px; }
.article-corps blockquote {
  margin: 0 0 22px; padding: 4px 0 4px 18px;
  border-left: 3px solid var(--accent); color: var(--text-2);
}
.article-corps blockquote p:last-child { margin-bottom: 0; }
.article-corps code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 1px 5px; font-size: .85em;
}
.article-corps hr { border: 0; border-top: 1px solid var(--border); margin: 32px 0; }
.article-corps .tableau { overflow-x: auto; margin: 0 0 22px; }
.article-corps table { width: 100%; border-collapse: collapse; font-family: var(--font); font-size: var(--t-md); }
.article-corps th, .article-corps td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.article-corps th {
  font-size: var(--t-xs); color: var(--text-3); font-weight: 650;
  text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border-strong);
}
.article-corps tr:last-child td { border-bottom: 0; }
.article-corps em { color: var(--text-2); }

/* L'appel de fin d'article : une invitation, la seule chose qui garde un fond. */
.article-appel {
  background: var(--accent-soft); border-left: 3px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0;
  padding: 18px 22px; margin: 36px 0 0; font-family: var(--font); font-size: var(--t-md); color: var(--text);
}
.article-appel p { margin: 0 0 12px; line-height: 1.55; }
.article-appel p:last-child { margin: 0; display: flex; gap: 10px; flex-wrap: wrap; }

.article-suite { margin-top: 40px; }
.liste-articles { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; border-top: 1px solid var(--border); }
.liste-articles li { padding: 12px 0; border-bottom: 1px solid var(--border); }
.liste-articles a { font-size: var(--t-base); font-weight: 650; text-decoration: none; }
.liste-articles a:hover { text-decoration: underline; }
.liste-articles span { display: block; font-size: var(--t-xs); color: var(--text-3); margin-top: 2px; }

.attente-blog { color: var(--text-3); font-size: var(--t-md); }

/* ---------- Page commune : carte et liste côte à côte ----------
   La liste porte le contenu indexé : elle reste entière et lisible sans
   JavaScript. La carte est un ajout, pas une dépendance — d'où la classe
   `sans-carte`, posée par le gabarit et retirée par js/ville.js quand la
   carte existe vraiment. */
.ville-double {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 2rem; align-items: start; margin-bottom: 2rem;
}
.ville-double.sans-carte { grid-template-columns: 1fr; }

.ville-carte {
  position: sticky; top: 1rem;
  height: min(72vh, 640px);
  border-radius: var(--radius); overflow: hidden;
  background: var(--panel); border: 1px solid var(--border);
}
.ville-carte .leaflet-container { height: 100%; font: inherit; }
.ville-liste { min-width: 0; }


@media (max-width: 900px) {
  .ville-double { grid-template-columns: 1fr; gap: 1.2rem; }
  .ville-carte { position: static; height: 300px; }
}

/* ---------- Filtres ---------- */

.ville-filtres {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-bottom: 14px;
}
.ville-filtres-titre {
  font-size: var(--t-xs); font-weight: 650; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-3); margin-right: 4px;
}
.ville-filtres-boutons { display: flex; flex-wrap: wrap; gap: 6px; }
.filtre {
  appearance: none; cursor: pointer;
  padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--panel);
  font: inherit; font-size: var(--t-sm); font-weight: 500; color: var(--text-2);
  transition: background-color .12s, border-color .12s, color .12s;
}
.filtre b { color: var(--text-3); font-weight: 500; margin-left: 2px; }
.filtre:hover { border-color: var(--accent); color: var(--accent-dark); }
.filtre.on { background: var(--accent); border-color: var(--accent); color: var(--accent-contraste); }
.filtre.on b { color: var(--accent-contraste); }
.ville-compte { margin-left: auto; font-size: var(--t-xs); color: var(--text-3); font-variant-numeric: tabular-nums; }
.ville-vide { padding: 1.4rem 0; color: var(--text-3); font-family: var(--font-lecture); }

/* Repère visuel quand un marqueur renvoie vers sa fiche dans la liste. */
.station-visee { outline: 2px solid var(--accent); outline-offset: 4px; transition: outline-color .4s; }

.ville-liste .voisines-stations { margin: 0; }
.ville-liste .voisines-stations li[hidden] { display: none; }

/* Fiche consultable sur place, sur les pages catégorie. */
.fiche-voir {
  margin-left: 6px; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--panel); padding: 2px 9px;
  font: inherit; font-size: var(--t-xs); font-weight: 500; color: var(--text-2);
}
.fiche-voir:hover { border-color: var(--accent); color: var(--accent-dark); }

.fiche-panneau {
  grid-column: 1 / -1; position: relative;
  margin: 12px 0; padding: 18px 20px;
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow);
}
.fiche-panneau h3 { margin: 0 32px 12px 0; font-size: var(--t-xl); }
.fiche-panneau dl {
  display: grid; grid-template-columns: auto 1fr; gap: 6px 16px;
  margin: 0 0 14px; font-size: var(--t-md);
}
.fiche-panneau dt { color: var(--text-3); font-size: var(--t-xs); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; padding-top: .2em; }
.fiche-panneau dd { margin: 0; color: var(--text); }
.fiche-panneau .fiche-vide { margin: 0 0 14px; color: var(--text-3); font-size: var(--t-md); }
.fiche-panneau .fiche-actions { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }

.fiche-fermer {
  position: absolute; top: 10px; right: 10px;
  width: 28px; height: 28px; cursor: pointer; line-height: 1;
  border: 0; border-radius: 50%; background: none;
  font: inherit; font-size: var(--t-base); color: var(--text-3);
}
.fiche-fermer:hover { background: var(--panel-2); color: var(--text); }

/* ---------- Restrictions d'eau (VigiEau) ---------- */

.eau { margin: 2rem 0; }
.eau h2 { margin-bottom: 12px; }

.eau-niveau { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; }
.eau-niveau span, .eau-pastille {
  font-weight: 650; font-size: var(--t-xs); letter-spacing: .05em; text-transform: uppercase;
  padding: 3px 9px; border-radius: var(--radius-sm); border: 1px solid currentColor;
}
.eau-pastille { flex: none; }
/* Les quatre niveaux de gravité sont une échelle officielle, pas un état de
   l'interface : ils ont leurs jetons, du jaune de vigilance au rouge de crise. */
/* Scopé à `.eau-niveau` : le bandeau du haut porte aussi la classe
   `eau-alerte`, et `.eau-alerte span` y écrasait toutes les pastilles. */
.eau-niveau.eau-vigilance span, .eau-vigilance-pastille { color: var(--eau-1); background: var(--eau-1-fond); }
.eau-niveau.eau-alerte    span, .eau-alerte-pastille    { color: var(--eau-2); background: var(--eau-2-fond); }
.eau-niveau.eau-renforcee span, .eau-renforcee-pastille { color: var(--eau-3); background: var(--eau-3-fond); }
.eau-niveau.eau-crise     span, .eau-crise-pastille     { color: var(--eau-4); background: var(--eau-4-fond); }
.eau-libre-pastille { color: var(--text-2); background: var(--panel); border-color: var(--border-strong); }

.eau-regle {
  margin: 0 0 12px; padding: 4px 0 4px 16px; max-width: 68ch;
  border-left: 3px solid var(--warn-vif);
  font-family: var(--font-lecture); font-size: var(--t-base); line-height: 1.55;
}
.eau-regle p { margin: 0 0 6px; }
.eau-regle cite { font-style: normal; font-family: var(--font); font-size: var(--t-sm); color: var(--text-2); }
.eau-muet { margin: 0 0 10px; }
.eau-libre { margin: 0 0 10px; color: var(--text-2); font-family: var(--font-lecture); }
.eau-source { font-size: var(--t-sm); color: var(--text-3); margin: 0; }
.eau-type {
  margin: 0 0 10px; font-size: var(--t-md);
  padding: 8px 12px; background: var(--accent-soft); border-radius: var(--radius-sm);
}

/* Bandeau d'alerte « eau », en haut de page. Jamais masqué : il contient
   d'emblée un lien vers VigiEau, de la hauteur que le statut occupera. */
/* Sélectionné par son attribut : la classe `eau-alerte` est aussi celle du
   niveau « alerte » de `.eau-niveau`, plus bas dans la page. */
.eau-alerte[data-eau-alerte] {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  min-height: 2.5rem;
  margin: 0 0 18px; padding: 8px 14px;
  font-size: var(--t-md); line-height: 1.4;
  background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--warn-vif);
  border-radius: var(--radius-sm);
}
.eau-alerte[data-eau-alerte] a { color: var(--text-2); }
.eau-alerte[data-eau-alerte] a:hover { color: var(--accent); }
/* Alerte renforcée et crise : le bandeau cesse d'être discret. */
.eau-alerte-forte[data-eau-alerte] { background: var(--danger-soft); border-color: var(--danger); }

/* ---------- Signalement public ---------- */

.fiche-etat {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin: 0 0 18px; padding: 10px 14px;
  font-size: var(--t-md);
  background: var(--warn-soft); border-left: 3px solid var(--warn-vif); border-radius: var(--radius-sm);
}
.fiche-etat-suspendue { background: var(--danger-soft); border-left-color: var(--danger); }
.fiche-etat-pastille {
  flex: none; font-weight: 650; font-size: var(--t-xs);
  letter-spacing: .05em; text-transform: uppercase;
  padding: 3px 9px; border-radius: var(--radius-sm);
  border: 1px solid currentColor; color: var(--danger);
}
.fiche-etat-douce { color: var(--warn); }

.signalement { margin: 2.5rem 0 0; padding: 0; border-top: 1px solid var(--border); }
.signalement > summary { cursor: pointer; padding: 16px 0; font-weight: 650; color: var(--text-2); }
.signalement > summary:hover { color: var(--accent); }
.signalement-intro { max-width: 60ch; color: var(--text-2); font-family: var(--font-lecture); font-size: var(--t-base); }

.signalement-motifs { border: 0; margin: 0 0 1rem; padding: 0; display: grid; gap: 6px; }
.signalement-motifs legend { padding: 0 0 8px; font-weight: 650; font-size: var(--t-base); }
.signalement-motifs label { display: flex; align-items: baseline; gap: 8px; font-size: var(--t-base); cursor: pointer; }
.signalement input[type="radio"] { accent-color: var(--accent); }

.signalement-champ { display: block; margin: 0 0 1rem; font-size: var(--t-md); color: var(--text-2); }
.signalement-champ textarea,
.signalement-champ input {
  display: block; width: 100%; max-width: 34rem; margin-top: 6px;
  padding: 8px 10px; font: inherit; font-size: var(--t-base);
  color: var(--text); background: var(--panel);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
.signalement-champ textarea { resize: vertical; }
.signalement-champ small { display: block; margin-top: 4px; color: var(--text-3); }

.signalement button[type="submit"] {
  font: inherit; font-weight: 650; cursor: pointer;
  padding: 10px 18px; border: 0; border-radius: var(--radius-sm);
  color: var(--accent-contraste); background: var(--accent);
}
.signalement button[type="submit"]:hover { background: var(--accent-dark); }
.signalement button[type="submit"]:disabled { background: var(--text-3); cursor: progress; }

/* Région live : vide, elle reste dans le flux (hauteur nulle), jamais
   `display: none`, sinon rien n'est annoncé. */
.signalement-retour { margin: 0; font-size: var(--t-md); }
.signalement-retour:not(:empty) { margin: 12px 0 0; }
.signalement-erreur { color: var(--danger); }
.signalement-merci { color: var(--success); font-weight: 650; }

/* Lien d'évitement : hors écran jusqu'à ce que le clavier l'atteigne. */
.evitement {
  position: absolute; left: -9999px; top: 0;
  z-index: 100; padding: 10px 16px;
  color: var(--text); background: var(--panel);
  border: 2px solid var(--accent); border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 650; text-decoration: none;
}
.evitement:focus { left: 0; }

/* ---------- Écrans étroits ---------- */

@media (max-width: 600px) {
  .bandeau { padding: 10px 16px; }
  .fil, main, footer { padding-left: 16px; padding-right: 16px; }
  h2 { font-size: var(--t-xl); margin-top: 36px; }
  .station-infos, .fiche-station .station-infos { grid-template-columns: 1fr; gap: 2px 0; }
  .station-infos dt, .fiche-station .station-infos dt { margin-top: 8px; padding-top: 0; }
  .station-infos dt:first-child { margin-top: 0; }
  .indicateurs li { padding-right: 14px; margin-right: 14px; }
  .indicateurs b { font-size: var(--t-xl); }
  .bouton-carte, .bouton-secondaire-lien { flex: 1 1 auto; justify-content: center; }
}

/* ---------- Thème sombre : la carte Leaflet de la page commune ----------
   Les jetons habillent tout le reste ; seules les tuiles, qui sont des
   images, demandent un filtre pour passer en sombre. */
@media (prefers-color-scheme: dark) {
  .ville-carte .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) saturate(.4) brightness(.82) contrast(.92); }
  .ville-carte .leaflet-popup-content-wrapper, .ville-carte .leaflet-popup-tip,
  .ville-carte .leaflet-bar a, .ville-carte .leaflet-control-attribution {
    background: var(--panel); color: var(--text);
  }
  .ville-carte .leaflet-control-attribution a { color: var(--accent); }
}

/* ══ UX ══ Composants introduits par le chantier UX, repris dans le système
   (jetons, échelle, voix typographique). ══ */

/* ── Fiche station : premier écran ──
   L'ordre du DOM est l'ordre de décision : état d'ouverture, nom, situation,
   actions, faits. */

/* État d'ouverture. Sans script : les horaires sur UNE ligne, tronquée ; le
   script y écrit l'état à la place, même hauteur, rien ne bouge. Les teintes
   sont sémantiques — sodium quand la lampe est allumée, arrêt quand c'est
   fermé — jamais l'accent. */
.ouverture {
  margin: 18px 0 -4px; min-height: 1.5em; line-height: 1.5;
  font-size: var(--t-md); font-weight: 500; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ouverture::before {
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 9px; vertical-align: .05em; background: var(--border-strong);
}
.ouverture[data-etat] {
  font-size: var(--t-sm); font-weight: 650; text-transform: uppercase; letter-spacing: .06em;
}
.ouverture[data-etat="ouvert"] { color: var(--warn); }
.ouverture[data-etat="ouvert"]::before { background: var(--warn-vif); box-shadow: 0 0 0 3px var(--warn-soft); }
.ouverture[data-etat="ferme"] { color: var(--danger); }
.ouverture[data-etat="ferme"]::before { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }

/* Sur les listes, l'état s'ajoute en fin de ligne « type · distance ». */
.ouverture-etat { font-weight: 650; }
.ouverture-etat::before { content: " · "; font-weight: 400; color: var(--text-3); }
.ouverture-etat[data-etat="ouvert"] { color: var(--warn); }
.ouverture-etat[data-etat="ferme"]  { color: var(--danger); }
.ouverture-etat[hidden] { display: none; }

/* « Portique · Orvault · à 3,0 km du centre » : une ligne de données, en
   grotesque, pas un chapeau en Literata. */
.chapeau.situation {
  font-family: var(--font); font-size: var(--t-base); line-height: 1.4;
  color: var(--text-2); margin: 0 0 8px;
}
.fiche-signaler { margin: 0 0 14px; font-size: var(--t-sm); }
.fiche-signaler a { color: var(--text-3); text-decoration-color: var(--border-strong); }
.fiche-signaler a:hover { color: var(--accent); }

/* Barre d'actions : en ligne sous le titre ; fixée en bas d'écran sur mobile,
   à portée de pouce, le pied de page se dégageant d'autant. */
.fiche-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin: 0 0 22px;
}
.fiche-actions .bouton-carte,
.fiche-actions .bouton-secondaire-lien { text-align: center; justify-content: center; }
.fiche-action-lien { font-size: var(--t-md); font-weight: 650; color: var(--accent); margin-left: 4px; }
@media (max-width: 600px) {
  .fiche-actions {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    margin: 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: var(--panel); border-top: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
  }
  .fiche-actions .bouton-carte,
  .fiche-actions .bouton-secondaire-lien { flex: 1 1 0; padding: 12px 10px; }
  .fiche-action-lien { flex: 1 1 100%; text-align: center; margin: 0; padding: 4px 0; }
  main.fiche ~ footer { padding-bottom: 120px; }
}

/* Faits en lignes comparables : même intitulé, même place, d'une fiche à
   l'autre. « non renseigné » tient la ligne plutôt que de la faire manquer. */
.faits-titre {
  margin: 0 0 4px; font-size: var(--t-xs); font-weight: 650;
  text-transform: uppercase; letter-spacing: .08em; color: var(--text-3);
}
.faits { list-style: none; margin: 0; padding: 0; }
.fait {
  display: grid; grid-template-columns: 124px 1fr; gap: 4px 18px; align-items: baseline;
  padding: 10px 0; border-top: 1px solid var(--border); font-size: var(--t-base);
}
.fait:first-child { border-top: 0; }
.fait-cle {
  color: var(--text-3); font-size: var(--t-xs); font-weight: 500;
  text-transform: uppercase; letter-spacing: .05em;
}
.fait-valeur { min-width: 0; line-height: 1.5; }
.fait-valeur .station-services { margin: 0; }
.fait-absent { color: var(--text-3); }
@media (max-width: 600px) {
  .fait { grid-template-columns: 1fr; gap: 2px; }
}

/* ── Page commune : entrées compactes ── */
.station-adresse { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.station-distance { color: var(--text-3); }
.station-detail { margin: 8px 0 0; }
.station-detail > summary {
  cursor: pointer; padding: 4px 0; list-style-position: inside;
  font-size: var(--t-sm); font-weight: 650; color: var(--accent);
}
.station-detail > summary:hover { color: var(--accent-dark); text-decoration: underline; }
.station-detail > summary::marker { color: var(--text-3); font-size: .8em; }
.station-detail[open] > summary { margin-bottom: 10px; }
.station-detail .station-liens { margin-top: 12px; }

/* Filtres : l'état enfoncé est porté par aria-pressed, la classe suit. Le
   filtre « ouvert maintenant » s'allume au sodium, comme l'état qu'il lit. */
.filtre[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-contraste); }
.filtre[aria-pressed="true"] b { color: var(--accent-contraste); }
.filtre-ouvert::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin-right: 7px; vertical-align: .08em; background: var(--warn-vif);
}
.filtre-ouvert:hover { border-color: var(--warn-vif); color: var(--warn); }
.filtre-ouvert[aria-pressed="true"] { background: var(--warn-vif); border-color: var(--warn-vif); color: var(--bg); }
.filtre-ouvert[aria-pressed="true"]::before { background: var(--bg); }

/* ── Formulaire de signalement : compteur et retour hors des labels ── */
.signalement form > textarea {
  display: block; width: 100%; max-width: 34rem; margin: 6px 0 0;
  padding: 8px 10px; font: inherit; font-size: var(--t-base); resize: vertical;
  color: var(--text); background: var(--panel);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
.signalement form > small { display: block; margin: 4px 0 1rem; font-size: var(--t-xs); color: var(--text-3); }
.signalement form > .signalement-champ[for] { margin-bottom: 0; }
