/* ThermoPiscine — feuille de style unique, sans police externe */

:root {
  --fond: #F2F7F7;
  --surface: #FFFFFF;
  --encre: #10324A;
  --encre-2: #45616F;
  --ligne: #CFE0E3;
  --lien: #0B6A87;
  --froid: #7FB8C9;
  --chaud: #F2A541;
  --chaud-fonce: #B86A10;
  --alerte: #A33A1E;
  --focus: #0B6A87;

  --t14: #2E5E8C; --t18: #4F8FB5; --t22: #7FC1C9; --t25: #CFE3C2; --t27: #F6D58E; --t29: #F2A541; --t32: #D9653B;

  --sans: "Avenir Next", Avenir, "Segoe UI Variable Display", "Segoe UI", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, "Iowan Old Style", Georgia, serif;

  --mesure: 66ch;
  --gouttiere: clamp(16px, 4vw, 40px);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #0D2130;
    --surface: #132C3E;
    --encre: #E3EFF2;
    --encre-2: #A3BBC6;
    --ligne: #25465C;
    --lien: #8FD0E3;
    --chaud-fonce: #F2B866;
    --alerte: #F08A6B;
    --focus: #8FD0E3;
  }
}
:root[data-theme="dark"] {
  --fond: #0D2130; --surface: #132C3E; --encre: #E3EFF2; --encre-2: #A3BBC6; --ligne: #25465C;
  --lien: #8FD0E3; --chaud-fonce: #F2B866; --alerte: #F08A6B; --focus: #8FD0E3;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font: 400 1.0625rem/1.55 var(--sans);
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: var(--lien); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }

.evitement { position: absolute; left: -999px; }
.evitement:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }

h1, h2, h3 { font-family: var(--sans); line-height: 1.15; letter-spacing: -0.012em; margin: 0; }
h1 { font-size: clamp(2rem, 1.2rem + 3.6vw, 3.4rem); font-weight: 700; max-width: 20ch; }
h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem); font-weight: 650; margin-top: 2.6rem; }
h3 { font-size: 1.15rem; font-weight: 650; margin-top: 1.8rem; }
p, ul, ol, dl, table { margin: 0.9rem 0 0; }

/* En-tête */
.entete {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 18px var(--gouttiere);
  border-bottom: 1px solid var(--ligne);
}
.marque { display: inline-flex; align-items: center; gap: 10px; color: var(--encre); text-decoration: none; font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; }
.nav { display: flex; gap: 4px 20px; flex-wrap: wrap; }
.nav a { color: var(--encre); text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--chaud); }

main { padding: 0 var(--gouttiere) 64px; max-width: 1180px; margin: 0 auto; }
main > *:first-child { margin-top: 40px; }

/* Pied */
.pied { border-top: 1px solid var(--ligne); padding: 28px var(--gouttiere) 40px; color: var(--encre-2); font-size: 0.95rem; }
.pied p { max-width: 70ch; margin: 0; }
.pied nav { display: flex; gap: 8px 22px; flex-wrap: wrap; margin-top: 14px; }

/* Accueil */
.une { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 48px; align-items: end; padding-top: 24px; }
.une .chapo { font-size: 1.2rem; color: var(--encre-2); max-width: 46ch; }
.une .actions { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; }
.figure-saison { margin: 0; }
.figure-saison figcaption { font-size: 0.92rem; color: var(--encre-2); margin-top: 12px; max-width: 44ch; }
@media (max-width: 860px) { .une { grid-template-columns: 1fr; gap: 32px; } }

.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 650 1rem/1 var(--sans); padding: 14px 22px; border-radius: 999px;
  background: var(--encre); color: var(--fond); border: 2px solid var(--encre); text-decoration: none; cursor: pointer;
}
.bouton:hover { background: transparent; color: var(--encre); }
.bouton[disabled] { opacity: 0.55; cursor: progress; }
.bouton-secondaire { background: transparent; color: var(--encre); }
.bouton-secondaire:hover { background: var(--encre); color: var(--fond); }

