/* =========================================================================
   mystere-de-vie.fr — Design system "Foret nordique"
   Palette et typographie inedites dans le reseau (releve de saturation
   2026-10-12 : Cormorant Garamond pris par 10 sites du pole, Fraunces par 8,
   Playfair + fond creme par betterave-rouge.fr / instant-present.fr).
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Young+Serif&family=Public+Sans:ital,wght@0,400;0,600;0,700;1,400&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  --foret:   #1C3029;
  --foret-2: #27443A;
  --mineral: #EFF1ED;
  --cuivre:  #A8643C;
  --cuivre-c:#8E5230;
  --givre:   #D6E0DA;
  --encre:   #1A1F1C;
  --brume:   #6E7A72;
  --blanc:   #FBFCFA;

  --f-display: 'Young Serif', Georgia, 'Times New Roman', serif;
  --f-body: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;

  --w-article: 700px;
  --w-large: 1280px;
  --w-hero: 1440px;
  --r: 2px;

  --shadow-s: 0 1px 3px rgba(26, 31, 28, .08);
  --shadow-m: 0 4px 16px rgba(26, 31, 28, .10);
}

/* ---------- Reset + anti-distorsion images (REGLE 14 reseau) ---------- */
*, *::before, *::after { box-sizing: border-box; }
img { max-width: 100%; height: auto; display: block; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--mineral);
  color: var(--encre);
  font-family: var(--f-body);
  font-size: 18px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* Wrappers a ratio fixe — JAMAIS object-fit sur <img> seul */
.img-hero     { aspect-ratio: 3/2;  overflow: hidden; width: 100%; }
.img-card     { aspect-ratio: 3/2;  overflow: hidden; width: 100%; }
.img-body     { aspect-ratio: 3/2;  overflow: hidden; width: 100%; }
.img-portrait { aspect-ratio: 1/1;  overflow: hidden; width: 100%; 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;
}

/* ---------- Typographie ---------- */
h1, h2, h3, h4 {
  font-family: var(--f-display);
  font-weight: 400;
  line-height: 1.18;
  color: var(--foret);
  margin: 0 0 .6em;
  letter-spacing: -.01em;
}
h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.25rem); margin-top: 2.4em; position: relative; padding-bottom: .34em; }
h2::after { content: ''; position: absolute; left: 0; bottom: 0; width: 56px; height: 2px; background: var(--cuivre); }
h3 { font-size: clamp(1.25rem, 2.4vw, 1.5rem); margin-top: 1.9em; }
p { margin: 0 0 1.35em; }
a { color: var(--cuivre-c); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--foret); }
strong { font-weight: 600; }

.kicker {
  font-family: var(--f-mono);
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--cuivre);
  display: block;
  margin-bottom: .9em;
}

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: var(--w-large); margin: 0 auto; padding: 0 24px; }
.wrap-article { width: 100%; max-width: var(--w-article); margin: 0 auto; padding: 0 24px; }
.section { padding: 5rem 0; }
.section-alt { background: var(--givre); }
.section-dark { background: var(--foret); color: var(--givre); }
.section-dark h2, .section-dark h3 { color: var(--blanc); }
.section-dark a { color: var(--givre); }

.diamond { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 3.5rem 0; }
.diamond::before, .diamond::after { content: ''; height: 1px; background: var(--givre); flex: 1; max-width: 160px; }
.diamond span { width: 8px; height: 8px; background: var(--cuivre); transform: rotate(45deg); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(239, 241, 237, .93);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--givre);
  transition: background .3s, box-shadow .3s;
}
.site-header.scrolled { background: var(--foret); box-shadow: var(--shadow-m); border-bottom-color: transparent; }
.site-header.scrolled .logo, .site-header.scrolled .nav a { color: var(--blanc); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 72px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--f-display); font-size: 1.22rem; color: var(--foret); text-decoration: none; }
.logo-mark { width: 30px; height: 30px; flex: 0 0 30px; }
.nav { display: flex; align-items: center; gap: 26px; }
.nav a { font-size: .93rem; color: var(--encre); text-decoration: none; padding: 6px 0; border-bottom: 1px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--cuivre); color: var(--cuivre-c); }
.burger { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.burger span { display: block; width: 24px; height: 2px; background: var(--encre); margin: 5px 0; transition: .25s; }
.site-header.scrolled .burger span { background: var(--blanc); }

/* ---------- Hero ---------- */
.hero { position: relative; max-width: var(--w-hero); margin: 0 auto; }
.hero-media { position: relative; aspect-ratio: 16/9; overflow: hidden; width: 100%; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.hero-media::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(28,48,41,.30) 0%, rgba(28,48,41,.52) 55%, rgba(28,48,41,.82) 100%);
}
.hero-text { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 24px 3rem; z-index: 2; }
.hero-text .inner { max-width: var(--w-large); margin: 0 auto; }
.hero h1 { color: var(--blanc); max-width: 20ch; }
.hero .kicker { color: var(--givre); }
.hero-lede { color: var(--givre); font-size: 1.12rem; max-width: 56ch; margin-bottom: 1.6em; }
.hero-compact .hero-media { aspect-ratio: 21/9; }

