/* Juralacs Météo : « Carnet d'observateur ». Papier de relevé, encre bleu-noir, turquoise de Chalain. */

/* Reset image obligatoire (Astro génère width/height : sans height:auto l'image s'étire) */
img { max-width: 100%; height: auto; display: block; }
*, *::before, *::after { box-sizing: border-box; }

:root {
  --papier: #EEF1EC;
  --papier-2: #E4E9E3;
  --encre: #1E2A3A;
  --turq: #3E9C9A;        /* décor : remplissages, filets, favicon (contraste insuffisant en texte) */
  --turq-t: #256F6D;      /* texte de lien et composants : 5,16:1 sur papier */
  --turq-clair: #7FD0CC;  /* lien sur fond nuit : 6,72:1 */
  --rouge: #B3261E;       /* records et alertes chaudes, usage rare */
  --graphite: #8A9196;    /* filets et grille, jamais du texte */
  --graphite-t: #586269;  /* légendes (texte) : 5,47:1 sur papier */
  --nuit: #2B3A33;
  --grille: rgba(138, 145, 150, .18);
  --grille-fort: rgba(138, 145, 150, .30);
  --serif: var(--af-newsreader), Georgia, serif;
  --sans: var(--af-instrument), Arial, sans-serif;
  --wrap: 72rem;
  --gut: clamp(1rem, 4vw, 2rem);
}

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body {
  margin: 0; background: var(--papier); color: var(--encre);
  font-family: var(--serif); font-optical-sizing: auto;
  font-size: clamp(1.0625rem, 1.02rem + .2vw, 1.125rem); line-height: 1.65;
}
main { display: block; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gut); }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.15; color: var(--encre); margin: 0 0 .6em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 1.4rem + 2.8vw, 3.3rem); letter-spacing: -.012em; }
h2 { font-size: clamp(1.5rem, 1.25rem + 1.2vw, 2.05rem); margin-top: 2.2em; }
h3 { font-size: clamp(1.2rem, 1.1rem + .5vw, 1.4rem); margin-top: 1.8em; }
p { margin: 0 0 1.1em; }
a { color: var(--turq-t); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: var(--encre); }
:focus-visible { outline: 3px solid var(--turq-t); outline-offset: 3px; border-radius: 2px; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--encre); color: var(--papier); padding: .6rem 1rem; z-index: 100; font-family: var(--sans); }
.skip-link:focus { left: 0; }
strong { font-weight: 650; }

/* ---------- En-tête ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--papier); border-bottom: 1px solid var(--graphite); }
.site-header.scrolled { box-shadow: 0 1px 0 var(--grille-fort); }
.header-inner { max-width: var(--wrap); margin-inline: auto; padding: .55rem var(--gut); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--encre); }
.brand img { width: 36px; height: 36px; border-radius: 6px; }
.brand-name { font-family: var(--serif); font-weight: 650; font-size: 1.3rem; letter-spacing: -.01em; line-height: 1; }
.brand-sub { font-style: italic; font-weight: 400; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .15rem 1.1rem; }
.main-nav a { font-family: var(--sans); font-weight: 500; font-size: .94rem; color: var(--encre); text-decoration: none; padding: .35rem 0; border-bottom: 2px solid transparent; }
.main-nav a:hover { border-bottom-color: var(--turq); color: var(--encre); }
.main-nav a[aria-current="page"] { border-bottom-color: var(--encre); }
.nav-toggle { display: none; background: none; border: 1px solid var(--encre); border-radius: 4px; width: 44px; height: 44px; padding: 0; cursor: pointer; }
.nav-toggle span { display: block; width: 20px; height: 2px; background: var(--encre); margin: 4px auto; }
@media (max-width: 1060px) {
  .nav-toggle { display: block; }
  .main-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--papier); border-bottom: 1px solid var(--graphite); padding: .5rem var(--gut) 1rem; }
  .nav-open .main-nav { display: block; }
  .main-nav ul { flex-direction: column; gap: 0; }
  .main-nav a { display: block; padding: .7rem 0; font-size: 1.05rem; border-bottom: 1px solid var(--grille-fort); }
}

/* ---------- Images : wrappers à ratio fixe (anti-distorsion) ---------- */
.img-hero { width: 100%; aspect-ratio: 16 / 9; overflow: hidden; max-height: min(75vh, 44vw); background: var(--papier-2); }
.img-body { aspect-ratio: 3 / 2; overflow: hidden; background: var(--papier-2); }
.img-card { aspect-ratio: 16 / 9; overflow: hidden; background: var(--papier-2); }
.img-portrait { aspect-ratio: 1 / 1; overflow: hidden; border-radius: 50%; }
.img-hero img, .img-card img, .img-body img, .img-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.img-ph { width: 100%; height: 100%; min-height: 8rem; background-color: var(--papier-2); background-image: linear-gradient(var(--grille) 1px, transparent 1px), linear-gradient(90deg, var(--grille) 1px, transparent 1px); background-size: 12px 12px; }
.hero-bandeau { margin: 0; }
.hero-bandeau figcaption, .article-body figcaption { font-family: var(--sans); font-size: .82rem; color: var(--graphite-t); padding: .45rem var(--gut); max-width: var(--wrap); margin-inline: auto; }
.article-body figure { margin: 1.8em 0; }
.article-body figure figcaption { padding-inline: 0; }

