/* Styles for the generated blog pages (/blog/ and /blog/<slug>/).
   Hand-written and safe to edit; the HTML in blog/ is generated, this is not.

   The tokens, typeface and label idiom are lifted verbatim from index.html so
   the blog reads as the same site. Two deliberate differences, both for
   long-form reading rather than looks:
     - the column is 560px instead of 460px (a post needs a measure);
     - the page is top-aligned instead of vertically centred (a post scrolls). */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { color-scheme: light; }

:root {
  --bg: #f4f1ea;
  --ink: #1a1a1a;
  --ink-soft: #3a3a3a;
  --rule: #e2dccd;
  --muted: #9a9382;
  --code-bg: #ece7db;
}

body.blog {
  background: var(--bg);
  color: var(--ink);
  font-family: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  min-height: 100vh;
  padding: 96px clamp(48px, 9vw, 140px);
  display: flex;
  align-items: flex-start;
}

body.blog main {
  width: 100%;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 64px;
}

.label {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

body.blog h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0;
  margin: 0;
}

.crumb {
  margin-bottom: 22px;
}

body.blog a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: opacity 0.15s ease;
  word-break: break-word;
}

body.blog a:hover {
  opacity: 0.55;
}

.crumb a {
  color: inherit;
}

body.blog a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  text-decoration: none;
}

/* --- index listing ------------------------------------------------------- */

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-item {
  display: block;
  padding: 18px 0;
  border-top: 1px solid var(--rule);
}

.post-item:last-child {
  border-bottom: 1px solid var(--rule);
}

.post-link {
  display: inline-block;
  font-size: 14px;
  font-weight: 500;
}

.post-item .post-date {
  display: block;
  margin-top: 8px;
  color: var(--ink-soft);
}

.post-excerpt {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.post-empty {
  margin: 0;
  color: var(--ink-soft);
}

/* --- a single post ------------------------------------------------------- */

body.post header .post-date {
  display: block;
  margin-top: 12px;
  color: var(--ink-soft);
}

.prose {
  font-size: 13px;
  line-height: 1.8;
  color: var(--ink-soft);
}

.prose > *:first-child { margin-top: 0; }
.prose > *:last-child { margin-bottom: 0; }

.prose p {
  margin: 0 0 20px;
}

.prose h2,
.prose h3,
.prose h4 {
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0;
  margin: 40px 0 14px;
  line-height: 1.4;
}

.prose h2 { font-size: 15px; }
.prose h3 { font-size: 13px; }
.prose h4 {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.prose ul,
.prose ol {
  margin: 0 0 20px;
  padding-left: 20px;
}

.prose li {
  margin: 0 0 8px;
}

/* Nested lists: tighter, and the last child carries no trailing gap. */
.prose li > ul,
.prose li > ol {
  margin: 8px 0 0;
}

.prose li > ul li:last-child,
.prose li > ol li:last-child {
  margin-bottom: 0;
}

.prose blockquote {
  margin: 0 0 20px;
  padding: 2px 0 2px 18px;
  border-left: 1px solid var(--rule);
  color: var(--ink);
}

.prose blockquote p {
  margin: 0;
}

.prose code {
  background: var(--code-bg);
  padding: 1px 4px;
  border-radius: 2px;
  font-size: 12px;
  word-break: break-word;
}

.prose pre {
  margin: 0 0 20px;
  padding: 14px 16px;
  background: var(--code-bg);
  border: 1px solid var(--rule);
  border-radius: 2px;
  overflow-x: auto;
  font-size: 11px;
  line-height: 1.7;
}

.prose pre code {
  background: none;
  padding: 0;
  font-size: inherit;
  word-break: normal;
  white-space: pre;
}

.prose hr {
  margin: 36px 0;
  border: 0;
  border-top: 1px solid var(--rule);
}

.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 0 20px;
}

.prose strong {
  color: var(--ink);
  font-weight: 600;
}

body.blog footer {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 24px;
  border-top: 1px solid var(--rule);
}

body.blog footer a {
  color: var(--muted);
}

/* --- phone -------------------------------------------------------------- */

@media (max-width: 520px) {
  body.blog {
    padding: 40px 20px;
  }

  body.blog main {
    gap: 48px;
  }

  body.blog h1 {
    font-size: 24px;
  }

  .prose {
    font-size: 14px;
  }

  .prose h2 { font-size: 16px; }
  .prose h3 { font-size: 14px; }
}
