/* ==========================================================================
   Blog — index (blog.html) and posts (blog/<slug>.html)
   Reached from the footer only (no header nav item). Scoped: .blog-*, .post-*
   ========================================================================== */

/* ---------- Index ---------- */
.blog-hero .page-hero__title { max-width: 12ch; }
.blog-hero__lead { max-width: 40ch; color: var(--ink-2); }

.blog-list { list-style: none; border-top: 1px solid var(--line-strong); }
.blog-item { border-bottom: 1px solid var(--line); }
.blog-item__link {
  display: grid;
  gap: 10px var(--col-gap);
  padding-block: clamp(22px, 2.6vw, 34px);
  color: inherit;
  text-decoration: none;
}
.blog-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-family: var(--font-sans);
  font-size: var(--fs-label);
  color: var(--muted);
}
.blog-item__title {
  font-size: var(--fs-h3);
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
  transition: color 0.2s var(--ease);
}
.blog-item__body { display: grid; gap: 8px; }
.blog-item__desc { max-width: 60ch; font-size: var(--fs-small); line-height: 1.55; color: var(--ink-2); }
.blog-item__more { font-family: var(--font-sans); font-size: var(--fs-small); font-weight: 500; }
.blog-item__more::after { content: "→"; display: inline-block; margin-left: 0.35em; transition: transform 0.35s var(--ease-out); }
.blog-item__link:hover .blog-item__title { color: var(--accent); }
.blog-item__link:hover .blog-item__more::after { transform: translateX(5px); }
@media (min-width: 900px) {
  .blog-item__link { grid-template-columns: minmax(0, 2fr) minmax(0, 7fr); align-items: start; }
  .blog-item__meta { flex-direction: column; padding-top: 0.3em; }
  .blog-item__body { gap: 10px; }
}

/* ---------- Post: hero ---------- */
.post-hero .page-hero__title { font-size: var(--fs-h1); line-height: 1.04; letter-spacing: -0.035em; max-width: 22ch; }
.post-hero__lead { max-width: 46ch; color: var(--ink-2); }
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: clamp(20px, 2.4vw, 32px);
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-family: var(--font-sans);
  font-size: var(--fs-label);
  color: var(--muted);
}
.post-meta strong { font-weight: 500; color: var(--ink); }
.post-back { display: inline-flex; gap: 8px; margin-top: 14px; font-family: var(--font-sans); font-size: var(--fs-label); color: var(--muted); }
.post-back:hover { color: var(--accent); }

/* ---------- Post: table of contents (label column) ---------- */
.post-toc { display: grid; gap: 12px; align-content: start; }
.post-toc__head {
  font-family: var(--font-sans);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.post-toc ol { list-style: none; display: grid; counter-reset: toc; }
.post-toc a {
  display: flex;
  gap: 10px;
  padding-block: 6px;
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  font-weight: 500;
  line-height: 1.3;
  color: var(--ink-2);
  counter-increment: toc;
}
.post-toc a::before {
  content: counter(toc, decimal-leading-zero);
  flex: none;
  min-width: 1.6em;
  font-size: var(--fs-micro);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding-top: 0.15em;
}
.post-toc a:hover { color: var(--accent); }
@supports selector(:target-current) {
  .post-toc { scroll-target-group: auto; }
  .post-toc a:target-current, .post-toc a:target-current::before { color: var(--accent); }
}
@media (max-width: 899px) {
  .post-toc { padding-bottom: 8px; }
  .post-toc a { border-top: 1px solid var(--line); padding-block: 8px; }
}

/* ---------- Post: article body ---------- */
.post-body { max-width: 42rem; }
.post-body > * + * { margin-top: 1.05em; }
.post-body p,
.post-body li { font-family: var(--font-serif); font-size: var(--fs-body); line-height: 1.66; color: var(--ink-2); }
.post-body > p,
.post-body > ul,
.post-body > ol { max-width: 59ch; }
.post-body h2 {
  margin-top: clamp(44px, 5vw, 72px);
  font-size: clamp(1.375rem, 1.25rem + 0.4vw, 1.625rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  scroll-margin-top: calc(var(--header-h) + 24px);
  text-wrap: balance;
}
.post-body h3 { margin-top: 2em; font-size: var(--fs-h4); line-height: 1.25; letter-spacing: -0.01em; }
.post-body h2 + *, .post-body h3 + * { margin-top: 0.7em; }
.post-body ul, .post-body ol { padding-left: 1.2em; }
.post-body li + li { margin-top: 0.45em; }
.post-body li::marker { color: var(--muted); }
.post-body strong { font-weight: 600; color: var(--ink); }
.post-body a:not(.btn) { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
.post-body a:not(.btn):hover { text-decoration-thickness: 2px; }
.post-body blockquote {
  padding-left: 20px;
  border-left: 2px solid var(--accent);
  font-family: var(--font-serif);
  font-size: var(--fs-lead);
  line-height: 1.4;
  color: var(--ink);
}
.post-body table { width: 100%; border-collapse: collapse; font-family: var(--font-sans); font-size: var(--fs-small); }
.post-body th, .post-body td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; line-height: 1.45; }
.post-body th { font-weight: 600; color: var(--ink); border-bottom-color: var(--line-strong); }
.post-table { overflow-x: auto; }

/* Callout: a checklist or key takeaway inside the article */
.post-note {
  padding: 20px 22px;
  border-radius: var(--radius);
  background: var(--paper-2);
}
.post-note > * + * { margin-top: 0.6em; }
.post-note__title { font-family: var(--font-sans); font-size: var(--fs-small); font-weight: 600; color: var(--ink); }
.post-body .post-note p, .post-body .post-note li { font-size: var(--fs-small); line-height: 1.55; }

/* ---------- Post: end (related concept + more posts) ---------- */
.post-end { display: grid; gap: 24px var(--col-gap); }
@media (min-width: 700px) { .post-end { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.post-end__card {
  display: grid;
  gap: 8px;
  align-content: start;
  padding-top: 16px;
  border-top: 1px solid var(--line-strong);
}
.post-end__kicker { font-family: var(--font-sans); font-size: var(--fs-label); color: var(--muted); }
.post-end__card h2, .post-end__card h3 { font-size: var(--fs-h4); line-height: 1.25; letter-spacing: -0.01em; }
.post-end__card p { font-size: var(--fs-small); line-height: 1.55; color: var(--ink-2); }
.post-end__list { list-style: none; display: grid; }
.post-end__list a { display: block; padding-block: 8px; border-bottom: 1px solid var(--line); font-family: var(--font-sans); font-weight: 500; line-height: 1.3; }
.post-end__list a:hover { color: var(--accent); }
