/* ============================================================
   BLOG  —  /blog and /blog/<slug>
   Pages are generated by blog/build.py from Hashnode's RSS feed.
   Body HTML comes from Hashnode, so this styles bare elements
   (h2, p, ul, a, blockquote) inside .post-body rather than classes.
   ============================================================ */

/* ---- shared ------------------------------------------------ */
.blog-index,
.post {
  padding: 120px 0 96px;
  background: var(--bg-cream);
}

.post-back {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-2);
  text-decoration: none;
  margin-bottom: 36px;
}
.post-back:hover { color: var(--accent); }

/* ---- index ------------------------------------------------- */
.blog-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(44px, 7vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--fg-1);
  margin: 10px 0 18px;
}

.post-list {
  list-style: none;
  margin: 56px 0 0;
  padding: 0;
  border-top: 1px solid var(--bg-cream-deep);
}
.post-card { border-bottom: 1px solid var(--bg-cream-deep); }
.post-card a {
  display: block;
  padding: 32px 0;
  text-decoration: none;
}
.post-card-meta {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin: 0 0 10px;
}
.post-card-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(26px, 3.4vw, 34px);
  line-height: 1.2;
  color: var(--fg-1);
  margin: 0 0 10px;
  transition: color .15s ease;
}
.post-card a:hover .post-card-title { color: var(--accent); }
.post-card-desc {
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  color: var(--fg-2);
  margin: 0;
  max-width: 62ch;
}

/* ---- post head --------------------------------------------- */
.post-meta {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin: 0 0 14px;
}
.post-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(38px, 6vw, 60px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--fg-1);
  margin: 0 0 20px;
}
.post-lede {
  font-family: var(--font-ui);
  font-size: 20px;
  line-height: 1.55;
  color: var(--fg-2);
  margin: 0 0 40px;
  max-width: 58ch;
}
.post-cover {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 48px;
  border: 1px solid var(--bg-cream-deep);
}

/* ---- post body (raw Hashnode HTML) -------------------------- */
.post-body {
  font-family: var(--font-ui);
  font-size: 18px;
  line-height: 1.72;
  color: var(--fg-1);
  max-width: 68ch;
}
.post-body > *:first-child { margin-top: 0; }

.post-body h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(28px, 3.6vw, 36px);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--fg-1);
  margin: 56px 0 18px;
}
.post-body h3 {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.35;
  color: var(--fg-1);
  margin: 40px 0 14px;
}
.post-body p { margin: 0 0 24px; }
.post-body ul,
.post-body ol { margin: 0 0 24px; padding-left: 24px; }
.post-body li { margin: 0 0 10px; }
.post-body strong { font-weight: 650; color: var(--fg-1); }
.post-body em { font-style: italic; }

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

.post-body blockquote {
  margin: 36px 0;
  padding: 4px 0 4px 24px;
  border-left: 2px solid var(--accent);
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.4;
  color: var(--fg-1);
}
.post-body blockquote p:last-child { margin-bottom: 0; }

.post-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 36px 0;
  border: 1px solid var(--bg-cream-deep);
}
.post-body hr {
  border: 0;
  border-top: 1px solid var(--bg-cream-deep);
  margin: 48px 0;
}
.post-body code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.9em;
  background: var(--bg-cream-deep);
  padding: 2px 6px;
}
.post-body pre {
  background: var(--bg-charcoal);
  color: var(--fg-on-dark-1);
  padding: 20px 24px;
  overflow-x: auto;
  margin: 32px 0;
  font-size: 14px;
  line-height: 1.6;
}
.post-body pre code { background: none; padding: 0; color: inherit; }

.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 32px 0;
  font-size: 16px;
}
.post-body th,
.post-body td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--bg-cream-deep);
}
.post-body th { font-weight: 600; color: var(--fg-1); }

/* ---- post foot ---------------------------------------------- */
.post-foot {
  margin: 64px 0 0;
  padding-top: 32px;
  border-top: 1px solid var(--bg-cream-deep);
  font-family: var(--font-ui);
  font-size: 17px;
  font-weight: 500;
}
.post-foot a { color: var(--accent); text-decoration: none; }
.post-foot a:hover { text-decoration: underline; }

@media (max-width: 720px) {
  .blog-index, .post { padding: 96px 0 72px; }
  .post-body { font-size: 17px; }
  .post-lede { font-size: 18px; }
}
