/* ═══════════════════════════════════════════════════════
   ARTICLE TYPOGRAPHY
   ═══════════════════════════════════════════════════════ */
article h1 {
  font-size: 2.5rem;
  line-height: 1.3;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

article h2 {
  font-size: 1.8rem;
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-card);
  color: var(--text-primary);
}

article h3 {
  font-size: 1.4rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: #fff;
}

article p {
  margin-bottom: 1.5rem;
}

article ul,
article ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

article li {
  margin-bottom: 0.5rem;
}

blockquote {
  border-left: 4px solid var(--primary);
  padding-left: 20px;
  font-style: italic;
  color: var(--body-text);
  margin: 2rem 0;
  background: var(--bg-card);
  padding: 20px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ═══════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════ */
article table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.9rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-card);
}

article thead {
  background: rgba(112, 132, 255, 0.12);
}

article th {
  font-family: var(--font-sans);
  font-weight: 700;
  color: var(--text-primary);
  text-align: left;
  padding: 14px 18px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid rgba(112, 132, 255, 0.2);
}

article td {
  padding: 12px 18px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-card);
  vertical-align: top;
  line-height: 1.5;
}

article tbody tr:last-child td {
  border-bottom: none;
}

article tbody tr:hover {
  background: rgba(112, 132, 255, 0.04);
}

article td:first-child,
article th:first-child {
  font-weight: 600;
  color: rgba(244, 245, 251, 0.88);
}

@media (max-width: 640px) {
  article table {
    font-size: 0.8rem;
  }
  article th,
  article td {
    padding: 10px 12px;
  }
}

/* ═══════════════════════════════════════════════════════
   CODE BLOCKS
   ═══════════════════════════════════════════════════════ */
article pre {
  background: rgba(12, 20, 41, 0.9);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin: 1.5rem 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

article pre code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.7;
  color: #b4c0ff;
  background: none;
  padding: 0;
  border: none;
  border-radius: 0;
}

article code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: #b4c0ff;
  background: rgba(112, 132, 255, 0.1);
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid var(--border-card);
}

article pre::-webkit-scrollbar {
  height: 6px;
}
article pre::-webkit-scrollbar-track {
  background: rgba(244, 245, 251, 0.04);
  border-radius: 3px;
}
article pre::-webkit-scrollbar-thumb {
  background: rgba(112, 132, 255, 0.2);
  border-radius: 3px;
}
article pre::-webkit-scrollbar-thumb:hover {
  background: rgba(112, 132, 255, 0.35);
}

/* ═══════════════════════════════════════════════════════
   META INFO / DATE
   ═══════════════════════════════════════════════════════ */
.meta-info {
  font-size: 0.9rem;
  color: var(--body-text);
  margin-bottom: 40px;
  display: flex;
  gap: 20px;
}

.article-date {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  margin-bottom: 2rem;
}

/* ═══════════════════════════════════════════════════════
   CTA BOX
   ═══════════════════════════════════════════════════════ */
.cta-box {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 40px;
  margin: 60px 0;
  text-align: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.cta-box h3 {
  margin-top: 0;
  font-size: 1.8rem;
  color: var(--text-primary);
}

.btn-cta {
  display: inline-block;
  background: linear-gradient(135deg, #7084ff 0%, #5a6bf0 50%, #4a56d4 100%);
  border: 1px solid rgba(139, 156, 255, 0.3);
  color: #ffffff;
  padding: 16px 32px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
  margin-top: 20px;
  transition: all 0.3s var(--ease-premium);
  box-shadow:
    0 0 20px rgba(112, 132, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.btn-cta::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.12) 40%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0.12) 60%,
    transparent 100%
  );
  transform: translateX(-100%);
  transition: none;
}

