/* ==========================================================================
   sechage-de-bois.fr — feuille de style
   Identité : manuel technique. Papier ivoire, encre vert forêt profond,
   filets doubles, numérotation de chapitres, tableaux de données.
   Typo : Archivo (titres, libellés) + Source Serif 4 (corps) via Google Fonts,
   monospace système pour les valeurs chiffrées.
   Mobile-first, AA, aucune dépendance JS.
   ========================================================================== */

:root {
  --papier: #f7f5ef;
  --papier-2: #efece3;
  --carte: #fcfbf7;
  --encre: #22291f;          /* corps de texte — AA sur papier */
  --encre-douce: #55604f;    /* texte secondaire — AA sur papier */
  --vert: #1d5741;           /* vert forêt, titres et liens — AA sur papier */
  --vert-fonce: #143c2d;
  --vert-pale: #e4ebe2;
  --mousse: #6e7f5e;
  --filet: #cfc9b8;
  --filet-doux: #e0dbcd;
  --alerte-fond: #f4e9dc;
  --alerte-bord: #b0722f;
  --alerte-texte: #6e4517;
  --ok: #2c6e49;
  --maxw: 54rem;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Archivo", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
:target { scroll-margin-top: 1.5rem; }

body {
  font-family: var(--serif);
  font-size: 1.075rem;
  line-height: 1.75;
  color: var(--encre);
  background: var(--papier);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; height: auto; }

::selection { background: rgba(29, 87, 65, 0.18); }

/* ---------- Accessibilité ---------- */

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--vert);
  outline-offset: 2px;
  border-radius: 2px;
}
.site-head a:focus-visible,
.cta-box a:focus-visible,
.site-foot a:focus-visible { outline-color: #9fd3b8; }

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -3.2rem;
  z-index: 100;
  background: var(--vert-fonce);
  color: #fff;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.6rem 1rem;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 0.5rem; }

/* ---------- Typographie ---------- */

h1, h2, h3 {
  font-family: var(--sans);
  color: var(--vert-fonce);
  line-height: 1.2;
  text-wrap: balance;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(1.85rem, 5vw, 2.6rem); font-weight: 800; margin: 0 0 0.6rem; }
h2 { font-size: clamp(1.35rem, 3.4vw, 1.7rem); font-weight: 700; margin: 2.4rem 0 0.8rem; }
h3 { font-size: 1.13rem; font-weight: 700; margin: 1.6rem 0 0.5rem; }

p { margin: 0 0 1.05rem; }
p:last-child { margin-bottom: 0; }

ul, ol { margin: 0 0 1.05rem 1.35rem; }
li { margin-bottom: 0.45rem; }
li::marker { color: var(--vert); }

a { color: var(--vert); text-decoration-thickness: 1px; text-underline-offset: 2.5px; }
a:hover { color: var(--vert-fonce); }

strong { color: var(--vert-fonce); }

.lead {
  font-size: 1.18rem;
  line-height: 1.65;
  color: var(--encre);
}

.kicker {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--mousse);
  display: block;
  margin-bottom: 0.7rem;
}

.val {
  font-family: var(--mono);
  font-size: 0.94em;
  background: var(--papier-2);
  padding: 0.05rem 0.35rem;
  border-radius: 3px;
  white-space: nowrap;
}

/* ---------- Structure ---------- */

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.25rem;
}

main { display: block; }

/* ---------- En-tête ---------- */

