/* ==============================================
   article.css — Strate design system
   ============================================== */

/* ===== Base ===== */
body {
  background: #0a0a0b;
  letter-spacing: 0.01em;
  line-height: 1.75;
}

::selection {
  background: rgba(99, 102, 241, 0.3);
  color: #fff;
}

/* ===== Headings ===== */
h1, h2, h3 {
  letter-spacing: -0.02em;
}

/* ==============================================
   READING PROGRESS BAR
   ============================================== */
.reading-progress {
  position: fixed;
  top: 64px; /* below nav */
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, #6366f1, #a78bfa);
  width: 0%;
  z-index: 49;
  transition: width 0.1s linear;
}

/* ==============================================
   ARTICLE CONTENT — typography
   ============================================== */
.article-content {
  font-size: 1.08rem;
  line-height: 1.78;
  color: #9ca3af;
}

.article-content p {
  margin-bottom: 1.2em;
}

.article-content p:last-child {
  margin-bottom: 0;
}

/* ===== Drop cap ===== */
.dropcap::first-letter {
  font-family: 'Playfair Display', serif;
  float: left;
  font-size: 4.5rem;
  line-height: 0.8;
  margin-top: 0.15em;
  margin-right: 0.12em;
  color: #6366f1;
}

/* ==============================================
   ARTICLE SECTIONS — visual rhythm
   ============================================== */

/* Section reveal */
.article-content section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.article-content section.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Section heading — accent bar */
.article-content section h2 {
  position: relative;
  padding-left: 1rem;
}

.article-content section h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.15em;
  width: 3px;
  height: 1.2em;
  background: #6366f1;
  border-radius: 2px;
}

/* ==============================================
   PULL-QUOTE — breaks out of column
   ============================================== */
.pull-quote {
  position: relative;
  margin: 3.5rem -2rem;
  padding: 2.5rem 2rem 2.5rem 2.5rem;
  border-left: 3px solid #6366f1;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, transparent 60%);
  border-radius: 0 1rem 1rem 0;
}

.pull-quote p {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 1.5rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0;
}

.pull-quote::before {
  content: '"';
  position: absolute;
  top: -0.2em;
  left: 0.5rem;
  font-family: 'Playfair Display', serif;
  font-size: 4rem;
  color: rgba(99, 102, 241, 0.2);
  line-height: 1;
}

/* ==============================================
   NUMBERED CARDS — enhanced with counter & badges
   ============================================== */
.num-list {
  counter-reset: num-counter;
  list-style: none;
  padding: 0;
  margin: 2rem 0;
}

.num-card {
  counter-increment: num-counter;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem;
  background: #111113;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: border-color 0.3s ease,
              transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              background 0.3s ease,
              box-shadow 0.3s ease;
  /* stagger reveal */
  opacity: 0;
  transform: translateY(12px);
}

.revealed .num-card,
.num-card.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* stagger delays */
.num-card:nth-child(1) { transition-delay: 0s; }
.num-card:nth-child(2) { transition-delay: 0.07s; }
.num-card:nth-child(3) { transition-delay: 0.14s; }
.num-card:nth-child(4) { transition-delay: 0.21s; }
.num-card:nth-child(5) { transition-delay: 0.28s; }

.num-card:hover {
  border-color: rgba(99, 102, 241, 0.25);
  transform: translateX(4px);
  background: #141416;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.08);
}

.num-card:focus-within {
  border-color: rgba(99, 102, 241, 0.4);
  outline: none;
}

/* Badge numéro — cercle dégradé */
.num-card .num {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #818cf8);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
  font-family: 'Source Serif 4', serif;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.3s ease;
}

.num-card:hover .num {
  transform: scale(1.1) rotate(-3deg);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.45);
}

.num-card p {
  font-size: 0.9rem;
  color: #d1d5db;
  margin-bottom: 0;
  line-height: 1.5;
}

/* ==============================================
   INLINE LIST — lightweight alternative
   ============================================== */
.inline-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.inline-list li {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: #d1d5db;
  line-height: 1.55;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: color 0.3s ease;
}

.inline-list li:last-child {
  border-bottom: none;
}

.inline-list li:hover {
  color: #fff;
}

.inline-list li::before {
  content: '';
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #818cf8);
  box-shadow: 0 0 6px rgba(99, 102, 241, 0.4);
  position: relative;
  top: 0.1em;
}

