/* Démonstrateur axe Seine — Carte 42
   Feuille unique, sans dépendance externe. */

:root {
  --fond: #ffffff;
  --fond-doux: #f4f6f8;
  --fond-appui: #e8edf2;
  --texte: #1a2229;
  --texte-doux: #4a5866;
  --trait: #cfd8e0;
  --accent: #1c5d8c;
  --accent-clair: #2b7fbd;
  --icono: #b8482e;
  --evenement: #1c5d8c;
  --station: #2e7d5b;
  --alerte-fond: #2b2118;
  --alerte-texte: #f5e8dc;
  --largeur: 66rem;   /* blocs larges : tableaux, carte, chiffres */
  --mesure: 36rem;    /* colonne de lecture, environ 72 signes */
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #12181d;
    --fond-doux: #1a2229;
    --fond-appui: #232d36;
    --texte: #e6ecf2;
    --texte-doux: #a3b1bf;
    --trait: #33414d;
    --accent: #74b3dd;
    --accent-clair: #9acbeb;
    --icono: #e08a70;
    --evenement: #74b3dd;
    --station: #6bbf95;
  }
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font: 400 1rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* --- bandeau de démonstration, présent sur toutes les pages --- */
.bandeau-demo {
  background: var(--alerte-fond);
  color: var(--alerte-texte);
  padding: 0.6rem 1rem;
  font-size: 0.88rem;
  text-align: center;
  margin: 0;
}
.bandeau-demo strong { color: #fff; }

/* --- structure --- */
.enveloppe { max-width: var(--largeur); margin: 0 auto; padding: 0 1.25rem; }

/* Colonne de lecture centree.

   Auparavant chaque <p> portait max-width: 62ch dans une enveloppe de 74rem :
   le texte se plaquait a gauche et laissait un vide permanent a droite, alors
   que les tableaux et la carte, eux, prenaient toute la largeur. La mesure de
   lecture est desormais portee par la grille : le texte occupe une colonne
   centrale, et seuls les blocs qui gagnent a etre larges en sortent. */
main .enveloppe {
  display: grid;
  grid-template-columns: 1fr min(var(--mesure), 100%) 1fr;
}
main .enveloppe > * { grid-column: 2; }
main .enveloppe > .chiffres,
main .enveloppe > .defilant,
main .enveloppe > .zone-carte,
main .enveloppe > table { grid-column: 1 / -1; }

header.site {
  border-bottom: 1px solid var(--trait);
  background: var(--fond-doux);
}
header.site .enveloppe {
  display: flex; flex-wrap: wrap; gap: 1rem;
  align-items: baseline; justify-content: space-between;
  padding-top: 1rem; padding-bottom: 1rem;
}
.marque { font-weight: 650; font-size: 1.05rem; letter-spacing: -0.01em; }
.marque span { font-weight: 400; color: var(--texte-doux); }

nav.principal ul { list-style: none; display: flex; flex-wrap: wrap; gap: 1.25rem; margin: 0; padding: 0; }
nav.principal a { color: var(--texte-doux); text-decoration: none; font-size: 0.94rem; }
nav.principal a:hover, nav.principal a[aria-current="page"] { color: var(--accent); text-decoration: underline; }

main { padding: 2rem 0 3.5rem; }
h1 { font-size: 1.75rem; line-height: 1.25; letter-spacing: -0.02em; margin: 0 0 0.75rem; }
h2 { font-size: 1.25rem; margin: 2.25rem 0 0.75rem; letter-spacing: -0.01em; }
h3 { font-size: 1.02rem; margin: 1.5rem 0 0.4rem; }
p { margin: 0 0 1rem; }
a { color: var(--accent); }
.chapo { font-size: 1.08rem; color: var(--texte-doux); }

/* --- chiffres clés --- */
.chiffres { display: grid; gap: 1px; background: var(--trait);
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  border: 1px solid var(--trait); margin: 1.75rem 0; }
.chiffres div { background: var(--fond); padding: 1rem 1.1rem; }
.chiffres dt { font-size: 0.82rem; color: var(--texte-doux); margin-bottom: 0.3rem; }
.chiffres dd { margin: 0; font-size: 1.6rem; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.chiffres dd small { font-size: 0.78rem; font-weight: 400; color: var(--texte-doux); display: block; letter-spacing: 0; }

/* --- carte --- */
.zone-carte { display: grid; grid-template-columns: 17rem 1fr; gap: 0; border: 1px solid var(--trait); }
@media (max-width: 62rem) { .zone-carte { grid-template-columns: 1fr; } }

.panneau { background: var(--fond-doux); border-right: 1px solid var(--trait); padding: 1.1rem; overflow-y: auto; max-height: 34rem; }
@media (max-width: 62rem) { .panneau { border-right: 0; border-bottom: 1px solid var(--trait); max-height: none; } }
.panneau h2 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--texte-doux); margin: 1.25rem 0 0.5rem; }
.panneau h2:first-child { margin-top: 0; }
.panneau fieldset { border: 0; margin: 0; padding: 0; }
.panneau legend { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--texte-doux); margin-bottom: 0.5rem; padding: 0; }
.panneau label { display: flex; align-items: baseline; gap: 0.5rem; padding: 0.22rem 0; font-size: 0.92rem; cursor: pointer; }
.panneau label:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.pastille { width: 0.7rem; height: 0.7rem; border-radius: 50%; flex: 0 0 auto; translate: 0 -0.05rem; }
.pastille.iconographie { background: var(--icono); }
.pastille.evenement { background: var(--evenement); }
.pastille.station { background: var(--station); }
.compte { margin-left: auto; color: var(--texte-doux); font-size: 0.84rem; font-variant-numeric: tabular-nums; }

