/* ==========================================================================
   rides.md — paper + post-prose
   Narrative styling for about (/about/), changelog (/changelog/), journal index, and journal posts.
   Adapted from toms-md. Applied via body.paper.
   ========================================================================== */

:root {
  /* Warm-paper palette matching the rest of the site (site-shell + inverted gray-*). */
  --c-paper:        oklch(96.2% 0.007 92); /* paper (matches site-shell) */
  --c-paper-soft:   var(--color-gray-900);
  --c-text:         var(--color-gray-300);
  --c-strong:       var(--color-gray-100);
  --c-muted:        var(--color-gray-400);
  --c-border:       var(--color-gray-800);
  --c-rule:         var(--color-gray-700);
  --font-serif:     "Newsreader", Georgia, Cambria, "Times New Roman", Times, serif;
  --font-mono:      "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

/* --- Narrative surfaces --------------------------------------------------- */

/* Only content containers opt into Newsreader + paper palette.
   The site-shell body + header/footer stay identical to every other page. */
.post,
.post-list {
  font-family: var(--font-serif);
  color: var(--c-text);
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  hanging-punctuation: first last;
}

.post a,
.post-list a { color: inherit; }

/* --- Eyebrows / meta (mono) ---------------------------------------------- */

.eyebrow,
.meta,
.post-brand {
  font-family: var(--font-mono);
}

.eyebrow {
  margin: 0 0 1.5rem;
  color: var(--c-muted);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 1.5;
  text-transform: uppercase;
  text-wrap: balance;
  font-variant-numeric: tabular-nums;
}

.meta {
  margin: 0.75rem 0 0;
  padding-bottom: 0;
  color: var(--c-muted);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.55;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.meta a { text-decoration: underline; text-underline-offset: 0.22em; }

/* --- Post container ------------------------------------------------------ */

/* Left-aligned to the page gutter (same rail as the home page and the nav),
   not centered. The 54ch reading measure is preserved; only the horizontal
   position changes, so the eyebrow/title start where the logo and home hero do. */
.post {
  margin-inline: 0;
  max-width: 54ch;
}

.post-header { margin-bottom: 1.75rem; }

.post-title {
  margin: 0;
  width: min(92vw, 680px);
  color: var(--c-strong);
  font-size: clamp(2.75rem, 4vw + 1.1rem, 4.9rem);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 0.96;
  text-wrap: balance;
}

.post-title.narrow {
  max-width: 13ch;
  font-size: 2.5rem; /* ~40px; close to Tailwind text-4xl/5xl, not the large display clamp */
  line-height: 1.05;
  letter-spacing: -0.02em;
}

/* --- Prose body ---------------------------------------------------------- */

.post-prose {
  --c-tone-soft: color-mix(in oklab, currentColor 50%, transparent);
  font-size: clamp(1.15rem, 0.2vw + 1.1rem, 1.24rem);
  line-height: 1.78;
}

.post-prose > :first-child { margin-top: 0; }

.post-prose :where(p, li, blockquote) { text-wrap: pretty; }

.post-prose p { margin: 1.25rem 0; }

/* The eyebrow/meta are <p> inside .post-prose, so `.post-prose p` (higher
   specificity) was clobbering their margins and adding a 20px top margin that
   collapsed up and pushed the whole article down. Restore their intended
   margins so the eyebrow sits the same distance below the nav as app pages. */
.post-prose .eyebrow { margin: 0 0 1.5rem; }
.post-prose .meta { margin: 0.75rem 0 0; }

.post-prose :where(a) {
  color: inherit;
  font-weight: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

.post-prose :where(strong) {
  color: var(--c-strong);
  font-weight: 500;
}

.post-prose h2 {
  margin: 3.5rem 0 1rem;
  color: var(--c-strong);
  font-size: clamp(1.85rem, 1.45rem + 0.9vw, 2.2rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.08;
  text-wrap: balance;
}

.post-prose h3 {
  margin: 2.5rem 0 0.85rem;
  color: var(--c-strong);
  font-size: clamp(1.35rem, 1.2rem + 0.6vw, 1.65rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.16;
  text-wrap: balance;
}

.post-prose h4 {
  margin: 1.8rem 0 0.6rem;
  color: var(--c-muted);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1.6;
  text-transform: uppercase;
}

.post-prose :where(ul) { list-style-type: disc; }
.post-prose :where(ol) { list-style-type: decimal; }

.post-prose :where(ul, ol) {
  margin-block: 1.5rem;
  padding-inline-start: 1.25rem;
}

.post-prose :where(ul > li, ol > li) { padding-left: 0.25rem; }

.post-prose :where(ul > li + li, ol > li + li) { margin-top: 0.55rem; }

.post-prose :where(ul > li, ol > li)::marker { color: var(--c-tone-soft); }

.post-prose blockquote {
  margin: 1.75rem 0;
  padding-left: 1rem;
  border-left: 2px solid var(--c-tone-soft);
  color: inherit;
  font-style: normal;
  quotes: none;
}

.post-prose blockquote p::before,
.post-prose blockquote p::after { content: none !important; }

.post-prose hr {
  margin: 3rem 0;
  border: 0;
  border-top: 1px solid var(--c-border);
}

.post-prose figure { margin: 1.75rem 0; }

.post-prose .figure-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  /* Left-anchored at the gutter, filling the content rail (gutter to gutter). */
  width: min(1100px, 61rem, calc(100vw - 3rem));
  margin-top: 2.25rem;
  margin-bottom: 2.5rem;
  margin-left: 0;
  transform: none;
}

.post-prose .figure-pair figure {
  margin: 0;
}

.post-prose .figure-pair figcaption {
  margin-top: 0.5rem;
  padding-bottom: 0.25rem;
}

.post-prose .figure-pair img {
  width: 100%;
  border-radius: 0.75rem;
}

@media (max-width: 640px) {
  .post-prose .figure-pair {
    grid-template-columns: 1fr;
    gap: 1.75rem;
    width: 100%;
    margin: 1.75rem 0;
    transform: none;
  }
}

.post-prose .screenshot-frame {
  width: min(760px, 61rem, calc(100vw - 3rem));
  margin: 2.25rem 0;
  transform: none;
  padding: clamp(0.3rem, 1vw, 0.55rem);
  background: var(--c-paper-soft);
  border: 1px solid var(--c-border);
  border-radius: 0.9rem;
}

.post-prose .screenshot-frame__bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.45rem 0.55rem;
  color: var(--c-muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
}

.post-prose .screenshot-frame__dot {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: color-mix(in oklab, var(--c-muted) 42%, transparent);
}

.post-prose .screenshot-frame__label {
  margin-left: 0.35rem;
  opacity: 0.72;
}

.post-prose .screenshot-frame img {
  display: block;
  width: 100%;
  border-radius: 0.55rem;
}

.post-prose .screenshot-frame figcaption {
  padding: 0 0.25rem 0.2rem;
}

.post-prose figcaption,
.post-prose .caption,
.post-prose small {
  color: var(--c-muted);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  line-height: 1.6;
  text-transform: none;
  margin-top: 0.5rem;
  display: block;
}

.post-prose pre {
  margin: 1.5rem 0;
  background: var(--c-paper-soft);
  border: 1px solid var(--c-border);
  border-radius: 0.5rem;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--c-strong);
}

.post-prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: var(--c-strong);
}

.post-prose pre code { color: inherit; }

.post-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.96rem;
}

.post-prose th,
.post-prose td {
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--c-border);
}