/* ---------- Bandes climatiques (signature) ---------- */
.stripes { margin: 0; }
.stripes-svg { display: block; width: 100%; height: clamp(46px, 7.5vw, 92px); }
.stripe { opacity: 0; animation: stripe-in .55s ease-out forwards; animation-delay: calc(var(--i) * 24ms + 150ms); }
@keyframes stripe-in { from { opacity: 0; } to { opacity: 1; } }
.stripes-axis { display: flex; justify-content: space-between; max-width: var(--wrap); margin-inline: auto; padding: .25rem var(--gut) 0; font-family: var(--sans); font-size: .78rem; color: var(--graphite-t); font-variant-numeric: tabular-nums; }
.stripes-cap { max-width: var(--wrap); margin-inline: auto; padding: .35rem var(--gut) 0; font-family: var(--sans); font-size: .85rem; color: var(--graphite-t); display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; align-items: center; }
.stripes-source { flex: 1 1 24rem; }
.stripes-scale { display: inline-flex; align-items: center; gap: .45rem; font-variant-numeric: tabular-nums; }
.stripes-ramp { display: inline-block; width: 6.5rem; height: .6rem; background: linear-gradient(90deg, #053061, #4393C3, #F7F7F7, #D6604D, #67001F); border: 1px solid var(--graphite); }
.stripes-link { font-weight: 500; }
.stripes--mini { margin: 0 0 1.6rem; }
.stripes--mini .stripes-svg { height: clamp(34px, 5vw, 52px); }
.stripes--mini .stripes-axis, .stripes--mini .stripes-cap { padding-inline: 0; }

/* ---------- Accueil ---------- */
.home-head { padding-block: clamp(1.6rem, 4vw, 3rem) .5rem; }
.home-head h1 { max-width: 20ch; }
.chapeau { font-size: 1.2em; line-height: 1.55; color: var(--encre); max-width: 46rem; font-style: italic; }
.more { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.4rem; }
.btn { display: inline-block; font-family: var(--sans); font-weight: 600; font-size: .95rem; background: var(--encre); color: var(--papier); text-decoration: none; padding: .7rem 1.2rem; border: 2px solid var(--encre); border-radius: 3px; }
.btn:hover { background: var(--turq-t); border-color: var(--turq-t); color: var(--papier); }
.btn--sec { background: transparent; color: var(--encre); }
.btn--sec:hover { background: var(--encre); color: var(--papier); border-color: var(--encre); }

.rubriques { padding-block: 2.2rem 1rem; }
.rubriques h2 { margin-top: 0; }
.rub-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); border-top: 2px solid var(--encre); border-left: 1px solid var(--graphite); }
.rub { border-right: 1px solid var(--graphite); border-bottom: 1px solid var(--graphite); background-image: linear-gradient(var(--grille) 1px, transparent 1px), linear-gradient(90deg, var(--grille) 1px, transparent 1px); background-size: 12px 12px; }
.rub a { display: block; height: 100%; padding: 1.1rem 1.1rem 1.3rem; text-decoration: none; color: var(--encre); }
.rub a:hover { background: var(--papier-2); }
.rub-label { display: block; font-family: var(--serif); font-weight: 650; font-size: 1.3rem; margin-bottom: .35rem; }
.rub-text { display: block; font-size: .96rem; line-height: 1.5; color: var(--graphite-t); }

