/* ================================================================
   ARTICLE STYLES — Page de tutoriels vidéo
   ================================================================ */

/* ----------------------------------------------------------------
   TOP NAVIGATION BAR
   ---------------------------------------------------------------- */
.article-topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 800px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 0;
}
.article-topnav-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}
.article-topnav-back:hover {
  color: var(--accent);
}
.article-topnav-back svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.article-topnav-brand {
  font-family: 'Caveat', cursive;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-black);
  text-decoration: none;
  transition: color 0.2s ease;
}
.article-topnav-brand:hover {
  color: var(--accent);
}

/* ----------------------------------------------------------------
   ARTICLE HEADER
   ---------------------------------------------------------------- */
.article-header {
  padding: 2rem 1.5rem 2rem;
  background: var(--bg);
}

.article-header .container {
  max-width: 800px;
  margin: 0 auto;
}

.article-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.article-breadcrumb a {
  color: var(--accent);
  transition: color 0.2s var(--ease);
}

.article-breadcrumb a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.article-breadcrumb svg {
  width: 14px;
  height: 14px;
  opacity: 0.5;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.article-category {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.article-date {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.article-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-black);
  margin-bottom: 1rem;
}

.article-excerpt {
  font-size: 1.125rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ----------------------------------------------------------------
   VIDEO NAVIGATION
   ---------------------------------------------------------------- */
.video-nav {
  padding: 0 1.5rem;
  margin-bottom: 2rem;
}

.video-nav .container {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.video-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  background: var(--bg-white);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  color: var(--text-dark);
  font-weight: 500;
  font-size: 0.9375rem;
  flex: 1;
  min-width: 200px;
  transition: all 0.2s var(--ease);
}

.video-nav-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.video-nav-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ----------------------------------------------------------------
   VIDEO SECTION TITLE
   ---------------------------------------------------------------- */
.video-section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-black);
  margin-bottom: 0.5rem;
}

.video-section-desc {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

/* ----------------------------------------------------------------
   VIDEO SEPARATOR
   ---------------------------------------------------------------- */
hr.video-separator {
  max-width: 800px;
  margin: 3rem auto;
  border: none;
  border-top: 2px dashed var(--card-border);
}

/* ----------------------------------------------------------------
   VIDEO CONTAINER
   ---------------------------------------------------------------- */
.article-video {
  padding: 0 1.5rem 3rem;
}

.article-video .container {
  max-width: 800px;
  margin: 0 auto;
}


.video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ----------------------------------------------------------------
   ARTICLE CONTENT
   ---------------------------------------------------------------- */
.article-content {
  padding: 0 1.5rem 4rem;
}

.article-content .container {
  max-width: 800px;
  margin: 0 auto;
}

.article-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-black);
  margin: 2.5rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.article-content h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.article-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-dark);
  margin: 2rem 0 0.75rem;
}

.article-content p {
  margin-bottom: 1.25rem;
  line-height: 1.8;
}

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

.article-content li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
  list-style: disc;
}

.article-content ol li {
  list-style: decimal;
}

.article-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-content a:hover {
  color: var(--accent-hover);
}

.article-content strong {
  font-weight: 600;
  color: var(--text-black);
}

.article-content code {
  background: rgba(0, 0, 0, 0.05);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: 'SF Mono', Consolas, monospace;
}

.article-content pre {
  background: #2c2c2c;
  color: #f8f8f2;
  padding: 1.25rem;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  line-height: 1.6;
}

.article-content pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.article-content blockquote {
  border-left: 4px solid var(--accent);
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--text-muted);
}

/* ----------------------------------------------------------------
   TRANSCRIPT BOX
   ---------------------------------------------------------------- */
.transcript-box {
  background: var(--bg-white);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 2rem;
}

.transcript-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0;
  background: none;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
}

.transcript-toggle svg {
  width: 20px;
  height: 20px;
  transition: transform 0.3s var(--ease);
}

.transcript-toggle.is-open svg {
  transform: rotate(180deg);
}

.transcript-content {
  display: none;
  padding-top: 1.25rem;
  margin-top: 1.25rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  font-size: 0.9375rem;
  line-height: 1.8;
  color: var(--text-muted);
}

.transcript-content.is-visible {
  display: block;
}

.transcript-content p {
  margin-bottom: 1rem;
}

/* ----------------------------------------------------------------
   CTA SECTION
   ---------------------------------------------------------------- */
