/* ==========================================================================
   Blog theme — extends marketing-theme.css (loaded first, see
   scripts/build-blog.mjs's pageShell) with typography for long-form
   article prose and the /blog index grid. Reuses that file's tokens
   (--bg/--ink/--muted/--accent/--gold/--line/--font-display/--font-body)
   rather than redefining a second palette, per brand/BRAND.md.
   ========================================================================== */

.blog-wrap { padding-top: 40px; padding-bottom: 64px; }

/* ---------- Index page ---------- */
.blog-index h1 { text-align: center; margin: 0 0 8px; }
.blog-index-list {
  display: grid;
  gap: 18px;
  margin-top: 40px;
}
.blog-index-card {
  display: block;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s ease;
}
.blog-index-card:hover,
.blog-index-card:focus-visible { border-color: var(--line-bright); }
.blog-index-date {
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  font-size: 0.8rem;
  color: var(--muted);
}
.blog-index-card h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 8px 0 6px;
  letter-spacing: -0.01em;
  text-align: left; /* overrides marketing-theme.css's `section h2 { text-align: center }` — that rule targets marketing-page section headers, not card titles inside .blog-index's <section> */
}
.blog-index-card p { margin: 0; color: var(--muted); line-height: 1.5; }

/* ---------- Post page ---------- */
.blog-post { max-width: 68ch; margin: 0 auto; }
.blog-back {
  display: inline-block;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 24px;
}
.blog-back:hover { color: var(--accent); }
.blog-post h1 {
  font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.3rem);
  line-height: 1.2;
  margin: 0 0 10px;
}
.blog-meta {
  font-family: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

/* Prose rendered from markdown — deliberately generous line-height/measure
   for long-form reading, distinct from the tighter marketing copy above
   the fold on index.html. */
.blog-body { font-size: 1.05rem; line-height: 1.7; }
.blog-body p { margin: 0 0 22px; }
.blog-body strong { color: var(--ink); font-weight: 700; }
.blog-body a { color: var(--accent); text-decoration-color: var(--line-bright); }
.blog-body a:hover { text-decoration-color: currentColor; }
.blog-body h2 {
  font-size: 1.3rem;
  margin: 40px 0 16px;
  text-align: left;
}
/* Comparison tables wrap cell text to fit the 68ch reading column instead
   of forcing horizontal scroll — a table of short phrases reads better
   wrapped than as a wide scrolling strip. Still scrolls as a fallback on
   very narrow viewports where even wrapped columns don't fit. */
.blog-body table {
  display: block;
  overflow-x: auto;
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 22px;
  font-size: 0.95rem;
}
.blog-body th,
.blog-body td {
  padding: 10px 14px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

/* Newsletter signup — under every post and on the blog index. Markup is built
   in scripts/build-blog.mjs (newsletterSignupHtml()), behavior in
   src/marketing/newsletterSignup.ts. */
.newsletter-signup {
  margin: 48px 0 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}
.newsletter-signup h2 { font-size: 1.1rem; margin: 0 0 6px; text-align: left; }
.newsletter-signup p { margin: 0 0 14px; color: var(--muted); font-size: 0.95rem; }
.newsletter-signup form { display: flex; gap: 10px; flex-wrap: wrap; }
.newsletter-signup input[type="email"] {
  flex: 1 1 220px;
  min-width: 0;
  padding: 12px 14px;
  font: inherit;
  border: 1px solid var(--line-bright);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
}
.newsletter-signup input[type="email"]::placeholder { color: var(--faint); }
.newsletter-signup input[type="email"]:focus { outline: none; border-color: var(--accent); }
.newsletter-signup button {
  padding: 12px 20px;
  font: inherit;
  font-weight: 700;
  border: 0;
  border-radius: 8px;
  background: var(--gold);
  color: var(--accent-ink);
  cursor: pointer;
}
.newsletter-signup button:disabled { opacity: 0.6; cursor: default; }
.newsletter-signup .newsletter-status { min-height: 1.2em; margin: 10px 0 0; font-size: 0.9rem; }
.newsletter-signup .newsletter-status.is-error { color: var(--warning); }
/* Honeypot: off-screen rather than display:none, since some bots skip
   display:none fields. */
.newsletter-signup .nl-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 640px) {
  .blog-wrap { padding-top: 24px; padding-bottom: 40px; }
  .blog-index-card { padding: 18px; }
  .blog-post h1 { margin-bottom: 8px; }
  .blog-body { font-size: 1rem; }
}
