/* ============================================================
   AstonLegacy — single.css
   PAGE ARTICLE — single.php  (is_singular('post'))

   Refonte « long-read cinématique » + design system mutualisé :
     • hero plein écran qui rétrécit au scroll (scroll-driven CSS)
     • barre de progression de lecture (100% CSS, animation-timeline:scroll())
     • plaque hero en DOUBLE verre (.al-glass + .al-glass__panel)
     • colonne centrée + sommaire (gauche) & partage (droite) STICKY
     • liens in-text « redessinés » (effet Aaron Iker, CSS pur)
     • modèle lié en bande pleine largeur (.al-btn--gooey-white)
     • « À lire aussi » en cartes poster (langage .rev-card)

   Contrat toc.js INCHANGÉ : #article-content · #toc-items · #sidebar-toc
     .sidebar-toc__item / __num / __text / --active
   Or « selon la situation » (WCAG) : FOND CLAIR → gold-deep ; SOMBRE → gold.
   Variables globales (palette, gold, .al-glass, .al-link, gooey) : style.css
   ============================================================ */

/* ------------------------------------------------------------ 1. TOKENS */
body {
  --bg:        #EFF0EF;
  --muted:     #3e3e3e;
  --read:      #2C2E2D;
  --rv-gold:   var(--color-gold-deep, #7A5E16);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-nb);
  font-weight: 400;
  line-height: 1.5;
}
body h1, body h2, body h3 { font-family: var(--font-nb); color: var(--ink); line-height: 1; }
body p  { color: var(--muted); font-weight: 400; }
body a  { color: inherit; }
body em { font-style: italic; color: inherit; }
body strong { color: var(--ink); }

/* ------------------------------------------------------------ 2. PROGRESSION DE LECTURE (100% CSS) */
.article-progress {
  position: fixed; top: var(--admin-h, 0px); left: 0; right: 0;
  height: 3px; z-index: 200; pointer-events: none;
  background: rgba(19, 21, 20, 0.06);
}
.article-progress span {
  display: block; height: 100%; width: 100%;
  transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, #C9952F, var(--rv-gold));
}
@keyframes al-read { to { transform: scaleX(1); } }
@supports (animation-timeline: scroll()) {
  .article-progress span { animation: al-read linear both; animation-timeline: scroll(root); }
}

/* ------------------------------------------------------------ 3. HERO plein écran (rétrécit au scroll) */
.article-hero {
  position: sticky; top: 0; z-index: 0;
  height: 100svh;
  display: flex; align-items: flex-end;
  overflow: hidden;
  background-color: #16181A;          /* repli sans image */
}
.article-hero__media {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  will-change: transform, filter;
}
.article-hero__overlay {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(8,9,9,0.62) 0%, rgba(8,9,9,0.05) 55%);
}
.article-hero__shell {
  position: relative; z-index: 3;
  width: 100%; max-width: 1640px; margin: 0 auto;
  padding: 0 5vw clamp(40px, 8vh, 90px);
}
.article-hero__cue {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  z-index: 3; color: rgba(255,255,255,0.7); font-size: 22px;
  animation: al-cue-bob 1.8s ease-in-out infinite;
}
@keyframes al-cue-bob { 0%,100% { transform: translate(-50%,0); } 50% { transform: translate(-50%,6px); } }

/* — scroll-driven : zoom + assombrissement du média, fondu de la plaque — */
@keyframes hero-zoom  { to { transform: scale(1.14); filter: brightness(0.45); } }
@keyframes hero-plate {           /* remonte tout du long ; l'opacité ne bouge qu'à partir de 50% */
  0%   { opacity: 1; transform: translateY(0); }
  50%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(-510px); }
}
@keyframes hero-fade  { to { opacity: 0; } }
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .article-hero__media { animation: hero-zoom  linear both; animation-timeline: scroll(root); animation-range: 0 100vh; }
    .article-hero__shell { animation: hero-plate linear both; animation-timeline: scroll(root); animation-range: 0 64vh; }
    .article-hero__cue   { animation: hero-fade  linear both; animation-timeline: scroll(root); animation-range: 0 18vh; }
  }
}

