/* ─── Article Page Layout ─────────────────────────────────────── */

.article-page {
  padding: 64px 0 80px;
}

.article-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 64px;
  align-items: start;
}

/* Back link */
.article-back {
  margin-bottom: 32px;
}
.article-back a {
  font-size: 0.875rem;
  color: var(--muted);
  text-decoration: none;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  transition: color 0.15s;
}
.article-back a:hover { color: var(--primary); }

/* Article header */
.article-header {
  margin-bottom: 32px;
}
.article-meta-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.article-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 400;
  color: var(--primary);
  letter-spacing: -0.8px;
  line-height: 1.15;
  margin-bottom: 20px;
}
.article-lead {
  font-size: 1.125rem;
  color: var(--body-muted);
  line-height: 1.7;
  border-left: 3px solid var(--hairline);
  padding-left: 20px;
  margin: 0;
}

/* Advice warning */
.article-advice-warning {
  background: var(--soft-stone);
  border-left: 3px solid var(--coral);
  border-radius: 0 var(--r-xs) var(--r-xs) 0;
  padding: 14px 20px;
  margin: 32px 0;
  font-size: 0.875rem;
  color: var(--body-muted);
  line-height: 1.65;
}
.article-advice-warning strong {
  color: var(--primary);
}

/* Article content typography */
.article-content {
  font-size: 1rem;
  color: var(--body-muted);
  line-height: 1.8;
}
.article-content h2 {
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--primary);
  letter-spacing: -0.2px;
  margin: 40px 0 12px;
  padding-top: 40px;
  border-top: 1px solid var(--hairline);
}
.article-content h2:first-child {
  border-top: none;
  padding-top: 0;
}
.article-content h3 {
  font-size: 1.0625rem;
  font-weight: 500;
  color: var(--primary);
  margin: 28px 0 10px;
}
.article-content p {
  margin-bottom: 18px;
}
.article-content ul,
.article-content ol {
  margin: 0 0 18px 0;
  padding-left: 24px;
}
.article-content li {
  margin-bottom: 8px;
}
.article-content strong {
  color: var(--primary);
  font-weight: 500;
}
.article-content .callout {
  background: var(--soft-stone);
  border-radius: var(--r-sm);
  padding: 20px 24px;
  margin: 28px 0;
}
.article-content .callout p {
  margin: 0;
  font-size: 0.9375rem;
}

/* Article footer note */
.article-footer-note {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.65;
}

/* ─── Sidebar ─────────────────────────────────────────────────── */

.article-sidebar {
  position: sticky;
  top: 88px;
}

.sidebar-card {
  background: var(--soft-stone);
  border-radius: var(--r-sm);
  padding: 20px;
}

.sidebar-toc {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: toc;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sidebar-toc li {
  counter-increment: toc;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.sidebar-toc li::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--muted);
  flex-shrink: 0;
  margin-top: 2px;
}
.sidebar-toc a {
  font-size: 0.875rem;
  color: var(--body-muted);
  text-decoration: none;
  line-height: 1.5;
  transition: color 0.15s;
}
.sidebar-toc a:hover { color: var(--primary); }

.sidebar-related {
  display: block;
  padding: 12px;
  border-radius: var(--r-xs);
  background: #fff;
  text-decoration: none;
  transition: box-shadow 0.15s;
}
.sidebar-related:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.07); }
.sidebar-related-title {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--primary);
  margin-bottom: 4px;
}
.sidebar-related-meta {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ─── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .article-layout {
    grid-template-columns: 1fr;
  }
  .article-sidebar {
    position: static;
  }
}