.band { background: var(--papier-2); margin-top: 2.5rem; padding-block: 2.4rem 3rem; border-top: 1px solid var(--graphite); }
.band h2 { margin-top: 0; }

/* ---------- Cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1.8rem 1.6rem; }
.card { border-top: 2px solid var(--encre); padding-top: .8rem; }
.card[hidden] { display: none; }
.card-link { display: block; color: inherit; text-decoration: none; }
.card .img-card { margin-bottom: .75rem; }
.card-meta { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; font-family: var(--sans); font-size: .84rem; margin: 0 0 .35rem; }
.card-cat { color: var(--turq-t); font-weight: 600; }
.card-cat::before { content: ""; display: inline-block; width: .55em; height: .55em; margin-right: .4em; background: var(--turq); border-radius: 50% 50% 50% 0; transform: rotate(-45deg); }
.card-format { font-weight: 500; color: var(--graphite-t); }
.card-date { color: var(--graphite-t); font-variant-numeric: tabular-nums; white-space: nowrap; }
.card-title { font-size: 1.28rem; margin: 0 0 .35rem; line-height: 1.22; }
.card-link:hover .card-title { text-decoration: underline; text-decoration-color: var(--turq); text-underline-offset: .18em; }
.card-summary { font-size: .98rem; line-height: 1.5; color: var(--encre); margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@media (min-width: 62rem) {
  .card-grid--home { grid-template-columns: repeat(3, 1fr); }
  .rub-grid { grid-template-columns: repeat(5, 1fr); }
}

/* ---------- Listing et filtre ---------- */
.listing-head { padding-top: 1.4rem; }
.listing { padding-block: 1.6rem 3rem; }
.category-filter { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.2rem 0 .6rem; }
.chip { font-family: var(--sans); font-size: .9rem; font-weight: 500; background: transparent; color: var(--encre); border: 1px solid var(--encre); border-radius: 999px; padding: .45rem 1rem; cursor: pointer; min-height: 40px; }
.chip:hover { background: var(--papier-2); }
.chip.is-active { background: var(--encre); color: var(--papier); }
.filter-status { font-family: var(--sans); font-size: .85rem; color: var(--graphite-t); margin: 0; min-height: 1.4em; }
.filter-empty { font-family: var(--sans); color: var(--graphite-t); }

/* ---------- Article ---------- */
.article-head { padding-top: 1.2rem; }
.breadcrumbs { font-family: var(--sans); font-size: .84rem; color: var(--graphite-t); margin-bottom: 1rem; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .2rem .5rem; padding: 0; margin: 0; }
.breadcrumbs li + li::before { content: "/"; margin-right: .5rem; color: var(--graphite); }
.breadcrumbs a { color: var(--graphite-t); }
.cat-label { font-family: var(--sans); font-weight: 600; font-size: .9rem; color: var(--turq-t); margin: 0 0 .4rem; }
.cat-label::before { content: ""; display: inline-block; width: .55em; height: .55em; margin-right: .45em; background: var(--turq); border-radius: 50% 50% 50% 0; transform: rotate(-45deg); }
.article-head h1 { max-width: 24ch; }
.article-meta { font-family: var(--sans); font-size: .88rem; color: var(--graphite-t); margin-bottom: 1rem; }
.article-grid { padding-block: 1.6rem 3rem; display: block; }
.article-grid.has-toc { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 3rem; align-items: start; }
.toc { position: sticky; top: 5rem; font-family: var(--sans); font-size: .9rem; border-top: 2px solid var(--encre); padding-top: .8rem; max-height: calc(100vh - 110px); overflow-y: auto; }
.toc-title { font-weight: 600; margin: 0 0 .5rem; }
.toc ol { margin: 0; padding-left: 1.1rem; }
.toc li { margin-bottom: .4rem; line-height: 1.35; }
@media (max-width: 62rem) {
  .article-grid.has-toc { display: block; }
  .toc { position: static; margin-bottom: 1.6rem; }
}
.article-main { max-width: 46rem; min-width: 0; }
.article-body > :first-child { margin-top: 0; }
.article-body h2 { padding-top: .9rem; border-top: 1px solid var(--graphite); }
.article-body ul, .article-body ol { padding-left: 1.3rem; margin: 0 0 1.2em; }
.article-body li { margin-bottom: .45em; padding-left: .2rem; }
.article-body ul { list-style: none; padding-left: 1.2rem; }
.article-body ul > li { position: relative; }
.article-body ul > li::before { content: ""; position: absolute; left: -1.05rem; top: .72em; width: .42rem; height: .42rem; background: var(--turq); border-radius: 1px; }
.article-body ol { font-variant-numeric: tabular-nums; }
.article-body ol li::marker { font-family: var(--sans); font-weight: 600; color: var(--turq-t); }
.article-body blockquote { margin: 1.6em 0; padding: .2em 0 .2em 1.2rem; border-left: 3px solid var(--turq); font-style: italic; color: var(--encre); }
.article-body hr { border: 0; border-top: 1px solid var(--graphite); margin: 2.2em 0; }
.article-body :is(h2, h3) { scroll-margin-top: 5rem; }

