/* Frugal blog — article, index, topic-hub, and author-page styles.
   Loads after styles.css and reuses its tokens (:root custom properties),
   header/footer chrome, buttons, and the CTA banner card. Only what the
   blog needs beyond the marketing page lives here. */

/* --- shared ----------------------------------------------------------- */

.blog-hero {
  padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(1.5rem, 3vw, 2.5rem);
}
.blog-hero h1 {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  max-width: 22ch;
}
.blog-hero .lede { max-width: 58ch; }

.crumbs {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--fg-mute);
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5ch;
}
.crumbs a { color: var(--fg-mute); }
.crumbs a:hover { color: var(--fg); }
.crumbs [aria-current] {
  color: var(--fg-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 34ch;
}

.blog-chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--fg-dim);
}
a.blog-chip:hover { border-color: var(--emerald); color: var(--emerald); }
.blog-chip.static { cursor: default; }

.blog-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

/* --- index / lists ----------------------------------------------------- */

.blog-list { padding: clamp(1.5rem, 3vw, 2.5rem) 0 clamp(3rem, 6vw, 5rem); }

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.blog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: border-color 120ms ease, transform 120ms ease;
}
.blog-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.blog-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fg-mute);
}
.blog-card-kind {
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.blog-card-title {
  font-size: 1.125rem;
  line-height: 1.3;
  letter-spacing: -0.015em;
  margin: 0;
}
.blog-card-title a { color: var(--fg); }
.blog-card-title a:hover { color: var(--emerald); }
.blog-card-excerpt {
  margin: 0;
  color: var(--fg-dim);
  font-size: 0.9375rem;
}

/* --- article ----------------------------------------------------------- */

.post-shell { max-width: 780px; }
.post { padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(3rem, 6vw, 5rem); }

.post-header h1 {
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  margin: 0.75rem 0 1rem;
}
.post-byline {
  color: var(--fg-mute);
  font-size: 0.9375rem;
  margin: 0 0 1rem;
}
.post-byline a { color: var(--fg-dim); font-weight: 500; }
.post-byline a:hover { color: var(--emerald); }

.post-body {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--fg-dim);
}
.post-body > * + * { margin-top: 1.1em; }
.post-body h2 {
  font-size: 1.5rem;
  color: var(--fg);
  margin-top: 2.2em;
  scroll-margin-top: 5rem;
}
.post-body h3 {
  font-size: 1.1875rem;
  color: var(--fg);
  margin-top: 1.8em;
}
.post-body strong { color: var(--fg); }
.post-body a { text-decoration: underline; text-underline-offset: 2px; }
.post-body ul, .post-body ol { padding-left: 1.4rem; }
.post-body li + li { margin-top: 0.45em; }
.post-body blockquote {
  margin: 1.5em 0;
  padding: 0.25rem 1.25rem;
  border-left: 3px solid var(--emerald);
  color: var(--fg-dim);
  font-style: italic;
}
.post-body code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.1em 0.35em;
}
.post-body pre {
  background: var(--term-bg);
  color: var(--term-fg);
  border: 1px solid var(--term-border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.6;
}
.post-body pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
}
.post-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  display: block;
  overflow-x: auto;
}
.post-body th, .post-body td {
  text-align: left;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.post-body th { color: var(--fg); font-weight: 600; white-space: nowrap; }
.post-body hr {
  border: 0;
  border-top: 1px solid var(--border-strong);
  margin: 2.5em 0;
}

/* --- author box + related ---------------------------------------------- */

.author-box {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  margin-top: 3rem;
}
.author-box-mark {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--emerald-soft);
  color: var(--emerald);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.author-box-mark.large { width: 72px; height: 72px; font-size: 1.5rem; }
.author-box-name { margin: 0 0 0.25rem; font-weight: 600; }
.author-box-name a { color: var(--fg); }
.author-box-name a:hover { color: var(--emerald); }
.author-box-bio { margin: 0; color: var(--fg-dim); font-size: 0.9375rem; }

.related { margin-top: 3rem; }
.related h2 { font-size: 1.375rem; margin-bottom: 1.25rem; }

.post-cta { margin-top: 3rem; }

/* --- author page --------------------------------------------------------- */

.author-hero .author-head {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}
.author-hero h1 { margin: 0; }
.author-role {
  margin: 0.35rem 0 0;
  color: var(--fg-mute);
  font-family: var(--font-mono);
  font-size: 0.875rem;
}
.author-bio { max-width: 66ch; }
.author-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 1.5rem;
  font-weight: 500;
}
.author-posts-heading { font-size: 1.375rem; margin-bottom: 1.25rem; }

.topic-intro { max-width: 66ch; margin-top: 1rem; }

@media (max-width: 640px) {
  .blog-grid { grid-template-columns: 1fr; }
}