/* — Plaque DOUBLE VERRE : .al-glass (cadre + réfraction) > .al-glass__panel (panneau frosté) — */
.article-hero__plate {
  --glass-tint: rgba(255, 255, 255, 0.22);
  --glass-radius: 26px;
  position: relative;
  isolation: isolate;
  max-width: 720px;
  padding: 0;                          /* le panneau intérieur porte le padding */
  /* repli frosté hors-Chromium (la liste partagée le fournissait) ;
     html.lg-plate pose la réfraction url(#…) par-dessus sur Chromium. */
  -webkit-backdrop-filter: blur(14px) saturate(1) brightness(1.16);
          backdrop-filter: blur(14px) saturate(1) brightness(1.16);
  animation: al-rise 0.85s var(--spring-soft) both 0.05s;
}
/* Chromium : réfraction réelle chaînée par-dessus le verre (single.js → lg-plate). */
html.lg-plate .article-hero__plate {
  -webkit-backdrop-filter: url(#al-lg-article-plate) brightness(1.16) saturate(1);
          backdrop-filter: url(#al-lg-article-plate) brightness(1.16) saturate(1);
}
.article-hero__panel {
  --panel-tint: rgba(255, 255, 255, 0.46);
  --panel-radius: 19px;
  --panel-blur: 16px;
  margin: 9px;
  padding: 24px 30px 26px;
}
.article-hero__plate .eyebrow {
  margin-bottom: 12px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--rv-gold);
}
.article-hero__plate .eyebrow::before { background: var(--rv-gold); }
.article-hero__title {
  margin: 0; font-family: var(--font-nb); font-weight: 800;
  font-size: clamp(30px, 4.4vw, 56px); letter-spacing: -0.03em; line-height: 1.02;
  color: var(--ink);
}
.article-hero__meta {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 16px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  color: var(--muted); font-variant-numeric: tabular-nums;
}
.article-hero__sep {
  width: 4px; height: 4px; border-radius: 50%; background: var(--rv-gold);
  font-size: 0; line-height: 0; color: transparent;
}
.article-hero__read-time { display: inline-flex; align-items: center; gap: 5px; }
.article-hero__read-time .ti { font-size: 13px; color: var(--rv-gold); }

/* ------------------------------------------------------------ 4. FLOW (recouvre le hero au scroll) */
.article-flow {
  position: relative; z-index: 2;
  background: var(--bg);
  border-radius: 30px 30px 0 0;
  margin-top: -34px;
  box-shadow: 0 -28px 60px -22px rgba(19, 21, 20, 0.28);
}

/* ------------------------------------------------------------ 5. BREADCRUMB */
.breadcrumb {
  max-width: 1280px; margin: 0 auto;
  padding: 20px 5vw 4px;
  font-size: 11px; letter-spacing: 0.04em; color: var(--subtle);
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--rv-gold); }
.breadcrumb .current { color: var(--ink); }
.breadcrumb-sep { color: var(--subtle); opacity: 0.5; }

/* ------------------------------------------------------------ 6. GRILLE : sommaire | colonne | partage */
.article-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 720px) minmax(0, 1fr);
  gap: 0 40px; align-items: start;
  max-width: 1280px; margin: 0 auto;
  padding: 30px 5vw 60px;
}
.article-toc   { grid-column: 1; justify-self: end; width: 210px; }
.article-body  { grid-column: 2; min-width: 0; background: none; padding: 0; }
.article-share { grid-column: 3; justify-self: start; }

.article-toc, .article-share {
  position: sticky; top: calc(var(--admin-h, 0px) + 92px);
}

