/* Hallmark · page: blog (/blog, /blog/<slug>), the full stamp is site.css · copy: verbatim · every post title, excerpt and body comes from content/posts.json unchanged (contract: post text comes through as written), so the copy gates 19, 58 and 69 report on it as notes */
/* Blog page CSS, tokens only. Link it from blog pages only: any page that links it inherits copy: verbatim.
 * Shape: one rail. On wide screens the date and tag sit in a left rail (columns 1 to 3) and the words read in columns 4 to 11,
 * the same axis on the index rows and on a post. Under 60rem the rail folds in under the title. */

/* ---------- Post lists: /blog and related posts ---------- */
.post-list { margin: 0; padding: 0; list-style: none; border-top: var(--rule-hair) solid var(--color-rule); }
.post-row { position: relative; display: grid; row-gap: var(--space-sm); padding-block: var(--space-xl); border-bottom: var(--rule-hair) solid var(--color-rule); }
.post-row__title { max-width: 40ch; font-size: var(--text-title); line-height: 1.2; }
/* The title link covers the whole row, so the row is one click target and one tab stop. */
.post-row__link { border-radius: var(--space-3xs); color: var(--color-ink); text-decoration-line: none; text-decoration-thickness: 1px; text-underline-offset: 0.18em; transition: color var(--dur-micro) var(--ease-out); }
.post-row__link::after { content: ""; position: absolute; inset: 0; }
.post-row__link:hover { color: var(--color-accent); text-decoration-line: underline; }
.post-row__link:active { color: var(--color-accent-2); }
.post-row__link:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.post-row__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs) var(--space-sm); color: var(--color-ink-2); font-size: var(--text-sm); }
.post-row__excerpt { max-width: 56ch; color: var(--color-ink-2); }
.post-row--feature .post-row__title { font-size: var(--text-2xl); line-height: 1.15; }
.post-row__image { margin: 0 0 var(--space-sm); }
.post-row__image img { width: 100%; border-radius: var(--radius-card); }

/* ---------- One post ---------- */
.post__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs) var(--space-md); margin-bottom: var(--space-xl); color: var(--color-ink-2); font-size: var(--text-sm); }
.post__lead { max-width: 46ch; color: var(--color-ink-2); font-size: var(--text-title); line-height: 1.45; }
.post__cover { margin: var(--space-xl) 0 0; }
.post__cover img { width: 100%; border-radius: var(--radius-card); }

/* Long-form reading: the body a step up from the 16px base (18px on phones, about 21px at 1440).
 * Outfit's zero is wide (about 0.65em), so .prose's 68ch sets near 90 characters a line; 48ch holds it near 70. */
.post__body { max-width: 48ch; margin-top: var(--space-2xl); font-size: var(--text-lead); }
.post__body table, .post__body pre { font-size: var(--text-md); }
/* Row heads are the first cell of each row: read as body text, allowed to wrap. */
.post__body tbody th { font-size: inherit; font-weight: 500; white-space: normal; }
/* A code block's label sits above it. */
.post-code figcaption { margin: 0 0 var(--space-xs); color: var(--color-ink); font-size: var(--text-md); font-weight: 500; }

.post-related__all { margin-top: var(--space-lg); }

/* ---------- Wide screens: the rail ---------- */
@media (min-width: 60rem) {
  .post-row, .post__grid { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap-columns); }
  .post-row { align-content: start; }
  .post-row > * { grid-column: 4 / 12; }
  /* The rail spans the title and excerpt rows, so a one-line title never leaves a gap above its excerpt. */
  .post-row > .post-row__meta { grid-column: 1 / 4; grid-row: 1 / span 2; flex-direction: column; align-items: flex-start; align-self: start; padding-top: var(--space-2xs); }
  .post-row--feature > .post-row__meta { grid-row: 2 / span 2; }

  .post__grid { display: grid; align-items: start; }
  .post__meta { grid-column: 1 / 4; flex-direction: column; align-items: flex-start; margin-bottom: 0; padding-top: var(--space-2xs); }
  .post__content { grid-column: 4 / 12; }
}

/* At 1200px and up the newest post's picture moves beside its title, so the first screen shows the post, not only its picture. */
@media (min-width: 75rem) {
  .post-row--feature { grid-template-rows: auto 1fr; }
  .post-row--feature > .post-row__image { grid-column: 8 / 13; grid-row: 1 / span 2; margin: 0; }
  .post-row--feature > .post-row__title, .post-row--feature > .post-row__excerpt { grid-column: 4 / 8; }
  .post-row--feature > .post-row__meta { grid-row: 1 / span 2; }
}

/* Without the rail the date and tag sit right under the title, so they keep close to it. */
@media (max-width: 60rem) {
  .page-head + .post__main { padding-top: var(--space-lg); }
}

@media (max-width: 40rem) {
  .post-row { padding-block: var(--space-lg); }
}

/* A numbered principle (h3) right under its section heading (h2) needs air to read as a level below it. */
.post__body h2 + h3 { margin-top: var(--space-lg); text-wrap: balance; }
@media (max-width: 40rem) { .post__body h3 { font-size: var(--text-lg); } }
