:root {
  --bg: #FBF6EC; --surface: #FFFFFF; --soft: #F1E9D8; --ink: #1C2B2C; --muted: #4F5F5E;
  --line: #8A7F6A; --primary: #B2251F; --barre: #B2251F; --on-barre: #FFFFFF; --on-primary: #FFFFFF; --green: #1B6355;
  --amber: #F2B544; --on-amber: #1C2B2C; --verif: #8A5A00; --focus: #1B4FA8; --batiment: #CFC6B4;
  --titres: "Bricolage Grotesque", system-ui, "Segoe UI", sans-serif;
  --texte: "Source Sans 3", system-ui, "Segoe UI", sans-serif;
  --menu: "Oswald", "Arial Narrow", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12201F; --surface: #1B2C2B; --soft: #243836; --ink: #F4EFE4; --muted: #B7C2BE;
    --line: #7E8F8B; --primary: #FF9A73; --barre: #8E1C17; --on-primary: #1F1007; --green: #6FCBB4;
    --verif: #F2C879; --focus: #9CC2FF; --batiment: #3D5250;
  }
}
:root[data-theme="dark"] {
  --bg: #12201F; --surface: #1B2C2B; --soft: #243836; --ink: #F4EFE4; --muted: #B7C2BE;
  --line: #7E8F8B; --primary: #FF9A73; --barre: #8E1C17; --on-primary: #1F1007; --green: #6FCBB4;
  --verif: #F2C879; --focus: #9CC2FF; --batiment: #3D5250;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 1rem; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--texte);
  font-size: clamp(1.0625rem, 1rem + .3vw, 1.1875rem); line-height: 1.6; overflow-wrap: break-word;
}
h1, h2, h3 { font-family: var(--titres); line-height: 1.1; margin: 0 0 .6em; }
h1 { font-size: clamp(2.4rem, 7vw, 4.5rem); line-height: 1.05; font-weight: 800; }
h2 { font-size: clamp(1.7rem, 4vw, 2.6rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--primary); }
img, svg { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.conteneur { width: min(100%, 1120px); margin: 0 auto; padding: 0 16px; }
.lecture { max-width: calc(65ch + 32px); }
section { padding: clamp(3.5rem, 9vw, 7rem) 0; }
.doux { background: var(--soft); }
.fort { font-weight: 600; font-size: 1.1em; }
.mention { color: var(--muted); }
.petit, .source { font-size: .9em; color: var(--muted); }

.evitement { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: .6rem 1rem; z-index: 30; }
.evitement:focus { left: 16px; }
.apercu { background: var(--amber); color: var(--on-amber); text-align: center; padding: .4rem 16px; font-weight: 600; font-size: .95em; }

/* En-tête repris de l'ancien Chalonscope (2013-2015) : logo d'origine, barre de menu rouge en Oswald capitales. */
.entete { background: var(--bg); }
.entete-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 0 1rem; }
.marque { display: inline-flex; align-items: center; padding: .9rem 0 .8rem; text-decoration: none; }
.marque img { width: clamp(170px, 30vw, 240px); height: auto; }
.entete nav { flex-basis: 100%; background: var(--barre); box-shadow: 0 0 0 100vmax var(--barre); clip-path: inset(0 -100vmax); }
.entete ul { display: flex; flex-wrap: wrap; gap: 0 1.6rem; list-style: none; margin: 0; padding: 0; }
.entete nav a { color: var(--on-barre); font-family: var(--menu); font-weight: 500; text-transform: uppercase; letter-spacing: .03em; font-size: 1.05rem; text-decoration: none; min-height: 48px; display: inline-flex; align-items: center; }
.entete nav a:hover { text-decoration: underline; text-underline-offset: .3em; }
.entete nav a:focus-visible { outline-color: var(--on-barre); outline-offset: -3px; }
/* Logo gris et rouge sur fond transparent : en sombre, posé sur une plaque claire. */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .marque img { background: #FBF6EC; border-radius: 8px; padding: 4px 10px; } }
:root[data-theme="dark"] .marque img { background: #FBF6EC; border-radius: 8px; padding: 4px 10px; }

.devise { display: none; margin: 0; font-family: var(--menu); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-size: .95rem; }
.icone-menu { display: inline-block; margin-right: .4rem; flex: none; }
.entete nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: .3em; }

/* Réseaux : icônes dans l'en-tête, boutons nommés près de l'appel et dans le pied. */
.reseaux-icones, .reseaux-boutons { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.entete .reseaux-icones { gap: .25rem; margin-left: auto; flex-wrap: nowrap; }
.reseaux-icones a { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--ink); }
.reseaux-icones a:hover { background: var(--soft); }
.reseaux-icones svg, .reseaux-boutons svg { fill: currentColor; }
.bouton-theme {
  display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: 0 .8rem; margin-left: .25rem;
  border: 2px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink);
  font: 600 .9rem/1 var(--texte); cursor: pointer;
}
.bouton-theme[hidden] { display: none; }
.bouton-theme:hover { background: var(--soft); }
/* Petit écran : logo, trois réseaux et bouton tiennent sur une ligne. */
@media (max-width: 420px) {
  .entete-ligne { column-gap: .5rem; }
  .marque img { width: 150px; }
  .entete .reseaux-icones { gap: 0; }
  .reseaux-icones a { width: 38px; }
  .bouton-theme-texte { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .bouton-theme { padding: 0; width: 40px; justify-content: center; margin-left: 0; }
}
.reseaux-boutons { gap: .6rem; margin: .5rem 0 1rem; }
.reseaux-boutons a {
  display: inline-flex; align-items: center; gap: .55rem; min-height: 48px; padding: .4rem 1rem .4rem .8rem;
  border: 2px solid currentColor; border-radius: 999px; color: var(--ink); text-decoration: none; font-size: .95rem;
}
.reseaux-boutons a:hover { background: var(--soft); }

.masque { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.surtitre {
  font-family: var(--menu); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; font-size: 1.05rem;
  border-top: 4px solid var(--ink); padding-top: .5rem; margin: 0 0 1.25rem;
}

/* À la une : le dernier article en grand, les suivants en cartes (liste construite par construire.mjs). */
.une { padding: clamp(1.5rem, 4vw, 2.5rem) 0 clamp(2.5rem, 6vw, 4rem); }
.article-une, .article-carte { background: var(--surface); border-radius: 4px; overflow: hidden; box-shadow: 0 1px 0 var(--line); }
.article-une { display: grid; }
.article-image img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16 / 10; }
.article-texte { padding: 1.25rem 1.25rem 1.5rem; }
.article-rubrique { font-family: var(--menu); text-transform: uppercase; letter-spacing: .04em; color: var(--primary); font-weight: 600; margin: 0 0 .4rem; }
.article-une h2, .article-carte h3 { font-family: var(--menu); font-weight: 600; line-height: 1.1; margin: 0 0 .6rem; }
.article-une h2 { font-size: clamp(1.9rem, 4.6vw, 3.1rem); }
.article-carte h3 { font-size: 1.4rem; }
.article-une h2 a, .article-carte h3 a { color: var(--ink); text-decoration: none; }
.article-une h2 a:hover, .article-carte h3 a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .15em; }
.article-chapo { font-size: 1.1em; }
.article-date { font-family: var(--menu); text-transform: uppercase; letter-spacing: .03em; font-size: .85em; color: var(--muted); margin: 0; }
.article-date a { font-weight: 600; }
.etiquette-apercu { display: inline-block; margin-left: .5rem; background: var(--amber); color: var(--on-amber); padding: 0 .5rem; border-radius: 4px; font-size: .8em; letter-spacing: 0; text-transform: none; }
.articles-suite { display: grid; gap: 1.25rem; margin-top: 1.25rem; }

