/* ════════════════════════════════════════════════════════════════════════
 * Blog — Field Notes
 *
 * 2026-05-27 rebuild. The previous treatment leaned on a translucent paper
 * card over the photo backdrop; the user feedback was that it "still looks
 * crap". This rewrite is committed to a magazine register — typewriter
 * kickers, italic display titles, dropcaps, ruled section heads, and a
 * numbered-stack gallery for the "more dispatches" list.
 *
 * Variants (Editorial / Manuscript / Folio) layer on top via blog-variants.css.
 * ──────────────────────────────────────────────────────────────────────── */

:root {
  --blog-paper:       #fbf6ec;
  --blog-paper-soft:  #f4ecdc;
  --blog-ink:         #2a2118;
  --blog-ink-mid:     #5a4a38;
  --blog-ink-faint:   #8a7558;
  --blog-rule:        rgba(110, 80, 40, 0.22);
  --blog-rule-strong: rgba(110, 80, 40, 0.42);
  --blog-gold:        #b8893b;
  --blog-gold-deep:   var(--ds-gold-deep);
  --blog-rust:        #b54a2a;
}

html { min-height: 100%; }

.site-body--blog {
  position: relative;
  min-height: 100vh;
  margin: 0;
  /* 2026-05-28: warm paper base, NOT black. User reported "black on top and
   * bottom" — that was the dark body showing past the photo + the floating
   * card margins. Base is now warm paper so any uncovered sliver reads paper,
   * never black. */
  background-color: var(--blog-paper);
  color: var(--blog-ink);
}

/* Full-bleed atmospheric photo: covers the ENTIRE viewport (background-size:
 * cover, fixed) so it reaches every edge with no letterbox bands. The overlay
 * is a soft WARM wash (not a dark veil) so the photo reads as atmosphere and
 * the paper reading-column on top still has full contrast. */
.site-body--blog::before {
  /* 2026-06-01b: the painting now covers the ENTIRE screen (user: "extend the blog
     background to cover the entire screen"). ONE fixed full-bleed image; the masthead
     no longer paints its own copy (see .blog-masthead::before below), so there is no
     duplicate/ghost. A warm wash keeps the floating reading cards legible over it. */
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(251, 246, 236, 0.28), rgba(251, 246, 236, 0.5)),
    image-set(
      url("/static/blog_background.webp") type("image/webp"),
      url("/static/blog_background.jpg") type("image/jpeg")
    ) center 24% / cover no-repeat;
  background-color: var(--blog-paper);
  pointer-events: none;
}

.site-body--blog > * { position: relative; z-index: 1; }

/* ── Topbar ─── transparent over the hero photo so it reaches the top ── */
/* 2026-05-28: the nav floats over the full-bleed hero (light text on a soft
 * top-scrim) so the background image truly extends to the screen's top edge.
 * The masthead sits directly behind it. */
.site-blog-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  background: linear-gradient(180deg, rgba(20, 16, 10, 0.45) 0%, rgba(20, 16, 10, 0.12) 70%, transparent 100%);
  border-bottom: 0;
}
.site-blog-topbar .blog-brand { color: #fffaf2; }
.site-blog-topbar .site-nav-link {
  color: rgba(255, 250, 242, 0.88);
}
.site-blog-topbar .site-nav-link:hover { color: #fff; }
.site-blog-topbar .site-nav-link-active { color: #f0d9a8; }
.site-blog-topbar .site-nav-cta {
  background: rgba(255, 250, 242, 0.16);
  border: 1px solid rgba(255, 250, 242, 0.4);
  color: #fffaf2;
}
.blog-topbar-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.2rem;
  padding: 0.75rem 1.5rem;
}
.blog-brand {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.01em;
  color: var(--blog-ink);
}
.blog-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  justify-content: center;
}
/* The topbar now holds only brand + locale (the old marketing nav is gone,
   2026-07-16) — pin the locale switch to the grid's right-hand column. */
.blog-topbar-inner .site-locale {
  grid-column: 3;
  justify-self: end;
}
.blog-topbar-side {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

/* Variant picker — now full-strength, no longer a tiny chip stuffed in the
 * corner. Sits prominently in the topbar's right-hand slot. */
.site-blog-variant-picker {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.45rem;
  background: rgba(20, 16, 10, 0.06);
  border: 1px solid var(--blog-rule);
  border-radius: 999px;
}
.site-blog-variant-picker__label {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blog-ink-faint);
  padding: 0 0.45rem 0 0.55rem;
}
.site-blog-variant-picker__btn {
  border: 0;
  background: transparent;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  color: var(--blog-ink-mid);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}
.site-blog-variant-picker__btn:hover {
  color: var(--blog-ink);
  background: rgba(184, 137, 59, 0.12);
}
.site-blog-variant-picker__btn.is-active {
  background: var(--blog-ink);
  color: var(--blog-paper);
}

@media (max-width: 820px) {
  .blog-topbar-inner { grid-template-columns: 1fr; }
  .blog-nav { justify-content: flex-start; }
  .blog-topbar-side { justify-content: flex-start; }
}

/* ── Page shell ───────────────────────────────────────────────────── */
/* 2026-05-28: full-screen, no floating card, no black bands. The page is a
 * full-width column; the masthead is a full-bleed photo hero; the reading
 * content sits on a warm-paper plate that flows from the hero to the footer
 * with zero dark gaps. */
.site-blog-page.blog-mag {
  max-width: none;
  margin: 0;
  padding: 0 0 4rem;
  background: transparent;
  position: relative;
}
.site-blog-page.blog-mag > * { position: relative; z-index: 1; }

.blog-back {
  display: inline-block;
  margin: 0 0 1.4rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--blog-ink-mid);
  text-decoration: none;
}
.blog-back::before { content: "← "; }
.blog-back:hover { color: var(--blog-rust); }

