/* Vigiprev — feuille de style unique. Aucune police externe, aucun style en ligne (CSP). */
:root {
  --fond: #f4f7f6;
  --papier: #ffffff;
  --encre: #12252d;
  --encre-2: #4b5d65;
  --accent: #0b6d88;
  --accent-fonce: #0d4a5c;
  --accent-doux: #e3f1f5;
  --bord: #d9e3e6;
  --bon: #1d7449;
  --bon-fond: #e6f4ec;
  --attention: #8f5a00;
  --attention-fond: #fcf1dc;
  --alerte: #b42318;
  --alerte-fond: #fdeceb;
  --neutre-fond: #edf2f4;
  --ombre: 0 1px 2px rgba(18, 37, 45, .06), 0 4px 16px rgba(18, 37, 45, .05);
  --rayon: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #0e181c;
    --papier: #142228;
    --encre: #e5eef1;
    --encre-2: #a7b8bf;
    --accent: #5fc2dc;
    --accent-fonce: #9ad8e8;
    --accent-doux: #16323a;
    --bord: #24373e;
    --bon: #6fd19c;
    --bon-fond: #133126;
    --attention: #f0b44c;
    --attention-fond: #33280f;
    --alerte: #ff8a80;
    --alerte-fond: #3a1a18;
    --neutre-fond: #1a2a30;
    --ombre: none;
    color-scheme: dark;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fond); color: var(--encre);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); text-underline-offset: .15em; }
