/* =====================================================
   MOVAWAY — PAGE ARTICLE (blog post)
   Layout : hero plein-largeur avec image + titre overlay,
   puis 2 colonnes (article body + sidebar TOC sticky).
   ===================================================== */

/* ============ HERO ARTICLE ============ */
.article-hero {
  position: relative;
  min-height: 480px;
  display: flex;
  align-items: flex-end;
  background: var(--ink);
  overflow: hidden;
  isolation: isolate;
}
.article-hero-image {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.article-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
/* Overlay dégradé sombre → assure la lisibilité du texte blanc en bas */
.article-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(0, 8, 56, 0.1) 0%, rgba(0, 8, 56, 0.85) 100%);
}
.article-hero-content {
  position: relative;
  width: 100%;
  padding-top: 80px;
  padding-bottom: 50px;
  color: #fff;
  text-align: center;       /* centre tous les éléments du hero */
}

/* Fil d'Ariane (centré) */
.article-breadcrumb {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 22px;
}
.article-breadcrumb a {
  color: inherit;
  text-decoration: none;
  transition: color .15s ease;
}
.article-breadcrumb a:hover { color: #fff; text-decoration: underline; }
.article-breadcrumb span { color: rgba(255, 255, 255, 0.5); }

/* Pastille catégorie */
.article-category {
  display: inline-block;
  padding: 5px 14px;
  background: var(--primary-cta);
  color: #fff;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 18px;
  box-shadow: 0 4px 12px rgba(41, 124, 255, 0.4);
}

/* Titre H1 (centré) */
.article-title {
  font-size: clamp(1.8rem, 1.3rem + 2.2vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.15;
  margin: 0 auto 24px;
  color: #fff;
  max-width: 900px;
}

/* Meta (auteur, date, temps de lecture) — centrée */
.article-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
}
.article-author a {
  color: #fff;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.article-author a:hover { color: var(--primary-soft); }
.article-dot { color: rgba(255, 255, 255, 0.5); }
.article-readtime {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ============ LAYOUT : article + sidebar ============ */
.article-section {
  padding: 60px 0 80px;
  background: #fff;
}
/* Layout : utilise toute la largeur du .container (1640px global, comme les
   autres pages). La colonne article (1fr) remplit toute la place jusqu'à la
   sidebar — pas de cap interne, pas d'espace vide entre les deux. */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 32px;
  align-items: start;
}

/* ============ ARTICLE BODY ============
   Pas de max-width ici : la cellule grid (.article-layout - sidebar - gap)
   contraint naturellement à ~760px. Pas de double constraint = pas de gap parasite. */
.article-main {
  color: var(--ink);
  min-width: 0;          /* nécessaire dans grid pour éviter overflow horizontal */
}
.article-main p,
.article-main li {
  font-size: 1.0625rem;       /* ~17px — confort de lecture longue */
  line-height: 1.75;
  color: var(--ink);
  margin: 0 0 1.4em;
}
.article-main p strong { font-weight: 700; }
.article-main p:first-of-type {
  font-size: 1.15rem;
  line-height: 1.65;
  color: var(--ink);
  font-weight: 500;
}

/* Titres internes */
.article-main h2 {
  font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.6px;
  line-height: 1.25;
  margin: 2.4em 0 0.7em;
  color: var(--ink);
  scroll-margin-top: 100px;   /* ancre du TOC ne tape pas sous le header */
}
.article-main h3 {
  font-size: clamp(1.15rem, 1rem + 0.6vw, 1.4rem);
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1.3;
  margin: 1.8em 0 0.5em;
  color: var(--ink);
  scroll-margin-top: 100px;
}

/* Le tout premier H2 doit avoir moins de marge top */
.article-main > h2:first-child,
.article-main > p:first-child + h2 {
  margin-top: 1.6em;
}

/* Listes */
.article-main ul,
.article-main ol {
  margin: 0 0 1.4em;
  padding-left: 0;
  list-style: none;
}
.article-main li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 0.6em;
}
.article-main ul > li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}
.article-main ol {
  counter-reset: article-step;
}
.article-main ol > li {
  counter-increment: article-step;
}
.article-main ol > li::before {
  content: counter(article-step) ".";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--primary);
  font-weight: 800;
  font-size: 0.95em;
}
/* Évite les puces sur les <p> à l'intérieur des <li> Slate */
.article-main li > p {
  margin-bottom: 0.3em;
  font-size: inherit;
}

/* Liens dans le texte */
.article-main a:not(.btn) {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(41, 124, 255, 0.4);
  transition: color .15s ease, text-decoration-color .15s ease;
  font-weight: 600;
}
.article-main a:not(.btn):hover {
  color: var(--primary-dark);
  text-decoration-color: var(--primary-dark);
}

/* Images dans le contenu */
.article-main img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--border-radius);
  margin: 1.6em 0;
  box-shadow: var(--shadow-sm);
}

