/* ─── Blog styles ───────────────────────────────────────────
   Scoped to /blog/* — extends tokens from styles.css.
   Treat this file as the place to evolve editorial layout
   without touching the marketing site.
─────────────────────────────────────────────────────────── */

/* ─── Nav override for blog pages ───────────────────────────
   The main site's nav is designed to sit over a dark video hero.
   Blog pages have a light background, so we force the nav into
   its light/scrolled state from page load.
─────────────────────────────────────────────────────────── */
.blog-page .nav {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom-color: rgba(15, 23, 42, 0.06);
}
.blog-page .nav .brand-mark { color: var(--ink); }

/* ─── Blog landing ──────────────────────────────────────── */
.blog-hero {
  padding: 120px 0 56px;
  background: linear-gradient(180deg, #ffffff 0%, var(--purple-tint) 100%);
}

.blog-hero .container-narrow { text-align: left; }

.blog-hero-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 24px;
}
.blog-hero-title { min-width: 0; }

.blog-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(40px, 5.6vw, 64px);
  margin: 14px 0 0;
  letter-spacing: -0.028em;
}

.blog-hero-mark {
  flex-shrink: 0;
  width: 130px;
  height: 130px;
}
.blog-hero-mark svg { width: 100%; height: 100%; display: block; }

@media (max-width: 640px) {
  .blog-hero-head {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 20px;
  }
  .blog-hero-mark { width: 88px; height: 88px; }
}

.blog-hero-lede {
  font-size: 19px;
  line-height: 1.62;
  color: var(--gray-700);
  max-width: 640px;
  margin-bottom: 22px;
}

.blog-hero-byline {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--purple-dk);
}

.blog-list {
  padding: 64px 0 96px;
  background: var(--white);
}

.post-card {
  display: block;
  padding: 32px 0;
  border-top: 1px solid var(--gray-200);
}
.post-card:first-child { border-top: 1px solid var(--ink); }

.post-card-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-bottom: 14px;
}
.post-card-meta .sep { color: var(--gray-300); }
.post-card-meta .post-card-tag { color: var(--purple-dk); }

.post-card h2 {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.2vw, 36px);
  margin-bottom: 12px;
  letter-spacing: -0.022em;
}
.post-card h2 a { color: var(--ink); transition: color 160ms ease; }
.post-card:hover h2 a { color: var(--purple-dk); }

.post-card-deck {
  font-size: 17px;
  line-height: 1.6;
  color: var(--gray-600);
  margin-bottom: 16px;
  max-width: 640px;
}

.post-card-readmore {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--purple-dk);
  letter-spacing: -0.005em;
}
.post-card-readmore svg {
  width: 14px; height: 14px;
  transition: transform 160ms ease;
}
.post-card:hover .post-card-readmore svg { transform: translateX(3px); }

/* ─── Single post ───────────────────────────────────────── */
.post {
  padding: 96px 0 64px;
  background: var(--white);
}

.post-header {
  border-bottom: 1px solid var(--gray-200);
  padding-bottom: 32px;
  margin-bottom: 40px;
}

/* ─── Intro / manifesto post header variant ────────────── */
.post-header.is-intro {
  text-align: center;
  border-bottom: none;
  padding-bottom: 12px;
  margin-bottom: 32px;
}
.post-header.is-intro .post-meta { justify-content: center; }
.post-header.is-intro .post-deck { margin-left: auto; margin-right: auto; }

.post-portrait {
  width: 156px;
  height: 156px;
  border-radius: 50%;
  margin: 0 auto 32px;
  display: block;
  background: var(--gray-100);
  object-fit: cover;
  box-shadow:
    0 0 0 1px rgba(124, 58, 237, 0.16),
    0 0 0 6px rgba(124, 58, 237, 0.05),
    0 12px 32px rgba(15, 23, 42, 0.10);
}
@media (max-width: 640px) {
  .post-portrait { width: 128px; height: 128px; margin-bottom: 24px; }
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-bottom: 22px;
}
.post-meta a { color: var(--purple-dk); border-bottom: 1px solid transparent; }
.post-meta a:hover { border-bottom-color: var(--purple-dk); }
.post-meta .sep { color: var(--gray-300); }

.post-header h1 {
  font-family: var(--font-display);
  font-size: clamp(36px, 5.2vw, 60px);
  letter-spacing: -0.028em;
  line-height: 1.06;
  margin-bottom: 18px;
}

.post-deck {
  font-size: 21px;
  line-height: 1.5;
  color: var(--gray-600);
  font-style: italic;
  margin-bottom: 22px;
  max-width: 620px;
}