a:hover { color: var(--accent-fonce); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); }
h2 { font-size: clamp(1.25rem, 2.4vw, 1.55rem); margin-top: .2em; }
h3 { font-size: 1.1rem; margin-top: 1.2em; }
p { margin: 0 0 1em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.petit { font-size: .88rem; color: var(--encre-2); }
.evitement { position: absolute; left: -999px; }
.evitement:focus { left: 1rem; top: 1rem; background: var(--papier); padding: .5rem 1rem; z-index: 10; }

/* En-tête */
.entete { background: var(--papier); border-bottom: 1px solid var(--bord); }
.barre { max-width: 1120px; margin: 0 auto; padding: .7rem 1rem; display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; }
.marque { display: inline-flex; align-items: center; gap: .45rem; font-weight: 750; font-size: 1.2rem; color: var(--encre); text-decoration: none; letter-spacing: -.02em; }
.logo-goutte { width: 1.6rem; height: 1.6rem; }
.logo-goutte path { fill: var(--accent); }
.logo-goutte .reflet { fill: none; stroke: var(--papier); stroke-width: 1.8; stroke-linecap: round; }
.menu { display: flex; gap: 1rem; flex-wrap: wrap; }
.menu a { color: var(--encre-2); text-decoration: none; font-weight: 550; }
.menu a:hover, .menu a[aria-current] { color: var(--accent); }

/* Recherche */
.recherche { position: relative; display: flex; }
.recherche input {
  font: inherit; color: var(--encre); background: var(--papier); border: 1px solid var(--bord);
  border-radius: 999px 0 0 999px; padding: .45rem .9rem; min-width: 0; flex: 1;
}
.recherche button {
  font: inherit; font-weight: 650; border: 0; background: var(--accent); color: #fff; cursor: pointer;
  border-radius: 0 999px 999px 0; padding: .45rem .9rem; display: inline-flex; align-items: center;
}
.recherche button svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.recherche--entete { margin-left: auto; flex: 0 1 18rem; }
.recherche--grande { max-width: 36rem; margin: 1.2rem 0 .6rem; }
.recherche--grande input { font-size: 1.1rem; padding: .8rem 1.2rem; }
.recherche--grande button { padding: .8rem 1.4rem; }
.recherche input:focus-visible, .recherche button:focus-visible { outline: 3px solid var(--accent-doux); outline-offset: 1px; }
.suggestions {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 20; list-style: none; margin: 0; padding: .3rem;
  background: var(--papier); border: 1px solid var(--bord); border-radius: var(--rayon); box-shadow: var(--ombre);
}
.suggestions li { padding: .45rem .7rem; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; gap: 1rem; }
.suggestions li[aria-selected="true"], .suggestions li:hover { background: var(--accent-doux); }
.suggestions small { color: var(--encre-2); white-space: nowrap; }

/* Structure */
main { max-width: 1120px; margin: 0 auto; padding: 1rem 1rem 3rem; }
.fil ol { list-style: none; display: flex; flex-wrap: wrap; gap: .3rem; padding: 0; margin: .4rem 0 1rem; font-size: .88rem; color: var(--encre-2); }
.fil li + li::before { content: "›"; margin-right: .3rem; }
.fil a { color: var(--encre-2); }
.tete { margin: .6rem 0 1.4rem; max-width: 52rem; }
.surtitre { margin: 0 0 .3rem; color: var(--encre-2); font-weight: 550; }
.surtitre a { color: inherit; }
.chapeau { font-size: 1.1rem; color: var(--encre-2); }
.bloc { background: var(--papier); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 1.3rem 1.4rem; margin: 1.2rem 0; box-shadow: var(--ombre); }
details.bloc summary { cursor: pointer; font-weight: 650; }
.texte { max-width: 46rem; }
.texte h2 { margin-top: 1.6em; }
.page-texte .texte { background: var(--papier); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 1.4rem 1.6rem; }

/* Verdict et états */
.verdict { border-radius: var(--rayon); padding: 1.1rem 1.3rem; border: 1px solid var(--bord); background: var(--neutre-fond); }
.verdict p:last-child { margin-bottom: 0; }
.verdict-titre { font-weight: 700; font-size: 1.12rem; }
.verdict--bon { background: var(--bon-fond); border-color: color-mix(in srgb, var(--bon) 35%, transparent); }
.verdict--attention { background: var(--attention-fond); border-color: color-mix(in srgb, var(--attention) 35%, transparent); }
.verdict--alerte { background: var(--alerte-fond); border-color: color-mix(in srgb, var(--alerte) 35%, transparent); }
.etat { padding-left: .8rem; border-left: 4px solid var(--bord); }
.etat--bon { border-color: var(--bon); }
.etat--attention { border-color: var(--attention); }
.etat--alerte { border-color: var(--alerte); }
.etat-cell { font-weight: 800; text-align: center; }
td.etat--bon { color: var(--bon); }
td.etat--attention { color: var(--attention); }
td.etat--alerte { color: var(--alerte); }
.pastille { display: inline-block; font-size: .8rem; font-weight: 700; padding: .12rem .55rem; border-radius: 999px; white-space: nowrap; }
.pastille--bon { background: var(--bon-fond); color: var(--bon); }
.pastille--alerte { background: var(--alerte-fond); color: var(--alerte); }

/* Tableaux */
.tableau { overflow-x: auto; margin: .6rem 0 1rem; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: .55rem .65rem; border-bottom: 1px solid var(--bord); vertical-align: top; }
thead th { font-size: .85rem; font-weight: 650; color: var(--encre-2); white-space: nowrap; }
tbody th { font-weight: 600; }
table.triable thead th { cursor: pointer; user-select: none; }
table.triable thead th::after { content: " ↕"; color: var(--bord); }
table.indicateurs td:nth-child(2) strong { font-size: 1.05rem; }

/* Chiffres clés, cartes, grilles */
.chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: .8rem; margin: 1rem 0; }
.chiffres p { margin: 0; background: var(--papier); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 1rem 1.1rem; box-shadow: var(--ombre); }
.chiffres strong { display: block; font-size: 1.6rem; color: var(--accent-fonce); letter-spacing: -.02em; }
.chiffres span { color: var(--encre-2); font-size: .92rem; }
.cartes { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; }
.carte { border: 1px solid var(--bord); border-radius: var(--rayon); padding: .9rem 1.1rem; }
.carte h3 { margin-top: 0; font-size: 1rem; }
.carte ol { margin: 0; padding-left: 1.2rem; font-size: .95rem; }
.grille-liens { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .8rem; }
.grille-liens a { display: block; height: 100%; text-decoration: none; border: 1px solid var(--bord); border-radius: var(--rayon); padding: .9rem 1rem; color: var(--encre); }
.grille-liens a:hover { border-color: var(--accent); }
.grille-liens strong { display: block; color: var(--accent); margin-bottom: .2rem; }
.grille-liens span { font-size: .92rem; color: var(--encre-2); }
.liste-dep li, .liste-risques li { margin-bottom: .35rem; }