/* Sommaire — carte verre douce */
.article-toc {
  padding: 15px 16px 13px; border-radius: 18px;
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(12px) saturate(1.1); backdrop-filter: blur(12px) saturate(1.1);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 2px 36px -16px rgba(19, 21, 20, 0.35);
}
.article-toc__label {
  font-size: 9px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--subtle); margin-bottom: 8px;
}
.sidebar-toc__item {
  display: flex; align-items: baseline; gap: 9px;
  padding: 6px 0 6px 9px; border-left: 2px solid transparent;
  text-decoration: none; cursor: pointer;
}
.sidebar-toc__num {
  font-size: 10px; font-weight: 700; color: var(--subtle);
  flex-shrink: 0; font-variant-numeric: tabular-nums; transition: color 0.25s ease;
}
.sidebar-toc__text { font-size: 11.5px; line-height: 1.35; color: var(--muted); transition: color 0.25s ease; }
.sidebar-toc__item:hover .sidebar-toc__text { color: var(--ink); }
.sidebar-toc__item--active { border-left-color: var(--gold, #C9A84C); }
.sidebar-toc__item--active .sidebar-toc__text { color: var(--ink); font-weight: 600; }
.sidebar-toc__item--active .sidebar-toc__num { color: var(--rv-gold); }

/* Partage — rail verre vertical */
.article-share {
  display: flex; flex-direction: column; gap: 6px;
  padding: 9px; width: 50px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(12px) saturate(1.1); backdrop-filter: blur(12px) saturate(1.1);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 2px 36px -16px rgba(19, 21, 20, 0.4);
}
.article-share__btn {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border: 0; background: transparent; border-radius: 50%; cursor: pointer;
  color: var(--ink); font-size: 16px; text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease;
}
.article-share__btn:hover { color: var(--rv-gold); background: rgba(255, 255, 255, 0.6); }
.article-share__div { width: 20px; height: 1px; background: var(--line); margin: 2px auto; flex-shrink: 0; }
.article-share__top { color: var(--rv-gold); }
/* feedback « lien copié » : passe en vert 2 s puis revient (main.js → .is-copied) */
.article-share__btn.is-copied { color: #1d9e75; background: rgba(29, 158, 117, 0.14); }

/* ------------------------------------------------------------ 7. CORPS D'ARTICLE */
.article-lead {
  margin: 0 0 34px; padding-bottom: 30px;
  border-bottom: 1px solid var(--line-soft);
  font-size: clamp(18px, 1.6vw, 21px); line-height: 1.55; font-weight: 500;
  font-style: normal; color: var(--ink);
}
.article-content { color: var(--read); }
.article-content > *:first-child { margin-top: 0; }
.article-content p { margin: 0 0 22px; font-size: 17px; line-height: 1.8; color: var(--read); }
.article-content h2 {
  font-size: clamp(24px, 3vw, 32px); font-weight: 800; letter-spacing: -0.025em; line-height: 1.12;
  color: var(--ink); margin: 52px 0 16px;
  scroll-margin-top: calc(var(--admin-h, 0px) + 96px);
}
.article-content h3 { font-size: clamp(19px, 2.2vw, 23px); font-weight: 700; letter-spacing: -0.015em; color: var(--ink); margin: 34px 0 12px; }
.article-content h4 { font-size: 17px; font-weight: 700; color: var(--ink); margin: 26px 0 10px; }

/* Liens in-text — effet Aaron Iker = composant PARTAGÉ .al-prose a (style.css),
   activé par la classe .al-prose sur .article-content (markup par prose-links.js). */

.article-content strong { font-weight: 700; color: var(--ink); }
.article-content em { font-style: italic; }
.article-content ul, .article-content ol { margin: 0 0 22px; padding-left: 1.4em; color: var(--read); }
.article-content li { margin: 0 0 8px; font-size: 17px; line-height: 1.7; }
.article-content li::marker { color: var(--rv-gold); }
.article-content blockquote { margin: 32px 0; padding: 4px 0 4px 26px; border-left: 2px solid var(--rv-gold); }
.article-content blockquote p { font-size: clamp(20px, 2.4vw, 26px); font-weight: 600; line-height: 1.4; letter-spacing: -0.01em; color: var(--ink); }
.article-content img { width: 100%; height: auto; display: block; border-radius: 16px; margin: 32px 0; box-shadow: 0 22px 50px -30px rgba(19, 21, 20, 0.4); }
.article-content figure { margin: 32px 0; }
.article-content figure img { margin: 0; }
.article-content figcaption { margin-top: 10px; font-size: 12px; color: var(--subtle); }
.article-content hr { border: 0; height: 1px; background: var(--line); margin: 40px 0; }
.article-content code { font-family: ui-monospace, Menlo, monospace; font-size: 0.9em; background: var(--surface); padding: 2px 6px; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--line); }
.article-content pre { background: var(--surface); border-radius: 14px; padding: 18px 20px; overflow-x: auto; margin: 28px 0; box-shadow: inset 0 0 0 1px var(--line); }
.article-content pre code { background: none; box-shadow: none; padding: 0; }

/* Tags — puces verre */
.article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 40px 0 0; }
.article-tags .tag {
  font-size: 10px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--rv-gold); padding: 7px 14px; border-radius: 999px; text-decoration: none;
  background: rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid rgba(122, 94, 22, 0.25);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.article-tags .tag:hover { background: #fff; border-color: rgba(122, 94, 22, 0.5); }

/* Signature auteur */
.article-author {
  display: flex; align-items: center; gap: 14px;
  margin: 30px 0 0; padding: 16px 18px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line);
}
.article-author__avatar {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(201, 168, 76, 0.16); color: var(--rv-gold); font-weight: 700; font-size: 14px;
}
.article-author__name { font-size: 14px; font-weight: 700; color: var(--ink); }
.article-author__role { font-size: 12px; color: var(--muted); }

/* Navigation précédent / suivant */
.article-nav { display: flex; gap: 16px; margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--line-soft); }
.article-nav__item {
  flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 8px;
  padding: 18px 20px; border-radius: 16px; text-decoration: none;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-soft), 0 16px 40px -30px rgba(19, 21, 20, 0.4);
  transition: transform 0.4s var(--spring-soft), box-shadow 0.4s ease;
}
.article-nav__item:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1px var(--line), 0 26px 56px -30px rgba(19, 21, 20, 0.45); }
.article-nav__item--next { text-align: right; align-items: flex-end; }
.article-nav__label { font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 700; color: var(--rv-gold); display: flex; align-items: center; gap: 6px; }
.article-nav__title { font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.3; }

