/* ============================================================
   SAMA · blog.css
   Mise en page éditoriale du blog (liste + articles). S'appuie sur
   les variables/styles de base de style.css (reset, nav, footer,
   modales légales, boutons, palette) — ne redéfinit rien de la
   page d'accueil, n'ajoute que ce qui manque pour le blog.

   Parti pris : lecture longue confortable sur fond sombre (cohérent
   avec l'identité cinématographique du site), ponctuée de modules
   clairs ("paper") pour les éléments à scanner rapidement (chiffres
   clés, sommaire, citation, FAQ, CTA) — inspiré des meilleurs sites
   éditoriaux (longueur de ligne maîtrisée, hiérarchie typographique
   nette, contenu dense transformé en repères visuels).
   ============================================================ */

/* ── Barre de progression de lecture ───────────────────────── */
.reading-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: rgba(240, 250, 244, 0.12);
  z-index: 200;
}
.reading-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--red);
  transition: width 0.1s linear;
}
body.blog-page #main-nav { top: 3px; }

@media (prefers-reduced-motion: reduce) {
  .reading-progress-bar { transition: none; }
}

/* ── Base pages blog ────────────────────────────────────────── */
body.blog-page {
  padding-top: 5.6rem;
}

html:has(body.blog-page) {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html:has(body.blog-page) { scroll-behavior: auto; }
}

.blog-wrap {
  max-width: 700px;
  margin: 0 auto;
  padding: 3.5rem 6vw 6rem;
}

/* Au-delà de 1040px, le conteneur s'élargit pour occuper l'écran :
   la liste reste à une largeur de lecture confortable, l'article
   gagne une colonne de sommaire fixe à gauche (cf. .article-layout). */
@media (min-width: 1040px) {
  .blog-wrap { max-width: 1180px; padding: 4.5rem 4vw 7rem; }
  .blog-list { max-width: 700px; margin: 0 auto; }
}

.blog-eyebrow,
.article-eyebrow {
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.26em;
  color: var(--red);
  margin-bottom: 1rem;
}

.blog-page-title {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  line-height: 1.05;
  color: var(--dark-text);
  margin-bottom: 1rem;
}

.blog-page-lead {
  font-size: 1.05rem;
  color: var(--dark-text-muted);
  max-width: 540px;
  line-height: 1.7;
  margin-bottom: 3rem;
}

/* ── Liste des articles ─────────────────────────────────────── */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

.blog-card {
  display: block;
  background: var(--paper);
  border-radius: 16px;
  padding: 1.9rem 2.1rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.blog-card:hover,
.blog-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(8, 9, 10, 0.2);
}

.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--dim);
  margin-bottom: 0.7rem;
}

.blog-card-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--navy-deep);
  margin-bottom: 0.7rem;
  line-height: 1.28;
}

.blog-card-excerpt {
  font-size: 0.94rem;
  color: var(--dim-mid);
  line-height: 1.7;
}

/* ── Mise en page large de l'article (≥1040px) ──────────────── */
/* Colonne de sommaire fixe à gauche + contenu à largeur de lecture
   confortable à droite : utilise l'espace d'un écran d'ordinateur
   sans jamais élargir le texte lui-même (mauvais pour la lecture). */
@media (min-width: 1040px) {
  .article-layout {
    display: grid;
    grid-template-columns: 230px minmax(0, 700px);
    grid-template-areas:
      "toc header"
      "toc stats"
      "toc prose"
      "toc faq"
      "toc cta"
      "toc footer";
    column-gap: 4.5rem;
    align-items: start;
  }
  .article-header   { grid-area: header; }
  .stat-grid        { grid-area: stats; margin-bottom: 0; }
  .article-toc      { grid-area: toc; position: sticky; top: 7.5rem; align-self: start; }
  .article-prose    { grid-area: prose; }
  .article-faq      { grid-area: faq; }
  .article-cta-card { grid-area: cta; }
  .article-footer   { grid-area: footer; }
}

/* ── En-tête d'article ─────────────────────────────────────── */
.article-header {
  margin-bottom: 2.6rem;
}

.article h1 {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: clamp(2rem, 4.6vw, 3.1rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--dark-text);
  opacity: 1; /* override style.css h1{opacity:0} : pas de mask reveal JS ici */
  margin-bottom: 1.3rem;
}

.article-lead {
  font-size: clamp(1.02rem, 1.4vw, 1.18rem);
  color: var(--dark-text-muted);
  line-height: 1.7;
  margin-bottom: 1.4rem;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.78rem;
  color: rgba(240, 250, 244, 0.5);
}
.article-meta-dot { opacity: 0.6; }

/* ── Chiffres clés (scannable à l'ouverture) ──────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
  margin-bottom: 2.4rem;
}

.stat-card {
  background: var(--paper);
  border-radius: 14px;
  padding: 1.2rem 1.1rem;
  text-align: center;
}

.stat-value {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
  color: var(--navy-deep);
  line-height: 1.1;
  margin-bottom: 0.4rem;
}

.stat-label {
  font-size: 0.72rem;
  color: var(--dim);
  line-height: 1.4;
}

@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr; }
  .stat-card { display: flex; align-items: center; justify-content: space-between; text-align: left; padding: 0.9rem 1.1rem; }
  .stat-label { max-width: 60%; }
}

/* ── Sommaire ("Dans cet article") ──────────────────────────── */
.article-toc {
  background: var(--paper);
  border-radius: 14px;
  padding: 1.5rem 1.7rem;
  margin-bottom: 2.6rem;
}

.article-toc-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--navy-deep);
  margin-bottom: 0.8rem;
}

.article-toc ol {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  counter-reset: toc;
}

.article-toc li { counter-increment: toc; }

