/* Blog — Obsidian-style reading view.
   Self-hosted Inter, a comfortable measure and line-height, and an Obsidian
   dark/light palette. This file is loaded only on /blog/ pages (after
   theme.css and style.css), so the token overrides below re-skin the blog
   without touching the rest of the site. */

/* Inter @font-face lives in theme.css now (the whole site uses Inter). */

/* ── Obsidian palette (overrides theme.css tokens, blog pages only) ───────── */
:root {
  --bg: #ffffff;
  --text: #2e3338;
  --muted: #6b7178;
  --link: #7c5cff;
  --link-hover: #5b3fd6;
  --border: #e4e4e6;
  --heading: #1a1a1a;
  --card-bg: #f4f4f5;
  --code-bg: #f2f2f3;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #1e1e1e;
    --text: #dadada;
    --muted: #9aa0a6;
    --link: #a78bfa;
    --link-hover: #c4b5fd;
    --border: #363636;
    --heading: #e8e8ea;
    --card-bg: #2a2a2a;
    --code-bg: #2a2a2a;
  }
}
:root[data-theme="dark"] {
  --bg: #1e1e1e;
  --text: #dadada;
  --muted: #9aa0a6;
  --link: #a78bfa;
  --link-hover: #c4b5fd;
  --border: #363636;
  --heading: #e8e8ea;
  --card-bg: #2a2a2a;
  --code-bg: #2a2a2a;
}

/* ── Reading layout ───────────────────────────────────────────────────────
   Inter everywhere; content anchored to the top (overriding the vertically
   centered flex body from style.css); a comfortable reading measure. */
body {
  font-family: var(--font-sans);
  align-items: flex-start;
  padding: 3.5rem 1.5rem 5rem;
}

main {
  max-width: 720px;
  gap: 0;
}

.blog-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.1rem;
  margin-bottom: 2.1rem;
}

.blog-header h1 {
  font-family: var(--font-sans);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--heading);
  margin-bottom: 0.5rem;
}

/* Post pages (which have a .post-body) get a lighter title; the /blog index
   keeps its heavier "Blog" heading. */
body:has(.post-body) .blog-header h1 {
  font-weight: 700;
}

.blog-header .breadcrumb {
  color: var(--muted);
  font-size: 0.85rem;
}

.blog-header .breadcrumb a { color: var(--muted); text-decoration: none; }
.blog-header .breadcrumb a:hover { color: var(--text); }

/* ── Post list (blog index) ──────────────────────────────────────────────── */
.post-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}

.post-list li {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.6rem;
}

.post-list li:last-child { border-bottom: none; }

.post-list a {
  color: var(--heading);
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  display: block;
  margin-bottom: 0.35rem;
}

.post-list a:hover { color: var(--link); }

.post-list .meta {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 0.45rem;
}

.post-list .summary {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.7;
}

/* ── Post body — the reading column ──────────────────────────────────────── */
.post-body {
  color: var(--text);
  font-size: 1.12rem;
  line-height: 1.75;
}

.post-body p { margin: 0 0 1.25rem; }
.post-body p:last-child { margin-bottom: 0; }

.post-body em { font-style: italic; color: var(--text); }
.post-body strong { font-weight: 700; color: var(--heading); }

.post-body h2,
.post-body h3,
.post-body h4 {
  font-family: var(--font-sans);
  color: var(--heading);
  line-height: 1.25;
}

.post-body h2 { font-size: 1.55rem; font-weight: 700; margin: 2.4rem 0 0.9rem; }
.post-body h3 { font-size: 1.25rem; font-weight: 700; margin: 2rem 0 0.7rem; }
.post-body h4 { font-size: 1.1rem; font-weight: 600; margin: 1.7rem 0 0.6rem; }

.post-body h2:first-child,
.post-body h3:first-child,
.post-body h4:first-child { margin-top: 0; }

.post-body a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: color-mix(in srgb, var(--link) 50%, transparent);
  transition: color 0.15s, text-decoration-color 0.15s;
}

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

.post-body ul,
.post-body ol {
  margin: 0 0 1.25rem;
  padding-left: 1.5rem;
}

.post-body ul { list-style: disc; }
.post-body ol { list-style: decimal; }

.post-body li { margin-bottom: 0.5rem; }
.post-body li:last-child { margin-bottom: 0; }

.post-body code {
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;
  font-size: 0.88em;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.12em 0.4em;
}

.post-body blockquote {
  border-left: 3px solid var(--border);
  padding: 0.1rem 0 0.1rem 1.1rem;
  margin: 0 0 1.25rem;
  color: var(--muted);
}

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

/* ── Post footer meta ────────────────────────────────────────────────────── */
.post-meta {
  color: var(--muted);
  font-size: 0.875rem;
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.post-meta a { color: var(--muted); text-decoration: none; }
.post-meta a:hover { color: var(--text); }

@media (max-width: 600px) {
  body { padding: 2.25rem 1.25rem 3rem; }
  .blog-header h1 { font-size: 1.7rem; }
  .post-body { font-size: 1.08rem; }
  .post-body h2 { font-size: 1.45rem; }
  .post-body h3 { font-size: 1.2rem; }
}
