/* =====================================================================
 * Weda Blog System — ARTICLE (single post)
 * Pixel-perfect Figma 42R7JoA7h4vlGJUONQJxbx (article 3539:11990).
 * Réutilise tokens (blog-front.css) + composants hub (blog-hub.css).
 * ===================================================================== */

.weda-article {
  box-sizing: border-box;
  width: calc(100% - 48px);
  max-width: var(--weda-blog-container); /* 1348 */
  margin: 0 auto;
  /* Dégage le header sticky du site (sinon le hero passe dessous) — aligné sur .weda-hub */
  padding: clamp(120px, 13vw, 190px) 0 0;
  color: var(--weda-blog-text);
  font-family: 'Outfit', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.weda-article * { box-sizing: border-box; }

/* ---------- Hero ---------- */
.weda-article__hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: stretch;
  min-height: 370px;
  margin-bottom: clamp(32px, 4vw, 56px);
}
.weda-article__hero-text {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: 4px 0;
}
.weda-article__breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: none;       /* maquette : pas de capitales */
  color: rgba(56, 67, 208, .3);
}
.weda-article__breadcrumb a { color: inherit; text-decoration: none; }
.weda-article__breadcrumb a:hover { color: var(--weda-blog-blue-700); }
.weda-article__crumb-sep { display: inline-flex; align-items: center; }
.weda-article__crumb-sep img { width: 16px; height: 16px; display: block; }
/* Préfixe `.weda-article` (0,2,0) pour battre `.breakdance h1` (0,1,1) qui imposait
 * 50px/500. Maquette article : H1 Outfit Light 40/48. Vérifié computed en live. */
.weda-article .weda-article__title {
  margin: 0;
  font-size: clamp(30px, 3vw, 40px);
  line-height: 1.2;
  font-weight: 300; /* Outfit Light */
  color: #000;
  letter-spacing: -.01em;
}
.weda-article__meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 12px 16px;
  background: rgba(236, 241, 251, .5);
  border-radius: 8px;
  color: rgba(0, 0, 0, .5);
  font-size: 14px;
  line-height: 18.2px;
}
.weda-article__hero-media .weda-card__media {
  height: 100%;
  min-height: 320px;
  border-radius: 8px;
}
/* Idem carte : monte la spécificité pour battre `.breakdance img { height:auto }`. */
.weda-article__hero-media .weda-article__hero-img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Layout 2 colonnes ---------- */
.weda-article__layout {
  display: flex;
  align-items: flex-start;
  gap: 60px;
}
.weda-article__sidebar {
  position: sticky;
  /* Cale la colonne sticky SOUS le header sticky du site (~90px, cf. offset -90
   * des ancres du sommaire dans blog-article.js) — sinon le haut de la colonne
   * (« Retour au blog ») disparaît derrière le header au scroll. */
  top: 100px;
  flex: 0 0 250px;
  width: 250px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-self: flex-start;
}
.weda-article__content { flex: 1 1 auto; min-width: 0; max-width: 998px; }