.colonnes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px 40px; }
.colonnes dt { font-weight: 650; margin-top: 1.2rem; }
.colonnes dd { margin: 0.3rem 0 0; color: var(--encre-2); }

.liste-guides { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 40px; }
.liste-guides li { border-top: 1px solid var(--ligne); padding: 16px 0 18px; }
.liste-guides a { font-weight: 650; font-size: 1.1rem; text-decoration: none; color: var(--encre); }
.liste-guides a:hover { color: var(--lien); text-decoration: underline; }
.liste-guides p { margin: 6px 0 0; color: var(--encre-2); font-size: 0.97rem; }

/* Bandes de saison — l'élément signature */
.bandes { display: grid; gap: 10px; }
.bande { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); align-items: center; gap: 12px; }
.bande-nom { font-size: 0.9rem; color: var(--encre-2); line-height: 1.25; }
.bande-traits { display: block; width: 100%; height: 64px; border-radius: 4px; overflow: hidden; shape-rendering: crispEdges; }
.bande-mois { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 12px; font-size: 0.8rem; color: var(--encre-2); }
.bande-mois .piste { position: relative; height: 1.2em; }
.bande-mois .piste span { position: absolute; transform: translateX(-1px); padding-left: 4px; border-left: 1px solid var(--ligne); white-space: nowrap; }
.echelle { display: flex; align-items: center; gap: 10px; font-size: 0.82rem; color: var(--encre-2); margin-top: 6px; flex-wrap: wrap; }
.echelle-degrade { width: 180px; height: 10px; border-radius: 2px; background: linear-gradient(90deg, var(--t14), var(--t18) 22%, var(--t22) 44%, var(--t25) 61%, var(--t27) 72%, var(--t29) 83%, var(--t32)); }
@media (max-width: 560px) {
  .bande, .bande-mois { grid-template-columns: 1fr; gap: 4px; }
  .bande-mois > div:first-child { display: none; }
  .bande-traits { height: 44px; }
}

/* Simulateur */
.simulateur { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 48px; align-items: start; }
@media (max-width: 920px) { .simulateur { grid-template-columns: minmax(0, 1fr); gap: 32px; } }
.formulaire { background: var(--surface); border: 1px solid var(--ligne); border-radius: 14px; padding: 22px 20px; }
@media (min-width: 921px) { .formulaire { position: sticky; top: 16px; } }
fieldset { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
legend { font-weight: 650; padding: 0; margin-bottom: 8px; font-size: 1rem; }
.champ { display: grid; gap: 4px; margin-top: 10px; }
.champ label, .champ .etiquette { font-size: 0.93rem; }
.aide { font-size: 0.84rem; color: var(--encre-2); }
input[type="text"], input[type="number"], input[type="search"], input[type="date"], select {
  font: inherit; font-size: 1rem; width: 100%; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--encre-2); background: var(--fond); color: var(--encre); min-width: 0;
}
input[aria-invalid="true"] { border-color: var(--alerte); }
.ligne-champs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ligne-champs.deux { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choix { display: flex; flex-wrap: wrap; gap: 6px; }
.choix label { position: relative; }
.choix input { position: absolute; opacity: 0; inset: 0; }
.choix span { display: inline-block; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--ligne); font-size: 0.92rem; cursor: pointer; background: var(--fond); }
.choix input:checked + span { background: var(--encre); color: var(--fond); border-color: var(--encre); }
.choix input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
details.avance summary { cursor: pointer; font-weight: 650; margin-bottom: 4px; }

