/* blog.css, /blog site chrome (loaded with prose.css). */

/* ── Blog (/blog, /blog/{slug}) ──────────────────────────────────
 *
 * Posts are markdown with YAML frontmatter (internal/content/blog)
 * rendered through the same hermetic templ + embed.FS pattern as
 * /docs and /whitepaper. Single reading column — a blog has no nav
 * tree to hold, so the sidebar the docs need would only narrow the
 * measure. The rendered body reuses .prose verbatim; these rules add
 * the page frame, the index list, and the post header. */

.blog-index,
.blog-post {
  --fg: #11141b;
  --fg-soft: #3b424f;
  --fg-muted: #73716d;
  --rule-soft: rgba(17, 20, 27, 0.10);
  max-width: 52rem;
  margin: clamp(2rem, 5vw, 4rem) auto clamp(4rem, 8vw, 7rem);
  padding: clamp(2rem, 5vw, 4rem) clamp(1.25rem, 5vw, 3.5rem) clamp(3rem, 7vw, 6rem);
  color: var(--fg-soft);
  background: #f7f8fa;
  border: 1px solid rgba(246, 241, 231, 0.16);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.22);
}

.blog-index-head,
.blog-post-head {
  padding-bottom: var(--size-5);
  border-bottom: 1px solid var(--rule-soft);
  margin-bottom: var(--size-6);
}

.blog-index-head h1,
.blog-post-head h1 {
  color: var(--fg);
  margin: 0.35em 0 0;
  text-wrap: balance;
}

.blog-index-lede {
  color: var(--fg-muted);
  margin: 0.6em 0 0;
}

.blog-post-meta {
  color: var(--fg-muted);
  font-size: 0.9rem;
  margin: 0.7em 0 0;
  display: flex;
  gap: 0.5em;
  flex-wrap: wrap;
}

/* Index list. Numbered in markup (<ol>) because the order is
 * meaningful — newest first — but the numerals are noise. */
.blog-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--size-6);
}

.blog-list-item + .blog-list-item {
  padding-top: var(--size-6);
  border-top: 1px solid var(--rule-soft);
}

.blog-date {
  display: block;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
}

.blog-list-title {
  margin: 0.3em 0 0;
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  text-wrap: balance;
}

.blog-list-title a {
  color: var(--fg);
  text-decoration: none;
}

.blog-list-title a:hover,
.blog-list-title a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.blog-list-summary {
  margin: 0.5em 0 0;
  color: var(--fg-soft);
  max-width: 60ch;
}

.blog-empty {
  color: var(--fg-muted);
}

/* Diagrams ship as inline SVG inside the markdown, so they inherit
 * the prose column's width and must not overflow it. */
.blog-post .prose svg {
  display: block;
  width: 100%;
  height: auto;
  margin: var(--size-5) 0;
}

@media (max-width: 40rem) {
  .blog-index,
  .blog-post {
    box-shadow: none;
  }
}

/* ── Taxonomy: kind chips, tags, year groups ─────────────────────
 *
 * Grouping and filtering are derived from what exists — year headings
 * inside the index rather than /blog/{year} archives, and tag views
 * that 404 when empty. Structure that only appears once there is
 * something to structure, so the site never shows an empty room. */

.blog-tagdir {
  display: flex;
  flex-wrap: wrap;
  gap: var(--size-2);
  margin-bottom: var(--size-6);
  padding-bottom: var(--size-5);
  border-bottom: 1px solid var(--rule-soft);
}

.blog-tag {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4em;
  padding: 0.25em 0.7em;
  border: 1px solid var(--rule-soft);
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--fg-soft);
  text-decoration: none;
  background: var(--bg-elev, #fff);
}

.blog-tag:hover,
.blog-tag:focus-visible {
  border-color: rgba(17, 20, 27, 0.35);
  color: var(--fg);
}

.blog-tag-count {
  font-variant-numeric: tabular-nums;
  font-size: 0.75em;
  color: var(--fg-muted);
}

.blog-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--size-2);
  margin: var(--size-3) 0 0;
  padding: 0;
}

/* Kind is a label, not a section — semantic colour, distinct from the
 * site accent, so an essay and a changelog are separable at a glance. */
.blog-kind {
  display: inline-block;
  padding: 0.15em 0.55em;
  border-radius: 3px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid currentColor;
}

.blog-kind-essay { color: #1f6f63; }
.blog-kind-note { color: #4a5568; }
.blog-kind-changelog { color: #2c5282; }
.blog-kind-announcement { color: #8a5a00; }
.blog-kind-report { color: #6b3fa0; }
.blog-kind-draft { color: #a81f16; }

.blog-year + .blog-year {
  margin-top: var(--size-7);
}

.blog-year-head {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--fg-muted);
  margin: 0 0 var(--size-4);
  padding-bottom: var(--size-2);
  border-bottom: 1px solid var(--rule-soft);
  font-variant-numeric: tabular-nums;
}

.blog-cards {
  display: flex;
  flex-direction: column;
  gap: var(--size-6);
}

.blog-card-meta {
  display: flex;
  align-items: center;
  gap: 0.7em;
  flex-wrap: wrap;
  margin: 0;
}

.blog-card-title {
  margin: 0.35em 0 0;
  font-size: clamp(1.2rem, 2.3vw, 1.5rem);
  text-wrap: balance;
}

.blog-card-title a {
  color: var(--fg);
  text-decoration: none;
}

.blog-card-title a:hover,
.blog-card-title a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.blog-card-summary {
  margin: 0.5em 0 0;
  color: var(--fg-soft);
  max-width: 62ch;
}
