/* ===========================================================================
   blog.css — styles for /blog (list + post pages).
   Reuses the design tokens from styles.css (:root). Loaded AFTER styles.css,
   so .container, .site-header, .btn, .site-footer all come for free.
   =========================================================================== */

/* Clear the fixed site-header */
.blog-main {
  padding-top: 132px;
  padding-bottom: 96px;
  min-height: 70vh;
}

.blog-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Breadcrumb / back link ─────────────────────────────────────────────── */
.blog-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
  margin-bottom: 28px;
}
.blog-back:hover { color: var(--accent); }

/* ── List header ────────────────────────────────────────────────────────── */
.blog-index-head { margin-bottom: 48px; }
.blog-index-head h1 {
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}
.blog-index-head p {
  font-size: 18px;
  color: var(--text-mid);
  margin: 0;
  max-width: 60ch;
}

/* ── Post list ──────────────────────────────────────────────────────────── */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.post-card {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color var(--dur) var(--ease),
              background var(--dur) var(--ease),
              transform var(--dur) var(--ease);
}
.post-card:hover {
  border-color: var(--border-mid);
  background: var(--surface-2);
  transform: translateY(-2px);
}
.post-card-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.post-card-meta .dot { opacity: 0.5; }
.post-card h2 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  color: var(--text);
}
.post-card:hover h2 { color: var(--accent); }
.post-card p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-mid);
  margin: 0;
}

.post-list-empty {
  color: var(--text-muted);
  font-size: 16px;
  padding: 40px 0;
}

/* ── Single post header ─────────────────────────────────────────────────── */
.post-header { margin-bottom: 36px; }
.post-header h1 {
  font-size: clamp(30px, 4.5vw, 42px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
}
.post-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 14px;
  color: var(--text-muted);
}
.post-meta .dot { opacity: 0.5; }

/* ── Post body typography ───────────────────────────────────────────────── */
.post-body {
  font-size: 17px;
  line-height: 1.75;
  color: var(--text-mid);
}
.post-body > *:first-child { margin-top: 0; }
.post-body h2 {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 48px 0 16px;
}
.post-body h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin: 36px 0 12px;
}
.post-body p { margin: 0 0 20px; }
.post-body a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-dim);
  transition: border-color var(--dur) var(--ease);
}
.post-body a:hover { border-bottom-color: var(--accent); }
.post-body ul,
.post-body ol { margin: 0 0 20px; padding-left: 24px; }
.post-body li { margin-bottom: 8px; }
.post-body strong { color: var(--text); font-weight: 600; }
.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 24px 0;
}
.post-body blockquote {
  margin: 24px 0;
  padding: 4px 20px;
  border-left: 3px solid var(--accent);
  color: var(--text);
  background: var(--accent-dim);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.post-body blockquote p:last-child { margin-bottom: 0; }
.post-body hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}
.post-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
}
.post-body pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  overflow-x: auto;
  margin: 0 0 24px;
}
.post-body pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: 14px;
  line-height: 1.6;
}
.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 24px;
  font-size: 15px;
}
.post-body th,
.post-body td {
  border: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
}
.post-body th { background: var(--surface-2); color: var(--text); font-weight: 600; }

/* ── Post footer CTA ────────────────────────────────────────────────────── */
.post-cta {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}
.post-cta p { margin: 0; color: var(--text-mid); font-size: 16px; }

@media (max-width: 600px) {
  .blog-main { padding-top: 104px; }
  .post-body { font-size: 16px; }
}