.post-prose th { color: var(--c-strong); font-weight: 500; }
.post-prose td { color: var(--c-text); }
.post-prose table tr:last-child td { border-bottom: none; }

.post-prose a { color: var(--color-accent-ink); text-decoration: underline; text-underline-offset: 0.2em; text-decoration-color: var(--color-accent-ink); }
.post-prose a:hover { color: var(--color-brand-800); }
.post-prose .eyebrow a,
.post-prose .eyebrow a:hover { color: inherit; text-decoration: none; }

.changelog-entry a { color: var(--color-accent-ink); text-decoration: underline; text-underline-offset: 0.2em; }
.changelog-entry a:hover { color: var(--color-brand-800); }

/* --- Listing (journal index entries) ---------------------------------------- */

.post-list { margin-inline: 0; margin-left: 3rem; max-width: 54ch; }

.post-list__entry {
  display: block;
  padding: 2rem 0;
  border-top: 1px solid var(--c-border);
  color: inherit;
  text-decoration: none;
}

.post-list__entry:first-child { border-top: 0; padding-top: 0; }

.post-list__title {
  margin: 0.35rem 0 0.6rem;
  color: var(--c-strong);
  font-size: clamp(1.5rem, 1.2rem + 0.8vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  text-wrap: balance;
}

.post-list__summary {
  color: var(--c-text);
  font-size: 1.08rem;
  line-height: 1.72;
  text-wrap: pretty;
}

.post-list__entry:hover .post-list__title { text-decoration: underline; text-underline-offset: 0.18em; }

/* --- Changelog entries --------------------------------------------------- */

.changelog-entry {
  padding: 3rem 0;
  border-top: 1px solid var(--c-border);
}

.changelog-entry:first-child { border-top: 0; padding-top: 0; }

.changelog-entry__header { margin-bottom: 1.25rem; }

.changelog-entry__date {
  font-size: clamp(1.6rem, 1.25rem + 0.9vw, 2.1rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--c-strong);
}

.changelog-entry__lede {
  margin-top: 0.6rem;
  color: var(--c-muted);
  font-size: 1.05rem;
  line-height: 1.6;
}