/* ==============================================
   STAT GRID — data visualization blocks
   ============================================== */
.stat-grid {
  display: grid;
  gap: 1px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 1rem;
  overflow: hidden;
  margin: 3rem 0;
}

.stat-grid .stat-cell {
  background: #111113;
  padding: 1.5rem;
  transition: background 0.3s ease;
}

.stat-grid .stat-cell:hover {
  background: #161618;
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.12);
}

/* a11y: contraste amélioré pour les labels de stats — text-gray-500 (#6b7280) a un ratio ~3.5:1 sur #111113, insuffisant pour du texte normal */
.stat-cell .stat-label {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #9ca3af; /* gray-400 — ratio ~5.5:1 sur #111113 */
  font-family: 'Source Serif 4', serif;
  margin-bottom: 0.5rem;
}

.stat-cell .stat-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
}

/* ==============================================
   TAKEAWAY BOX — enhanced
   ============================================== */
.takeaway-box {
  position: relative;
  background: rgba(99, 102, 241, 0.04);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 1rem;
  padding: 2rem;
  overflow: hidden;
}

.takeaway-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #a78bfa, #6366f1);
}

.takeaway-box .takeaway-icon {
  position: absolute;
  top: 1rem;
  right: 1rem;
  opacity: 0.08;
}

.takeaway-box:hover {
  border-color: rgba(99, 102, 241, 0.25);
  box-shadow: 0 0 40px rgba(99, 102, 241, 0.06);
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

/* ==============================================
   RELATED ARTICLES GRID
   ============================================== */
.related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-top: 2rem;
}

.related-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.75rem;
  background: linear-gradient(160deg, #111113 0%, #0e0e10 100%);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 1rem;
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.35s ease;
}

.related-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.3), transparent);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.related-card:hover {
  transform: translateY(-6px);
  border-color: rgba(99, 102, 241, 0.2);
  box-shadow: 0 16px 40px rgba(99, 102, 241, 0.1),
              0 0 0 1px rgba(99, 102, 241, 0.08);
}

.related-card:hover::before {
  opacity: 1;
}

.related-card .related-tag {
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #a5b4fc;
  margin-bottom: 0.75rem;
}

.related-card .related-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.related-card .related-excerpt {
  font-size: 0.82rem;
  color: #9ca3af;
  line-height: 1.55;
  margin-bottom: 1.25rem;
}

.related-card .related-cta {
  font-size: 0.75rem;
  font-weight: 700;
  color: #a5b4fc;
  letter-spacing: 0.05em;
  transition: color 0.3s ease, gap 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.related-card:hover .related-cta {
  color: #818cf8;
  gap: 0.6rem;
}

/* ==============================================
   ARTICLE H3 — subtle accent
   ============================================== */
.article-content section h3 {
  position: relative;
  padding-left: 0.85rem;
}

.article-content section h3::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.2em;
  width: 3px;
  height: 1em;
  background: rgba(99, 102, 241, 0.4);
  border-radius: 2px;
}

/* ==============================================
   QUESTION BLOCK — gradient card
   ============================================== */
.question-block {
  background: linear-gradient(180deg, #111113 0%, #0a0a0b 100%);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 1rem;
  padding: 2rem;
  margin: 3rem 0;
}

.question-block .question-item {
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-style: italic;
  font-size: 0.95rem;
  color: #9ca3af;
}

.question-block .question-item:last-child {
  border-bottom: none;
  color: #a5b4fc;
  font-weight: 700;
}

/* ==============================================
   SHARE BUTTON — hover
   ============================================== */
.share-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.share-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-2px);
}

.share-btn svg {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
  color: #9ca3af;
  transition: color 0.3s ease;
}

.share-btn:hover svg {
  color: #fff;
}

/* ==============================================
   SCROLL REVEAL SYSTEM (homepage)
   ============================================== */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}

[data-reveal-delay="1"] { transition-delay: 0.1s; }
[data-reveal-delay="2"] { transition-delay: 0.2s; }
[data-reveal-delay="3"] { transition-delay: 0.3s; }
[data-reveal-delay="4"] { transition-delay: 0.4s; }

/* ==============================================
   HOMEPAGE COMPONENTS
   ============================================== */

/* Article cards */
.article-card {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.4s ease;
}

.article-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.15);
}

