/* ===========================================================
   Blog-specific styles
   =========================================================== */

.blog-hero {
  text-align: center;
  padding: 3rem 0 1rem;
}
.blog-hero h1 { max-width: 18ch; margin-inline: auto; }
.blog-hero p { max-width: 60ch; margin-inline: auto; font-size: 1.1rem; }

.blog-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: start;
}
@media (max-width: 1000px) { .blog-layout { grid-template-columns: 1fr; } }

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.post-card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--t), box-shadow var(--t);
}
.post-card:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); }
.post-thumb {
  aspect-ratio: 16 / 9;
  display: grid; place-items: center;
  font-size: 3.4rem;
  color: rgba(255,255,255,.95);
  position: relative;
}
.post-thumb .thumb-icon { width: 56px; height: 56px; stroke-width: 1.5; opacity: .95; }
.post-hero-img .hero-icon { width: 84px; height: 84px; stroke-width: 1.25; opacity: .95; }
.post-thumb.bg-1 { background: linear-gradient(135deg, #1E3A8A, #3B82F6); }
.post-thumb.bg-2 { background: linear-gradient(135deg, #0F1F4D, #60A5FA); }
.post-thumb.bg-3 { background: linear-gradient(135deg, #1E40AF, #93C5FD); }
.post-thumb.bg-4 { background: linear-gradient(135deg, #0F1F4D, #1E3A8A); }
.post-thumb.bg-5 { background: linear-gradient(135deg, #2563EB, #93C5FD); }
.post-body { padding: 1.5rem; display: flex; flex-direction: column; gap: .75rem; flex: 1; }
.post-body h3 { font-size: 1.15rem; margin: 0; line-height: 1.3; }
.post-body p { font-size: .92rem; margin: 0; }
.post-meta { font-size: .8rem; color: var(--text-muted); display: flex; gap: 1rem; margin-top: auto; padding-top: .5rem; }
.read-more { font-weight: 600; color: var(--blue-mid); font-size: .9rem; }

.sidebar { display: flex; flex-direction: column; gap: 1.5rem; position: sticky; top: calc(var(--nav-h) + 18px); }
.sidebar-block {
  padding: 1.5rem;
  background: var(--bg-base);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
}
.sidebar-block h4 {
  font-size: .82rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted); margin-bottom: 1rem;
}
.sidebar-block ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .65rem; }
.sidebar-block ul a { color: var(--text-soft); font-size: .9rem; }
.sidebar-block ul a:hover { color: var(--blue-primary); }
.popular-item {
  display: flex; gap: .75rem; align-items: flex-start;
  padding: .5rem 0;
}
.popular-item .num {
  flex-shrink: 0; width: 32px; height: 32px;
  border-radius: 9px; background: var(--tint);
  font-variant-numeric: tabular-nums;
  display: grid; place-items: center;
  font-weight: 700; color: var(--blue-primary); font-size: .85rem;
}
.popular-item .title { font-size: .88rem; font-weight: 500; color: var(--text-dark); line-height: 1.4; }
.popular-item .title:hover { color: var(--blue-primary); }

/* ----- Article hero ----- */
.article-hero {
  padding: 1rem 0 3rem;
}
.article-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1rem;
  margin: 1.5rem 0 1rem;
  color: var(--text-muted); font-size: .9rem;
}
.author-mini { display: inline-flex; align-items: center; gap: .65rem; }
.author-mini .avatar { width: 38px; height: 38px; font-size: .8rem; }
.share-row { display: flex; gap: .5rem; align-items: center; }

.post-hero-img {
  margin: 2rem 0;
  aspect-ratio: 16 / 7;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  display: grid; place-items: center;
  color: #fff;
  font-size: 5rem;
}

.toc-sticky { position: sticky; top: 90px; max-height: calc(100vh - 110px); overflow-y: auto; }
.toc-sticky h4 {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted); margin-bottom: .85rem;
}
.toc-sticky ol { padding-left: 1.2rem; margin: 0; display: flex; flex-direction: column; gap: .4rem; }
.toc-sticky a { font-size: .88rem; color: var(--text-soft); }
.toc-sticky a:hover { color: var(--blue-primary); }

.article-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 3rem;
  align-items: start;
}
@media (max-width: 1000px) {
  .article-layout { grid-template-columns: 1fr; }
  .toc-sticky { position: static; max-height: none; }
}

.author-bio {
  margin-top: 3rem;
  padding: 1.75rem;
  background: var(--bg-base);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  display: flex; gap: 1.25rem; align-items: flex-start;
}
.author-bio .avatar { width: 64px; height: 64px; font-size: 1.2rem; }
.author-bio h4 { margin: 0 0 .35rem; }
.author-bio p { margin: 0; font-size: .92rem; }

.newsletter-inline {
  margin: 2.5rem 0;
  padding: 2rem;
  background: var(--bg-base);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-md);
  text-align: center;
}
.newsletter-inline h3 { color: var(--blue-primary); margin-bottom: .5rem; }
.newsletter-inline p { margin-bottom: 1.25rem; }

.related-posts { margin-top: 4rem; }
.related-posts h3 { margin-bottom: 1.5rem; }
