/* ==========================================================================
   Journal (Phase 3 demo, RD17, 15 Oct 2026): index (jn-) + article template (ja-).
   Loads after site.css + academy.css (tokens, chips filter). Article body: 17px, 65-character lines.
   ========================================================================== */
.hdr-nav a[aria-current="page"] { color: var(--saffron-lt); }

/* ---------- index ---------- */
.jn-hero { padding: clamp(32px, 5vw, 72px) 0 clamp(24px, 3vw, 40px); }
.jn-hero .wrap { display: grid; gap: 14px; }
.jn-hero h1 { font-size: calc(var(--ds) * clamp(44px, 5vw + 18px, 92px)); color: var(--cream); max-width: 12em; }

.jn-lead { display: grid; gap: 20px; color: inherit; text-decoration: none; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--espresso-2); transition: border-color .4s var(--ease); }
.jn-lead:hover, .jn-lead:focus-visible { border-color: color-mix(in oklab, var(--c) 70%, transparent); }
.jn-lead img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: 50% 30%; }
.jn-lead-copy { display: grid; gap: 12px; padding: 0 20px 24px; align-content: center; }
.jn-lead-copy .label { color: var(--saffron); }
.jn-lead-title { font-size: calc(var(--ds) * clamp(32px, 2.4vw + 18px, 54px)); color: var(--cream); }
.jn-lead-dek { color: var(--ink-soft); max-width: 40em; }
.jn-lead-go { color: var(--saffron); font-weight: 500; min-height: 24px; }
@media (min-width: 900px) {
  .jn-lead { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 0; }
  .jn-lead img { aspect-ratio: auto; height: 100%; min-height: 440px; }
  .jn-lead-copy { padding: 40px; }
}

.jn-n { opacity: .6; font-variant-numeric: tabular-nums; }
.jn-grid { display: grid; gap: 0; border-top: 1px solid var(--line); margin-top: 8px; }
.jn-card[hidden], .jn-lead-wrap[hidden] { display: none; }
.jn-card a {
  display: grid; grid-template-columns: 1fr 96px; grid-template-rows: auto auto 1fr; gap: 6px 16px;
  padding: 18px 0; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; min-height: 44px;
}
.jn-card img { grid-column: 2; grid-row: 1 / 4; width: 96px; height: 96px; object-fit: cover; object-position: 50% 30%; border-radius: 10px; background: var(--espresso-3); }
.jn-topic { display: flex; align-items: center; gap: 8px; }
.jn-topic::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.jn-title { font-size: 18px; line-height: 1.35; font-weight: 500; color: var(--cream); }
.jn-meta { font-size: 14px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.jn-card a:hover .jn-title, .jn-card a:focus-visible .jn-title { color: var(--saffron-lt); }
@media (min-width: 768px) {
  .jn-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 24px; border-top: 0; }
  .jn-card a { grid-template-columns: 1fr; grid-template-rows: none; padding: 0; border: 0; align-content: start; }
  .jn-card img { grid-column: auto; grid-row: auto; width: 100%; height: auto; aspect-ratio: 4 / 3; margin-bottom: 8px; transition: transform .8s var(--ease); }
  .jn-card a:hover img { transform: scale(1.02); }
}
@media (min-width: 1100px) { .jn-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.jn-more { border-top: 1px solid var(--line); margin-top: var(--sec); }

/* ---------- article ---------- */
.ja-head { display: grid; gap: 16px; padding-top: clamp(24px, 4vw, 56px); }
.ja-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px; margin-bottom: -6px; }
.ja-crumbs a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink-muted); text-decoration: none; }
.ja-crumbs a:hover { color: var(--ink); }
.ja-head h1 { font-size: calc(var(--ds) * clamp(38px, 3.4vw + 18px, 76px)); color: var(--cream); max-width: 16em; }
.ja-dek { color: var(--ink-soft); font-size: 19px; line-height: 1.5; max-width: 38em; }
.ja-meta { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 15px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.ja-meta a { color: var(--ink); text-decoration-color: var(--c); display: inline-flex; align-items: center; min-height: 44px; }
.ja-meta > span { display: inline-flex; align-items: center; gap: .3em; }
.ja-hero { margin-top: clamp(20px, 3vw, 40px); }
.ja-hero img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: 50% 28%; border-radius: var(--radius); background: var(--espresso-3); }
@media (min-width: 768px) {
  .ja-hero img { aspect-ratio: 21 / 9; }
  /* portrait photos (most of hers) keep her face: a taller crop, not a letterbox */
  .ja-hero--portrait img { aspect-ratio: 3 / 2; object-position: 50% 18%; }
}

