/* ============================================================
   ARTICLE LAYOUT : design premium, partage entre tous les articles
   Depend de aqua-theme.css (header, footer, click splash, etc.)
   ============================================================ */

/* Reset article-only */
.article-page {
  background:
    radial-gradient(ellipse at 0% 0%, rgba(186, 230, 253, 0.30) 0%, transparent 45%),
    radial-gradient(ellipse at 100% 30%, rgba(125, 211, 252, 0.18) 0%, transparent 40%),
    var(--bg, #F5F7FD);
}

/* ===== Reading progress bar (fixed top) ===== */
.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--grad-aqua, linear-gradient(135deg, #0EA5E9, #38BDF8, #7DD3FC));
  z-index: 3000;
  transition: width 0.1s linear;
  box-shadow: 0 0 8px rgba(14, 165, 233, 0.5);
}

/* ===== Page-header (article hero compact) ===== */
.article-header {
  position: relative;
  width: 100%;
  padding: 130px 6vw 60px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 0% 0%, rgba(56, 189, 248, 0.45) 0%, transparent 55%),
    radial-gradient(ellipse at 100% 50%, rgba(125, 211, 252, 0.32) 0%, transparent 50%),
    linear-gradient(180deg, #F0F9FF 0%, #E0F2FE 100%);
}
.article-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(14, 165, 233, 0.18) 1px, transparent 0);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, transparent 0%, #000 25%, #000 90%, transparent 100%);
  pointer-events: none;
  opacity: 0.5;
}
.article-header-inner {
  position: relative;
  max-width: 820px;
  margin: 0 auto;
  z-index: 2;
}

.article-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--cyan) !important;
  font-weight: 700;
  margin-bottom: 18px;
  transition: gap 0.2s ease, color 0.2s ease;
}
.article-back:hover { gap: 10px; }
.article-back svg { width: 16px; height: 16px; }

.article-tag {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--grad-aqua, linear-gradient(135deg, #0EA5E9, #38BDF8, #7DD3FC));
  color: #fff !important;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  margin-bottom: 16px;
  box-shadow: 0 8px 22px -6px rgba(14, 165, 233, 0.5);
}

.article-title {
  font-size: clamp(30px, 5vw, 52px);
  font-weight: 800;
  color: var(--blue);
  line-height: 1.12;
  letter-spacing: -0.025em;
  margin-bottom: 22px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 13.5px;
  color: var(--text-soft);
  font-weight: 600;
  flex-wrap: wrap;
}
.article-meta span { display: inline-flex; align-items: center; gap: 6px; }
.article-meta svg { width: 15px; height: 15px; color: var(--cyan); }
.article-meta .meta-author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-right: 18px;
  border-right: 1px solid rgba(2, 24, 51, 0.14);
}
.meta-author-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--grad-aqua);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.04em;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.35);
}

/* ===== Layout : article + sidebar TOC + share bar ===== */
.article-layout {
  display: grid;
  grid-template-columns: 60px 1fr 220px;
  gap: 30px;
  max-width: 1140px;
  margin: 0 auto;
  padding: 50px 6vw 60px;
  align-items: start;
}
@media (max-width: 1080px) {
  .article-layout { grid-template-columns: 1fr; gap: 20px; padding: 40px 5vw 50px; }
  .article-share, .article-toc { display: none !important; }
}

/* ===== Share bar (gauche, sticky desktop) ===== */
.article-share {
  position: sticky;
  top: 110px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.article-share-label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-soft);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  margin-bottom: 8px;
}
.article-share a, .article-share button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid rgba(2, 24, 51, 0.10);
  box-shadow: 0 6px 16px -6px rgba(2, 24, 51, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--blue) !important;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.article-share a:hover, .article-share button:hover {
  transform: translateY(-3px);
  background: var(--grad-aqua);
  color: #fff !important;
  border-color: transparent;
  box-shadow: 0 12px 24px -6px rgba(14, 165, 233, 0.5);
}
.article-share svg { width: 18px; height: 18px; }