.btn-cta:hover {
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, #8b9cff 0%, #7084ff 50%, #5a6bf0 100%);
  border-color: rgba(139, 156, 255, 0.5);
  box-shadow:
    0 0 30px rgba(112, 132, 255, 0.3),
    0 0 60px rgba(112, 132, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.btn-cta:hover::after {
  animation: btn-shimmer-guide 1s ease-in-out;
}

.btn-secondary {
  display: inline-block;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  margin-top: 15px;
  margin-left: 10px;
  border: 1px solid var(--border-card);
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: var(--primary-soft);
  text-decoration: none;
}

/* ═══════════════════════════════════════════════════════
   TABLE OF CONTENTS
   ═══════════════════════════════════════════════════════ */
.toc {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin: 0 0 2rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.toc-title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--primary-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.toc-title i {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.toc.collapsed .toc-title i {
  transform: rotate(-90deg);
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc.collapsed .toc-list {
  display: none;
}

.toc-list li {
  margin: 0;
  padding: 0;
}

.toc-list a {
  display: block;
  padding: 6px 0 6px 0;
  font-size: 0.88rem;
  color: var(--text-tertiary);
  text-decoration: none;
  transition:
    color 0.2s ease,
    padding-left 0.2s ease;
  border-left: 2px solid transparent;
  line-height: 1.4;
}

.toc-list a:hover {
  color: var(--primary-soft);
  padding-left: 8px;
  border-left-color: var(--primary);
}

.toc-list a.toc-h3 {
  padding-left: 16px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.toc-list a.toc-h3:hover {
  padding-left: 24px;
}

.toc-list a.toc-active {
  color: var(--primary-soft);
  border-left-color: var(--primary);
}

/* ═══════════════════════════════════════════════════════
   HERO IMAGE
   ═══════════════════════════════════════════════════════ */
.hero-image {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin-bottom: 2rem;
  border: 1px solid var(--border-card);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

/* ═══════════════════════════════════════════════════════
   AUTHOR BIO (in-article)
   ═══════════════════════════════════════════════════════ */
.author-bio {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 28px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  margin: 2.5rem 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.author-bio img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid rgba(112, 132, 255, 0.2);
  flex-shrink: 0;
}

.author-bio strong {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  color: var(--text-primary);
}

.author-bio p {
  font-size: 0.88rem;
  color: var(--body-text);
  line-height: 1.5;
  margin: 6px 0;
}

.author-bio-links {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.author-bio-links a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  color: var(--primary-soft);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-card);
  transition: all 0.2s;
}

.author-bio-links a:hover {
  background: rgba(112, 132, 255, 0.08);
  border-color: var(--border-card-hover);
}

/* ═══════════════════════════════════════════════════════
   FAQ SECTION (article-level)
   ═══════════════════════════════════════════════════════ */
.faq-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-card);
}

.faq-section h2 {
  border-bottom: none;
}

.faq-item {
  margin-bottom: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: all 0.35s var(--ease-premium);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.faq-item:hover {
  border-color: var(--border-card-hover);
}

.faq-question {
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-question::after {
  content: "+";
  font-size: 1.2rem;
  color: var(--primary);
  transition: transform 0.3s ease;
}

.faq-item.active .faq-question::after {
  content: "\2212";
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition:
    max-height 0.3s ease,
    padding 0.3s ease;
  padding: 0 20px;
  color: var(--body-text);
}

.faq-item.active .faq-answer {
  max-height: 300px;
  padding: 0 20px 16px;
}

/* ═══════════════════════════════════════════════════════
   SKIP LINK
   ═══════════════════════════════════════════════════════ */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: #fff;
  padding: 8px 16px;
  z-index: 10000;
  transition: top 0.3s;
  border-radius: 0 0 4px 0;
}

.skip-link:focus {
  top: 0;
}

/* ═══════════════════════════════════════════════════════
   V3 FOOTER (replaces old simple footer)
   Articles use <footer> inside .container — restyle it.
   ═══════════════════════════════════════════════════════ */
footer {
  border-top: 1px solid var(--border-card);
  padding: 40px 0;
  margin-top: 80px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  position: relative;
  z-index: 10;
}

footer a {
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 0.2s;
}

footer a:hover {
  color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════
   KEY TAKEAWAYS (GEO)
   ═══════════════════════════════════════════════════════ */
.key-takeaways {
  background: linear-gradient(
    135deg,
    rgba(52, 211, 153, 0.06),
    rgba(112, 132, 255, 0.06)
  );
  border: 1px solid rgba(52, 211, 153, 0.15);
  border-left: 4px solid var(--success);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 20px 24px;
  margin: 1.5rem 0 2rem;
}

.kt-title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--success);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.key-takeaways ul {
  margin: 0;
  padding: 0 0 0 18px;
}

.key-takeaways li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 6px;
}

.key-takeaways li:last-child {
  margin-bottom: 0;
}

/* ═══════════════════════════════════════════════════════
   READING PROGRESS BAR
   ═══════════════════════════════════════════════════════ */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--primary), var(--success));
  z-index: 9999;
  transition: width 0.1s linear;
  border-radius: 0 2px 2px 0;
}

/* ═══════════════════════════════════════════════════════
   EXIT-INTENT POPUP
   ═══════════════════════════════════════════════════════ */
#exit-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

#exit-popup {
  background: var(--bg-elevated);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 40px;
  max-width: 440px;
  width: 90%;
  text-align: center;
  position: relative;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#exit-popup-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

#exit-popup-close:hover {
  color: var(--text-primary);
}