.site-head {
  background: var(--vert-fonce);
  color: #fff;
  border-bottom: 4px double #9fd3b8;
}
.site-head .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 1.5rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}
.brand {
  font-family: var(--sans);
  font-weight: 800;
  font-size: 1.22rem;
  letter-spacing: -0.01em;
  color: #fff;
  text-decoration: none;
}
.brand .tld { color: #9fd3b8; }
.brand-tag {
  font-family: var(--sans);
  font-size: 0.82rem;
  color: #c4d8cb;
  flex: 1 1 auto;
}
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.15rem;
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 600;
}
.site-nav a { color: #e4efe7; text-decoration: none; padding: 0.15rem 0; }
.site-nav a:hover { color: #fff; text-decoration: underline; }
.site-nav a[aria-current="page"] {
  color: #fff;
  border-bottom: 2px solid #9fd3b8;
}

/* ---------- Hero ---------- */

.hero {
  background: var(--carte);
  border-bottom: 1px solid var(--filet);
  padding: 2.6rem 0 2.3rem;
}
.hero .lead { max-width: 42rem; }
.hero-meta {
  font-family: var(--sans);
  font-size: 0.84rem;
  color: var(--encre-douce);
  margin-top: 1.1rem;
}

/* ---------- Sommaire ---------- */

.toc {
  background: var(--vert-pale);
  border: 1px solid var(--filet);
  border-left: 4px solid var(--vert);
  padding: 1.15rem 1.35rem;
  margin: 1.8rem 0;
}
.toc h2 {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--vert-fonce);
}
.toc ol { margin: 0 0 0 1.2rem; }
.toc li { margin-bottom: 0.25rem; }
.toc a { font-family: var(--sans); font-weight: 600; font-size: 0.98rem; }

/* ---------- Sections numérotées (style manuel) ---------- */

.chap { padding: 0.4rem 0 1rem; }
.chap > h2 {
  border-bottom: 3px double var(--filet);
  padding-bottom: 0.55rem;
}
.chap > h2 .num {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--mousse);
  margin-right: 0.55rem;
  font-size: 0.9em;
}

/* ---------- Tableaux ---------- */

