/* ============================================================
   lac.css — Feuille de style commune
   Réserve de la Base de loisirs de Razisse
   ============================================================ */
:root {
  --nuit: #0d3b44;
  --lac: #1b6f7a;
  --lac-clair: #2a9d8f;
  --fond: #f3f6f6;
  --carte: #ffffff;
  --texte: #1c2b30;
  --gris: #66787e;
  --bord: #dfe7e8;
  --good: #2e8b57;
  --warn: #d98a1c;
  --bad: #c8453a;
  --info: #2f7fa3;
  --unknown: #8a979c;
  --ombre: 0 2px 12px rgba(13, 59, 68, .08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  background: var(--fond);
  color: var(--texte);
  line-height: 1.55;
}
a { color: var(--lac); }

/* ── En-tête avec photo du lac ──────────────────────────── */
.hero {
  position: relative;
  color: #fff;
  padding: 26px 20px 96px;
  /* l'image (dégradé + photo) est posée en style inline par lac_header() */
  background-color: var(--nuit);
  background-size: cover;
  background-position: center 40%;
  background-repeat: no-repeat;
}
.hero.compact { padding: 18px 20px 62px; background-position: center 55%; }
.hero-inner { max-width: 1100px; margin: 0 auto; text-align: center; }

.logo-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.96); border-radius: 16px; padding: 8px 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,.28); margin-bottom: 20px;
}
.logo-badge img { display: block; height: 86px; width: auto; }
.hero.compact .logo-badge { padding: 5px 12px; border-radius: 12px; margin-bottom: 12px; }
.hero.compact .logo-badge img { height: 52px; }

.surtitre {
  margin: 0; font-size: .9rem; font-weight: 600; letter-spacing: .32em;
  text-transform: uppercase; opacity: .92; text-shadow: 0 1px 6px rgba(0,0,0,.5);
}
.brand {
  margin: 4px 0 0; font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 6.5vw, 3.4rem); font-weight: 700; line-height: 1.12;
  letter-spacing: .3px; text-shadow: 0 3px 14px rgba(0,0,0,.55);
}
.filet { width: 70px; height: 3px; margin: 14px auto 12px; border-radius: 3px; background: rgba(255,255,255,.7); }
.tagline { margin: 0 auto; max-width: 660px; font-size: 1.05rem; text-shadow: 0 1px 8px rgba(0,0,0,.6); }

.hero.compact .surtitre { font-size: .72rem; }
.hero.compact .brand { font-size: clamp(1.45rem, 4.8vw, 2.1rem); }
.hero.compact .filet { margin: 9px auto 7px; width: 50px; }
.hero.compact .tagline { font-size: .88rem; }

.nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 22px; }
.nav a {
  color: #fff; text-decoration: none; font-size: .9rem; font-weight: 600;
  padding: 8px 16px; border-radius: 999px;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.4);
  backdrop-filter: blur(4px); transition: background .15s;
}
.nav a:hover { background: rgba(255,255,255,.3); }
.nav a.active { background: #fff; color: var(--nuit); border-color: #fff; }

/* ── Contenu ─────────────────────────────────────────────── */
main { max-width: 1100px; margin: 0 auto; padding: 26px 20px 50px; position: relative; }
main.accueil { margin-top: -56px; padding-top: 0; }
.page-titre { margin: 0 0 14px; font-size: 1.6rem; color: var(--nuit); }
h2.section { margin: 38px 0 14px; font-size: 1.25rem; color: var(--nuit); }
.intro { color: var(--gris); margin: 0 0 18px; max-width: 760px; }
.petit { font-size: .8rem; color: var(--gris); }

.carte {
  background: var(--carte); border-radius: 14px; box-shadow: var(--ombre);
  padding: 20px; margin-bottom: 18px; border: 1px solid var(--bord);
}
.carte h2, .carte h3 { margin: 0 0 12px; font-size: 1rem; color: var(--nuit); }

/* ── Avis baignade : grand bandeau coloré ────────────────── */
.verdict {
  display: flex; gap: 22px; align-items: center;
  border-radius: 18px; padding: 26px 30px; margin-bottom: 18px; color: #fff;
  background: var(--unknown); box-shadow: 0 10px 30px rgba(13,59,68,.22);
}
.verdict .pastille {
  flex: 0 0 auto; width: 76px; height: 76px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.4rem; font-weight: 800; color: #fff;
  background: rgba(255,255,255,.22); border: 3px solid rgba(255,255,255,.7);
}
.verdict .etiquette { margin: 0 0 2px; font-size: .78rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; opacity: .9; }
.verdict h2 { margin: 0 0 6px; font-size: clamp(1.5rem, 4vw, 2.1rem); line-height: 1.15; color: #fff; }
.verdict p { margin: 0; color: rgba(255,255,255,.95); font-size: 1rem; }
.verdict .maj { margin-top: 10px; font-size: .82rem; opacity: .85; }
.verdict.good    { background: linear-gradient(135deg, #1f7a4a, #2e9d63); }
.verdict.warn    { background: linear-gradient(135deg, #c27412, #e0a02d); }
.verdict.bad     { background: linear-gradient(135deg, #a8322a, #d2574c); }
.verdict.unknown { background: linear-gradient(135deg, #5d6c72, #8a979c); }

/* ── Photos du site ──────────────────────────────────────── */
.photos { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.photo { margin: 0; border-radius: 14px; overflow: hidden; box-shadow: var(--ombre); background: #fff; border: 1px solid var(--bord); }
.photo img { display: block; width: 100%; height: 260px; object-fit: cover; }
.photo figcaption { padding: 10px 14px; font-size: .85rem; color: var(--gris); }

/* ── Raisons (pourquoi cet avis) ─────────────────────────── */
.raisons { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 14px; }
.raison { background: var(--carte); border: 1px solid var(--bord); border-radius: 12px; padding: 16px 18px; border-top: 4px solid var(--unknown); box-shadow: var(--ombre); }
.raison.good { border-top-color: var(--good); } .raison.warn { border-top-color: var(--warn); }
.raison.bad { border-top-color: var(--bad); }   .raison.info { border-top-color: var(--info); }
.raison .tete { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.raison .nom { font-weight: 700; color: var(--nuit); }
.raison .val { font-weight: 700; font-size: 1.15rem; }
.raison p { margin: 8px 0 0; font-size: .9rem; color: #3a4a50; }

.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.badge.good    { background: rgba(46,139,87,.13);  color: var(--good); }
.badge.warn    { background: rgba(217,138,28,.15); color: #a76512; }
.badge.bad     { background: rgba(200,69,58,.13);  color: var(--bad); }
.badge.info    { background: rgba(47,127,163,.13); color: var(--info); }
.badge.unknown { background: #e8eced;              color: var(--gris); }

/* ── Jauges ──────────────────────────────────────────────── */
.jauges { display: flex; flex-wrap: wrap; justify-content: space-around; align-items: flex-end; gap: 22px; }
.speedo { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.speedo svg { overflow: visible; }
.speedo-needle { fill: var(--nuit); filter: drop-shadow(0 2px 2px rgba(13,59,68,.3)); }
.speedo-pivot { fill: var(--nuit); stroke: #fff; stroke-width: 2; }
.speedo-minmax { font-size: 11px; fill: #98a6ab; font-weight: 600; }
.speedo-value { font-size: 1.6rem; font-weight: 800; color: var(--nuit); line-height: 1; margin-top: -6px; }
.speedo-unit { font-size: .78rem; font-weight: 600; opacity: .55; margin-left: 3px; }
.speedo-label { font-size: .85rem; font-weight: 600; color: var(--nuit); margin-top: 2px; }
.legende { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 14px; font-size: .78rem; color: var(--gris); }
.legende i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }

/* ── Cartes capteurs ─────────────────────────────────────── */
.grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 16px; margin-bottom: 18px; }
.capteur { background: var(--carte); border: 1px solid var(--bord); border-radius: 14px; padding: 18px 20px; box-shadow: var(--ombre); border-top: 4px solid var(--lac-clair); }
.capteur h3 { margin: 0 0 10px; font-size: .95rem; color: var(--nuit); }
.ligne { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; font-size: .92rem; border-bottom: 1px solid #eef2f3; }
.ligne:last-of-type { border-bottom: none; }
.ligne .v { font-weight: 700; white-space: nowrap; }
.capteur .meta { font-size: .78rem; color: var(--gris); margin-top: 10px; }
.capteur .alerte { font-size: .8rem; color: #a76512; margin-top: 8px; }
.capteur a.plus { display: inline-block; margin-top: 12px; font-size: .85rem; font-weight: 600; text-decoration: none; }
.capteur a.plus:hover { text-decoration: underline; }

/* ── Tuiles d'information ────────────────────────────────── */
.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.tuile { background: var(--carte); border: 1px solid var(--bord); border-radius: 12px; padding: 16px 18px; box-shadow: var(--ombre); }
.tuile .ico { font-size: 1.5rem; }
.tuile h3 { margin: 6px 0 6px; font-size: .98rem; color: var(--nuit); }
.tuile p { margin: 0; font-size: .88rem; color: #3a4a50; }

/* ── Mention officielle ──────────────────────────────────── */
.note { background: #eef6f7; border: 1px solid #cfe3e6; border-left: 5px solid var(--lac); border-radius: 10px; padding: 14px 18px; margin: 26px 0 0; font-size: .88rem; color: #26434a; }
.note p { margin: 6px 0 0; }

/* ── Tableaux ────────────────────────────────────────────── */
.tableau { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; background: var(--carte); }
thead th { text-align: left; padding: 9px 12px; background: #e6eff0; color: var(--nuit); font-weight: 700; white-space: nowrap; }
tbody td { padding: 8px 12px; border-bottom: 1px solid #eef2f3; white-space: nowrap; }
tbody tr:hover td { background: #f6fafa; }

/* ── Éléments de graphiques / formulaires ────────────────── */
.entete-graph { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.entete-graph h2 { margin: 0; font-size: 1rem; color: var(--nuit); }
.select-periode, .onglet-select {
  padding: 6px 12px; border: 1.5px solid var(--lac); border-radius: 8px;
  font-size: .85rem; color: var(--lac); background: #eef6f7; cursor: pointer; outline: none;
}
.onglets { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.onglet { padding: 5px 14px; border-radius: 999px; font-size: .82rem; font-weight: 600; cursor: pointer; border: 1.5px solid var(--bord); background: #fff; color: var(--gris); }
.onglet.actif { background: var(--lac); border-color: var(--lac); color: #fff; }

.valeur-xl { font-size: 3rem; font-weight: 800; color: var(--lac); line-height: 1.1; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: #eef6f7; border-radius: 12px; padding: 12px; text-align: center; }
.stat .lib { font-size: .75rem; color: var(--gris); }
.stat .val { font-size: 1.2rem; font-weight: 700; color: var(--lac); }

.alerte-bandeau { background: #fdf3e3; border-left: 5px solid var(--warn); border-radius: 8px; padding: 11px 16px; margin-bottom: 14px; font-size: .9rem; }
.alerte-bandeau.rouge { background: #fbeceb; border-left-color: var(--bad); }
.alerte-bandeau.bleu { background: #eaf4f8; border-left-color: var(--info); }

.statut-barre { background: var(--carte); border: 1px solid var(--bord); border-radius: 10px; padding: 10px 16px; margin-bottom: 14px; font-size: .88rem; display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.point { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.point.vert { background: #2ecc71; } .point.orange { background: var(--warn); } .point.rouge { background: var(--bad); } .point.gris { background: #bdc3c7; }

details.tech { margin-top: 18px; background: var(--carte); border: 1px solid var(--bord); border-radius: 12px; padding: 12px 18px; box-shadow: var(--ombre); }
details.tech summary { cursor: pointer; font-weight: 700; color: var(--nuit); font-size: .95rem; }
details.tech[open] summary { margin-bottom: 12px; }
.journal { font-family: Consolas, monospace; font-size: .74rem; background: #f6f8f8; padding: 10px 12px; border-radius: 8px; max-height: 200px; overflow-y: auto; white-space: pre-wrap; word-break: break-all; color: #3a4a50; }

/* ── Pied de page ────────────────────────────────────────── */
.pied { text-align: center; padding: 26px 20px 38px; font-size: .85rem; color: var(--gris); border-top: 1px solid var(--bord); background: #fff; }
.pied p { margin: 3px 0; }
.logo-pied { height: 70px; width: auto; display: block; margin: 0 auto 10px; }

/* ── Tooltip graphique (TempEau) ─────────────────────────── */
.zone-graph { position: relative; }
.bulle { position: absolute; pointer-events: none; background: var(--texte); color: #fff; font-size: .78rem; line-height: 1.4; padding: 6px 10px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, -115%); opacity: 0; transition: opacity .1s; z-index: 5; }
.bulle.visible { opacity: 1; }
.bulle .date { opacity: .75; font-size: .72rem; }
.canvas-wrap { position: relative; height: 280px; }

@media (max-width: 600px) {
  .verdict { flex-direction: column; text-align: center; padding: 22px 18px; }
  .logo-badge img { height: 64px; }
  .valeur-xl { font-size: 2.4rem; }
}