/* ------------------------------------------------------------ 8. MODÈLE LIÉ — bande pleine largeur */
.article-model { max-width: 1080px; margin: 16px auto 0; padding: 0 5vw; }
.article-model__card {
  --glass-tint: rgba(255, 255, 255, 0.5);
  --glass-radius: 24px;
  display: grid; grid-template-columns: 300px 1fr; gap: 28px; align-items: center;
  padding: 20px;
  -webkit-backdrop-filter: blur(14px) saturate(1.1); backdrop-filter: blur(14px) saturate(1.1);
}
.article-model__media { border-radius: 16px; overflow: hidden; background: #16201b; aspect-ratio: 16 / 10; }
.article-model__media img { width: 100%; height: 100%; object-fit: cover; }
.article-model__name { font-size: clamp(22px, 2.4vw, 30px); font-weight: 800; letter-spacing: -0.02em; margin: 6px 0 8px; color: var(--ink); }
.article-model__desc { font-size: 13px; line-height: 1.6; color: var(--muted); margin-bottom: 16px; max-width: 46ch; }

/* ------------------------------------------------------------ 9. À LIRE AUSSI — cartes poster */
.article-related { max-width: 1180px; margin: 56px auto 0; padding: 0 5vw 40px; }
.article-related > .eyebrow { margin-bottom: 18px; font-size: 11px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--rv-gold); }
.article-related > .eyebrow::before { background: var(--rv-gold); }
.article-related__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
/* cartes = composant partagé .al-card (style.css) */

