/* =========================================================
   ARTICLE DEEP-READING MODE STYLES
   Reading progress, Table of Contents, Markdown Typography,
   Interactive Likes, Syntax Highlighted Code, Comments
   ========================================================= */

/* Reading Progress Bar */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3.5px;
  width: 0%;
  background: var(--gradient-primary);
  z-index: 2000;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.7);
  transition: width 0.1s ease-out;
}

/* Article Container & Header */
.reader-container {
  padding-top: 2.5rem;
  padding-bottom: 5rem;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.breadcrumbs a:hover {
  color: var(--text-accent);
}

.article-header {
  margin-bottom: 2.5rem;
}

.article-title {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.2;
  margin: 1rem 0 1.5rem;
}

.article-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 2rem;
}

.author-info-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.article-metrics {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.article-featured-img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 3rem;
  box-shadow: var(--shadow-lg);
}

/* Reader Layout: Article + Sticky TOC */
.reader-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 3.5rem;
  position: relative;
}

/* Sticky Table of Contents (TOC) */
.toc-sidebar {
  position: sticky;
  top: 96px;
  height: fit-content;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding: 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.toc-title {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.toc-link {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
  display: block;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.toc-link:hover, .toc-link.active {
  color: var(--accent-primary);
  transform: translateX(4px);
  font-weight: 600;
}

.toc-link.h3-indent {
  padding-left: 1rem;
  font-size: 0.8rem;
}

/* Article Prose Typography */
.article-body {
  font-size: 1.12rem;
  line-height: 1.85;
  color: var(--text-secondary);
}

.article-body h2 {
  font-size: 1.85rem;
  margin: 2.75rem 0 1.25rem;
  color: var(--text-primary);
  scroll-margin-top: 96px;
}

.article-body h3 {
  font-size: 1.4rem;
  margin: 2rem 0 1rem;
  color: var(--text-primary);
  scroll-margin-top: 96px;
}

.article-body p {
  margin-bottom: 1.6rem;
}

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

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

.article-body a:hover {
  color: var(--accent-hover);
}

.article-body ul, .article-body ol {
  margin: 0 0 1.6rem 1.75rem;
}

.article-body li {
  margin-bottom: 0.65rem;
}

.article-body blockquote {
  position: relative;
  padding: 1.25rem 1.75rem;
  margin: 2rem 0;
  background: var(--bg-surface);
  border-left: 4px solid var(--accent-primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  font-size: 1.15rem;
  color: var(--text-primary);
}

/* Code Blocks & Syntax */
.code-block-wrapper {
  position: relative;
  margin: 2rem 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #0d1117;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md);
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: #161b22;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #8b949e;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #c9d1d9;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.copy-btn:hover {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
}

.article-body pre {
  padding: 1.25rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  line-height: 1.6;
  color: #e6edf3;
}

.article-body code:not(pre code) {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  padding: 0.2rem 0.45rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-accent);
}

/* Tables */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.95rem;
}

.article-body th, .article-body td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-subtle);
  text-align: left;
}

.article-body th {
  background: var(--bg-surface);
  color: var(--text-primary);
  font-weight: 600;
}

.article-body tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

/* Interactive Like & Share Bar */
.post-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.75rem 0;
  margin-top: 3.5rem;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.like-button {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-glow);
  color: var(--text-primary);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.like-button:hover, .like-button.liked {
  border-color: var(--accent-rose);
  color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.1);
  transform: scale(1.05);
}

.like-button.liked svg {
  fill: var(--accent-rose);
}

.share-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Author Bio Card */
.author-bio-card {
  display: flex;
  gap: 1.75rem;
  padding: 2rem;
  margin-top: 3.5rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.author-bio-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border-glow);
  flex-shrink: 0;
}

.author-bio-content h3 {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.author-bio-title {
  font-size: 0.85rem;
  color: var(--accent-primary);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.author-bio-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Comments Section */
.comments-section {
  margin-top: 4.5rem;
}

.comments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.comment-form {
  padding: 2rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  margin-bottom: 2.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.comment-item {
  padding: 1.5rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.comment-author-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.comment-author-name {
  font-weight: 600;
  color: var(--text-primary);
}

.comment-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.comment-content {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Responsive */
@media (max-width: 900px) {
  .reader-layout {
    grid-template-columns: 1fr;
  }
  .toc-sidebar {
    display: none; /* Hide TOC on mobile to maximize reading space */
  }
  .article-title {
    font-size: 2.2rem;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .author-bio-card {
    flex-direction: column;
  }
}