/* Appel à témoins : la bande la plus forte de la page. */
.appel-temoins { background: var(--barre); color: var(--on-barre); padding: clamp(2.5rem, 7vw, 4.5rem) 0; }
.appel-temoins .surtitre { border-top-color: var(--on-barre); }
.appel-temoins h2 { font-size: clamp(2.1rem, 6vw, 3.6rem); font-weight: 800; }
.appel-chapo { font-size: 1.15em; max-width: 52ch; }
.appel-bouton { background: var(--on-barre); color: #8E1C17; font-size: 1.1rem; min-height: 56px; padding: .7rem 1.75rem; }
.appel-bouton:hover { filter: brightness(.93); }
.appel-temoins a:focus-visible { outline-color: var(--on-barre); }
.autres-actions { list-style: none; padding: 0; margin: 1.75rem 0; display: grid; gap: .75rem; }
.autres-actions a {
  display: block; min-height: 48px; padding: .8rem 1rem; border: 2px solid rgb(255 255 255 / .7); border-radius: 10px;
  color: var(--on-barre); text-decoration: none;
}
.autres-actions a:hover { background: rgb(255 255 255 / .12); }
.autres-actions strong { display: block; }
.appel-reseaux p { margin: 0; font-weight: 600; }
.appel-reseaux .reseaux-boutons a { color: var(--on-barre); }
.appel-reseaux .reseaux-boutons a:hover { background: rgb(255 255 255 / .12); }
.appel-garantie { margin: 0; font-size: .95em; }

.chapo { font-size: 1.15em; max-width: 60ch; }
.bouton {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .6rem 1.5rem;
  border-radius: 999px; font: 600 1rem/1.2 var(--texte); text-decoration: none; cursor: pointer; border: 2px solid transparent;
}
.principal { background: var(--primary); color: var(--on-primary); }
.principal:hover { filter: brightness(.88); }
.secondaire { border-color: var(--ink); color: var(--ink); background: transparent; }
.secondaire:hover { background: var(--soft); }

.chiffres { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; margin: 2rem 0 .75rem; }
.chiffres div { display: flex; flex-direction: column; }
.chiffres dd { order: 1; margin: 0; font: 700 clamp(1.7rem, 4vw, 2.6rem)/1.1 var(--titres); color: var(--green); }
.chiffres dt { order: 2; color: var(--muted); }

.etapes { list-style: none; counter-reset: etape; display: grid; gap: 1.5rem; padding: 0; margin: 2.5rem 0 1.5rem; }
.etapes li { counter-increment: etape; position: relative; padding-left: 3.5rem; }
.etapes li::before {
  content: counter(etape); position: absolute; left: 0; top: 0; width: 2.5rem; height: 2.5rem; border-radius: 50%;
  display: grid; place-items: center; background: var(--amber); color: var(--on-amber); font: 700 1.1rem var(--titres);
}

.deux { display: grid; gap: 1.25rem; margin: 1.5rem 0; }
.panneau { background: var(--surface); padding: 1.25rem 1.5rem; border-left: 4px solid var(--green); border-radius: 0 12px 12px 0; }
.panneau.verif { border-left: 4px dashed var(--verif); }
.panneau p { margin: 0; }
.panneau.docs h3 { color: var(--green); }
.panneau.verif h3 { color: var(--verif); }

/* Carte : utilisée par carte.source.html, mise de côté jusqu'à son retour au menu. */
.carte-grille { display: grid; gap: 2rem; align-items: center; }
.plan { margin: 0; }
.plan svg {
  --c-fond: var(--surface); --c-bati: var(--batiment); --c-texte: var(--ink); --c-halo: var(--surface); --c-zone: var(--primary);
  --c-lien: var(--line); --c-cit: var(--primary); --c-dec: var(--green); --c-lie: var(--amber); --c-str: var(--verif);
}
.plan svg { width: 100%; border-radius: 12px; }
.plan figcaption { font-size: .9em; color: var(--muted); margin-top: .6rem; }
.questions { font-weight: 600; padding-left: 1.2rem; }

.formulaire-bloc { max-width: calc(560px + 32px); }
fieldset { border: 0; padding: 0; margin: 0 0 1.25rem; }
legend { font-weight: 600; padding: 0; margin-bottom: .4rem; }
fieldset > label { display: flex; gap: .6rem; align-items: center; min-height: 44px; }
.champ { margin-bottom: 1.25rem; }
.champ > label { display: block; font-weight: 600; margin-bottom: .25rem; }
.champ.accord label { font-weight: 400; display: flex; gap: .6rem; align-items: flex-start; }
.accord input { margin-top: .35rem; }
.requis { font-weight: 400; color: var(--muted); }
.aide { font-size: .9em; color: var(--muted); margin: .2rem 0 .4rem; }
input[type="text"], textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; padding: .6rem .75rem; min-height: 48px;
}
input[type="radio"], input[type="checkbox"] { width: 1.3rem; height: 1.3rem; flex: none; accent-color: var(--primary); }
.erreur { color: var(--primary); font-weight: 600; margin: .3rem 0 0; }
.resume-erreurs { background: var(--surface); border-left: 4px solid var(--primary); padding: .75rem 1rem; margin-bottom: 1.25rem; }
.champ-piege { position: absolute; left: -9999px; }

