/* =========================================================================
   Blog — listing + individual posts
   Inherits global tokens from /styles.css. Self-contained — does NOT depend
   on /trust-model/styles.css (different visual treatment: centered single-
   column reading flow instead of sticky-TOC docs layout).
   ========================================================================= */

.blog-body {
  background: var(--bg-primary);
  color: var(--fg-primary);
}

/* Suppress marketing-site grain on blog (cleaner reading surface) */
.blog-body .grain,
.blog-body .cursor { display: none; }

/* Nav adapted for blog: matches body --snow so there's no visible seam
   between the fixed nav and the page on first scroll. */
.nav-blog {
  background: rgba(248, 250, 252, 0.85);
  backdrop-filter: blur(8px) saturate(120%);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
}

/* =========================================================================
   Listing — /blog
   ========================================================================= */
.blog-index {
  padding-top: calc(var(--nav-h) + 64px);
  padding-bottom: 96px;
  min-height: calc(100vh - var(--nav-h));
}

.blog-index-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 28px;
}

.blog-index-head {
  max-width: 720px;
  margin: 0 auto 56px;
  text-align: center;
}
.blog-index-head .eyebrow {
  margin-bottom: 16px;
  display: inline-block;
}
.blog-index-title {
  margin: 0 0 16px;
  font-size: clamp(36px, 4.4vw, 56px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--fg-primary);
}
.blog-index-sub {
  margin: 0 auto;
  font-size: clamp(17px, 1.4vw, 19px);
  line-height: 1.6;
  color: var(--fg-secondary);
  max-width: 56ch;
}

/* Posts stack — single-column text-only entries separated by hairlines.
   Hover reveals a brand-blue stripe on the left and shifts the title color.
   Pattern: text-only tech-publication blog index (Stripe Press, Vercel Blog
   text mode) — no cover imagery, headlines do the work. */
.blog-stack {
  max-width: min(840px, 100%);
  margin: 0 auto;
}

.blog-entry {
  border-top: 1px solid var(--border);
  padding: 40px 0;
}
.blog-entry:last-child {
  border-bottom: 1px solid var(--border);
}

/* The whole entry is one click target. A transparent 3px left border at
   rest reserves the space; on hover/focus it fills with brand-blue and
   the content shifts right by 16px in sync. Reserving the border space
   prevents text reflow on hover. */
.blog-entry-link {
  display: block;
  text-decoration: none;
  color: inherit;
  border-left: 3px solid transparent;
  padding-left: 0;
  transition: border-color .28s var(--ease), padding-left .28s var(--ease);
}
.blog-entry-link:hover,
.blog-entry-link:focus-visible {
  border-left-color: var(--brand-blue);
  padding-left: 10px;
  outline: none;
}

.blog-entry-meta {
  display: block;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 12px;
}

.blog-entry-title {
  margin: 0 0 12px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
  color: var(--fg-primary);
  max-width: 52ch;
  transition: color .28s var(--ease);
}
.blog-entry-link:hover .blog-entry-title,
.blog-entry-link:focus-visible .blog-entry-title {
  color: var(--brand-blue);
}

.blog-entry-lede {
  margin: 0 0 16px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--fg-secondary);
  max-width: 72ch;
}

.blog-entry-cta {
  display: inline-block;
  font-size: 14px;
  font-weight: 500;
  color: var(--brand-blue);
  transition: transform .15s var(--ease);
}
.blog-entry-link:hover .blog-entry-cta,
.blog-entry-link:focus-visible .blog-entry-cta {
  transform: translateX(2px);
}

/* Empty state preserved for future use (no posts yet). */
.blog-index-empty {
  text-align: center;
  color: var(--fg-muted);
  padding: 64px 0;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* =========================================================================
   Post — /blog/<slug>
   Centered single-column long-form reading flow (Stripe Blog / Vercel feel).
   ========================================================================= */
.blog-post {
  padding-top: calc(var(--nav-h) + 48px);
  padding-bottom: 96px;
}

.blog-post-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 24px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--fg-primary);
}

/* Back link — text-style nav link (not a button). Pinned to the left
   of the reading column on desktop via position:fixed; collapses to
   inline on mobile. Chrome stripped so the link top-aligns with the
   eyebrow that sits next to it in the column header row. */
.blog-post-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--brand-blue);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  margin-bottom: 32px;
  transition: color .25s var(--ease);
}
.blog-post-back:hover {
  color: var(--brand-blue-deep);
}

/* Desktop only: pin to the left of the centered reading column. The
   `top` matches .blog-post padding-top so the link's top edge aligns
   with the eyebrow's top edge inside the column. */
@media (min-width: 880px) {
  .blog-post-back {
    position: fixed;
    top: calc(var(--nav-h) + 48px);
    right: calc(50% + 340px + 24px);
    margin-bottom: 0;
    z-index: 10;
  }
}