.article-cta {
  background: var(--bg-white);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 2rem;
  margin-top: 3rem;
  text-align: center;
}

.article-cta h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-black);
  margin-bottom: 0.5rem;
}

.article-cta p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

a.article-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.2s var(--ease);
  text-decoration: none;
}

a.article-cta-btn svg {
  stroke: #ffffff;
}

a.article-cta-btn:hover {
  background: var(--accent-hover);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(200, 92, 62, 0.3);
}

/* ----------------------------------------------------------------
   TIMESTAMP BADGES
   ---------------------------------------------------------------- */
.timestamp-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 0.5rem;
  padding: 0.2rem 0.5rem;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  font-family: 'SF Mono', Consolas, monospace;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  vertical-align: middle;
  text-decoration: none;
}

.timestamp-link:hover {
  background: var(--accent);
  color: #fff;
}

.timestamp-link svg {
  width: 12px;
  height: 12px;
}

.article-content h2 .timestamp-link,
.article-content h3 .timestamp-link {
  font-size: 0.7rem;
  transform: translateY(-1px);
}

/* ----------------------------------------------------------------
   BACK TO ARTICLES
   ---------------------------------------------------------------- */
.article-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 3rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg-white);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  color: var(--text-dark);
  font-weight: 500;
  transition: all 0.2s var(--ease);
}

.article-back:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.article-back svg {
  width: 16px;
  height: 16px;
}

/* ----------------------------------------------------------------
   TABLE OF CONTENTS (Floating Sidebar)
   ---------------------------------------------------------------- */
.article-layout {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.article-toc {
  display: none;
}

@media (min-width: 1200px) {
  .article-toc {
    display: block;
    position: fixed;
    left: max(1rem, calc((100vw - 800px) / 2 - 240px));
    top: 6rem;
    width: 200px;
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
    background: var(--bg-white);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  }
}

.toc-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--card-border);
}

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

.toc-item {
  margin-bottom: 0.25rem;
}

.toc-link {
  display: block;
  padding: 0.4rem 0.5rem;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--text-muted);
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  transition: all 0.2s var(--ease);
  text-decoration: none;
}

.toc-link:hover {
  color: var(--text-dark);
  background: rgba(0, 0, 0, 0.03);
}

.toc-link.is-active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-light);
  font-weight: 500;
}

/* Nested TOC for h3 */
.toc-link[data-level="3"] {
  padding-left: 1rem;
  font-size: 0.75rem;
}

/* Mobile TOC toggle */
.toc-mobile-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.875rem 1rem;
  margin-bottom: 1.5rem;
  background: var(--bg-white);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
}

.toc-mobile-toggle svg {
  width: 18px;
  height: 18px;
  transition: transform 0.2s var(--ease);
}

.toc-mobile-toggle.is-open svg {
  transform: rotate(180deg);
}

.toc-mobile-content {
  display: none;
  background: var(--bg-white);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.toc-mobile-content.is-visible {
  display: block;
}

@media (min-width: 1200px) {
  .toc-mobile-toggle,
  .toc-mobile-content {
    display: none !important;
  }
}

/* ----------------------------------------------------------------
   TABLES
   ---------------------------------------------------------------- */
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--card-border, #e5e5e5);
}

.article-content thead {
  background: var(--bg-dark, #1a1a1a);
  color: #fff;
}

.article-content th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.article-content td {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--card-border, #e5e5e5);
}

.article-content tbody tr:nth-child(even) {
  background: var(--bg-light, #f8f8f8);
}

.article-content tbody tr:hover {
  background: var(--accent-light, #fff5f0);
}

@media (max-width: 640px) {
  .article-content table {
    font-size: 0.8rem;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .article-content th,
  .article-content td {
    padding: 0.6rem 0.75rem;
    white-space: nowrap;
  }
}

/* ----------------------------------------------------------------
   RESPONSIVE
   ---------------------------------------------------------------- */
@media (max-width: 640px) {
  .article-header {
    padding: 5rem 1rem 1.5rem;
  }

  .video-nav {
    padding: 0 1rem;
  }

  .video-nav .container {
    flex-direction: column;
  }

  .video-nav-link {
    min-width: auto;
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
  }

  .article-video,
  .article-content {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .video-wrapper {
    border-radius: 8px;
  }

  .transcript-box {
    padding: 1rem;
  }

  .article-cta {
    padding: 1.5rem;
  }

  hr.video-separator {
    margin: 2rem 1rem;
  }
}