.exit-popup-emoji {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

#exit-popup h3 {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--text-primary);
  margin-bottom: 10px;
}

#exit-popup p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 6px;
  line-height: 1.5;
}

.exit-popup-sub {
  font-size: 0.85rem !important;
  color: var(--text-tertiary) !important;
  margin-bottom: 20px !important;
}

#exit-popup-cta {
  display: inline-block;
  padding: 14px 32px;
  background: linear-gradient(135deg, #34d399, #059669);
  color: #030712;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
  margin-top: 8px;
}

#exit-popup-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(52, 211, 153, 0.3);
}

/* ═══════════════════════════════════════════════════════
   STICKY "LIRE AUSSI" BAR
   ═══════════════════════════════════════════════════════ */
#sticky-read-more {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(7, 13, 31, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-card);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 9998;
  font-size: 0.85rem;
  transform: translateY(100%);
  transition: transform 0.35s ease;
}

#sticky-read-more.visible {
  transform: translateY(0);
}

.srm-label {
  color: var(--text-tertiary);
  font-weight: 600;
  white-space: nowrap;
  font-family: var(--font-sans);
}

#sticky-read-more a {
  color: var(--primary-soft);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
  transition: color 0.2s;
}

#sticky-read-more a:hover {
  color: var(--text-primary);
}

#srm-close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  flex-shrink: 0;
}

#srm-close:hover {
  color: var(--text-tertiary);
}

/* ═══════════════════════════════════════════════════════
   SHARE BUTTONS
   ═══════════════════════════════════════════════════════ */
#share-buttons {
  position: fixed;
  left: max(16px, calc(50% - 440px));
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 500;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

#share-buttons.visible {
  opacity: 1;
  pointer-events: auto;
}

#share-buttons a,
#share-buttons button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  color: var(--text-tertiary);
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#share-buttons a:hover,
#share-buttons button:hover {
  color: var(--primary-soft);
  border-color: var(--border-card-hover);
  background: rgba(112, 132, 255, 0.08);
}

/* ═══════════════════════════════════════════════════════
   RELATED ARTICLES
   ═══════════════════════════════════════════════════════ */
.related-articles {
  margin: 2.5rem 0;
  padding-top: 2rem;
  border-top: 1px solid var(--border-card);
}

.related-articles h2 {
  font-size: 1.2rem !important;
  margin-bottom: 16px !important;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.related-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  text-decoration: none;
  transition: all 0.25s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.related-card:hover {
  border-color: var(--border-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.related-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
}

.related-card span {
  padding: 12px 14px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text-primary);
  line-height: 1.35;
}

/* ═══════════════════════════════════════════════════════
   BREADCRUMB
   ═══════════════════════════════════════════════════════ */
.breadcrumb {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-family: var(--font-sans);
}

.breadcrumb a {
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: var(--primary-soft);
}

.bc-sep {
  margin: 0 6px;
  color: var(--text-muted);
}

.bc-current {
  color: var(--text-tertiary);
}

/* ═══════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════ */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes btn-shimmer-guide {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .aurora-band-1 {
    width: 400px;
    height: 300px;
  }
  .aurora-band-2 {
    width: 350px;
    height: 250px;
  }
  .aurora-band-3 {
    width: 300px;
    height: 200px;
  }
  .spotlight {
    display: none;
  }

  article h1 {
    font-size: 1.8rem;
  }
  article h2 {
    font-size: 1.4rem;
  }

  #share-buttons {
    display: none;
  }
  .related-grid {
    grid-template-columns: 1fr;
  }
  #sticky-read-more {
    font-size: 0.78rem;
    gap: 10px;
  }
  #sticky-read-more a {
    max-width: 160px;
  }
  .author-bio {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .author-bio-links {
    justify-content: center;
  }
}