/* ── Masthead ─── full-bleed photo hero ───────────────────────────── */
/* 2026-05-28: the background image now fills the masthead edge-to-edge and
 * reaches the top of the screen (the title "extends to the edge"). It is a
 * tall hero band; the title sits over it with a legibility scrim at the
 * bottom that hands off to the reading column below — no hard rectangle, no
 * black band. */
.blog-masthead {
  position: relative;
  text-align: center;
  /* 2026-05-31: the masthead now shares the reading column's width + horizontal
   * padding (max-width 64rem, centred) so the painting and the title block line
   * up edge-for-edge with the body text beneath it. */
  max-width: 64rem;
  margin: 0 auto;
  padding: clamp(5rem, 16vh, 9rem) clamp(1.4rem, 5vw, 4rem) clamp(3rem, 8vh, 5rem);
  min-height: 56vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  overflow: hidden;
}
.blog-masthead::before {
  /* 2026-06-01b: no separate masthead painting — the full-screen body background
     (fixed) shows through here, so the hero and the rest of the page share ONE
     continuous image with no duplicate. */
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: transparent;
  pointer-events: none;
}
/* Bottom-weighted scrim so the title reads + the hero melts into the paper
 * reading column beneath (no hard seam). */
.blog-masthead::after {
  content: "";
  position: absolute;
  /* 2026-06-04: the scrim used to be a column-width rectangle (inset:0), which
     drew a faint BOX around the title over the full-bleed photo. Bleed it out
     past the column and feather the legibility wash as a radial that fades to
     transparent at the sides — only the bottom melts into the paper. */
  left: -50vw;
  right: -50vw;
  top: 0;
  bottom: 0;
  z-index: 0;
  background:
    linear-gradient(180deg, transparent 64%, rgba(251, 246, 236, 0.2) 82%, var(--blog-paper) 100%),
    radial-gradient(ellipse 60% 78% at 50% 42%, rgba(20, 16, 10, 0.34) 0%, rgba(20, 16, 10, 0.12) 55%, transparent 82%);
  pointer-events: none;
}
.blog-masthead > * { position: relative; z-index: 1; }

.blog-masthead__pretitle {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: #f0d9a8;
  margin: 0 0 0.9rem;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
}
.blog-masthead__title {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 800;
  font-size: clamp(2.8rem, 8vw, 5.4rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
  color: #fffaf2;
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.55);
}
.blog-masthead__italic { font-style: italic; font-weight: 700; color: #f0d9a8; }
.blog-masthead__lede {
  margin: 1.2rem auto 0;
  max-width: 40rem;
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  line-height: 1.5;
  color: rgba(255, 250, 242, 0.92);
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.5);
}
.blog-masthead__rule {
  margin: 2rem auto 0;
  width: 70%;
  max-width: 36rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--blog-rule-strong) 20%, var(--blog-rule-strong) 80%, transparent);
}

/* ── Reading column ─── paper plate, full-width, no black gaps ──────── */
/* 2026-05-28: the lead + stack share a continuous warm-paper reading column
 * that flows straight out of the hero. Generous max-width so articles
 * "cover the page". The paper backing + the body's warm photo overlay mean
 * there is never a black band anywhere. */