.post-byline {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--ink);
}
.post-byline .role { color: var(--gray-500); font-weight: 500; }

/* ─── Article body ──────────────────────────────────────── */
.post-body {
  font-size: 18px;
  line-height: 1.75;
  color: var(--gray-800, #2a3441);
}
.post-body > * + * { margin-top: 22px; }

.post-body h2 {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 30px);
  margin-top: 56px !important;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.post-body h2::before {
  content: "";
  display: block;
  width: 28px;
  height: 3px;
  background: var(--gradient);
  border-radius: 2px;
  margin-bottom: 18px;
}

.post-body p { color: var(--gray-700); }

.post-body strong { color: var(--ink); font-weight: 700; }
.post-body em { color: var(--ink); }

.post-body blockquote {
  margin: 32px 0;
  padding: 4px 0 4px 24px;
  border-left: 3px solid var(--purple);
  font-size: 19px;
  line-height: 1.6;
  color: var(--gray-700);
  font-style: italic;
}
.post-body blockquote p { color: var(--gray-700); }

.post-body a {
  color: var(--purple-dk);
  border-bottom: 1px solid var(--purple-border);
  transition: border-color 160ms ease;
}
.post-body a:hover { border-bottom-color: var(--purple-dk); }

/* ─── Lists ─────────────────────────────────────────────────
   Editorial lists used in walkthroughs / architectural choices.
   Numbers and bullets in the brand purple; comfortable line-height
   so multi-sentence items still read as prose.
─────────────────────────────────────────────────────────── */
.post-body ul.post-list,
.post-body ol.post-list {
  margin: 22px 0;
  padding-left: 28px;
  color: var(--gray-700);
}
.post-body ul.post-list { list-style: none; padding-left: 0; }
.post-body ul.post-list > li {
  position: relative;
  padding-left: 24px;
  margin: 14px 0;
}
.post-body ul.post-list > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.78em;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--purple);
}
.post-body ol.post-list { padding-left: 0; counter-reset: postlist; list-style: none; }
.post-body ol.post-list > li {
  position: relative;
  padding-left: 44px;
  margin: 22px 0;
  counter-increment: postlist;
}
.post-body ol.post-list > li::before {
  content: counter(postlist);
  position: absolute;
  left: 0;
  top: 0.05em;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--purple);
  color: #fff;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  border-radius: 50%;
  letter-spacing: 0;
}
.post-body ol.post-list > li > p,
.post-body ol.post-list > li > blockquote,
.post-body ol.post-list > li > pre {
  margin-top: 14px;
}

/* ─── Code (inline + block) ─────────────────────────────────
   Inline <code> is a low-contrast lozenge in our purple-tint.
   Block <pre><code> is a dark slab — matches the post-cta ink
   so config snippets feel weighty, not chatty.
─────────────────────────────────────────────────────────── */
.post-body code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--purple-tint);
  color: var(--purple-dk);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--purple-border);
  word-break: break-word;
}
.post-body a code { color: inherit; background: transparent; border-color: transparent; padding: 0; }

.post-body pre {
  margin: 24px 0;
  padding: 20px 22px;
  background: var(--ink);
  color: #e5e7eb;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.6;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.10);
}
.post-body pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border: 0;
  border-radius: 0;
  font-size: inherit;
  word-break: normal;
  white-space: pre;
}
@media (max-width: 640px) {
  .post-body pre { font-size: 13px; padding: 16px 18px; border-radius: 8px; }
  .post-body ol.post-list > li { padding-left: 40px; }
  .post-body ol.post-list > li::before { width: 26px; height: 26px; font-size: 13px; }
}

/* ─── Figures ───────────────────────────────────────────────
   Editorial inline visuals: single image, grid of stills,
   before/after pair, or an inline SVG diagram. All variants
   share a centered italic caption sitting under the visual.
─────────────────────────────────────────────────────────── */
.post-body .post-figure {
  margin: 40px 0;
}
.post-body .post-figure > img,
.post-body .post-figure > svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}
.post-body .post-figure figcaption {
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--gray-500);
  font-style: italic;
  text-align: center;
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}
.post-body .post-figure figcaption code {
  font-style: normal;
}

/* Shoot strip — 7-up portrait grid.
   Note: tracks use minmax(0, 1fr), not 1fr. CSS Grid's plain '1fr' is
   shorthand for 'minmax(auto, 1fr)' — and 'auto' lets tracks grow to
   the items' intrinsic content width. With explicit width/height on
   the <img> for CLS, that intrinsic width is 600px, so 4 cells would
   expand to 4×600=2400px and overflow the 720px container. minmax(0,…)
   forces the minimum to zero so tracks stay strictly equal-width. */
