/* =============================================================
   blog.css — Shared styles for all blog pages (index + articles)
   Loaded by: blog/index.html + blog/*.html
   ============================================================= */

/* ── Reading Progress Bar (Universal Compatibility, 100% Guaranteed) ── */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--text-main);
  z-index: 10001;
  pointer-events: none;
  transition: width 0.08s linear;
}

/* ── Layout ── */
.container-blog {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ── Blog Index: Filter Bar (Inherits .filter-bar & .filter-btn from shared.css) ── */


/* ── Blog Index: Grid & Card Equalization ── */
#articlesGrid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 640px) {
  #articlesGrid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.article-item {
  display: flex;
  flex-direction: column;
}
.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}
.article-card:hover {
  border-color: var(--border-color-hover);
  transform: translateY(-2px);
}
.article-card > div:first-child {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Card Thumbnail Styling */
.card-thumb-wrapper,
.card-thumb {
  margin-bottom: 1rem;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background-color: var(--bg-card);
  aspect-ratio: 16 / 9;
}
.card-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.article-card:hover .card-thumb-img {
  transform: scale(1.04);
}

/* Meta Tag & Title Sizing */
.meta-tag {
  font-family: 'Fira Code', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
  display: inline-block;
}
.card-title,
.card-title a {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.35;
  margin-top: 0.35rem;
  margin-bottom: 0.75rem;
  color: var(--text-main);
  text-decoration: none;
}
.card-title a:hover {
  text-decoration: underline;
}

/* Excerpt & Footer Equalization */
.article-excerpt {
  color: var(--text-muted);
  font-size: 0.925rem;
  line-height: 1.55;
  margin-bottom: 1.25rem;
  flex: 1;
}
.article-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
  margin-top: auto;
}

/* ── Article Pages: Content Typography ── */
.article-content h3 {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.1rem, 2.5vw, 1.3rem);
  font-weight: 600;
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
  line-height: 1.35;
}
.article-content p {
  font-size: clamp(0.95rem, 1.5vw + 0.5rem, 1.05rem);
  color: #e4e4e7;
  line-height: 1.65;
  margin-bottom: 1.25rem;
}
.article-content ul,
.article-content ol {
  color: #e4e4e7;
  font-size: clamp(0.95rem, 1.5vw + 0.5rem, 1.05rem);
  padding-left: 1.25rem;
  margin-bottom: 1.5rem;
}
.article-content li { margin-bottom: 0.5rem; }

/* ── Code Blocks ── */
pre {
  background-color: var(--code-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
  font-family: 'Fira Code', monospace;
  font-size: clamp(0.8rem, 2.5vw, 0.9rem);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  -webkit-overflow-scrolling: touch;
}
pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
}

/* ── Callout Box ── */
.callout {
  background-color: var(--bg-card);
  border-left: 4px solid var(--text-main);
  padding: 1rem 1.25rem;
  border-radius: 0 6px 6px 0;
  margin-bottom: 1.5rem;
}
.callout p { margin: 0; font-size: 0.95rem; color: var(--text-muted); }

/* ── Nav Links (article pages) ── */
.nav-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  font-size: 0.9rem;
}

/* Article body lists */
.article-body ul,
.article-body ol { margin-bottom: 1.5rem; padding-left: 1.5rem; color: #e4e4e7; }

/* Blog article inline style extractions */
.blog-badge { color: #ffffff; font-weight: 600; }
.callout-card { margin-top: 2.5rem; padding: 1.25rem; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-md); }
.heading-reset { margin-top: 0; margin-bottom: 0.6rem; color: var(--text-main); font-family: 'Outfit', sans-serif; font-size: 1.1rem; font-weight: 700; line-height: 1.3; }
.note-sm { margin-bottom: 0; font-size: 0.9rem; color: var(--text-muted); line-height: 1.55; }

/* ── Executive Summary & TOC ── */
.exec-summary {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--text-main);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}
.exec-summary-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}
.exec-summary ul {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.exec-summary li { margin-bottom: 0.35rem; }

.toc-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}
.toc-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.toc-list li { margin-bottom: 0.4rem; font-size: 0.925rem; }
.toc-list a { color: var(--text-muted); text-decoration: none; transition: color var(--transition); }
.toc-list a:hover { color: var(--text-main); text-decoration: underline; }

/* ── Author Bio Card ── */
.author-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-top: 3rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.author-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-color-hover);
}
.author-info h4 { margin: 0 0 0.25rem 0; font-size: 1.05rem; }
.author-info p { margin: 0; font-size: 0.88rem; color: var(--text-muted); line-height: 1.45; }

/* ── Render Performance Optimization (Baseline 2024+) ── */
.article-content > h2,
.article-content > .exec-summary,
.article-content > .toc-card,
.article-content > .callout-card,
.article-content > table,
.article-content > .faq-section {
  content-visibility: auto;
  contain-intrinsic-size: 1px 300px;
}