/* Tableaux de relevés : grille millimétrée très légère, chiffres tabulaires */
.article-body table, .plan table { display: block; width: fit-content; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 1.6em 0; font-family: var(--sans); font-size: .92rem; font-variant-numeric: tabular-nums; line-height: 1.4;
  background-image: linear-gradient(var(--grille) 1px, transparent 1px), linear-gradient(90deg, var(--grille) 1px, transparent 1px); background-size: 10px 10px; border-top: 2px solid var(--encre); border-bottom: 1px solid var(--graphite); }
.article-body th, .article-body td { padding: .5rem .75rem; text-align: left; border-bottom: 1px solid var(--graphite); vertical-align: top; }
.article-body th { background: var(--papier-2); font-weight: 600; white-space: nowrap; }
.article-body td:not(:first-child), .article-body th:not(:first-child) { text-align: right; }
.article-body td.record, .article-body .record { color: var(--rouge); font-weight: 600; }
.article-body caption { caption-side: top; text-align: left; font-weight: 600; padding: .5rem 0; }

.faq { margin-top: 2.6rem; }
.faq h2 { border-top: 0; padding-top: 0; }
.faq-item { border-top: 1px solid var(--graphite); }
.faq-item:last-child { border-bottom: 1px solid var(--graphite); }
.faq-item h3 { margin: 0; font-size: 1.1rem; }
.faq-item button { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 1rem; text-align: left; font: inherit; font-family: var(--serif); font-weight: 600; color: var(--encre); background: none; border: 0; padding: .9rem 0; cursor: pointer; min-height: 44px; }
.faq-plus { flex: none; position: relative; width: 14px; height: 14px; }
.faq-plus::before, .faq-plus::after { content: ""; position: absolute; background: var(--turq-t); }
.faq-plus::before { left: 0; right: 0; top: 6px; height: 2px; }
.faq-plus::after { top: 0; bottom: 0; left: 6px; width: 2px; }
.faq-item.open .faq-plus::after { display: none; }
.faq-answer { padding: 0 0 .5rem; }
.faq-answer[hidden] { display: none; }

.sources, .related { margin-top: 2.4rem; font-size: .95rem; }
.sources h2, .related h2 { font-size: 1.25rem; margin-top: 0; }
.sources ul, .related ul { padding-left: 1.2rem; }
.verifie { font-family: var(--sans); font-size: .85rem; color: var(--graphite-t); }
.pillar-articles { margin-top: 3rem; }
.pillar-articles h2 { border-top: 0; }

/* ---------- Graphique de relevés ---------- */
.releve-chart { margin: 2rem 0; padding: .9rem 1rem 1rem; border-top: 2px solid var(--encre); border-bottom: 1px solid var(--graphite);
  background-image: linear-gradient(var(--grille) 1px, transparent 1px), linear-gradient(90deg, var(--grille) 1px, transparent 1px); background-size: 12px 12px; }
.releve-title { font-family: var(--sans); font-weight: 600; font-size: .95rem; margin-bottom: .4rem; }
.releve-chart svg { width: 100%; height: auto; display: block; }
.rc-grid { stroke: var(--graphite); stroke-width: .6; stroke-opacity: .6; }
.rc-tick, .rc-label, .rc-unit { font-family: var(--sans); font-size: 11px; fill: var(--graphite-t); font-variant-numeric: tabular-nums; }
.rc-legend { list-style: none; display: flex; flex-wrap: wrap; gap: .3rem 1rem; padding: 0; margin: .4rem 0 0; font-family: var(--sans); font-size: .85rem; }
.rc-swatch { display: inline-block; width: .8rem; height: .8rem; margin-right: .4rem; vertical-align: -1px; }
.rc-source { font-family: var(--sans); font-size: .82rem; color: var(--graphite-t); margin: .5rem 0 0; }