#carte { height: 34rem; background: var(--fond-appui); }
@media (max-width: 62rem) { #carte { height: 26rem; } }

.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
button, .bouton {
  font: inherit; font-size: 0.9rem; padding: 0.45rem 0.85rem;
  background: var(--fond); color: var(--texte);
  border: 1px solid var(--trait); border-radius: 3px; cursor: pointer;
  text-decoration: none; display: inline-block;
}
button:hover, .bouton:hover { border-color: var(--accent); color: var(--accent); }
button:focus-visible, .bouton:focus-visible, a:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* --- tableaux --- */
.defilant { overflow-x: auto; border: 1px solid var(--trait); margin: 1.25rem 0; }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
caption { text-align: left; padding: 0.75rem 0.9rem; color: var(--texte-doux); font-size: 0.88rem; border-bottom: 1px solid var(--trait); }
th, td { text-align: left; padding: 0.5rem 0.9rem; border-bottom: 1px solid var(--trait); vertical-align: top; }
th { background: var(--fond-doux); font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--texte-doux); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td.nombre { text-align: right; font-variant-numeric: tabular-nums; }

/* --- listes de lieux (équivalent accessible) --- */
.commune { border: 1px solid var(--trait); margin: 0 0 0.75rem; }
.commune > summary { padding: 0.7rem 0.9rem; cursor: pointer; font-weight: 600; background: var(--fond-doux); }
.commune > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.commune > summary .compte { font-weight: 400; }
.commune ul { margin: 0; padding: 0.75rem 0.9rem 0.75rem 2rem; }
.commune li { margin-bottom: 0.35rem; }

.note { background: var(--fond-doux); border-left: 3px solid var(--accent); padding: 0.9rem 1.1rem; margin: 1.5rem 0; }
.note p:last-child { margin-bottom: 0; }
.note p { max-width: none; }

footer.site { border-top: 1px solid var(--trait); background: var(--fond-doux); padding: 1.5rem 0; font-size: 0.88rem; color: var(--texte-doux); }
footer.site p { max-width: none; margin-bottom: 0.4rem; }

.evite { position: absolute; left: -9999px; }
.evite:focus { left: 0.5rem; top: 0.5rem; position: fixed; z-index: 1000; background: var(--fond); padding: 0.6rem 1rem; border: 2px solid var(--accent); }

/* --- infobulles Leaflet, alignées sur la charte --- */
.leaflet-popup-content-wrapper { border-radius: 3px; }
.leaflet-popup-content { margin: 0.85rem 1rem; font: inherit; font-size: 0.9rem; line-height: 1.5; }
.leaflet-popup-content h3 { margin: 0 0 0.4rem; font-size: 0.98rem; }
/* La photo ouvre la fenetre contextuelle : elle deborde des marges du contenu
   pour occuper toute la largeur de la bulle, comme une illustration de tete. */
.leaflet-popup-content .vue { display: block; margin: -0.85rem -1rem 0.7rem; }
.leaflet-popup-content .vue img { display: block; width: 100%; height: auto; }
.leaflet-popup-content dl { margin: 0.5rem 0 0; display: grid; grid-template-columns: auto 1fr; gap: 0.15rem 0.6rem; font-size: 0.85rem; }
.leaflet-popup-content dt { color: #555; }
.leaflet-popup-content dd { margin: 0; }
.leaflet-container { font: inherit; }

/* --- zone de dépôt du validateur --- */
.depot {
  border: 2px dashed var(--trait);
  border-radius: 4px;
  padding: 1.5rem;
  margin: 1.25rem 0;
  background: var(--fond-doux);
  transition: border-color .15s, background .15s;
}
.depot.survol { border-color: var(--accent); background: var(--fond-appui); }
.depot p { margin-bottom: 0.6rem; }
.depot p:last-child { margin-bottom: 0; }
.depot label { font-weight: 600; display: inline-block; margin-right: 0.5rem; }
.depot input[type="file"] { font: inherit; font-size: 0.9rem; }
#rapport:focus { outline: none; }
#rapport h2 { margin-top: 2rem; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
       font-size: 0.88em; background: var(--fond-appui); padding: 0.1em 0.35em;
       border-radius: 2px; }

/* Codage de la gravité : sur un rapport qu'on parcourt, le bloquant doit se
   repérer sans lire. La couleur n'est jamais le seul porteur d'information —
   le mot reste écrit en toutes lettres. */
:root { --grave: #a33223; --moyen: #8a5a12; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --grave: #e8907f; --moyen: #d9ab5c; }
}
td.gravite { font-weight: 600; white-space: nowrap; }
td.gravite.bloquant { color: var(--grave); }
td.gravite.majeur { color: var(--moyen); }
td.gravite.mineur { color: var(--texte-doux); font-weight: 400; }

/* --- bascule du fond de plan, en bas de la carte --- */
.bascule-fond {
  display: flex;
  border: 1px solid var(--trait);
  border-radius: 0.3rem;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}
.bascule-fond button {
  border: 0;
  padding: 0.42rem 0.8rem;
  font: inherit;
  font-size: 0.86rem;
  background: var(--fond);
  color: var(--texte-doux);
  cursor: pointer;
}
.bascule-fond button + button { border-left: 1px solid var(--trait); }
.bascule-fond button:hover { color: var(--texte); }
.bascule-fond button[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
}

/* --- logos --- */
.marque { display: flex; align-items: center; gap: 0.6rem; }
.marque img { width: 2rem; height: 2rem; display: block; }

/* Les logos des trois maitres d'ouvrage identifient la consultation ; ils sont
   poses sur un panneau clair en toutes circonstances, faute de quoi celui du
   syndicat, fourni sur fond blanc opaque, decouperait un rectangle dans un
   theme sombre. */
.commanditaires {
  margin: 2rem 0 1.5rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--trait);
  border-radius: 0.3rem;
  background: #fff;
}
.commanditaires h2 { margin: 0 0 0.85rem; font-size: 0.82rem; letter-spacing: 0.06em;
                     text-transform: uppercase; color: #4a5866; }
.commanditaires ul { list-style: none; margin: 0; padding: 0;
                     display: flex; flex-wrap: wrap; align-items: center; gap: 1.75rem; }
.commanditaires img { height: 3.25rem; width: auto; display: block; }
.commanditaires .mentions { margin: 0.85rem 0 0; color: #4a5866; }

/* --- fiches d'oeuvre localisee --- */
.fiche { margin: 0 0 3.25rem; }
.fiche h2 { margin: 0 0 0.2rem; }
.attribution { color: var(--texte-doux); font-size: 0.94rem; margin-bottom: 0.9rem; }

.oeuvre {
  display: block;
  width: 100%; height: auto;
  border: 1px solid var(--trait);
  background: var(--fond-appui);
}

/* La notice reprend la table attributaire du chapitre 5.3 : presentee en
   paires terme / definition, elle reste annoncee comme telle par un lecteur
   d'ecran et se replie en une colonne sur petit ecran. */
.notice {
  display: grid;
  grid-template-columns: minmax(11rem, 16rem) 1fr;
  gap: 0.35rem 1.25rem;
  margin: 1.1rem 0 0.9rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--trait);
  background: var(--fond-appui);
  font-size: 0.93rem;
}
.notice dt { color: var(--texte-doux); }
.notice dd { margin: 0; }
@media (max-width: 34rem) {
  .notice { grid-template-columns: 1fr; gap: 0.1rem; }
  .notice dd { margin: 0 0 0.55rem; }
}

.legende { margin-top: 0.9rem; }
.mentions { font-size: 0.84rem; color: var(--texte-doux); }