/* ============ VIDÉOS INTÉGRÉES (YouTube, Vimeo…) ============
   Pleine largeur de la colonne + au moins 400px de haut. Couvre l'iframe brut
   ET l'enveloppe Gutenberg (wp-block-embed). On neutralise le « padding-hack »
   des responsive-embeds pour piloter la taille via aspect-ratio + min-height. */
.article-main figure.wp-block-embed {
  margin: 1.6em 0;
  width: 100%;
  max-width: 100%;
}
.article-main .wp-block-embed__wrapper {
  margin: 0;
  width: 100%;
  max-width: 100%;
}
.article-main .wp-block-embed.wp-has-aspect-ratio .wp-block-embed__wrapper::before {
  content: none; /* supprime le calage par padding-top */
}
.article-main iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 400px;          /* pleine largeur, 400px de haut */
  position: static;       /* annule le position:absolute du padding-hack */
  border: 0;
  border-radius: var(--border-radius);
  margin: 1.6em 0;
  box-shadow: var(--shadow-sm);
  background: #000;
}
/* Dans l'enveloppe Gutenberg, l'iframe ne cumule pas la marge du <figure>. */
.article-main .wp-block-embed__wrapper iframe { margin: 0; }

/* ============ TABLEAUX ============
   Enveloppés par le filtre the_content dans <figure class="article-table">.
   Le tableau remplit la colonne ; s'il est trop large, il défile à l'intérieur
   de ce conteneur au lieu de déborder sous la sidebar. */
.article-main .article-table {
  margin: 1.8em 0;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;   /* défilement fluide iOS */
  border-radius: var(--border-radius);
  border: 1px solid var(--border);
}
.article-main table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  font-size: 0.98rem;
  line-height: 1.5;
  background: #fff;
}
.article-main .article-table table { margin: 0; }
.article-main th,
.article-main td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}
.article-main thead th {
  background: var(--bg-soft, #EFF1F4);
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
}
.article-main tbody tr:last-child td { border-bottom: 0; }
.article-main tbody tr:nth-child(even) { background: rgba(0, 0, 0, 0.015); }

/* Citations (au cas où) */
.article-main blockquote {
  margin: 1.8em 0;
  padding: 20px 26px;
  background: #EFF1F4;
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  font-style: italic;
  color: var(--ink);
}

/* Code inline (au cas où) */
.article-main code {
  padding: 2px 8px;
  background: var(--bg-soft);
  border-radius: 4px;
  font-size: 0.95em;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  color: var(--primary-dark);
}

/* ============ SIDEBAR ============ */
.article-sidebar {
  position: sticky;
  top: calc(var(--header-h, 86px) + 20px);
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-self: start;
  /* max-height + overflow gérés naturellement par sticky */
}

/* Table des matières — uniquement les H2, donc liste courte, pas de scroll interne */
.article-toc {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 22px 24px;
}
.article-toc-title {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary-soft);
}
.article-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.article-toc-list li {
  border-left: 2px solid var(--border);
  padding: 4px 0 4px 12px;
  margin-left: 0;
  transition: border-color .2s ease;
}
.article-toc-list li:hover {
  border-color: var(--primary);
}
.article-toc-list li.is-active {
  border-color: var(--primary);
  border-width: 3px;
}
.article-toc-h2 a {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.4;
  display: block;
}
.article-toc-list a:hover { color: var(--primary); }
.article-toc-list li.is-active > a {
  color: var(--primary);
  font-weight: 800;
}

/* CTA sidebar : carte brand */
.article-cta {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border-radius: var(--border-radius);
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.article-cta::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -20%;
  width: 70%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
  pointer-events: none;
}
.article-cta-eyebrow {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
  position: relative;
}
.article-cta h3 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1.25;
  margin: 0 0 10px;
  color: #fff;
  position: relative;
}
.article-cta p {
  font-size: 13.5px;
  line-height: 1.55;
  margin: 0 0 16px;
  color: rgba(255, 255, 255, 0.92);
  position: relative;
}
.article-cta .btn {
  background: #fff;
  color: var(--primary);
  padding: 12px 22px;
  font-size: 13.5px;
  width: 100%;
  justify-content: center;
  position: relative;
}
.article-cta .btn:hover {
  background: var(--ink);
  color: #fff;
}

/* ============ COMMENTAIRES (zone pleine largeur sous l'article) ============ */
.article-comments {
  margin-top: 60px;
  padding-top: 50px;
  border-top: 1px solid var(--border);
}
.article-comments-title {
  font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.8rem);
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 0 0 32px;
  color: var(--ink);
}
.article-comments-count {
  color: var(--ink-soft);
  font-weight: 600;
  margin-left: 4px;
}