.btn {
  display: inline-block;
  font-family: var(--f-mono); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase;
  background: var(--cuivre); color: var(--blanc); text-decoration: none;
  padding: 15px 30px; border-radius: var(--r); border: 0; cursor: pointer;
  transition: background .2s, transform .2s;
}
.btn:hover { background: var(--cuivre-c); color: var(--blanc); transform: translateY(-1px); }
.btn-ghost { background: transparent; border: 1px solid var(--givre); color: var(--givre); }
.btn-ghost:hover { background: var(--givre); color: var(--foret); }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 32px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.card {
  background: var(--blanc);
  border: 1px solid var(--givre);
  border-radius: var(--r);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .22s, box-shadow .22s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-m); }
.card-body { padding: 22px 24px 26px; display: flex; flex-direction: column; flex: 1; }
.card h3 { margin: .25em 0 .5em; font-size: 1.22rem; }
.card h3 a { color: var(--foret); text-decoration: none; }
.card h3 a:hover { color: var(--cuivre-c); }
.card p { font-size: .95rem; color: var(--brume); margin-bottom: 1.1em; }
.card-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-family: var(--f-mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--cuivre); margin-top: auto; }
.card-meta time { color: var(--brume); }
.card-cat { font-family: var(--f-mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--cuivre); }

/* ---------- Bandeau chiffres ---------- */
.stats { display: grid; gap: 40px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); text-align: center; }
.stat-n { font-family: var(--f-display); font-size: clamp(2.4rem, 6vw, 3.6rem); color: var(--cuivre); line-height: 1; display: block; }
.stat-l { font-family: var(--f-mono); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--givre); margin-top: .7em; display: block; }

/* ---------- Article ---------- */
.article-head { padding: 3rem 0 1rem; }
.breadcrumb { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--brume); margin-bottom: 1.5em; }
.breadcrumb a { color: var(--brume); text-decoration: none; }
.breadcrumb a:hover { color: var(--cuivre-c); }
.article-meta { display: flex; gap: 18px; flex-wrap: wrap; font-family: var(--f-mono); font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--brume); margin-bottom: 2rem; }
.article-summary { font-size: 1.14rem; color: var(--foret); border-left: 2px solid var(--cuivre); padding-left: 22px; margin: 0 0 2.6rem; }

.article-body { font-size: 1.06rem; }
.article-body > figure { margin: 2.6rem 0; }
.article-body figcaption {
  display: block; position: static; visibility: visible;
  font-family: var(--f-mono); font-size: .75rem; line-height: 1.6;
  color: var(--brume); padding-top: .8em; border-top: 1px solid var(--givre); margin-top: .7em;
}
.article-body ul, .article-body ol { padding-left: 1.4em; margin: 0 0 1.5em; }
.article-body ul { list-style: disc outside; }
.article-body ol { list-style: decimal outside; }
.article-body li { margin-bottom: .6em; padding-left: .2em; }
.article-body li::marker { color: var(--cuivre); }
.article-body blockquote {
  margin: 2.2rem 0; padding: 0 0 0 26px; border-left: 3px solid var(--cuivre);
  font-family: var(--f-display); font-size: 1.3rem; line-height: 1.5; color: var(--foret);
}

.table-wrap { overflow-x: auto; margin: 2.2rem 0; border: 1px solid var(--givre); border-radius: var(--r); }

/* Les tableaux Markdown ne passent pas par .table-wrap : Astro les rend nus.
   Sans conteneur scrollable, ils debordaient la fenetre sur mobile (25/25
   pages, mesure Playwright 390px le 2026-10-12 : +83 px de scroll horizontal).
   display:block + overflow-x:auto rend chaque tableau scrollable isolement,
   sans toucher aux 25 fichiers Markdown. */