.autocomplete { position: relative; }
.suggestions { position: absolute; left: 0; right: 0; top: 100%; z-index: 5; list-style: none; margin: 4px 0 0; padding: 4px; background: var(--surface); border: 1px solid var(--ligne); border-radius: 8px; box-shadow: 0 8px 24px rgb(16 50 74 / 0.12); }
.suggestions li { padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.suggestions li[aria-selected="true"], .suggestions li:hover { background: var(--fond); }
.suggestions small { color: var(--encre-2); }

.erreurs { color: var(--alerte); font-size: 0.95rem; }
.erreurs:empty { display: none; }

.resultats:empty { display: none; }
.attente { color: var(--encre-2); }
.verdict { font-size: clamp(1.35rem, 1.05rem + 1.2vw, 1.9rem); line-height: 1.3; font-weight: 600; max-width: 34ch; margin: 0; }
.verdict strong { font-weight: 700; }
.chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 28px; margin-top: 24px; }
.chiffres div { border-top: 2px solid var(--encre); padding-top: 10px; margin-top: 12px; }
.chiffres dt { font-size: 0.9rem; color: var(--encre-2); }
.chiffres dd { margin: 4px 0 0; font-size: 1.45rem; font-weight: 650; }
.chiffres dd small { display: block; font-size: 0.86rem; font-weight: 400; color: var(--encre-2); margin-top: 2px; }

.tableau-defile { overflow-x: auto; margin-top: 12px; }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 9px 12px 9px 0; border-bottom: 1px solid var(--ligne); vertical-align: top; }
th { font-weight: 650; }
td.nombre, th.nombre { text-align: right; }
tr.retenu td { font-weight: 650; }
tr.retenu td:first-child::after { content: " · recommandée"; font-weight: 400; color: var(--chaud-fonce); }
caption { text-align: left; color: var(--encre-2); font-size: 0.9rem; padding-bottom: 6px; }

.marchands { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.note { font-size: 0.92rem; color: var(--encre-2); max-width: 70ch; }
.mention-affiliation { font-size: 0.9rem; color: var(--encre-2); border-left: 3px solid var(--chaud); padding: 4px 0 4px 12px; margin-top: 48px; max-width: 70ch; }

/* Articles */
.article { max-width: calc(var(--mesure) + 2 * var(--gouttiere)); }
.article .fil { font-size: 0.9rem; color: var(--encre-2); margin-top: 28px; }
.article .fil a { color: var(--encre-2); }
.article h1 { margin-top: 14px; }
.article .dates { font-size: 0.9rem; color: var(--encre-2); }
.article .reponse { font-family: var(--serif); font-size: 1.2rem; line-height: 1.55; border-left: 3px solid var(--chaud); padding-left: 16px; margin-top: 22px; }
.article .texte p, .article .texte li { font-family: var(--serif); font-size: 1.1rem; line-height: 1.68; }
.article .texte li + li { margin-top: 0.4rem; }
.article .sources { font-size: 0.92rem; }
.article .sources li { font-family: var(--sans); font-size: 0.92rem; line-height: 1.5; }

/* Mini-simulateur intégré aux guides */
.mini { background: var(--surface); border: 1px solid var(--ligne); border-radius: 14px; padding: 20px; margin-top: 28px; }
.mini h2 { margin-top: 0; font-size: 1.2rem; }
.mini form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 10px; align-items: end; margin-top: 12px; }
.mini form .autocomplete { grid-column: 1 / -1; }
.mini .champ { margin-top: 0; }
@media (max-width: 640px) { .mini form { grid-template-columns: 1fr; } }
.mini-resultat { margin-top: 16px; }
.mini-resultat:empty { display: none; }
.mini-resultat p { font-family: var(--sans); font-size: 1.05rem; }

@media (prefers-reduced-motion: no-preference) {
  .bandes.apparait .bande-traits rect { transform-box: fill-box; transform-origin: 50% 100%; animation: monte 600ms ease-out both; animation-delay: calc(var(--i) * 3ms); }
  @keyframes monte { from { opacity: 0; transform: scaleY(0.3); } to { opacity: 1; transform: none; } }
}

@media print {
  .entete .nav, .formulaire, .pied nav { display: none; }
  body { background: #fff; color: #000; }
}

/* Ajustements */
.simulateur { margin-top: 28px; }
.ligne-champs { align-items: end; }
.figure-saison .bande-traits { height: 96px; }
@media (max-width: 560px) { .figure-saison .bande-traits { height: 56px; } }