.blog-lead,
.blog-stack {
  background: var(--blog-paper);
  max-width: 64rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(1.4rem, 5vw, 4rem);
  padding-right: clamp(1.4rem, 5vw, 4rem);
}
.blog-lead {
  margin-bottom: 0;
  padding-top: 2.6rem;
  padding-bottom: 3rem;
}
.blog-lead__kicker {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--blog-rust);
  margin: 0 0 0.7rem;
}
.blog-lead__title {
  margin: 0 0 0.7rem;
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.018em;
  color: var(--blog-ink);
  text-wrap: balance;
}
.blog-lead__byline {
  margin: 0 0 1.6rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blog-ink-faint);
}
.blog-lead__by { color: var(--blog-ink-mid); }
.blog-lead__dot { color: var(--blog-gold); }
.blog-lead__body {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.14rem;
  /* 2026-05-31: looser vertical rhythm so the prose breathes instead of sitting
   * as one static block. */
  line-height: 1.85;
  color: var(--blog-ink);
  column-count: 1;
}
.blog-lead__body > p:first-of-type::first-letter {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 4.2rem;
  font-weight: 800;
  line-height: 0.88;
  float: left;
  padding: 0.18rem 0.7rem 0 0;
  color: var(--blog-gold-deep);
}
.blog-lead__body p { margin: 0 0 1.45rem; }
.blog-lead__body h3 {
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-weight: 700;
  font-size: 1.45rem;
  margin: 2.9rem 0 0.75rem;
  color: var(--blog-ink);
}
.blog-lead__body blockquote, .blog-stack__body blockquote {
  margin: 2.2rem 0;
  padding: 0.5rem 0 0.5rem 1.4rem;
  border-left: 3px solid var(--blog-gold);
  font-style: italic;
  color: var(--blog-ink-mid);
}
.blog-lead__body blockquote.pull, .blog-stack__body blockquote.pull {
  font-size: 1.45rem;
  line-height: 1.45;
  padding-left: 1.6rem;
}
.blog-lead__body code, .blog-stack__body code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.92em;
  background: rgba(184, 137, 59, 0.12);
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
}

/* ── Stack of more articles ──────────────────────────────────────── */
.blog-stack {
  border-top: 2px solid var(--blog-ink);
  padding-top: 2rem;
  padding-bottom: 3.5rem;
  margin-top: 0;
}
.blog-stack__head { margin-bottom: 1.4rem; }
.blog-stack__kicker {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--blog-gold-deep);
  margin: 0 0 0.4rem;
}
.blog-stack__title {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-weight: 700;
  font-size: 1.7rem;
  color: var(--blog-ink);
}
.blog-stack__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.blog-stack__item {
  padding-top: 4.5rem;   /* 2026-05-30: more vertical breathing between dispatches */
  border-top: 0;
  position: relative;
}
/* 2026-05-30: contained, centred ornamental divider — no longer a full-viewport line
 * spilling over the white margins. A short gold rule with a small diamond at its centre,
 * giving the page a calmer, more deliberate rhythm. */
.blog-stack__item + .blog-stack__item::before {
  content: "✦";
  display: block;
  position: absolute;
  top: 1.6rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  color: var(--blog-gold-deep);
  opacity: 0.55;
  text-align: center;
  width: auto;
}
.blog-stack__item + .blog-stack__item::after {
  content: "";
  position: absolute;
  top: 1.95rem;
  left: 50%;
  transform: translateX(-50%);
  /* 2026-05-31: short, contained rule — the old min(38%, 13rem) ran out past
   * the reading column onto the white margins. */
  width: min(20%, 6rem);
  height: 1px;
  background:
    linear-gradient(90deg, transparent, var(--blog-gold-deep) 35%, transparent 42%, transparent 58%, var(--blog-gold-deep) 65%, transparent);
  opacity: 0.4;
}
.blog-stack__item:last-child { border-bottom: none; }
.blog-stack__details { padding: 1.5rem 0 2.6rem; }
.blog-stack__summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 1.1rem;
  padding: 0;
}
.blog-stack__summary::-webkit-details-marker { display: none; }
.blog-stack__num {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--blog-gold-deep);
  align-self: start;
  padding-top: 0.45rem;
}
.blog-stack__title-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.blog-stack__article-title {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  font-size: 1.45rem;
  line-height: 1.18;
  color: var(--blog-ink);
  text-wrap: balance;
}
.blog-stack__article-kicker {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--blog-ink-faint);
}
.blog-stack__hint::after {
  content: "Read";
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--blog-rust);
  white-space: nowrap;
  padding-top: 0.45rem;
  display: inline-block;
}
.blog-stack__details[open] .blog-stack__hint::after { content: "Close"; color: var(--blog-ink-faint); }
.blog-stack__excerpt {
  margin: 0.7rem 0 0 calc(1.1rem + 2ch);
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-size: 1.02rem;
  line-height: 1.55;
  color: var(--blog-ink-mid);
}
.blog-stack__details[open] .blog-stack__excerpt { display: none; }
.blog-stack__body {
  margin: 1rem 0 0.4rem calc(1.1rem + 2ch);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.06rem;
  /* 2026-05-31: match the lead's looser rhythm. */
  line-height: 1.82;
  color: var(--blog-ink);
}
.blog-stack__body p { margin: 0 0 1.25rem; }
.blog-stack__body h3 {
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-weight: 700;
  font-size: 1.25rem;
  margin: 2.2rem 0 0.6rem;
}
.blog-stack__body ul { padding-left: 1.25rem; margin: 0 0 1.25rem; }

