/* ==========================================================================
   DEVV.IN — Article Reading Experience Stylesheet
   Designed for Distraction-Free Longform Technical Reading
   ========================================================================== */

/* Reading Progress Bar at the top of viewport */
#reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--accent-blue);
  width: 0%;
  z-index: 999;
  transition: width 0.1s ease-out;
}

/* Article Container Layout */
.article-header-section {
  padding: 44px 0 32px 0;
  border-bottom: 1px solid var(--border-hairline);
  background: linear-gradient(180deg, var(--bg-paper) 0%, var(--bg-page) 100%);
}

.article-header-inner {
  max-width: 820px;
  margin: 0 auto;
}

.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
  font-family: var(--font-display);
}

.breadcrumb-nav a {
  color: var(--text-secondary);
}

.breadcrumb-nav a:hover {
  color: var(--accent-blue);
}

.breadcrumb-sep {
  color: var(--border-strong);
  font-size: 11px;
}

.article-main-headline {
  font-family: var(--font-serif);
  font-size: 40px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-ink);
  letter-spacing: -0.025em;
  margin-bottom: 20px;
}

.article-byline-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-hairline);
}

.article-author-chip {
  display: flex;
  align-items: center;
  gap: 12px;
}

.article-author-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-ink);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.article-author-details h4 {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-ink);
}

.article-author-details span {
  font-size: 12.5px;
  color: var(--text-muted);
}

.article-meta-tags {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--text-muted);
}

.article-meta-tags strong {
  color: var(--accent-emerald);
}

/* Featured Lead Image */
.article-lead-visual {
  max-width: 980px;
  margin: 36px auto 0 auto;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  box-shadow: var(--shadow-md);
}

.article-lead-img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
}

/* Two Column Reading Layout */
.article-reading-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 56px;
  max-width: 1080px;
  margin: 48px auto;
  padding: 0 24px;
  align-items: flex-start;
}

/* Main Prose */
.article-prose {
  font-family: var(--font-sans);
  font-size: 17.5px;
  line-height: 1.8;
  color: var(--text-primary);
}

.article-prose p {
  margin-bottom: 24px;
}

.article-prose h2 {
  font-family: var(--font-serif);
  font-size: 27px;
  font-weight: 700;
  color: var(--text-ink);
  margin: 44px 0 18px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-hairline);
  letter-spacing: -0.02em;
}

.article-prose h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-ink);
  margin: 32px 0 14px 0;
  letter-spacing: -0.015em;
}

.article-prose ul, .article-prose ol {
  margin: 0 0 24px 28px;
}

.article-prose li {
  margin-bottom: 10px;
}

.article-prose blockquote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 20px;
  line-height: 1.6;
  color: var(--text-secondary);
  border-left: 3px solid var(--accent-blue);
  background: var(--bg-paper);
  padding: 20px 24px;
  margin: 32px 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Code Blocks & Terminal Snippets */
.code-container {
  margin: 28px 0;
  border-radius: var(--radius-sm);
  background: #0f172a;
  border: 1px solid #1e293b;
  overflow: hidden;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: #0b1120;
  border-bottom: 1px solid #1e293b;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #94a3b8;
}

.code-dots {
  display: flex;
  gap: 6px;
}

.code-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.code-dot-red { background: #ef4444; }
.code-dot-yellow { background: #f59e0b; }
.code-dot-green { background: #10b981; }

.btn-copy-code {
  background: #1e293b;
  border: 1px solid #334155;
  color: #cbd5e1;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-copy-code:hover {
  background: #334155;
  color: #fff;
}

.article-prose pre {
  margin: 0;
  padding: 20px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  color: #e2e8f0;
  background: #0f172a;
}

.article-prose code {
  font-family: var(--font-mono);
  font-size: 14.5px;
  padding: 2px 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  color: var(--accent-indigo);
}

.article-prose pre code {
  padding: 0;
  background: transparent;
  border: none;
  color: inherit;
}

/* Callout Box */
.takeaway-callout {
  background: var(--accent-blue-subtle);
  border: 1px solid rgba(29, 78, 216, 0.2);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  margin: 32px 0;
}

.takeaway-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-blue);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Reading Sidebar (TOC + Author) */
.reading-sidebar {
  position: sticky;
  top: 76px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.toc-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 20px;
}

.toc-heading {
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.toc-links-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toc-links-list a {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.4;
  display: block;
  border-left: 2px solid transparent;
  padding-left: 10px;
  transition: all var(--transition-fast);
}

.toc-links-list a:hover, .toc-links-list a.active {
  color: var(--accent-blue);
  border-left-color: var(--accent-blue);
}

/* Share & Action Bar */
.share-action-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px 0;
  border-top: 1px solid var(--border-hairline);
  margin-top: 40px;
}

.share-action-bar span {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.btn-share-icon {
  background: var(--bg-paper);
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.btn-share-icon:hover {
  background: var(--bg-subtle);
  color: var(--text-ink);
  border-color: var(--border-medium);
}

/* Responsive */
@media (max-width: 900px) {
  .article-reading-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .reading-sidebar {
    position: static;
  }
  .article-main-headline {
    font-size: 30px;
  }
}