.article-body > table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--givre);
  border-radius: var(--r);
}
.article-body > table thead th { white-space: nowrap; }
.article-body table { width: 100%; border-collapse: collapse; font-size: .94rem; background: var(--blanc); }
.article-body thead th {
  background: var(--foret); color: var(--blanc);
  font-family: var(--f-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase;
  text-align: left; padding: 13px 16px; font-weight: 600;
}
.article-body td, .article-body tbody th { padding: 12px 16px; border-top: 1px solid var(--givre); vertical-align: top; text-align: left; }
.article-body tbody th { font-weight: 600; color: var(--foret); }
.article-body tbody tr:nth-child(even) { background: rgba(214, 224, 218, .3); }

.encadre {
  background: var(--givre); border-left: 3px solid var(--cuivre);
  padding: 24px 26px; margin: 2.4rem 0; border-radius: var(--r); font-size: .99rem;
}
.encadre > :last-child { margin-bottom: 0; }

/* Icones de section — SVG inline, aux couleurs du design system.
   Derogation documentee au CODEX V6 §1.3, qui nomme Font Awesome : le site
   n'a aucune dependance CDN et le kit FA ajouterait ~75 Ko + une requete
   externe sur les 33 pages. Le SVG inline rend le meme service (reperage
   visuel des sections cles) sans rien charger. Decision d'Antoine, 2026-10-12. */
.ico {
  display: inline-block;
  width: .82em; height: .82em;
  margin-right: .38em;
  vertical-align: baseline;
  fill: none;
  stroke: var(--cuivre);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
h2 .ico, h3 .ico { stroke-width: 1.6; }
.article-body li .ico { width: .78em; height: .78em; margin-right: .3em; }
.section-dark .ico { stroke: var(--givre); }
.encadre-titre { font-family: var(--f-mono); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--cuivre-c); display: block; margin-bottom: .8em; }

/* ---------- Sommaire (TOC) ---------- */
.article-sommaire {
  background: var(--blanc); border: 1px solid var(--givre); border-radius: var(--r);
  padding: 22px 26px; margin: 0 0 2.8rem;
}
.article-sommaire .sommaire-titre { font-family: var(--f-mono); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--cuivre); margin-bottom: .9em; display: block; }
.article-sommaire ol { margin: 0; padding-left: 1.2em; list-style: decimal outside; }
.article-sommaire li { margin-bottom: .45em; font-size: .95rem; }
.article-sommaire a { color: var(--foret); text-decoration: none; }
.article-sommaire a:hover { color: var(--cuivre-c); text-decoration: underline; }
.toc { display: block; }

/* ---------- Interview ---------- */
.interview-expert-card {
  display: flex; gap: 22px; align-items: center;
  background: var(--givre); border-radius: var(--r); padding: 24px; margin: 0 0 2.6rem;
}
.interview-expert-card img { width: 104px; height: 104px; flex: 0 0 104px; border-radius: 50%; object-fit: cover; object-position: center top; }
.interview-expert-card .exp-nom { font-family: var(--f-display); font-size: 1.16rem; color: var(--foret); margin: 0 0 .25em; }
.interview-expert-card .exp-fn { font-size: .92rem; color: var(--brume); margin: 0; }
.article-body .question {
  font-family: var(--f-display); font-size: 1.16rem; color: var(--cuivre-c);
  margin: 2.3rem 0 .8rem; padding-left: 20px; border-left: 2px solid var(--cuivre);
}
.article-body .reponse { margin-bottom: 1.5rem; }

/* ---------- FAQ ---------- */
.faq { margin: 3.5rem 0 0; }
.faq-item { border-bottom: 1px solid var(--givre); }
.faq-q {
  width: 100%; background: none; border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  text-align: left; padding: 20px 0; font-family: var(--f-display); font-size: 1.1rem; color: var(--foret);
}
.faq-q::after { content: '+'; font-family: var(--f-body); font-size: 1.5rem; color: var(--cuivre); transition: transform .25s; flex: 0 0 auto; }
.faq-item.open .faq-q::after { transform: rotate(45deg); }
.faq-a { display: none; padding: 0 0 20px; font-size: 1rem; color: var(--encre); }
.faq-item.open .faq-a { display: block; }

/* ---------- Articles connexes ---------- */
.article-nav-related { margin: 4rem 0 0; padding-top: 2.2rem; border-top: 1px solid var(--givre); }
.article-nav-related .kicker { margin-bottom: 1.2em; }
.article-nav-related ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.article-nav-related a { color: var(--foret); text-decoration: none; font-family: var(--f-display); font-size: 1.08rem; }
.article-nav-related a:hover { color: var(--cuivre-c); text-decoration: underline; }