.card-icon {
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.article-card:hover .card-icon {
  transform: scale(1.2) rotate(2deg);
}

.card-bg {
  transition: opacity 0.5s ease;
  opacity: 1;
}

.article-card:hover .card-bg {
  opacity: 0.65;
}

/* CTA buttons */
.btn-primary {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(99, 102, 241, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.05);
}

.btn-secondary:active {
  transform: translateY(0);
}

/* Mobile menu */
#mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.3s ease;
  opacity: 0;
}

#mobile-menu.menu-open {
  max-height: 320px;
  opacity: 1;
}

/* Newsletter messages */
.form-msg {
  transition: opacity 0.4s ease, transform 0.4s ease;
  opacity: 0;
  transform: translateY(8px);
}

.form-msg.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Social icons */
.social-icon {
  transition: color 0.3s ease, transform 0.3s ease;
}

.social-icon:hover {
  color: #6366f1;
  transform: translateY(-2px);
}

/* Nav active link */
nav a.nav-active {
  color: #fff;
  position: relative;
}

nav a.nav-active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 2px;
  background: #6366f1;
  border-radius: 1px;
}

/* Spinner */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  animation: spin 0.6s linear infinite;
}

/* ==============================================
   MOBILE (<768px)
   ============================================== */
@media (max-width: 767px) {
  /* Article typography */
  .article-content {
    font-size: 1rem;
    line-height: 1.72;
  }

  .dropcap::first-letter {
    font-size: 3.2rem;
  }

  /* Pull-quote — no breakout on mobile */
  .pull-quote {
    margin-left: 0;
    margin-right: 0;
    margin-top: 2.5rem;
    margin-bottom: 2.5rem;
    padding: 1.5rem 1.25rem 1.5rem 1.5rem;
  }

  .pull-quote p {
    font-size: 1.2rem;
  }

  .pull-quote::before {
    font-size: 3rem;
  }

  /* Section heading bar — thinner */
  .article-content section h2 {
    padding-left: 0.75rem;
    font-size: 1.5rem;
  }

  /* Numbered cards — no hover translate on mobile */
  .num-card:hover {
    transform: none;
    box-shadow: none;
  }

  .num-card:hover .num {
    transform: none;
  }

  .num-card .num {
    width: 2rem;
    height: 2rem;
    font-size: 0.75rem;
  }

  /* Stat grid — 2 cols on mobile */
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Related grid — stack on mobile */
  .related-card:hover {
    transform: none;
    box-shadow: none;
  }

  /* Takeaway box */
  .takeaway-box {
    padding: 1.5rem;
  }

  /* Lighter reveal */
  [data-reveal],
  .article-content section {
    transform: translateY(16px);
  }

  /* Disable hover lifts on touch */
  .article-card:hover {
    transform: none;
    box-shadow: none;
  }

  .btn-primary:hover,
  .btn-secondary:hover {
    transform: none;
    box-shadow: none;
  }

  .share-btn:hover {
    transform: none;
  }
}

/* ==============================================
   DESKTOP (≥768px)
   ============================================== */
@media (min-width: 768px) {
  .article-content {
    font-size: 1.12rem;
    line-height: 1.82;
  }

  .pull-quote {
    margin-left: -3rem;
    margin-right: -3rem;
  }

  .pull-quote p {
    font-size: 1.6rem;
  }

  .stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .related-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .takeaway-box {
    padding: 2.5rem 3rem;
  }
}

/* ==============================================
   LARGE DESKTOP (≥1024px)
   ============================================== */
@media (min-width: 1024px) {
  .pull-quote {
    margin-left: -4rem;
    margin-right: -4rem;
    padding: 3rem 3rem 3rem 3.5rem;
  }
}

/* ==============================================
   REDUCED MOTION
   ============================================== */
@media (prefers-reduced-motion: reduce) {
  [data-reveal],
  .article-content section {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .article-card,
  .btn-primary,
  .btn-secondary,
  .card-icon,
  .card-bg,
  .social-icon,
  .num-card,
  .num-card .num,
  .share-btn,
  .stat-grid .stat-cell {
    transition: none;
  }

  .num-card {
    opacity: 1;
    transform: none;
  }

  .article-card:hover,
  .num-card:hover,
  .num-card:hover .num,
  .related-card:hover,
  .share-btn:hover {
    transform: none;
  }

  .reading-progress {
    transition: none;
  }
}
