/* Article pages – magazine layout + sidebar */

body.article-page {
  overflow-x: clip;
}

.page-content {
  padding: 0 0 100px;
  min-height: calc(100vh - 200px);
}

/* ── Masthead ─────────────────────────────────────────────── */
.article-masthead {
  padding-top: calc(var(--nav-h) + 28px);
  margin-bottom: 36px;
}

.article-masthead-inner {
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-card);
}

.article-masthead-media {
  overflow: hidden;
  background: var(--bg-2);
}

.article-masthead-img {
  display: block;
  width: 100%;
  height: 280px;
  object-fit: cover;
}

.article-masthead-content {
  padding: 28px 32px 32px;
  border-top: 1px solid var(--border);
}

.article-masthead-content .article-tag {
  margin-bottom: 14px;
}

.article-masthead-content h1 {
  font-size: clamp(1.65rem, 3vw, 2.15rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-100);
  margin-bottom: 12px;
  max-width: 32rem;
}

.article-lead {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text-300);
  margin-bottom: 16px;
  max-width: 38rem;
}

.article-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-300);
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.article-byline [aria-hidden="true"] {
  opacity: 0.4;
}

/* ── Body grid ────────────────────────────────────────────── */
.article-body-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: clamp(32px, 4vw, 64px);
  align-items: start;
}

.article-prose {
  max-width: 48rem;
  min-width: 0;
}

/* ── Prose typography ─────────────────────────────────────── */
.article-prose h2 {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-100);
  margin-top: 3rem;
  margin-bottom: 1.25rem;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: calc(var(--nav-h) + 24px);
}

.article-prose h2:first-child {
  margin-top: 0;
}

.article-prose h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent-warn);
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.article-prose p,
.article-prose ul,
.article-prose li {
  margin-bottom: 1.25rem;
  color: var(--text-200);
  line-height: 1.75;
}

.article-prose a:not(.btn):not(.btn-tech):not(.btn-primary):not(.btn-outline) {
  color: var(--accent-warn);
  text-decoration: underline;
}

.article-prose ul {
  padding-left: 1.5rem;
  list-style-type: disc;
}

.article-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 99px;
  background: var(--accent-amber-dim);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: var(--accent);
  width: fit-content;
}

/* ── Key points ───────────────────────────────────────────── */
.article-keypoints {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  padding: 24px 28px;
  margin-bottom: 2.5rem;
}

.article-keypoints-title {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 14px;
}

.article-keypoints ul {
  margin: 0;
  padding-left: 1.25rem;
  list-style: disc;
}

.article-keypoints li {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  color: var(--text-200);
  line-height: 1.5;
}

.article-keypoints li:last-child {
  margin-bottom: 0;
}

/* ── Images & quotes ──────────────────────────────────────── */
.article-body-img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin: 2rem 0;
  display: block;
}

.dropcap::first-letter {
  float: left;
  font-size: 3.2rem;
  line-height: 0.85;
  margin: 0.05em 0.12em 0 0;
  color: var(--accent);
  font-weight: 700;
}

blockquote.article-quote {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-warn);
  border-radius: 8px;
  color: var(--text-200);
  font-size: 0.95rem;
  font-style: italic;
  line-height: 1.65;
}

/* ── FAQ ──────────────────────────────────────────────────── */
.faq-container {
  margin-top: 1rem;
}

.faq-item {
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.25s ease;
}

.faq-item:hover {
  border-color: rgba(245, 158, 11, 0.35);
}

.faq-item summary {
  padding: 16px 20px;
  font-weight: 600;
  color: var(--text-100);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '+';
  font-size: 1.1rem;
  color: var(--accent);
  flex-shrink: 0;
  margin-left: 12px;
}

.faq-item[open] summary::after {
  content: '−';
}

.faq-item[open] {
  border-color: rgba(245, 158, 11, 0.4);
}

.faq-content {
  padding: 0 20px 16px;
  color: var(--text-200);
  line-height: 1.7;
  border-top: 1px solid var(--border);
}

.faq-content p {
  margin-top: 12px;
  margin-bottom: 0;
}

/* ── Article footer ─────────────────────────────────────────── */
.article-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.article-author-line {
  font-size: 0.92rem;
  color: var(--text-300);
  margin: 0;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.article-sidebar-inner {
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: calc(var(--nav-h) + 24px);
}

.article-sidebar-title {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-300);
  margin: 0 0 12px;
}

.article-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.article-toc a:hover {
  color: var(--text-100);
  background: rgba(255, 255, 255, 0.04);
}

.article-toc a.is-active {
  color: var(--accent);
  background: var(--accent-amber-dim);
  border-left-color: var(--accent);
}

.article-sidebar-cta {
  padding: 24px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(245, 158, 11, 0.02));
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 12px;
  text-align: center;
}

.article-sidebar-cta h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-100);
  margin: 0 0 8px;
}

.article-sidebar-cta p {
  font-size: 0.88rem;
  color: var(--text-300);
  line-height: 1.5;
  margin: 0 0 16px;
}

.article-sidebar-cta .btn {
  width: 100%;
  justify-content: center;
  margin-bottom: 8px;
}

.article-sidebar-cta .btn:last-child {
  margin-bottom: 0;
}

.article-related ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.article-related a {
  display: block;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-200);
  font-size: 0.88rem;
  line-height: 1.4;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.article-related a:hover {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-100);
}

.article-related .article-tag {
  display: block;
  margin-bottom: 6px;
  font-size: 0.65rem;
  padding: 4px 8px;
}

/* Mobile TOC (in prose column) */
.article-toc-mobile {
  display: none;
  margin-bottom: 2rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.article-toc-mobile summary {
  padding: 14px 18px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-100);
  cursor: pointer;
  list-style: none;
}

.article-toc-mobile summary::-webkit-details-marker {
  display: none;
}

.article-toc-mobile .article-toc {
  padding: 0 12px 12px;
}

.article-toc-desktop {
  display: block;
}

@media (max-width: 1024px) {
  .article-body-grid {
    grid-template-columns: 1fr;
  }

  .article-sidebar {
    display: none;
  }

  .article-toc-mobile {
    display: block;
  }
}

@media (max-width: 640px) {
  .article-masthead {
    padding-top: calc(var(--nav-h) + 16px);
    margin-bottom: 28px;
  }

  .article-masthead-inner {
    border-radius: 12px;
  }

  .article-masthead-content {
    padding: 18px 16px 20px;
  }

  .article-masthead-content h1 {
    max-width: none;
    font-size: 1.55rem;
  }

  .article-lead {
    max-width: none;
    font-size: 0.98rem;
  }

  .article-byline {
    font-size: 0.8rem;
    gap: 6px;
  }

  .article-prose h2 {
    font-size: 1.2rem;
    margin-top: 2.25rem;
  }

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

  blockquote.article-quote {
    padding: 1rem 1.1rem;
    font-size: 0.9rem;
  }

  .faq-item summary {
    padding: 14px 16px;
    font-size: 0.86rem;
  }

  .faq-content {
    padding: 0 16px 14px;
  }

  .article-keypoints {
    padding: 18px 20px;
  }
}

@media (max-width: 480px) {
  .article-masthead-img {
    height: 180px;
  }

  .article-masthead-content h1 {
    font-size: 1.4rem;
  }
}