/* ---------- Filtre categories ---------- */
.filtres { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 2.6rem; }
.filtre-btn {
  font-family: var(--f-mono); font-size: .74rem; letter-spacing: .09em; text-transform: uppercase;
  background: var(--blanc); color: var(--brume); border: 1px solid var(--givre);
  padding: 9px 17px; border-radius: var(--r); cursor: pointer; transition: .2s;
}
.filtre-btn:hover { border-color: var(--cuivre); color: var(--cuivre-c); }
.filtre-btn.actif { background: var(--foret); border-color: var(--foret); color: var(--blanc); }

/* ---------- Formulaire ---------- */
.form-row { margin-bottom: 1.4rem; }
.form-row label { display: block; font-family: var(--f-mono); font-size: .74rem; letter-spacing: .09em; text-transform: uppercase; color: var(--foret); margin-bottom: .55em; }
.form-row input, .form-row textarea, .form-row select {
  width: 100%; font-family: var(--f-body); font-size: 1rem; color: var(--encre);
  background: var(--blanc); border: 1px solid var(--givre); border-radius: var(--r); padding: 13px 15px;
}
.form-row input:focus, .form-row textarea:focus { outline: 2px solid var(--cuivre); outline-offset: 1px; border-color: var(--cuivre); }
.form-row textarea { min-height: 170px; resize: vertical; }
.form-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-msg { padding: 15px 18px; border-radius: var(--r); margin-bottom: 1.4rem; font-size: .96rem; }
.form-msg-ok { background: rgba(45,125,70,.1); border-left: 3px solid #2D7D46; color: #1d5e32; }
.form-msg-err { background: rgba(168,100,60,.1); border-left: 3px solid var(--cuivre); color: var(--cuivre-c); }

/* ---------- Footer ---------- */
.site-footer { background: var(--foret); color: var(--givre); padding: 4rem 0 2rem; margin-top: 5rem; }
.footer-grid { display: grid; gap: 40px; grid-template-columns: 1.4fr 1fr 1fr 1fr; }
.site-footer h4 { font-family: var(--f-mono); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--cuivre); margin-bottom: 1.1em; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .6em; }
.site-footer a { color: var(--givre); text-decoration: none; font-size: .94rem; }
.site-footer a:hover { color: var(--blanc); text-decoration: underline; }
.footer-brand { font-family: var(--f-display); font-size: 1.2rem; color: var(--blanc); margin-bottom: .6em; display: flex; align-items: center; gap: 10px; }
.footer-slogan { font-size: .94rem; color: var(--givre); opacity: .85; max-width: 34ch; }
.footer-bottom { margin-top: 3rem; padding-top: 1.6rem; border-top: 1px solid rgba(214,224,218,.2); display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; font-family: var(--f-mono); font-size: .72rem; letter-spacing: .05em; color: var(--givre); opacity: .8; }

/* ---------- Utilitaires ---------- */
.lede { font-size: 1.15rem; color: var(--brume); max-width: 60ch; }
.center { text-align: center; }
.mt0 { margin-top: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 17px; }
  .burger { display: block; }
  .nav {
    position: fixed; inset: 72px 0 auto; background: var(--foret);
    flex-direction: column; align-items: flex-start; gap: 0;
    padding: 18px 24px 26px; display: none; border-bottom: 1px solid rgba(214,224,218,.2);
  }
  body.nav-open .nav { display: flex; }
  .nav a { color: var(--blanc); width: 100%; padding: 12px 0; border-bottom: 1px solid rgba(214,224,218,.14); }
  .section { padding: 3.4rem 0; }
  /* Hero mobile : le texte passe SOUS l'image, en flux normal.
     Superpose, il debordait au-dessus du container (titre coupe) des que
     celui-ci etait court. Et elargir le container pour l'accueillir forcait un
     recadrage lateral qui coupait le visage, les heroes etant en 3:2
     (meme mecanisme que l'incident topcanon.fr). Separer les deux resout les
     deux problemes a la fois. */
  .hero-media { aspect-ratio: 4/3; }
  .hero-media::after { display: none; }
  .hero-compact .hero-media { aspect-ratio: 3/2; }

  .hero { background: var(--foret); }
  .hero-text {
    position: static;
    padding: 1.8rem 24px 2.2rem;
  }
  .hero h1 { color: var(--blanc); max-width: none; }
  .hero-lede { margin-bottom: 1.4em; }
  .hero-text { padding-bottom: 2.2rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .interview-expert-card { flex-direction: column; text-align: center; }
}