/* Per-post eyebrow stays on the site's default --fg-muted slate so it
   reads as supporting taxonomy rather than competing with the brand-blue
   back link that sits on the same baseline. */
.blog-post-wrap .eyebrow {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--fg-muted);
}

.blog-post-wrap h1 {
  margin: 0 0 16px;
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--fg-primary);
}

.blog-post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 0 0 40px;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.blog-post-meta span + span::before {
  content: '·';
  margin-right: 12px;
}

/* IMPORTANT: the global `.intro` class is a SECTION container with
   `padding: 140px 0 160px` and `background: var(--snow)`. Our blog
   posts use `.intro` as a typography modifier for the lede paragraph,
   so we need to neutralize the global section-level rules explicitly.
   Resetting padding + background here keeps the post lede from
   inheriting the landing-page intro section's huge top/bottom padding. */
.blog-post-wrap .intro {
  padding: 0;
  background: transparent;
  font-size: 19px;
  line-height: 1.6;
  color: var(--fg-secondary);
  margin: 0 0 40px;
}

.blog-post-wrap h2 {
  margin: 48px 0 16px;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--fg-primary);
  position: relative;
}

.blog-post-wrap h3 {
  margin: 32px 0 12px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg-primary);
  position: relative;
}

.blog-post-wrap p {
  margin: 0 0 20px;
  color: rgba(15, 23, 42, 0.85);
}

.blog-post-wrap strong {
  font-weight: 600;
  color: var(--fg-primary);
}

.blog-post-wrap a:not(.anchor-link):not(.blog-post-back):not(.cta) {
  color: var(--brand-blue);
  text-decoration: underline;
  text-decoration-color: rgba(51, 112, 255, 0.4);
  text-underline-offset: 3px;
  transition: text-decoration-color .2s var(--ease), color .2s var(--ease);
}
.blog-post-wrap a:not(.anchor-link):not(.blog-post-back):not(.cta):hover {
  color: var(--brand-blue-deep);
  text-decoration-color: var(--brand-blue);
}

.blog-post-wrap ul {
  margin: 0 0 20px;
  padding-left: 24px;
}
.blog-post-wrap ul li {
  margin-bottom: 8px;
  color: rgba(15, 23, 42, 0.85);
}

/* Copy-link anchor icon next to each h2/h3 -------------------------------- */
.anchor-link {
  display: inline-flex;
  align-items: center;
  opacity: 0;
  margin-left: 8px;
  color: rgba(15, 23, 42, 0.35);
  text-decoration: none;
  transition: opacity .2s var(--ease), color .2s var(--ease);
  vertical-align: middle;
  cursor: pointer;
  position: relative;
}
.blog-post-wrap h2:hover .anchor-link,
.blog-post-wrap h3:hover .anchor-link {
  opacity: 1;
}
.anchor-link:hover { color: var(--brand-blue); }
.anchor-link svg { width: 18px; height: 18px; }
.anchor-link::after {
  content: 'Copy link';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--white);
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s var(--ease);
  margin-top: 4px;
}
.anchor-link:hover::after { opacity: 1; }
.anchor-link.copied::after { content: 'Copied!'; }

/* FAQ block at the end of posts ------------------------------------------- */
.blog-post-wrap .faq {
  margin-top: 64px;
  padding-top: 48px;
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.08);
}
.blog-post-wrap .faq h2 { margin-top: 0; }
.blog-post-wrap .faq-item { margin-bottom: 24px; }
.blog-post-wrap .faq-item h3 {
  font-size: 17px;
  margin: 0 0 8px;
}
.blog-post-wrap .faq-item p {
  font-size: 16px;
  margin-bottom: 0;
}

/* Optional bottom CTA — reserved for future use (Request access etc.) ----- */
.blog-post-wrap .cta {
  display: inline-block;
  background: var(--brand-blue);
  color: var(--white);
  padding: 14px 28px;
  border-radius: 9999px;
  font-weight: 500;
  text-decoration: none;
  margin-top: 48px;
  transition: opacity .2s var(--ease);
}
.blog-post-wrap .cta:hover { opacity: 0.9; }

/* Responsive -------------------------------------------------------------- */
@media (max-width: 880px) {
  .blog-index-layout { grid-template-columns: 1fr; gap: 24px; }
  .blog-recent { position: static; }
}
@media (max-width: 720px) {
  .blog-index { padding-top: calc(var(--nav-h) + 32px); padding-bottom: 56px; }
  .blog-index-head { margin-bottom: 40px; }
  .blog-entry { padding: 28px 0; }
  .blog-entry-title { font-size: 22px; }
  .blog-entry-lede { max-width: none; }
  .blog-entry-link:hover,
  .blog-entry-link:focus-visible { padding-left: 8px; }
  .blog-post { padding-top: calc(var(--nav-h) + 24px); padding-bottom: 56px; }
  .blog-post-wrap { font-size: 16px; }
  .blog-post-wrap h2 { font-size: 22px; }
  .blog-post-wrap .intro { font-size: 17px; }
}