/* ===== Article body ===== */
.article-body {
  font-size: 16px;
  line-height: 1.78;
  color: var(--text-main, #1A2233);
  max-width: 720px;
  margin: 0 auto;
}
.article-body p {
  margin-bottom: 22px;
}
.article-body strong { color: var(--blue); font-weight: 700; }
.article-body em { color: #0a2954; }
.article-body a:not(.btn-primary):not(.article-back) {
  color: var(--cyan) !important;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(14, 165, 233, 0.35);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s ease;
}
.article-body a:not(.btn-primary):not(.article-back):hover {
  text-decoration-color: var(--cyan);
}

/* Paragraphe d'intro (lead) */
.article-lead {
  font-size: 19px !important;
  line-height: 1.65 !important;
  color: var(--blue) !important;
  font-weight: 500;
  margin-bottom: 30px !important;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(2, 24, 51, 0.08);
}

/* Drop cap sur le premier paragraphe */
.article-body > p:first-of-type::first-letter,
.article-body > .article-lead::first-letter {
  float: left;
  font-size: 64px;
  line-height: 0.9;
  font-weight: 900;
  color: var(--cyan);
  margin: 6px 12px 0 0;
  font-family: "Poppins", system-ui, sans-serif;
  background: var(--grad-aqua);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* H2 numerotes avec barre cyan */
.article-body { counter-reset: h2counter; }
.article-body h2 {
  counter-increment: h2counter;
  position: relative;
  font-size: clamp(22px, 3.6vw, 30px);
  font-weight: 800;
  color: var(--blue);
  margin: 50px 0 18px;
  letter-spacing: -0.015em;
  padding-left: 0;
  scroll-margin-top: 110px;
}
.article-body h2::before {
  content: counter(h2counter, decimal-leading-zero);
  display: block;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.20em;
  color: var(--cyan);
  margin-bottom: 8px;
  font-feature-settings: "tnum" 1;
}

.article-body h3 {
  position: relative;
  font-size: 19px;
  font-weight: 800;
  color: var(--blue);
  margin: 32px 0 12px;
  padding-left: 18px;
}
.article-body h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--grad-aqua);
}

/* Listes : bullets cyan en losange */
.article-body ul,
.article-body ol {
  margin: 0 0 24px 0;
  padding-left: 0;
  list-style: none;
}
.article-body ul li,
.article-body ol li {
  position: relative;
  padding-left: 28px;
  margin-bottom: 10px;
}
.article-body ul li::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 11px;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--grad-aqua);
  transform: rotate(45deg);
}
.article-body ol {
  counter-reset: olcounter;
}
.article-body ol li {
  counter-increment: olcounter;
}
.article-body ol li::before {
  content: counter(olcounter);
  position: absolute;
  left: 0;
  top: 1px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--grad-aqua);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(14, 165, 233, 0.35);
}

/* Blockquote premium */
.article-body blockquote {
  position: relative;
  margin: 40px 0;
  padding: 30px 32px 30px 64px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.06) 0%, rgba(125, 211, 252, 0.10) 100%);
  border-left: 4px solid var(--cyan);
  border-radius: 0 18px 18px 0;
  font-size: 18px;
  line-height: 1.6;
  color: var(--blue);
  font-style: italic;
  font-weight: 500;
}
.article-body blockquote::before {
  content: "“";
  position: absolute;
  top: 4px;
  left: 18px;
  font-size: 64px;
  line-height: 1;
  color: var(--cyan);
  font-style: normal;
  font-weight: 900;
  font-family: Georgia, serif;
}
.article-body blockquote p:last-child { margin-bottom: 0; }

/* Section divider */
.article-body hr,
.article-divider {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(14, 165, 233, 0.35) 50%, transparent 100%);
  margin: 40px 0;
}

/* ===== TOC sticky (droite, desktop) ===== */
.article-toc {
  position: sticky;
  top: 110px;
  padding: 18px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(2, 24, 51, 0.06);
  box-shadow: 0 12px 28px -10px rgba(2, 24, 51, 0.10);
  font-size: 12.5px;
}
.article-toc-title {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 14px;
}
.article-toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: toccounter;
}
.article-toc li {
  counter-increment: toccounter;
  position: relative;
  margin-bottom: 10px;
  padding-left: 22px;
}
.article-toc li::before {
  content: counter(toccounter, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  font-size: 10.5px;
  font-weight: 800;
  color: var(--text-soft);
  font-feature-settings: "tnum" 1;
  transition: color 0.2s ease;
}
.article-toc a {
  color: var(--text-main) !important;
  font-weight: 600;
  line-height: 1.4;
  transition: color 0.2s ease;
  display: block;
}
.article-toc a:hover { color: var(--cyan) !important; }
.article-toc li.active::before { color: var(--cyan); }
.article-toc li.active a { color: var(--cyan) !important; }

/* ===== Author byline ===== */
.article-byline {
  max-width: 720px;
  margin: 50px auto 0;
  padding: 26px 28px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid rgba(2, 24, 51, 0.08);
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: 0 10px 26px -10px rgba(2, 24, 51, 0.12);
}
.article-byline-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--grad-aqua);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.06em;
  flex-shrink: 0;
  box-shadow: 0 8px 22px -6px rgba(14, 165, 233, 0.5);
}
.article-byline-text { font-size: 13.5px; line-height: 1.55; color: var(--text-soft); }
.article-byline-text strong { color: var(--blue); display: block; font-size: 14.5px; margin-bottom: 2px; }