.liste-transparence { padding-left: 1.2rem; }
.liste-transparence li { margin-bottom: .6rem; }
.pied { background: var(--soft); padding: 2rem 0 5.5rem; font-size: .95em; }
.pied p { margin: 0 0 .4rem; }
.participer-collant { position: fixed; right: 16px; bottom: 16px; z-index: 15; box-shadow: 0 2px 10px rgb(0 0 0 / .25); }
.participer-collant[hidden] { display: none; }

@media (min-width: 640px) {
  .conteneur { padding: 0 24px; }
  .chiffres { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .articles-suite { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .autres-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .devise { display: block; }
  .deux { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .etapes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .etapes li { padding-left: 0; padding-top: 3.25rem; }
}
@media (min-width: 900px) {
  .article-une { grid-template-columns: 1.25fr 1fr; }
  .article-une .article-image { position: relative; min-height: 440px; }
  .article-une .article-image img { position: absolute; inset: 0; aspect-ratio: auto; }
  .article-une .article-texte { padding: 2rem 2.25rem; align-self: center; }
  .carte-grille { grid-template-columns: 1fr 1fr; }
  .participer-collant, .pied { padding-bottom: 2rem; }
  .participer-collant { display: none; }
}
@media (min-width: 1024px) {
  .articles-suite { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.panneau.cas { margin-top: 1.5rem; background: var(--soft); }
.panneau.cas h3 { color: var(--ink); }

.page-dossiers { padding: 2rem 0 4rem; }
.page-dossiers h1 { font-size: clamp(2rem, 5vw, 3rem); }
.page-dossiers .panneau.cas h2 { font-size: 1.35rem; }
.page-dossiers .panneau.cas { margin-bottom: 1.5rem; }
.page-dossiers .panneau.cas p + p { margin-top: .6rem; }
.etape-cas { font-family: var(--menu); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; font-size: .85em; color: var(--green); margin-right: .25rem; }
.etapes-dossier { margin: 2rem 0 1rem; }
.etapes-dossier h2 { font-size: 1.15rem; margin-bottom: .3rem; }
.etapes-dossier p { margin: 0; }
@media (min-width: 640px) { .etapes.etapes-dossier { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.page-legale { padding-top: 2rem; padding-bottom: 3rem; }
.page-legale h1 { font-size: clamp(2rem, 5vw, 3rem); }
.page-legale h2 { font-size: 1.3rem; margin-top: 1.75em; }