/* ---- Liste des commentaires ---- */
.article-comments-list {
  list-style: none;
  margin: 0 0 50px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.article-comment {
  display: flex;
  gap: 16px;
  padding: 20px 22px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.article-comment:hover {
  border-color: rgba(41, 124, 255, 0.25);
  box-shadow: 0 4px 14px rgba(0, 8, 56, 0.04);
}

/* Avatar : initiale dans un cercle bleu brand par défaut */
.article-comment-avatar {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary-cta);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  overflow: hidden;        /* clip l'image au cercle */
  position: relative;
}
/* Variant avec photo : l'image remplit le cercle, le fond bleu reste en fallback
   (visible quelques ms le temps que l'image charge) */
.article-comment-avatar-img {
  background: var(--bg-soft);     /* gris neutre pendant le chargement */
}
.article-comment-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Badge "Vérifié" à côté du nom (forme étoile pour distinguer du tag-pill standard) */
.article-comment-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px 3px 6px;
  background: rgba(41, 124, 255, 0.1);
  color: var(--primary);
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.article-comment-badge svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.article-comment-body {
  flex: 1;
  min-width: 0;
}
.article-comment-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.article-comment-author {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.2px;
}
.article-comment-date {
  font-size: 12.5px;
  color: var(--ink-soft);
  font-weight: 500;
}
.article-comment-text {
  margin: 0 0 10px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
}
.article-comment-reply {
  background: transparent;
  border: 0;
  padding: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  letter-spacing: -0.1px;
  transition: color .15s ease;
}
.article-comment-reply:hover {
  color: var(--primary-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---- Formulaire de nouveau commentaire ---- */
.article-comment-form-wrap {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 28px 26px;
}
.article-comment-form-title {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin: 0 0 6px;
  color: var(--ink);
}
.article-comment-form-note {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0 0 22px;
  line-height: 1.5;
}
.article-comment-req {
  color: #F97316;
  font-weight: 700;
  font-size: 0.8em;
  vertical-align: top;
  margin-left: 2px;
}

.article-comment-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.article-comment-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.article-comment-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.article-comment-field label {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  transition: color .2s ease;
}
.article-comment-field:hover label,
.article-comment-field:focus-within label {
  color: var(--primary);
}
.article-comment-field input,
.article-comment-field textarea {
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  background: #EFF1F4;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 14px 16px;
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
  width: 100%;
}
.article-comment-field input:hover,
.article-comment-field textarea:hover { background: #E5E9F0; }
.article-comment-field input:focus,
.article-comment-field textarea:focus {
  outline: none;
  background: #fff;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(41, 124, 255, 0.15);
}
.article-comment-field textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.55;
}
.article-comment-submit {
  margin-top: 6px;
}
.article-comment-submit .btn {
  padding: 14px 26px;
  font-size: 14px;
}

/* ============ ARTICLES SUGGÉRÉS ============ */
.article-related {
  background: #EFF1F4;
  padding: 80px 0;
}
.article-related-title {
  text-align: center;
  font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.8px;
  margin: 0 0 40px;
}
.article-related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  max-width: 1100px;
  margin: 0 auto;
}
/* Card : <article> non-cliquable. Le lien <a> est uniquement sur le titre,
   mais étendu à toute la card via ::after (pattern "stretched link") */
.article-related-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
  color: var(--ink);
}
.article-related-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.article-related-img {
  position: relative;
  aspect-ratio: 16 / 10.5;
  overflow: hidden;
}
.article-related-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}
.article-related-card:hover .article-related-img img {
  transform: scale(1.04);
}
.article-related-cat {
  position: absolute;
  bottom: 12px;
  left: 12px;
  padding: 4px 10px;
  background: var(--primary-cta);
  color: #fff;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  z-index: 2;       /* devant le link étendu pour rester non-cliquable */
}
.article-related-card h3 {
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.35;
  margin: 0;
  padding: 0 22px 22px;
  letter-spacing: -0.2px;
}
.article-related-card h3 a {
  color: var(--ink);
  text-decoration: none;
  transition: color .15s ease;
}
.article-related-card:hover h3 a { color: var(--primary); }
/* Stretched link : le ::after du <a> couvre toute la card → clic partout */
.article-related-card h3 a::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}
/* Focus visible quand on tabule au clavier (a11y) */
.article-related-card h3 a:focus-visible::after {
  outline: 2px solid var(--primary);
  outline-offset: -4px;
  border-radius: var(--border-radius);
}
.article-related-cta {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 1100px) {
  .article-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .article-sidebar {
    position: static;
    top: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-self: stretch;
  }
  .article-related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .article-hero { min-height: 360px; }
  .article-hero-content { padding-top: 50px; padding-bottom: 40px; }
  .article-section { padding: 40px 0 60px; }
  .article-sidebar { grid-template-columns: 1fr; }
  .article-main p:first-of-type { font-size: 1.05rem; }
  .article-related { padding: 60px 0; }
  .article-related-grid { grid-template-columns: 1fr; }
  /* Commentaires : form 1 col, comment avec padding réduit */
  .article-comment { padding: 16px 18px; gap: 12px; }
  .article-comment-avatar { width: 38px; height: 38px; font-size: 0.95rem; }
  .article-comment-form-wrap { padding: 22px 18px; }
  .article-comment-row { grid-template-columns: 1fr; gap: 14px; }
}