/* ===== CTA finale ===== */
.article-cta {
  max-width: 720px;
  margin: 40px auto 60px;
  padding: 38px 32px;
  border-radius: 24px;
  background: var(--grad-aqua);
  color: #fff;
  text-align: center;
  box-shadow: 0 30px 60px -16px rgba(14, 165, 233, 0.45);
  position: relative;
  overflow: hidden;
}
.article-cta::before {
  content: "";
  position: absolute;
  top: -50%; right: -20%;
  width: 60%; height: 200%;
  background: radial-gradient(ellipse, rgba(255,255,255,0.2) 0%, transparent 65%);
  pointer-events: none;
}
.article-cta h3 {
  color: #fff !important;
  font-size: clamp(20px, 3vw, 24px);
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}
.article-cta p {
  color: rgba(255,255,255,0.92);
  font-size: 14.5px;
  margin-bottom: 22px;
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}
.article-cta .btn-primary {
  background: #fff !important;
  color: var(--blue) !important;
  padding: 13px 28px !important;
  font-size: 14px !important;
  position: relative;
  z-index: 1;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18) !important;
}
.article-cta .btn-primary:hover { filter: brightness(1.04); }

/* ===== Articles connexes ===== */
.article-related {
  max-width: 1080px;
  margin: 0 auto 80px;
  padding: 0 6vw;
}
.article-related h3 {
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 800;
  color: var(--blue);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
  text-align: center;
}
.article-related h3 .kicker {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 8px;
}
.article-related p.intro {
  text-align: center;
  font-size: 13.5px;
  color: var(--text-soft);
  margin-bottom: 28px;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 880px) { .related-grid { grid-template-columns: 1fr; } }

.related-card {
  display: block;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(2, 24, 51, 0.08);
  box-shadow: 0 12px 28px -10px rgba(2, 24, 51, 0.12);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  text-decoration: none !important;
  color: inherit !important;
}
.related-card:hover {
  transform: translateY(-4px);
  border-color: var(--cyan);
  box-shadow: 0 22px 50px -14px rgba(14, 165, 233, 0.30);
}
.related-card .related-bar { height: 6px; background: var(--grad-aqua); }
.related-card .related-body { padding: 18px 20px 20px; }
.related-card .related-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.10);
  color: var(--cyan);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.related-card h4 {
  font-size: 15.5px;
  font-weight: 800;
  color: var(--blue);
  line-height: 1.35;
  margin-bottom: 8px;
}
.related-card .related-meta {
  font-size: 12px;
  color: var(--text-soft);
  font-weight: 600;
}

/* ===== Mobile : adjust article body ===== */
@media (max-width: 720px) {
  .article-header { padding: 105px 5vw 40px !important; }
  .article-title { font-size: clamp(24px, 7vw, 34px) !important; }
  .article-meta { font-size: 12.5px !important; gap: 10px !important; }
  .article-meta .meta-author { padding-right: 12px !important; }

  .article-body { font-size: 15.5px !important; line-height: 1.72 !important; }
  .article-body h2 { font-size: clamp(20px, 5.5vw, 26px) !important; margin: 36px 0 14px !important; }
  .article-body h3 { font-size: 17px !important; margin: 24px 0 10px !important; }
  .article-body blockquote {
    padding: 22px 22px 22px 50px !important;
    font-size: 16px !important;
    margin: 28px 0 !important;
  }
  .article-body blockquote::before { font-size: 50px !important; left: 14px !important; }

  .article-lead { font-size: 17px !important; padding-bottom: 22px !important; }
  .article-body > p:first-of-type::first-letter,
  .article-body > .article-lead::first-letter { font-size: 50px !important; margin: 4px 10px 0 0 !important; }

  .article-byline { padding: 20px 22px !important; gap: 14px !important; flex-direction: column; text-align: center; }
  .article-byline-avatar { width: 48px; height: 48px; }
  .article-cta { padding: 28px 22px !important; }
}

/* ===== Petit toast pour la copie de lien ===== */
.copy-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 16px 36px -10px rgba(2, 24, 51, 0.5);
  z-index: 4000;
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}
.copy-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