.ja-layout { display: grid; gap: 24px; margin-top: clamp(28px, 4vw, 56px); }
@media (min-width: 1024px) {
  .ja-layout { grid-template-columns: 240px minmax(0, 65ch); gap: 64px; justify-content: center; align-items: start; }
  .ja-layout.no-toc { grid-template-columns: minmax(0, 65ch); }
}

/* "In this article": folded on phones, sticky and open on desktop. Only rendered with 3+ sections. */
.ja-toc { border: 1px solid var(--line); border-radius: var(--radius); background: var(--espresso-2); }
.ja-toc summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 0 18px; font-weight: 500; color: var(--cream); }
.ja-toc summary::-webkit-details-marker { display: none; }
.ja-toc summary::after { content: "+"; font-size: 22px; color: var(--ink-muted); transition: transform .3s var(--ease); }
.ja-toc details[open] summary::after { transform: rotate(45deg); }
.ja-toc ol { counter-reset: t; padding: 0 18px 14px; }
.ja-toc li { counter-increment: t; }
.ja-toc a { display: grid; grid-template-columns: 2em 1fr; padding: 10px 0; min-height: 44px; align-items: start; text-decoration: none; color: var(--ink-soft); font-size: 15px; line-height: 1.4; border-top: 1px solid var(--line); }
.ja-toc a::before { content: counter(t, decimal-leading-zero); color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.ja-toc a:hover, .ja-toc a[aria-current] { color: var(--cream); }
.ja-toc a[aria-current]::before { color: color-mix(in oklab, var(--c) 50%, var(--cream)); }
@media (min-width: 1024px) {
  .ja-toc { position: sticky; top: calc(var(--hdr) + 24px); border: 0; background: none; }
  .ja-toc summary { padding: 0; min-height: 44px; margin-bottom: 0; font: 400 14px/1.4 var(--f-mono); letter-spacing: var(--label-track); text-transform: uppercase; color: var(--ink-muted); cursor: default; }
  .ja-toc summary::after { display: none; }
  .ja-toc ol { padding: 0; }
}

/* the reading column */
.ja-body { font-size: 17px; line-height: 1.7; color: var(--ink); max-width: 65ch; min-width: 0; }
.ja-body > * + * { margin-top: 1.1em; }
.ja-body h2 { font-size: calc(var(--ds) * clamp(28px, 1.4vw + 20px, 38px)); font-weight: var(--display-weight); letter-spacing: var(--display-track); line-height: 1.12; color: var(--cream); margin-top: 2em; scroll-margin-top: calc(var(--hdr) + 20px); text-wrap: balance; }
.ja-body h3 { font-size: 21px; font-weight: 500; line-height: 1.3; color: var(--cream); margin-top: 1.8em; }
.ja-body h4 { font-size: 18px; font-weight: 500; color: var(--cream); margin-top: 1.6em; }
.ja-body h2 + *, .ja-body h3 + *, .ja-body h4 + * { margin-top: .6em; }
.ja-body em { font-style: italic; }
.ja-body strong { font-weight: 600; color: var(--cream); }
.ja-body a { color: var(--saffron-lt); text-decoration-thickness: 1px; }
.ja-body ul, .ja-body ol { padding-left: 1.3em; }
.ja-body ul { list-style: disc; }
.ja-body ol { list-style: decimal; }
.ja-body li + li { margin-top: .45em; }
.ja-body li a { padding-block: 11px; }   /* 44px tap height for link lists, without changing the line layout */
.ja-body li::marker { color: color-mix(in oklab, var(--c) 50%, var(--cream)); }
.ja-body hr { border: 0; border-top: 1px solid var(--line); margin: 2.2em 0; }
.ja-body figure img { width: 100%; height: auto; border-radius: 10px; background: var(--espresso-3); }
.ja-body figcaption { font-size: 15px; color: var(--ink-muted); margin-top: 8px; }
.ja-body code { font: inherit; color: var(--saffron-lt); }
.ja-body blockquote { margin: 1.8em 0; padding-left: 20px; border-left: 3px solid var(--c); }
.ja-body blockquote p { font-size: calc(var(--ds) * 30px); line-height: 1.25; font-weight: var(--display-weight); letter-spacing: var(--display-track); color: var(--cream); }
.ja-body blockquote cite { display: block; margin-top: 10px; font-size: 15px; font-style: normal; color: var(--ink-muted); letter-spacing: 0; }
.ja-body .ja-note { padding: 18px 20px; border-radius: var(--radius); background: color-mix(in oklab, var(--saffron) 8%, var(--espresso-2)); border: 1px solid var(--line); }
.ja-body .ja-note .label { color: var(--saffron); margin-bottom: 6px; }
.ja-body .ja-note p { margin: 0; }
.ja-body .ja-note p + p { margin-top: .5em; }

/* after the article: the next step + the author */
.ja-after { display: grid; gap: 16px; margin-top: clamp(48px, 6vw, 88px); max-width: calc(65ch + var(--gutter) * 2); }
@media (min-width: 1024px) { .ja-after { max-width: calc(240px + 64px + 65ch + var(--gutter) * 2); padding-left: calc(var(--gutter) + 240px + 64px); } }
.ja-end { display: grid; gap: 12px; justify-items: start; padding: clamp(22px, 3vw, 32px); border: 1px solid var(--line-strong); border-left: 3px solid var(--saffron); border-radius: var(--radius); background: var(--espresso-2); }
.ja-end .label { color: var(--saffron); }
.ja-end-line { font-size: calc(var(--ds) * clamp(24px, 1vw + 18px, 30px)); line-height: 1.25; color: var(--cream); font-weight: var(--display-weight); letter-spacing: var(--display-track); }
.ja-author { display: grid; grid-template-columns: 64px 1fr; gap: 16px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); color: inherit; text-decoration: none; }
.ja-author img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; object-position: 50% 20%; }
.ja-author > span { display: grid; gap: 2px; }
.ja-author b { font-weight: 500; color: var(--cream); }
.ja-author > span > span:last-child { color: var(--ink-muted); font-size: 15px; }
.ja-author:hover b { color: var(--saffron-lt); }

/* Theme (16 Oct 2026): text sizes set inside old posts (block editor "small", captions, quotes'
   cite, inline code) never drop under the 14px floor. */
.ja-body .has-small-font-size, .ja-body small, .ja-body figcaption, .ja-body cite, .ja-body code { font-size: max(15px, .9em) !important; }

/* 29 Oct 2026: Privacy and Terms get an icon beside the title and a numbered contents box. */
.lg-head { display: flex; align-items: center; gap: 18px; }
.lg-head .trk-ic { width: 60px; height: 60px; --c: var(--saffron); }
.lg-toc { display: grid; gap: 2px; margin: 8px 0 32px; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--espresso-2); }
.lg-toc a { display: flex; align-items: center; gap: 12px; min-height: 44px; color: var(--ink-soft); text-decoration: none; }
.lg-toc a:hover, .lg-toc a:focus-visible { color: var(--cream); }
.lg-toc b { width: 1.8em; color: var(--saffron); font-weight: 500; font-variant-numeric: tabular-nums; }