.tbl-wrap { overflow-x: auto; margin: 1.3rem 0; border: 1px solid var(--filet); background: var(--carte); }
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 34rem;
  font-size: 0.95rem;
  line-height: 1.5;
}
caption {
  caption-side: top;
  text-align: left;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--vert-fonce);
  padding: 0.7rem 0.9rem 0.4rem;
}
th, td {
  padding: 0.6rem 0.9rem;
  text-align: left;
  vertical-align: top;
  border-top: 1px solid var(--filet-doux);
}
thead th {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--vert-fonce);
  color: #fff;
  border-top: none;
}
tbody th {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--vert-fonce);
}
tbody tr:nth-child(even) { background: var(--papier-2); }
td .val { background: #fff; border: 1px solid var(--filet-doux); }

.tbl-note {
  font-size: 0.88rem;
  color: var(--encre-douce);
  margin-top: -0.6rem;
  margin-bottom: 1.4rem;
}

/* ---------- Encadrés ---------- */

.fiche {
  background: var(--carte);
  border: 1px dashed var(--filet);
  border-left: 4px solid var(--vert);
  padding: 1.1rem 1.3rem;
  margin: 1.5rem 0;
}
.fiche h3 { margin-top: 0; font-size: 1rem; }

.warn {
  background: var(--alerte-fond);
  border-left: 4px solid var(--alerte-bord);
  padding: 1rem 1.3rem;
  margin: 1.5rem 0;
}
.warn strong { color: var(--alerte-texte); }

.seuils {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
  margin: 1.5rem 0;
}
@media (min-width: 620px) { .seuils { grid-template-columns: repeat(3, 1fr); } }
.seuil {
  background: var(--carte);
  border: 1px solid var(--filet);
  border-top: 4px solid var(--vert);
  padding: 1rem 1.1rem;
}
.seuil.repoussoir { border-top-color: var(--alerte-bord); }
.seuil .chiffre {
  font-family: var(--sans);
  font-weight: 800;
  font-size: 1.9rem;
  color: var(--vert-fonce);
  display: block;
  line-height: 1.1;
}
.seuil.repoussoir .chiffre { color: var(--alerte-texte); }
.seuil .legende {
  font-family: var(--sans);
  font-size: 0.86rem;
  color: var(--encre-douce);
  display: block;
  margin-top: 0.3rem;
}

/* ---------- Définitions ---------- */

dl.facteurs { margin: 1.2rem 0; }
dl.facteurs dt {
  font-family: var(--sans);
  font-weight: 700;
  color: var(--vert-fonce);
  margin-top: 1rem;
}
dl.facteurs dd { margin: 0.2rem 0 0; }

/* ---------- FAQ ---------- */

.faq-item {
  background: var(--carte);
  border: 1px solid var(--filet);
  padding: 1.3rem 1.5rem;
  margin: 1.1rem 0;
}
.faq-item h2 {
  margin: 0 0 0.6rem;
  font-size: 1.15rem;
  border: none;
  padding: 0;
}

/* ---------- CTA ---------- */

.cta-box {
  background: var(--vert-fonce);
  color: #e8f1ea;
  padding: 1.8rem 1.6rem;
  margin: 2.4rem 0 1.5rem;
  border-top: 4px double #9fd3b8;
}
.cta-box h2, .cta-box h3 { color: #fff; margin-top: 0; border: none; padding: 0; }
.cta-box p { color: #d7e5da; }
.cta-box a:not(.btn) { color: #b9e2c8; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.2rem; }
.btn {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.98rem;
  text-decoration: none;
  padding: 0.75rem 1.4rem;
  border-radius: 4px;
}
.btn-plein { background: #e8f1ea; color: var(--vert-fonce); }
.btn-plein:hover { background: #fff; color: var(--vert-fonce); }
.btn-contour { border: 2px solid #9fd3b8; color: #e8f1ea; }
.btn-contour:hover { background: rgba(159, 211, 184, 0.15); color: #fff; }
.cta-note { font-size: 0.83rem; color: #b6c9bb; margin-top: 1rem; }

/* ---------- Liens de suite ---------- */

.suite {
  border-top: 3px double var(--filet);
  margin-top: 2.5rem;
  padding-top: 1.4rem;
}
.suite h2 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.12em; margin: 0 0 0.8rem; border: none; padding: 0; }
.suite ul { list-style: none; margin: 0; }
.suite li { margin-bottom: 0.5rem; }
.suite a { font-family: var(--sans); font-weight: 600; }
.suite .desc { color: var(--encre-douce); font-size: 0.92rem; }

/* ---------- Pied de page ---------- */

.site-foot {
  background: var(--vert-fonce);
  color: #c4d8cb;
  margin-top: 3.5rem;
  padding: 2.2rem 0 2.5rem;
  font-size: 0.9rem;
  border-top: 4px double #9fd3b8;
}
.site-foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.3rem;
  font-family: var(--sans);
  font-weight: 600;
  margin-bottom: 1.2rem;
}
.site-foot a { color: #dcebe0; }
.site-foot .edition {
  border-top: 1px solid rgba(159, 211, 184, 0.3);
  padding-top: 1.1rem;
  font-size: 0.83rem;
  line-height: 1.65;
  color: #a8bfae;
}
.site-foot .edition strong { color: #d7e5da; }

/* ---------- Divers ---------- */

.pas-a-pas { counter-reset: etape; list-style: none; margin-left: 0; }
.pas-a-pas > li {
  counter-increment: etape;
  position: relative;
  padding-left: 2.6rem;
  margin-bottom: 0.9rem;
}
.pas-a-pas > li::before {
  content: counter(etape);
  position: absolute;
  left: 0;
  top: 0.15rem;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: var(--vert);
  color: #fff;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

hr {
  border: none;
  border-top: 3px double var(--filet);
  margin: 2.2rem 0;
}

@media (max-width: 480px) {
  body { font-size: 1.02rem; }
  .hero { padding: 2rem 0 1.8rem; }
  th, td { padding: 0.5rem 0.65rem; }
}

@media print {
  .site-head, .site-foot, .cta-box, .skip-link { display: none; }
  body { background: #fff; }
}
