/* Blog - editorial, restrained. Inspired by rendahmag.com/membership.
   Anti-design: no cards, no chrome, type and rhythm do the work. */
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body { font-size: 17px; line-height: 1.65; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Blog column aligned with nav .wrap left edge (nav uses max-width 1240
   centred with 32px padding, so its content starts at (100vw - 1240) / 2 + 32).
   On narrow screens, fall back to a 24px gutter. Tom 2026-05-24. */
.blog-wrap {
  max-width: 760px;
  margin-top: 0;
  margin-bottom: 0;
  margin-left: max(24px, calc((100vw - 1240px) / 2 + 32px));
  margin-right: auto;
  padding: 0;
}
@media (max-width: 720px) {
  .blog-wrap { margin-left: 24px; margin-right: 24px; padding: 0; }
}

/* Nav: minimal. Sticky. */
.blog-nav {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}
.blog-nav__inner {
  max-width: 1240px; margin: 0 auto; padding: 0 32px;
  height: 64px; display: flex; align-items: center; gap: 24px;
}
.blog-nav__links {
  display: flex; gap: 22px; margin-left: auto;
  font-size: 14px; color: var(--ink-2);
}
.blog-nav__links a:hover { text-decoration: none; color: var(--ink); }

/* Reserve space before JS hydrates the blog root, so the layout
   doesn't shift when posts render. Tuned to ~hero + 2 rows worth. */
#blog-root { min-height: 70vh; }
/* List view */
.blog-list { padding: 96px 0 120px; }
.blog-list__head { margin-bottom: 72px; }
.blog-list__head .h-1 {
  font-family: var(--sans); font-weight: 700;
  font-size: clamp(40px, 5vw, 64px); line-height: 1;
  letter-spacing: -0.025em;
  margin: 0 0 14px;
}
.blog-list__head .lede {
  font-size: 18px; color: var(--ink-2); line-height: 1.5;
  max-width: 540px; margin: 0;
}
.blog-list__divider {
  text-align: center; color: var(--ink-3);
  letter-spacing: 0.6em; font-size: 14px;
  margin: 56px 0;
}

/* Row layout: optional left thumbnail + text column on the right.
   When the post YAML has no hero_image, the row falls back to a
   single column (text only) without leaving a gap. */
.blog-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  padding: 28px 0 32px;
  border: none;
  align-items: start;
}
.blog-row:not(.blog-row--has-thumb) { grid-template-columns: 1fr; }
.blog-row + .blog-row { border-top: 1px solid var(--rule); margin-top: 8px; }
.blog-row__thumb {
  width: 160px; height: 120px;
  background: var(--paper-2, #f3f1ec);
  border-radius: 10px;
  overflow: hidden;
  display: block;
}
.blog-row__thumb img,
.blog-row__thumb picture {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.blog-row__thumb picture img { width: 100%; height: 100%; }
/* Body images get a max-width so the explicit width/height don't blow out. */
.blog-body picture img,
.blog-body img { max-width: 100%; height: auto; }
/* Play badge for video posts (no inline playback in the list). */
.blog-row__thumb { position: relative; }
.blog-row__play {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(20, 17, 15, 0.85);
  color: #fefcf6;
  border-radius: 999px;
  pointer-events: none;
  transition: background 0.15s ease, transform 0.15s ease;
}
.blog-row__play svg { margin-left: 2px; }
.blog-row:hover .blog-row__play {
  background: var(--coral, #ff5a3c);
  transform: translate(-50%, -50%) scale(1.05);
}
@media (max-width: 640px) {
  .blog-row.blog-row--has-thumb { grid-template-columns: 1fr; }
  .blog-row__thumb { width: 100%; max-width: 280px; height: auto; aspect-ratio: 4 / 3; }
}
.blog-row__date {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-3);
}
.blog-row__title {
  font-family: var(--sans); font-weight: 700;
  font-size: clamp(26px, 2.6vw, 34px); line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 10px 0 8px;
  color: var(--ink);
}
.blog-row__title { transition: color 0.15s ease; }
/* Rollover is colour, not an underline: the whole row is a link, so a hover
   underline sweeps across every line (date, title, desc, meta). Instead the
   title shifts to coral and the play badge lifts (above). */
.blog-row:hover { text-decoration: none; }
.blog-row:hover .blog-row__title { color: var(--coral, #ff5a3c); }
.blog-row__desc { color: var(--ink-2); font-size: 17px; line-height: 1.55; margin: 0; }
.blog-row__meta {
  margin-top: 12px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.05em;
  color: var(--ink-3);
}

/* Post view */
.blog-post { padding: 64px 0 100px; }
.blog-post__back {
  display: inline-block;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em;
  color: var(--ink-3); margin-bottom: 56px;
  text-transform: uppercase;
}
.blog-post__back:hover { text-decoration: none; color: var(--ink); }
.blog-post__head { margin-bottom: 48px; }
.blog-post__date {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 14px;
}
.blog-post__title {
  font-family: var(--sans); font-weight: 700;
  font-size: clamp(38px, 4.6vw, 56px); line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 0 18px;
}
.blog-post__desc {
  font-size: 21px; color: var(--ink-2); line-height: 1.45;
  font-family: var(--display); font-style: italic; font-weight: 500;
  margin: 0;
}
.blog-post__byline {
  margin-top: 24px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.05em;
  color: var(--ink-3);
}
.blog-post__byline strong { color: var(--ink); font-weight: 600; }
.blog-post__divider {
  text-align: center; color: var(--ink-3);
  letter-spacing: 0.6em; font-size: 14px;
  margin: 48px 0 32px;
}

/* Post body */
.blog-body { font-size: 19px; line-height: 1.75; color: var(--ink); }
.blog-body > *:first-child { margin-top: 0; }
.blog-body h2 {
  font-family: var(--sans); font-weight: 700;
  font-size: 26px; line-height: 1.2; letter-spacing: -0.02em;
  margin: 48px 0 14px;
}
.blog-body h3 {
  font-family: var(--sans); font-weight: 600;
  font-size: 20px; line-height: 1.25;
  margin: 36px 0 10px;
}
.blog-body p { margin: 0 0 22px; }
.blog-body strong { font-weight: 700; }
.blog-body em { font-style: italic; }
.blog-body ul, .blog-body ol { padding-left: 22px; margin: 0 0 22px; }
.blog-body li { margin-bottom: 8px; }
.blog-body li > p { margin-bottom: 6px; }
.blog-body blockquote {
  border-left: 2px solid var(--ink);
  margin: 32px 0; padding: 4px 22px;
  color: var(--ink-2); font-style: italic;
  font-family: var(--display); font-weight: 500;
  font-size: 22px; line-height: 1.4;
}
.blog-body code {
  font-family: var(--mono); font-size: 0.88em;
  background: var(--paper-2); padding: 2px 6px; border-radius: 3px;
}
.blog-body pre {
  background: var(--ink); color: var(--bg);
  padding: 18px 22px; border-radius: 6px;
  overflow-x: auto;
  font-family: var(--mono); font-size: 14px; line-height: 1.55;
  margin: 22px 0;
}
.blog-body pre code { background: transparent; padding: 0; color: inherit; font-size: inherit; }
.blog-body hr {
  border: none;
  text-align: center;
  margin: 48px 0;
  color: var(--ink-3);
}
.blog-body hr::after {
  content: "* * *";
  letter-spacing: 0.6em;
  font-size: 14px;
}
.blog-body a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--ink-3); }
.blog-body a:hover { text-decoration-color: var(--ink); }
.blog-body img { max-width: 100%; height: auto; display: block; margin: 32px 0; }

/* Footer */
.blog-footer {
  border-top: 1px solid var(--rule);
  padding: 56px 0;
  font-family: var(--mono); font-size: 11.5px; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 0.06em;
  text-align: center;
}
.blog-footer a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* States - brand sans, sentence case, a real action (no mono, no caps). */
.blog-loading {
  padding: 80px 0; color: var(--ink-3);
  font-family: var(--sans); font-size: 16px;
}
.blog-error { padding: 72px 0 88px; max-width: 34rem; }
.blog-error__title {
  font-family: var(--sans); font-weight: 800;
  font-size: clamp(1.75rem, 5vw, 2.5rem); line-height: 1.15;
  letter-spacing: -0.02em; color: var(--ink); margin: 0 0 0.6rem;
}
.blog-error__body {
  font-family: var(--sans); font-size: 1.125rem; line-height: 1.6;
  color: var(--ink-3); margin: 0 0 1.75rem;
}
.blog-error__actions { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; }
.blog-error__btn {
  display: inline-flex; align-items: center; font-family: var(--sans);
  font-weight: 700; font-size: 1rem; padding: 0.8rem 1.5rem;
  border-radius: 999px; background: var(--coral-fill); color: var(--on-coral);
  text-decoration: none; transition: filter 0.15s ease;
}
.blog-error__btn:hover { filter: brightness(1.06); text-decoration: none; }
.blog-error__link {
  font-family: var(--sans); font-weight: 600; font-size: 1rem;
  color: var(--ink); text-decoration: underline; text-underline-offset: 4px;
}