@media (max-width: 720px) {
  .blog-stack__summary { grid-template-columns: auto 1fr; gap: 0.8rem; }
  .blog-stack__hint { display: none; }
  .blog-stack__excerpt, .blog-stack__body { margin-left: calc(0.8rem + 2ch); }
}

/* ── Footer ─── blends into the paper column, no dark band ────────── */
/* 2026-05-28: footer was a dark glass bar — that was the "black on the
 * bottom". It now reads as a quiet paper foot on the same warm plate as the
 * reading column, so the page is paper top to bottom. */
.site-blog-foot {
  background: var(--blog-paper);
  border-top: 1px solid var(--blog-rule);
  color: var(--blog-ink-mid);
}
.site-blog-foot .site-foot-inner {
  max-width: 64rem;
  margin: 0 auto;
  padding: 1.6rem clamp(1.4rem, 5vw, 4rem);
}
.site-blog-foot .site-foot-copy { color: var(--blog-ink-faint); }
.site-blog-foot .site-foot-link { color: var(--blog-ink-mid); }
.site-blog-foot .site-foot-link:hover { color: var(--blog-rust); }

/* ── Signature sign-off ─── [[sig:Name]] token ────────────────────── */
.blog-sign {
  margin: 2.8rem 0 0.6rem;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}
/* 2026-06-01b: a real SIGNATURE, not just a font — the name in the handwriting
   face PLUS a hand-drawn flourish swash that signs itself in under it. */
.blog-sign__name {
  display: inline-block;
  font-family: "Caveat", "Playfair Display", cursive;
  font-weight: 700;
  font-size: clamp(2.8rem, 6vw, 3.5rem);
  line-height: 0.78;
  color: var(--blog-ink, #2a2118);
  letter-spacing: 0.01em;
  transform: rotate(-4deg);
  transform-origin: left center;
  padding-left: 0.35rem;
}
.blog-sign__flourish {
  display: block;
  width: clamp(190px, 64%, 290px);
  height: auto;
  margin-top: -0.4rem;
  color: var(--blog-gold-deep, #8a640f);
  transform: rotate(-2.2deg);
  transform-origin: left center;
  opacity: 0.9;
}
@media (prefers-reduced-motion: no-preference) {
  .blog-sign__flourish path {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: blog-sign-draw 1.5s cubic-bezier(0.6, 0, 0.2, 1) 0.35s forwards;
  }
  @keyframes blog-sign-draw { to { stroke-dashoffset: 0; } }
}
html.dark .blog-sign__name { color: var(--blog-gold, #c9a84c); }
html.dark .blog-sign__flourish { color: var(--blog-gold, #c9a84c); }

/* ── Dark-mode tweaks (lab page may apply html.dark) ─────────────── */
html.dark .site-blog-page.blog-mag {
  background: transparent;
  color: #f3e9d4;
}
html.dark .blog-lead,
html.dark .blog-stack { background: #1f1812; }
html.dark .blog-lead__title,
html.dark .blog-stack__article-title,
html.dark .blog-stack__title { color: #f3e9d4; }
html.dark .blog-lead__body,
html.dark .blog-stack__body { color: #e6d8ba; }
html.dark .blog-stack { border-top-color: #f3e9d4; }
html.dark .site-blog-foot { background: #1f1812; color: #e6d8ba; }
html.dark .blog-sign__name { color: var(--blog-gold, #c9a84c); }
