/* ── Blog ──────────────────────────────────────────────────
   Layered on top of style.css. Reuses the same tokens
   (--bg, --accent, --radius…) so the blog and the landing
   page stay one design.
   ────────────────────────────────────────────────────────── */

.container-narrow {
  max-width: 760px;
}

/* ── Blog index hero ─────────────────────────────────────── */
.blog-hero {
  padding: calc(var(--nav-h) + 80px) 0 56px;
  text-align: center;
}

.blog-hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 20px 0 18px;
  color: var(--text-primary);
}

.blog-hero-sub {
  font-size: 1.075rem;
  line-height: 1.65;
  color: var(--text-secondary);
  max-width: 620px;
  margin: 0 auto;
}

.blog-hero-sub a { color: var(--accent); }

.blog-rss {
  display: inline-block;
  margin-top: 26px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 18px;
  transition: border-color 0.2s, color 0.2s;
}

.blog-rss:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

/* ── Post cards ──────────────────────────────────────────── */
.blog-list { padding-bottom: var(--section-pad); }

.post-cards {
  display: grid;
  gap: 18px;
}

.post-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 30px;
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
}

.post-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-3);
  transform: translateY(-2px);
}

.post-card h2 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin: 10px 0 10px;
  color: var(--text-primary);
}

.post-card p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
}

.post-card-meta,
.post-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.post-meta-dot { opacity: 0.5; }

.post-card-more {
  display: inline-block;
  margin-top: 16px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
}

/* ── Tags ────────────────────────────────────────────────── */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}

.post-tag {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: lowercase;
  color: var(--text-muted);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 9px;
}

/* ── Post page ───────────────────────────────────────────── */
.post { padding: calc(var(--nav-h) + 56px) 0 var(--section-pad); }

.post-back {
  display: inline-block;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 28px;
  transition: color 0.2s;
}

.post-back:hover { color: var(--accent); }

.post-header { margin-bottom: 40px; }

.post-header h1 {
  font-size: clamp(1.85rem, 4.4vw, 2.65rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 16px 0 18px;
  color: var(--text-primary);
}

.post-lede {
  font-size: 1.1rem;
  line-height: 1.65;
  color: var(--text-secondary);
  margin: 0;
}

/* ── Table of contents ───────────────────────────────────── */
.post-toc {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-bottom: 44px;
}

.post-toc-title {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.post-toc ol {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 7px;
}

.post-toc li { color: var(--text-muted); font-size: 0.9rem; }
.post-toc a { color: var(--text-secondary); transition: color 0.2s; }
.post-toc a:hover { color: var(--accent); }

/* ── Post body ───────────────────────────────────────────── */
.post-body {
  font-size: 1.03rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

.post-body h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: var(--text-primary);
  margin: 52px 0 18px;
  scroll-margin-top: calc(var(--nav-h) + 20px);
}

.post-body h3 {
  font-size: 1.15rem;
  font-weight: 650;
  color: var(--text-primary);
  margin: 36px 0 14px;
  scroll-margin-top: calc(var(--nav-h) + 20px);
}

.post-body h4 {
  font-size: 1rem;
  font-weight: 650;
  color: var(--text-primary);
  margin: 28px 0 10px;
}

.post-body p { margin: 0 0 20px; }

.post-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(91, 141, 246, 0.35);
  transition: text-decoration-color 0.2s;
}

.post-body a:hover { text-decoration-color: var(--accent); }

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

.post-body ul,
.post-body ol {
  margin: 0 0 22px;
  padding-left: 22px;
  display: grid;
  gap: 9px;
}

.post-body li { padding-left: 4px; }
.post-body li::marker { color: var(--text-muted); }

.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 8px 0 24px;
}

.post-body hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 44px 0;
}

.post-body code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--text-primary);
}

.post-body pre {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  overflow-x: auto;
  margin: 0 0 24px;
}

.post-body pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.post-body blockquote {
  border-left: 3px solid var(--accent);
  background: var(--bg-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 4px 22px;
  margin: 0 0 24px;
}

.post-body blockquote p { margin: 16px 0; }

/* ── Tables ──────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  margin: 0 0 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.post-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 460px;
}

.post-body thead { background: var(--bg-2); }

.post-body th {
  font-weight: 650;
  color: var(--text-primary);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.post-body td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
}

.post-body tbody tr:last-child td { border-bottom: 0; }
.post-body tbody tr:hover { background: rgba(255, 255, 255, 0.02); }

/* ── In-post CTA ─────────────────────────────────────────── */
.post-cta {
  margin: 56px 0 0;
  background: linear-gradient(135deg, var(--bg-2), var(--bg-card));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px 32px;
}

.post-cta-inner {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.post-cta-icon {
  width: 56px;
  height: 56px;
  border-radius: 13px;
  flex-shrink: 0;
}

.post-cta h3 {
  font-size: 1.075rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 6px;
}

.post-cta p {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0;
}

.post-cta-inner > div { flex: 1 1 260px; }
.post-cta .btn { flex-shrink: 0; }

/* ── Prev / next ─────────────────────────────────────────── */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 26px;
}

.post-nav-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: border-color 0.2s, background 0.2s;
}

.post-nav-item:hover {
  border-color: var(--border-hover);
  background: var(--bg-3);
}

.post-nav-item span {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 7px;
}

.post-nav-item strong {
  display: block;
  font-size: 0.925rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
}

.post-nav-next { text-align: right; }

@media (max-width: 620px) {
  .post-nav { grid-template-columns: 1fr; }
  .post-nav-next { text-align: left; }
  .post-cta { padding: 24px; }
}