.article-toc a {
  display: flex;
  gap: 0.6rem;
  font-size: 0.88rem;
  color: var(--dim-mid);
  transition: color 0.2s;
}
.article-toc a::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--pale);
  min-width: 1.6rem;
}
.article-toc a:hover,
.article-toc a.is-active { color: var(--navy-deep); }
.article-toc a.is-active::before { color: var(--red); }

/* ── Corps de l'article ─────────────────────────────────────── */
.article-prose h2 {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: clamp(1.3rem, 2.6vw, 1.65rem);
  color: var(--dark-text);
  margin: 3rem 0 1.2rem;
  scroll-margin-top: 6.5rem; /* compense la nav fixe lors d'un saut d'ancre */
}
.article-prose h2:first-child { margin-top: 0; }

.article-prose p {
  font-size: clamp(1rem, 1.3vw, 1.08rem);
  color: var(--dark-text-muted);
  line-height: 1.85;
  margin-bottom: 1.3rem;
  max-width: 62ch;
}

.article-prose ul,
.article-prose ol {
  margin: 0 0 1.4rem 0;
  padding-left: 1.4rem;
  color: var(--dark-text-muted);
  font-size: clamp(1rem, 1.3vw, 1.08rem);
  line-height: 1.8;
  max-width: 62ch;
}
.article-prose li { margin-bottom: 0.65rem; }
.article-prose li::marker { color: var(--pale); }

.article-prose strong { color: var(--dark-text); font-weight: 600; }

/* Citation / avertissement mis en avant */
.article-callout {
  background: var(--paper);
  border-left: 4px solid var(--red);
  border-radius: 0 12px 12px 0;
  padding: 1.3rem 1.6rem;
  margin: 0 0 1.8rem;
}
.article-callout p {
  color: var(--dim-mid);
  font-size: 1rem;
  line-height: 1.7;
  margin: 0;
  max-width: none;
}
.article-callout strong { color: var(--navy-deep); }

/* ── Tableau des délais : cartes empilées sur mobile ────────── */
.table-wrap { margin-bottom: 1.4rem; }

.delais-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper);
  border-radius: 14px;
  overflow: hidden;
  font-size: 0.88rem;
}
.delais-table th,
.delais-table td {
  text-align: left;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid rgba(24, 42, 32, 0.1);
  color: var(--dim-mid);
}
.delais-table tbody tr:last-child td { border-bottom: none; }
.delais-table th {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--navy-deep);
  background: rgba(62, 125, 90, 0.06);
}

@media (max-width: 640px) {
  .delais-table thead { display: none; }
  .delais-table, .delais-table tbody, .delais-table tr, .delais-table td { display: block; width: 100%; }
  .delais-table tr { padding: 1rem 1.1rem; border-bottom: 1px solid rgba(24, 42, 32, 0.1); }
  .delais-table tbody tr:last-child { border-bottom: none; }
  .delais-table td { padding: 0.25rem 0; border-bottom: none; }
  .delais-table td::before {
    content: attr(data-label);
    display: block;
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--navy-deep);
    margin-bottom: 0.2rem;
  }
}

/* ── Bloc FAQ (accordéon) ──────────────────────────────────── */
.article-faq {
  margin-top: 3rem;
}
.article-faq h2 {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: clamp(1.3rem, 2.6vw, 1.65rem);
  color: var(--dark-text);
  margin-bottom: 0.6rem;
}

.article-faq-item {
  border-bottom: 1px solid rgba(240, 250, 244, 0.12);
}

.article-faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  padding: 1.3rem 0;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--dark-text);
  text-align: left;
}

.article-faq-icon {
  width: 24px; height: 24px;
  min-width: 24px;
  border-radius: 50%;
  border: 1px solid rgba(240, 250, 244, 0.25);
  display: flex; align-items: center; justify-content: center;
  color: var(--dark-text);
  transition: transform 0.3s var(--ease-out), background 0.3s, border-color 0.3s, color 0.3s;
}
.article-faq-item.open .article-faq-icon {
  background: var(--red);
  border-color: var(--red);
  color: var(--dark-text);
  transform: rotate(45deg);
}

.article-faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s var(--ease-out);
}
.article-faq-item.open .article-faq-answer { max-height: 320px; }

.article-faq-answer-inner {
  padding-bottom: 1.4rem;
  padding-right: 2rem;
  font-size: 0.94rem;
  color: var(--dark-text-muted);
  line-height: 1.75;
}

/* ── CTA de prise de rendez-vous ────────────────────────────── */
.article-cta-card {
  margin-top: 3rem;
  background: var(--paper);
  border-radius: 20px;
  padding: 2.6rem 2.2rem;
  text-align: center;
}
.article-cta-card .article-eyebrow { justify-content: center; }
.article-cta-card h2 {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: clamp(1.3rem, 2.8vw, 1.8rem);
  color: var(--navy-deep);
  margin-bottom: 0.8rem;
}
.article-cta-card p {
  font-size: 0.95rem;
  color: var(--dim-mid);
  line-height: 1.7;
  max-width: 440px;
  margin: 0 auto 1.6rem;
}

/* ── Pied d'article (sources, date de màj, conformité) ─────── */
.article-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(240, 250, 244, 0.1);
  font-size: 0.78rem;
  color: rgba(240, 250, 244, 0.45);
  line-height: 1.7;
}
.article-footer a { text-decoration: underline; text-underline-offset: 2px; color: inherit; }
.article-footer p { margin-bottom: 0.6rem; }

@media (max-width: 480px) {
  .blog-wrap { padding: 2.6rem 5.5vw 5rem; }
  .article-cta-card { padding: 2rem 1.5rem; }
  .article-toc { padding: 1.3rem 1.4rem; }
}