.post-body .post-figure-grid .post-figure-grid-inner {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.post-body .post-figure-grid img {
  display: block;
  width: 100%;
  height: auto;            /* override HTML height attr so aspect-ratio drives the height */
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 6px;
  background: var(--gray-100);
}
@media (max-width: 720px) {
  .post-body .post-figure-grid .post-figure-grid-inner { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .post-body .post-figure-grid .post-figure-grid-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}

/* Before/after pair — same minmax(0, 1fr) reason as the grid above */
.post-body .post-figure-pair .post-figure-pair-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}
.post-body .post-figure-pair .post-figure-pair-inner > figure {
  margin: 0;
}
.post-body .post-figure-pair img {
  display: block;
  width: 100%;
  height: auto;            /* override HTML height attr so aspect-ratio drives the height */
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 6px;
  background: var(--gray-100);
}
.post-body .post-figure-pair .post-figure-pair-label {
  display: block;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gray-500);
  text-align: center;
}
.post-body .post-figure-pair .post-figure-pair-label.is-after { color: var(--purple-dk); }
@media (max-width: 480px) {
  .post-body .post-figure-pair .post-figure-pair-inner { grid-template-columns: 1fr; gap: 18px; }
}

/* Architecture diagram — inline SVG, soft purple-tint canvas */
.post-body .post-figure-arch svg {
  display: block;
  width: 100%;
  height: auto;
  background: linear-gradient(180deg, #ffffff 0%, var(--purple-tint) 100%);
  padding: 18px;
  box-sizing: border-box;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
}
@media (max-width: 640px) {
  .post-body .post-figure { margin: 32px 0; }
  .post-body .post-figure-arch svg { padding: 12px; border-radius: 10px; }
}

.post-divider {
  border: none;
  margin: 56px auto;
  text-align: center;
  color: var(--gray-300);
  font-size: 18px;
  letter-spacing: 0.5em;
  height: auto;
}
.post-divider::before { content: "· · ·"; }

.post-signoff {
  font-size: 15px;
  color: var(--gray-500);
  font-style: italic;
  text-align: left;
  line-height: 1.65;
}
.post-signoff .signature {
  display: block;
  margin-top: 14px;
  color: var(--ink);
  font-style: normal;
  font-weight: 700;
}
.post-signoff .signature .role { color: var(--gray-500); font-weight: 500; }

/* ─── Byline + signature → /blog/meet-mason ─────────────────
   The author byline (in the post header) and the closing
   signature both link to the "Meet Mason" introduction post.
   Style as subtle inherited-color text that lifts to purple on
   hover — these aren't body-prose links, so no purple border.
─────────────────────────────────────────────────────────── */
.post-byline a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted transparent;
  transition: color 160ms ease, border-color 160ms ease;
}
.post-byline a:hover { color: var(--purple-dk); border-bottom-color: var(--purple-border); }
.post-byline a:hover .role { color: var(--purple-dk); }

.post-signoff .signature a {
  color: inherit;
  text-decoration: none;
  border: 0;
  transition: color 160ms ease;
}
.post-signoff .signature a:hover { color: var(--purple-dk); }
.post-signoff .signature a:hover .role { color: var(--purple-dk); }

/* ─── End-of-post CTA ───────────────────────────────────── */
.post-cta {
  background: var(--ink);
  color: #fff;
  padding: 96px 0;
  text-align: center;
}
.post-cta h2 {
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  margin-bottom: 14px;
  letter-spacing: -0.025em;
}
.post-cta p {
  color: rgba(255,255,255,0.78);
  font-size: 17px;
  max-width: 540px;
  margin: 0 auto 32px;
}

/* ─── Back-to-blog link ─────────────────────────────────── */
.post-footer-nav {
  padding: 0 0 80px;
  background: var(--white);
}
.post-footer-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-600);
  transition: color 160ms ease;
}
.post-footer-nav a:hover { color: var(--purple-dk); }
.post-footer-nav svg { width: 16px; height: 16px; }

/* ─── Mobile tweaks ─────────────────────────────────────── */
@media (max-width: 640px) {
  .blog-hero { padding: 96px 0 48px; }
  .blog-list { padding: 48px 0 72px; }
  .post { padding: 80px 0 48px; }
  .post-body { font-size: 17px; line-height: 1.7; }
  .post-body h2 { margin-top: 44px !important; }
  .post-deck { font-size: 19px; }
  .post-cta { padding: 72px 0; }
}
