/* Blog layout, prose, and code theme — Quiet Editorial.
   Loaded alongside styles.css, which provides the tokens and fonts. */

/* Blog pages read top-to-bottom rather than centering a card. */
body.blog {
  align-items: flex-start;
  padding: 56px 32px 96px;
}

/* Centered reading column. */
.page {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

.card--wide {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

/* ---- Top navigation ---- */
.topnav {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding-bottom: 20px;
  margin-bottom: 44px;
  border-bottom: 1px solid var(--faint);
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.15s ease;
}

.back-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.back-btn .back-arrow {
  display: flex;
  transition: transform 0.15s ease;
}

.back-btn:hover,
.back-btn:focus-visible {
  color: var(--accent);
}

.back-btn:hover .back-arrow,
.back-btn:focus-visible .back-arrow {
  transform: translateX(-3px);
}

/* Author wordmark — right-aligned signature linking home. */
.wordmark {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--muted);
  white-space: nowrap;
}

.wordmark .by {
  color: var(--muted);
  margin-right: 6px;
}

.wordmark .name {
  color: var(--ink);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.wordmark:hover .name,
.wordmark:focus-visible .name {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---- Blog index masthead ---- */
.blog-head {
  margin-bottom: 8px;
}

.blog-head h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(34px, 6vw, 46px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.blog-head .blog-sub {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-top: 16px;
}

/* ---- Post list ---- */
.post-list {
  display: flex;
  flex-direction: column;
  margin-top: 40px;
}

.post-card {
  display: block;
  padding: 28px 0;
  border-top: 1px solid var(--faint);
  text-decoration: none;
  color: var(--ink);
}

.post-list .post-card:last-child {
  border-bottom: 1px solid var(--faint);
}

.post-card h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 25px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  transition: color 0.15s ease;
}

.post-card:hover h2,
.post-card:focus-visible h2 {
  color: var(--accent);
}

.post-card .date {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--label);
  margin-top: 10px;
}

.post-card .excerpt {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.55;
  color: var(--muted);
  margin-top: 12px;
  max-width: 60ch;
}

.empty {
  font-family: var(--serif);
  font-size: 18px;
  color: var(--muted);
  margin-top: 32px;
}

/* ---- Post header ---- */
.post-header {
  margin-bottom: 40px;
}

.post-header h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(30px, 5.5vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.post-meta {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--label);
  margin-top: 18px;
}

.post-meta.draft {
  color: var(--accent);
}

/* Prominent banner at the very top of a draft post (dev-only builds). */
.draft-banner {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  text-align: center;
}

/* ---- Prose (rendered markdown) ---- */
.prose {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 19px;
  line-height: 1.7;
}

.prose > * + * {
  margin-top: 1.2em;
}

.prose h2,
.prose h3,
.prose h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-top: 1.9em;
}

.prose h2 {
  font-size: 26px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--faint);
}

.prose h3 { font-size: 21px; }
.prose h4 { font-size: 18px; }

.prose a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

.prose a:hover {
  color: var(--accent);
}

.prose ul,
.prose ol {
  padding-left: 1.3em;
}

.prose li + li { margin-top: 0.4em; }

.prose blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 20px;
  color: var(--muted);
  font-style: italic;
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 2px;
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--faint);
  margin: 2.4em 0;
}

/* Inline code chip */
.prose :not(pre) > code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: #F1EEE3;
  border: 1px solid var(--faint);
  padding: 1px 6px;
  border-radius: 3px;
}

/* Code blocks: soft warm-dark, quiet */
.prose pre {
  font-family: var(--mono);
  background: #2B2822;
  color: #EDE8DC;
  padding: 20px 22px;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 14.5px;
  line-height: 1.6;
}

.prose pre code {
  font-family: var(--mono);
  background: none;
  border: 0;
  padding: 0;
}

/* ---- Post footer ---- */
.post-footer {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--faint);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.15s ease;
}

.back-link svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
}

.back-link .back-arrow {
  display: flex;
  transition: transform 0.15s ease;
}

.back-link:hover,
.back-link:focus-visible {
  color: var(--accent);
}

.back-link:hover .back-arrow,
.back-link:focus-visible .back-arrow {
  transform: translateX(-3px);
}

/* ---- highlight.js theme (warm, muted, on soft-dark) ---- */
.hljs-comment,
.hljs-quote { color: #9a9384; font-style: italic; }

.hljs-keyword,
.hljs-selector-tag,
.hljs-built_in,
.hljs-name,
.hljs-tag { color: #d39a6a; }

.hljs-string,
.hljs-title,
.hljs-section,
.hljs-attribute,
.hljs-literal,
.hljs-template-tag,
.hljs-template-variable,
.hljs-type,
.hljs-addition { color: #a3b183; }

.hljs-number,
.hljs-symbol,
.hljs-bullet,
.hljs-link,
.hljs-meta,
.hljs-deletion { color: #c98f6b; }

.hljs-title.function_,
.hljs-function .hljs-title,
.hljs-class .hljs-title,
.hljs-title.class_ { color: #8ba6b3; }

.hljs-attr,
.hljs-variable,
.hljs-params { color: #d8d2c4; }

.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 600; }
