/* ============================================
   SantriDigitalPro — Article / Detail Page Styles
   ============================================ */

.article-page-header {
  padding: var(--space-10) 0 var(--space-8);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--space-12);
  align-items: start;
  padding-top: var(--space-10);
  padding-bottom: var(--space-16);
}

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

.article-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + var(--space-6));
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

@media (max-width: 1024px) {
  .article-sidebar {
    position: static;
    /* Show sidebar below content on mobile */
    order: 2;
  }
  .article-main {
    order: 1;
  }
}

.article-header__meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}

.article-header__series {
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.article-title {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-5);
  max-width: 22ch;
}

.article-excerpt {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  max-width: 58ch;
  margin: 0;
  font-style: italic;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-5);
}

/* Article body */
.article-body {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
}

.article-body h2 {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  margin-top: var(--space-12);
  margin-bottom: var(--space-4);
  line-height: var(--leading-snug);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--divider);
}

.article-body h3 {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
}

.article-body h4 {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-top: var(--space-6);
  margin-bottom: var(--space-2);
}

.article-body p {
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-5);
  max-width: 70ch;
  font-size: var(--text-base);
}

.article-body ul,
.article-body ol {
  margin: var(--space-4) 0 var(--space-6) var(--space-6);
}

.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }

.article-body li {
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-2);
  font-size: var(--text-base);
}

.article-body li::marker { color: var(--accent); font-weight: 700; }

.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding: var(--space-4) var(--space-6);
  margin: var(--space-8) 0;
  background: var(--accent-muted);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

.article-body blockquote p {
  color: var(--text-primary);
  font-style: italic;
  font-size: var(--text-base);
  margin: 0;
}

.article-body code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  color: var(--accent);
  word-break: break-word;
}

.article-body pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  overflow-x: auto;
  margin: var(--space-6) 0;
}

.article-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.article-body strong {
  color: var(--text-primary);
  font-weight: var(--weight-semibold);
}

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

.article-body hr {
  border: none;
  border-top: 1px solid var(--divider);
  margin: var(--space-10) 0;
}

/* Sidebar widgets */
.sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
}

.sidebar-widget__title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--divider);
}

.related-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.related-item {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
  text-decoration: none;
  padding: var(--space-2);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.related-item:hover {
  background: var(--bg-secondary);
}

.related-item__code {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-muted);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}

.related-item__title {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--text-primary);
  line-height: var(--leading-snug);
  transition: color var(--transition-fast);
}

.related-item:hover .related-item__title {
  color: var(--accent);
}

/* Series progress indicator */
.series-progress {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
}

.series-progress__title {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.series-progress__series {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

.series-progress__bar {
  height: 4px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: var(--space-2);
}

.series-progress__fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

.series-progress__label {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Share note */
.share-note {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-align: center;
  padding: var(--space-4);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  line-height: var(--leading-relaxed);
}

/* Coming soon state */
.coming-soon {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  padding: var(--space-16) var(--space-10);
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
}

.coming-soon__icon {
  width: 64px;
  height: 64px;
  background: var(--accent-muted);
  border-radius: var(--radius-2xl);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-6);
}

.coming-soon__icon svg {
  width: 32px;
  height: 32px;
  color: var(--accent);
}

.coming-soon__title {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

.coming-soon__desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  max-width: 40ch;
  margin: 0 auto var(--space-8);
}

/* ============================================
   ARTICLE — Mobile Reading Refinements
   ============================================ */

@media (max-width: 640px) {
  /* Tighter article page header on mobile */
  .article-page-header {
    padding: var(--space-8) 0 var(--space-6);
  }

  /* Article title: slightly smaller on 360px */
  .article-title {
    font-size: clamp(1.45rem, 5.5vw, 1.875rem);
    max-width: 100%;
  }

  /* Excerpt: match body size on mobile */
  .article-excerpt {
    font-size: var(--text-base);
  }

  /* Body paragraphs: comfortable line-height */
  .article-body p {
    font-size: var(--text-base);
    line-height: 1.85;
  }

  /* Headings in body: smaller on mobile */
  .article-body h2 {
    font-size: var(--text-xl);
    margin-top: var(--space-8);
    margin-bottom: var(--space-3);
  }
  .article-body h3 {
    font-size: var(--text-lg);
    margin-top: var(--space-6);
  }

  /* Blockquote: tighter padding */
  .article-body blockquote {
    padding: var(--space-4);
    margin: var(--space-6) 0;
  }

  /* Lists: less left indent on narrow screens */
  .article-body ul,
  .article-body ol {
    margin-left: var(--space-4);
  }

  /* Article layout: reduce top padding on mobile */
  .article-layout {
    padding-top: var(--space-6);
    padding-bottom: var(--space-10);
  }
}