/* Bulletin du jour (widget « Aujourd'hui à… ») — palettes officielles de l'indice ATMO et de l'indice pollen */
[hidden] { display: none !important; }
.jour-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr)); gap: .8rem; margin: .4rem 0 .8rem; }
.jour-carte { border: 1px solid var(--bord); border-radius: var(--rayon); padding: .8rem 1rem; }
.jour-carte h3 { margin: 0 0 .5rem; font-size: .92rem; color: var(--encre-2); }
.jour-carte p { margin: 0 0 .4rem; }
.jour-carte ul { margin: 0 0 .4rem; padding-left: 1.1rem; font-size: .95rem; }
.jour-carte .petit { margin: .5rem 0 0; }
.niveau { display: inline-block; font-weight: 750; padding: .2rem .75rem; border-radius: 999px; color: #12252d; background: #dddddd; }
.niv-1 { background: #50f0e6; } .niv-2 { background: #50ccaa; } .niv-3 { background: #f0e641; }
.niv-4 { background: #ff5050; } .niv-5 { background: #960032; color: #fff; } .niv-6 { background: #872181; color: #fff; }
.uv-1 { background: #9bd46a; } .uv-2 { background: #f7e04b; } .uv-3 { background: #f6a13b; }
.uv-4 { background: #c92a2a; color: #fff; } .uv-5 { background: #7b3fbf; color: #fff; }
.eau-0 { background: var(--bon-fond); color: var(--bon); } .eau-1 { background: #ffe066; } .eau-2 { background: #ffa94d; }
.eau-3 { background: #c92a2a; color: #fff; } .eau-4 { background: #7a1f1f; color: #fff; }

/* Barres de niveaux (air, pollens sur 12 mois) : SVG, couleurs des indices officiels */
.barre-niveaux { display: block; width: 100%; height: 1.4rem; border-radius: 6px; overflow: hidden; margin: .4rem 0 .5rem; }
.f-niv-0 { fill: #dddddd; } .f-niv-1 { fill: #50f0e6; } .f-niv-2 { fill: #50ccaa; } .f-niv-3 { fill: #f0e641; }
.f-niv-4 { fill: #ff5050; } .f-niv-5 { fill: #960032; } .f-niv-6 { fill: #872181; }
.legende-niveaux { list-style: none; padding: 0; margin: 0 0 .8rem; display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .88rem; color: var(--encre-2); }
.puce { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; margin-right: .35rem; vertical-align: -.05rem; background: #ddd; }
.puce.niv-0 { background: #dddddd; }

/* Outils */
.bouton-lien { font: inherit; background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: .15em; cursor: pointer; }
.bouton-lien:hover { color: var(--accent-fonce); }
.texte-outil { max-width: 52rem; }

/* Accueil */
.accueil-tete { padding: 2.2rem 0 1rem; max-width: 50rem; }
.accueil-tete h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
.exemples { color: var(--encre-2); font-size: .95rem; }

/* Formulaire de contact */
.form label { display: block; font-weight: 600; margin: .8rem 0 .25rem; }
.form input, .form select, .form textarea { font: inherit; width: 100%; padding: .55rem .7rem; border: 1px solid var(--bord); border-radius: 8px; background: var(--papier); color: var(--encre); }
.button { font: inherit; font-weight: 700; background: var(--accent); color: #fff; border: 0; border-radius: 999px; padding: .6rem 1.4rem; cursor: pointer; }

/* Pied de page */
.pied { background: var(--papier); border-top: 1px solid var(--bord); margin-top: 2rem; }
.pied-grille { max-width: 1120px; margin: 0 auto; padding: 2rem 1rem; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
.pied nav { display: flex; flex-direction: column; gap: .4rem; }
.pied nav a { color: var(--encre-2); text-decoration: none; }
.pied nav a:hover { color: var(--accent); }
.marque--pied { margin-bottom: .6rem; }

@media (max-width: 760px) {
  body { font-size: 16px; }
  table.indicateurs thead { display: none; }
  table.indicateurs, table.indicateurs tbody, table.indicateurs tr, table.indicateurs th, table.indicateurs td { display: block; width: 100%; }
  table.indicateurs tr { border-bottom: 1px solid var(--bord); padding: .5rem 0; }
  table.indicateurs th, table.indicateurs td { border: 0; padding: .15rem 0; }
  table.indicateurs td:empty { display: none; }
  table.indicateurs td[data-l]::before { content: attr(data-l) " : "; color: var(--encre-2); font-size: .85rem; }
  .recherche--entete { flex-basis: 100%; order: 3; }
  .jour-grille { grid-template-columns: 1fr 1fr; gap: .5rem; }
  .jour-carte { padding: .6rem .7rem; font-size: .95rem; }
  .jour-carte--large { grid-column: 1 / -1; }
  .niveau { padding: .15rem .6rem; }
  .pied-grille { grid-template-columns: 1fr; gap: 1.2rem; }
  .bloc { padding: 1rem; }
  th, td { padding: .45rem .5rem; }
}
@media print {
  .entete, .pied, .recherche { display: none; }
  .bloc { box-shadow: none; }
}
/* Eaux de baignade : qualité du classement ; avertissements (pesticides) */
.qualite { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .9rem; font-weight: 600; white-space: nowrap; }
.q-1 { background: var(--bon-fond); color: var(--bon); }
.q-2 { background: var(--accent-doux); color: var(--accent-fonce); }
.q-3 { background: var(--attention-fond); color: var(--attention); }
.q-4 { background: var(--alerte-fond); color: var(--alerte); }
.avert { background: var(--attention-fond); border-left: 4px solid var(--attention); padding: .6rem .9rem; border-radius: 6px; }
