/* ─────────────────────────────────────────
   Article page
───────────────────────────────────────── */

/* Two-column layout: 667px content + 405px sidebar */
.article-layout {
  padding: 80px 160px 200px;
  display: grid;
  grid-template-columns: 667px 405px;
  gap: 50px;
  align-items: start;
}

/* Left column: all article content */
.article-content {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

/* Header block */
.article-header {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.article-title-block {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.article-date {
  font-size: 18px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--flint);
}

.article-title {
  font-size: 48px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--pitch);
}

.article-intro {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.article-intro p {
  font-size: 18px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--pitch);
}

.article-divider {
  height: 1px;
  background: var(--flint);
  width: 100%;
}

/* Body sections */
.article-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
  scroll-margin-top: calc(var(--nav-height, 72px) + 24px);
}

.article-section-title {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--pitch);
}

.article-section p {
  font-size: 18px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--pitch);
}

.article-body-semibold {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.6;
  color: var(--pitch);
}

/* Block-level semibold paragraphs need to out-specify `.article-section p` */
.article-section p.article-body-semibold {
  font-weight: 600;
}

/* Prompt quote — indented, italic, with an ember rule 12px off the left */
.article-prompt {
  margin-left: 12px;
  padding-left: 12px;
  border-left: 2px solid var(--ember);
  font-style: italic;
}

.article-link {
  color: var(--pitch);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-section strong {
  font-weight: 600;
}

.article-list {
  list-style: disc;
  padding-left: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--pitch);
}

/* Image */
.article-image-block {
  width: 100%;
}

.article-img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.article-caption {
  margin-top: 12px;
  font-size: 14px;
  color: var(--flint);
  text-align: center;
}

/* Right sidebar */
.article-sidebar {
  position: sticky;
  top: calc(var(--nav-height, 0px) + 40px);
  margin-top: 22px;
}

.article-meta-card {
  background: var(--linen);
  border-radius: 24px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.article-toc-title {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--pitch);
}

/* Table of contents: a shale rail with a sliding ember indicator that
   tracks the section in focus. Titles sit flint; the active one is pitch. */
.article-toc {
  position: relative;
  padding-left: 16px; /* 1px rail + ~15px gap to the titles */
}

.article-toc-track {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--shale);
}

.article-toc-indicator {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 40px;
  background: var(--ember);
  opacity: 0; /* hidden until a section comes into focus */
  transform: translateY(0);
  transition: transform 0.35s ease, opacity 0.3s ease;
  will-change: transform, opacity;
}

.article-sections-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.article-sections-list li {
  height: 40px;
}

.article-sections-list li a {
  display: block;
  width: 350px;
  max-width: 100%;
  height: 40px;
  line-height: 40px; /* centers the single line vertically */
  font-size: 18px;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--flint);
  text-decoration: none;
  transition: color 0.3s ease;
}

.article-sections-list li.active a {
  color: var(--pitch);
}

.article-sections-list li a:hover {
  color: var(--pitch);
}

/* ─────────────────────────────────────────
   Mobile
───────────────────────────────────────── */
@media (max-width: 768px) {
  .article-layout {
    padding: 40px 24px 140px;
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }

  .article-sidebar {
    position: static;
    margin-top: 0;
  }

  .article-header {
    gap: 32px;
  }

  .article-date {
    font-size: 16px;
  }

  .article-intro p {
    font-size: 18px;
    line-height: 1.6;
  }

  .article-section-title {
    font-size: 20px;
  }

  .article-section p {
    font-size: 18px;
    line-height: 1.6;
  }

  .article-section .article-body-semibold {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.6;
  }

  .article-list {
    font-size: 18px;
    line-height: 1.6;
  }

  .article-sections-list li a {
    width: 100%;
    font-size: 18px;
  }
}