/* Retour au blog */
.weda-article__back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--weda-blog-blue-700);
  border-radius: 58px;
  color: var(--weda-blog-blue-700);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
}
.weda-article__back:hover { background: var(--weda-blog-blue-700); color: #fff; }
.weda-article__back-icon { font-size: 20px; line-height: 1; }

/* Sommaire (TOC).
 * ⚠️ Breakdance global : `.breakdance a, .button-atom--text { color: var(--bde-links-color) }`
 * a la MÊME spécificité (0,1,1) que `.weda-article__toc a` et gagne par ordre de source
 * → les ancres INACTIVES héritaient du bleu Breakdance au lieu du gris maquette
 * (--noir-50 = rgba(0,0,0,.5)). L'actif (0,2,1) et le hover gagnaient déjà, d'où l'illusion.
 * Correctif : préfixe par l'ancêtre `.weda-article` (0,2,1) pour imposer nos couleurs.
 * Même piège que le fix CTA du 2026-06-23 (couvrir aussi les :hover). */
.weda-article__toc { display: flex; flex-direction: column; gap: 16px; }
.weda-article .weda-article__toc a {
  display: block;
  padding-left: 16px;
  border-left: 2px solid rgba(0, 0, 0, .5);
  color: rgba(0, 0, 0, .5);   /* --noir-50 (maquette) */
  font-size: 16px;
  font-weight: 400;           /* maquette : Outfit Regular 16 / 120% */
  line-height: 1.2;
  text-decoration: none;
  transition: color .15s ease, border-color .15s ease;
}
.weda-article .weda-article__toc a:hover { color: var(--weda-blog-text); }
.weda-article .weda-article__toc a.is-active { border-color: var(--weda-blog-blue-700); color: var(--weda-blog-blue-700); font-weight: 500; }
.weda-article__toc:empty { display: none; }

/* Partage */
.weda-article__share {
  background: rgba(236, 241, 251, .5);
  border-radius: 8px;
  padding: 12px 16px;
}
.weda-article__share-label { display: block; margin-bottom: 10px; color: rgba(0, 0, 0, .5); font-size: 14px; line-height: 18.2px; }
.weda-article__share-icons { display: flex; align-items: center; gap: 14px; }
/* BugHerd #37 : maquette (Signature 3567:18138) = icônes bleues SANS pastille ronde.
 * On retire la bulle 34×34 blanche : simples glyphes bleus. */
.weda-article__share-link {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 2px; border: 0; cursor: pointer;
  background: transparent; color: var(--weda-blog-blue-700); text-decoration: none;
  transition: opacity .15s ease;
}
.weda-article__share-link:hover { background: transparent; }
/* Pictos maquette : viewBox non carrés → hauteur fixe + largeur auto (préserve le ratio).
 * Pas de `fill` global : chaque path porte son fill/stroke="currentColor" (LinkedIn = stroke). */
.weda-article__share-link svg { height: 20px; width: auto; }
/* Sommaire latéral (maquette 3596:8716) : filet sous le label + pictos répartis, un peu plus grands. BugHerd #29. */
.weda-article__share--side .weda-article__share-label { border-bottom: 1px solid rgba(0, 0, 0, .5); padding-bottom: 8px; margin-bottom: 12px; }
.weda-article__share--side .weda-article__share-icons { justify-content: space-between; gap: 8px; }
.weda-article__share--side .weda-article__share-link svg { height: 24px; }

/* BugHerd #9 : le partage latéral n'apparaît qu'au tiers de l'article (scroll). */
.weda-article__share--side {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
}
.weda-article__share--side.is-revealed {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

/* ---------- Contenu éditorial (blocs core) ---------- */
.weda-article__content > * { margin-top: 0; }
.weda-article__content > * + * { margin-top: clamp(18px, 2vw, 24px); }
/* ⚠️ Breakdance colore les titres via `.breakdance` + `--bde-headings-color:#000`
 * (spécificité 0,1,1) = ÉGALITÉ avec `.weda-article__content h2` → par ordre de
 * source, le noir Breakdance gagnait et écrasait notre bleu (BugHerd #30/#31).
 * Correctif : préfixe `.weda-article` (0,2,1) pour imposer nos couleurs de titre. */
.weda-article .weda-article__content h2 {
  margin: clamp(40px, 5vw, 64px) 0 0;
  font-size: 30px; line-height: 36px; font-weight: 500;
  color: var(--weda-blog-blue-700);
  scroll-margin-top: 100px;
}
.weda-article .weda-article__content h3 {
  margin: clamp(28px, 3vw, 40px) 0 0;
  font-size: 24px; line-height: 1.4; font-weight: 500; color: #000;
  scroll-margin-top: 100px;
}
.weda-article .weda-article__content h4 { font-size: 20px; line-height: 1.4; font-weight: 600; color: #000; }
.weda-article__content p {
  font-size: 18px; line-height: 1.45; letter-spacing: -.2px; color: rgba(0, 0, 0, .7);
}
.weda-article__content a:not(.weda-cta__button):not(.weda-btn-preview):not(.weda-encart__button):not(.weda-telechargement__button):not(.weda-card__cta):not(.weda-hub__bandeau-cta) {
  color: var(--weda-blog-blue-700); text-decoration: underline; text-underline-offset: 3px;
}
/* Listes NATIVES Gutenberg uniquement (.wp-block-list) — pas les listes des blocs ACF */
.weda-article__content .wp-block-list { padding-left: 0; list-style: none; }
.weda-article__content .wp-block-list > li {
  position: relative; padding-left: 32px;
  font-size: 17px; line-height: 1.45; letter-spacing: -.2px; color: rgba(0, 0, 0, .7);
}
.weda-article__content .wp-block-list > li + li { margin-top: 12px; }
.weda-article__content ul.wp-block-list > li::before {
  content: ''; position: absolute; left: 4px; top: .28em;   /* recentré sur la 1re ligne après réduction des fonts */
  width: 16px; height: 16px; border-radius: 50%; background: rgba(56, 67, 208, .3);
}
.weda-article__content ol.wp-block-list { counter-reset: weda-ol; }
.weda-article__content ol.wp-block-list > li { counter-increment: weda-ol; }
.weda-article__content ol.wp-block-list > li::before {
  content: counter(weda-ol); position: absolute; left: 0; top: .1em;
  width: 22px; height: 22px; border-radius: 50%; background: var(--weda-blog-blue-700); color: #fff;
  font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center;
}
/* Pas de border-radius sur les pictos SVG ; uniquement sur les vraies images */
.weda-article__content img { max-width: 100%; height: auto; }
.weda-article__content .wp-block-image img { border-radius: 12px; }
.weda-article__content figure { margin: 0; }
.weda-article__content figcaption { margin-top: 10px; color: var(--weda-blog-muted); font-size: 14px; line-height: 1.4; }
.weda-article__content blockquote {
  margin: 0; padding: 8px 0 8px 24px; border-left: 3px solid var(--weda-blog-blue-700);
  font-size: 22px; line-height: 1.45; color: #000;
}
.weda-article__content strong { font-weight: 700; }
/* Gras inline dans un TITRE : les H3 du CMS sont souvent <h3><strong>…</strong></h3>.
 * Sans ça, `.weda-article__content strong` (700) écrase le 500 du titre → titre trop gras
 * (maquette : titres Medium 500). Le <strong> dans un titre hérite donc du poids du titre.
 * (0,2,2) pour battre `.weda-article__content strong` et Breakdance. BugHerd #30. */
.weda-article .weda-article__content :is(h1, h2, h3, h4, h5, h6) strong { font-weight: inherit; }

/* Tableaux natifs (wp-block-table) chartés Weda — BugHerd #14.
   Même langage visuel que le bloc comparison-table : conteneur arrondi bleu pâle,
   en-tête bleu-50, séparateurs bleu-100. La 1re ligne fait office d'en-tête même
   sans <thead> (cas des tableaux Gutenberg : 1re <tr> en <td><strong>). */
.weda-article__content .wp-block-table {
  background: rgba(236, 241, 251, .5);
  border-radius: 10px;
  padding: 8px;
  overflow-x: auto;                 /* défilement horizontal si le tableau dépasse (mobile) */
  -webkit-overflow-scrolling: touch;
}
.weda-article__content .wp-block-table table {
  width: 100%;
  min-width: 640px;                 /* colonnes lisibles : sous 640px le tableau défile au lieu de se comprimer */
  border-collapse: collapse;
  font-size: 18px;
  line-height: 25px;
  color: rgba(0, 0, 0, .7);
}
.weda-article__content .wp-block-table th,
.weda-article__content .wp-block-table td {
  padding: 16px 20px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--weda-blog-blue-100);
  overflow-wrap: normal;            /* pas de césure en milieu de mot (annule le anywhere global mobile) */
  word-break: normal;
}
.weda-article__content .wp-block-table thead th,
.weda-article__content .wp-block-table tbody tr:first-child:not(:only-child) td {
  background: var(--weda-blog-blue-50);
  color: #000;
  font-weight: 600;
}
.weda-article__content .wp-block-table tr:last-child th,
.weda-article__content .wp-block-table tr:last-child td { border-bottom: 0; }
.weda-article__content .wp-block-table td strong { font-weight: 600; color: #000; }
.weda-article__content .wp-block-table figcaption { padding: 8px 12px 4px; }

/* ---------- Signature (date + partage fin) ---------- */
.weda-article__signature {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  margin: clamp(40px, 5vw, 64px) 0 0;
  padding-top: 24px; border-top: 1px solid var(--weda-blog-blue-100);
}
/* Signature : chip clair (comme le chip date) + séparateur avant les icônes (maquette 3567:18138). */
.weda-article__share--end { background: rgba(236, 241, 251, .5); border-radius: 8px; padding: 10px 16px; display: flex; align-items: center; gap: 16px; }
.weda-article__share--end .weda-article__share-label { margin-bottom: 0; }
.weda-article__share--end .weda-article__share-icons { padding-left: 16px; border-left: 1px solid var(--weda-blog-blue-100); }
.weda-article__share--end .weda-article__share-label { margin: 0; }
.weda-article__share--end .weda-article__share-link { background: transparent; } /* #37 : pas de pastille sur les icônes (maquette) */

/* « Vous aimerez aussi » : hérite de .weda-hub__actus (blog-hub.css) */
.weda-article__related { margin-top: clamp(48px, 6vw, 80px); }

/* Retour en haut */
.weda-article__top {
  position: fixed; right: 24px; bottom: 24px; z-index: 20;
  width: 46px; height: 46px; display: flex; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--weda-blog-blue-700); color: #fff; text-decoration: none;
  box-shadow: 0 8px 24px rgba(56, 67, 208, .3); font-size: 20px;
}
.weda-article__top[hidden] { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
  .weda-article { overflow-x: clip; }            /* garde-fou : pas de scroll horizontal de page */
  .weda-article__content { overflow-wrap: anywhere; }
  .weda-article__hero { grid-template-columns: 1fr; }
  /* Maquette mobile 3609:17903 : fil d'ariane + titre AVANT l'image. */
  .weda-article__hero-text { order: 1; }
  .weda-article__hero-media { order: 2; }
  .weda-article__hero-media .weda-card__media { min-height: 220px; height: 240px; }
  .weda-article__layout { flex-direction: column; align-items: stretch; gap: 28px; }
  /* Sommaire mobile (Figma « Zone sommaire min ») : bouton retour + sélecteur de section à chevrons */
  .weda-article__sidebar {
    position: static; width: 100%; flex-basis: auto;
    flex-direction: column; gap: 16px;
    padding: 0; border-radius: 0; background: transparent;
  }
  .weda-article__share--side { display: none; }  /* partage uniquement en fin d'article sur mobile */
  /* Sommaire mobile (maquette 3609:17903) : liste complète en haut + barre sticky au scroll (BugHerd #40). */
  .weda-article__toc { display: flex; }
  .weda-article__toc-selector {
    display: none;
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;  /* au-dessus du header Breakdance (~200) */
    align-items: center; justify-content: center; gap: 16px;
    padding: 12px 24px; background: #fff; box-shadow: 0 3px 10px rgba(0, 0, 0, .08);
  }
  .weda-article__toc-selector.is-visible { display: flex; }
  .weda-article__toc-chev { display: inline-flex; align-items: center; padding: 4px; border: 0; background: none; cursor: pointer; color: var(--weda-blog-blue-700); }
  .weda-article__toc-chev svg { width: 9.5px; height: 14px; }
  .weda-article__toc-chev--next { transform: scaleX(-1); }
  .weda-article__toc-chev:disabled { opacity: .3; cursor: default; }
  .weda-article__toc-current {
    border: 0; background: none; cursor: pointer; padding: 0;
    color: var(--weda-blog-blue-700); font-family: 'Outfit', sans-serif; font-size: 16px; line-height: 1.2; font-weight: 500;
    max-width: 72%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .weda-article__content { max-width: none; width: 100%; }
}

@media (max-width: 767px) {
  .weda-article { width: 100%; padding: 130px 24px 0; }  /* top pour dégager le header overlay Breakdance (cf. .weda-hub) */
  .weda-article .weda-article__title { font-size: 28px; }
  .weda-article__content h2 { font-size: 26px; line-height: 32px; }
  .weda-article__content h3 { font-size: 21px; }
  .weda-article__content p { font-size: 18px; }
  .weda-article__signature { flex-direction: column; align-items: flex-start; }
}

/* Override `.breakdance a` (global) sur les CTA de l'article (retour, partage, fil d'ariane). */
.weda-article .weda-article__back { color: var(--weda-blog-blue-700); }
.weda-article .weda-article__back:hover { color: #fff; }
.weda-article .weda-article__share-link { color: var(--weda-blog-blue-700); }
.weda-article .weda-article__share-link:hover { color: rgba(0, 0, 0, .7); }  /* survol gris lisible (pas de pastille) — BugHerd #29 */
.weda-article .weda-article__breadcrumb a { color: rgba(56, 67, 208, .3); }
.weda-article .weda-article__breadcrumb a:hover { color: var(--weda-blog-blue-700); }

/* État survol des liens de contenu en page détail (soulignement renforcé).
   Sélecteur aligné sur la règle de base (0,8,1) pour battre `.breakdance a:hover`. */
.weda-article__content a:not(.weda-cta__button):not(.weda-btn-preview):not(.weda-encart__button):not(.weda-telechargement__button):not(.weda-card__cta):not(.weda-hub__bandeau-cta):hover {
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