/* ------------------------------------------------------------ 10. RESPONSIVE */
@media (max-width: 1024px) {
  .article-grid { grid-template-columns: 1fr; max-width: 720px; }
  .article-toc, .article-share { position: static; width: auto; justify-self: stretch; }
  .article-toc { grid-row: auto; margin-bottom: 4px; }
  .article-share { flex-direction: row; width: max-content; }
  .article-share__div { width: 1px; height: 20px; margin: auto 2px; }
  .article-model__card { grid-template-columns: 1fr; }
  .article-related__grid { grid-template-columns: 1fr 1fr; }
}

/* Bouton flottant « Sommaire » (créé par toc.js) — caché hors mobile */
.article-toc-fab { display: none; }

/* ≤768 : sommaire → bottom-sheet (drawer) piloté par html.toc-open ;
   partage → barre sticky en bas. Les deux sortent du flux (overlays). */
@media (max-width: 768px) {
  .article-toc {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    width: auto; margin: 0; border-radius: 20px 20px 0 0;
    max-height: 72vh; overflow-y: auto;
    padding: 18px var(--gut) calc(18px + env(safe-area-inset-bottom, 0px));
    transform: translateY(110%);
    visibility: hidden;                 /* masqué tant que le drawer est fermé (fiable, vs transform seul) */
    transition: transform 0.4s var(--spring-soft, ease), visibility 0s linear 0.4s;
    box-shadow: 0 -18px 50px -20px rgba(19, 21, 20, 0.5);
  }
  html.toc-open .article-toc {
    transform: none; visibility: visible;
    transition: transform 0.4s var(--spring-soft, ease);
  }
  .sidebar-toc__item { padding: 11px 0 11px 10px; }    /* cibles ≥44px */
  .sidebar-toc__text { font-size: 14px; }

  .article-toc-fab {
    position: fixed; left: 14px; bottom: 14px; z-index: 61;
    display: inline-flex; align-items: center; gap: 7px;
    min-height: 44px; padding: 0 16px; border: 0; border-radius: 999px; cursor: pointer;
    background: rgba(255, 255, 255, 0.7); color: var(--ink);
    -webkit-backdrop-filter: blur(14px) saturate(1.1); backdrop-filter: blur(14px) saturate(1.1);
    box-shadow: 0 6px 24px -8px rgba(19, 21, 20, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
    font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
  }
  .article-toc-fab i { font-size: 16px; }

  /* Partage : pilule VERTICALE compacte sur le bord droit (icônes les unes sous
     les autres) → ne mange plus l'espace du bas et ne recouvre plus le FAB Sommaire. */
  .article-share {
    position: fixed; right: 8px; left: auto; top: 50%; bottom: auto;
    transform: translateY(-50%); z-index: 61;
    flex-direction: column; width: max-content;
    padding: 5px; gap: 4px;
    background: rgba(255, 255, 255, 0.7);
    -webkit-backdrop-filter: blur(14px) saturate(1.1); backdrop-filter: blur(14px) saturate(1.1);
  }
  .article-share__btn { width: 30px; height: 30px; font-size: 14px; }
  .article-share__div { width: 16px; height: 1px; margin: 2px auto; }
}
@media (max-width: 480px) {
  .article-hero__panel { padding: 20px 22px 22px; }
  .article-nav { flex-direction: column; }
  .article-related__grid { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------ 11. MOUVEMENT RÉDUIT */
@media (prefers-reduced-motion: reduce) {
  .article-hero__plate, .article-hero__cue { animation: none; }
  .article-nav__item, .sidebar-toc__num, .sidebar-toc__text,
  .article-tags .tag, .article-content a, .article-share__btn { transition: none; }
  .article-nav__item:hover { transform: none; }
}