/* ---------- Plan du site ---------- */
.plan { padding-block: 1.6rem 3rem; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 2rem; }
.plan h2 { font-size: 1.25rem; margin-top: 0; }
.plan ul { padding-left: 1.1rem; }

/* ---------- Pied de page ---------- */
.site-footer { background: var(--nuit); color: var(--papier); margin-top: 3rem; font-family: var(--sans); font-size: .92rem; }
.site-footer a { color: var(--turq-clair); }
.site-footer a:hover { color: var(--papier); }
.site-footer :focus-visible { outline-color: var(--turq-clair); }
.footer-body { max-width: var(--wrap); margin-inline: auto; padding: 2.6rem var(--gut) 1.6rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 2rem 2.5rem; }
@media (max-width: 52rem) { .footer-grid { grid-template-columns: 1fr; } }
.footer-name { font-family: var(--serif); font-weight: 650; font-size: 1.4rem; margin: 0 0 .6rem; }
.footer-nonaff, .footer-source { line-height: 1.55; margin: 0 0 .8rem; max-width: 34rem; }
.footer-source { font-size: .85rem; }
.footer-title { font-weight: 600; margin: 0 0 .5rem; }
.footer-title--next { margin-top: 1.2rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .35rem; }
.footer-copy { border-top: 1px solid rgba(238, 241, 236, .25); margin: 2rem 0 0; padding-top: 1rem; font-size: .84rem; }

@media (prefers-reduced-motion: reduce) {
  .stripe { animation: none; opacity: 1; }
  html { scroll-behavior: auto; }
}

/* ---------- Contact ---------- */
.contact-wrap { display: grid; grid-template-columns: minmax(0, 36rem) minmax(0, 1fr); gap: 3rem; padding-block: 1.5rem 3rem; align-items: start; }
@media (max-width: 62rem) { .contact-wrap { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; } }
.contact-form { display: flex; flex-direction: column; gap: 1.1rem; }
.form-group { display: flex; flex-direction: column; gap: .3rem; }
.contact-form label { font-family: var(--sans); font-weight: 600; font-size: .95rem; }
.contact-form input[type="text"], .contact-form input[type="email"], .contact-form select, .contact-form textarea { width: 100%; font: inherit; font-size: 1.05rem; padding: .7rem .8rem; border: 1.5px solid var(--encre); border-radius: 3px; background: #fff; color: var(--encre); }
.contact-form textarea { resize: vertical; }
.contact-form .hp { position: absolute; left: -9999px; }
.contact-form .btn { align-self: flex-start; cursor: pointer; }
.contact-form .btn:disabled { opacity: .6; cursor: wait; }
.contact-status { min-height: 1.5em; margin: 0; font-family: var(--sans); font-weight: 600; }
.contact-status.is-ok { color: #1F6B3A; }
.contact-status.is-err { color: var(--rouge); }
.contact-note { border-left: 3px solid var(--turq); padding-left: 1.2rem; font-size: 1rem; }
.contact-note h2 { margin-top: 0; font-size: 1.4rem; }
.meteo-jour { font-family: var(--sans); font-size: .9rem; color: var(--graphite-t); margin: 1rem 0 0; max-width: 46rem; }

/* Accueil : encart méthode */
.home-note { display: grid; gap: 1.4rem; align-items: center; padding-block: 2.4rem; }
.home-note figure { margin: 0; }
.home-note figcaption { font-family: var(--sans); font-size: .82rem; color: var(--graphite-t); padding-top: .45rem; }
@media (min-width: 52rem) { .home-note { grid-template-columns: 1.1fr 1fr; gap: 2.4rem; } }

/* Modificateurs structurels (classes posées par les gabarits) */
.footer-brand { min-width: 0; }
.article { min-width: 0; }
.article--blog .cat-label, .article--page .cat-label { margin-top: 0; }
.cat--saisons, .cat--eau-baignade, .cat--phenomenes, .cat--orages-vent, .cat--grandes-annees, .cat--magazine { text-transform: none; }
