/* Blog: list page and post page. Article elements (.prose) are the only components a post can use;
   blogs/README.md lists them for writers. */

/* ---- List ---- */
.blog-head { padding-bottom: var(--fp-space-block); }
.blog-list { padding-bottom: var(--fp-space-section); }
.blog-head .lead a { color: var(--fp-text); text-decoration: underline; text-decoration-color: #58758D; text-underline-offset: 3px; }
.blog-head .eyebrow a { color: inherit; text-decoration: none; }
.blog-head .eyebrow a:hover { color: var(--fp-text); }
.empty { color: var(--fp-text-muted); }
.post-meta { font: 500 12px/1.4 var(--fp-font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--fp-text-label); }
.post-title { font: 500 24px/1.25 var(--fp-font-display); letter-spacing: -0.02em; color: var(--fp-text); transition: color .15s; }
.post-desc { max-width: 680px; font: 400 16px/1.6 var(--fp-font-lead); color: #B8C8D6; }

/* ---- Blog page: filter chips and post cards ---- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; }
.blog-title { margin: 0 0 20px; font-family: var(--fp-font); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; padding-bottom: 28px; border-bottom: 1px solid #22394D; }
.filters[hidden] { display: none; }
.chip { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid #22394D; background: transparent; color: #B8C8D6; font: 500 14px/1 var(--fp-font-lead); cursor: pointer; transition: border-color .15s, color .15s; }
.chip:hover { border-color: #58758D; color: var(--fp-text); }
.chip[aria-pressed="true"] { background: #F2F5F8; border-color: #F2F5F8; color: #0A141D; }
.cards { list-style: none; margin: 0; padding: 32px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 900px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .cards { grid-template-columns: minmax(0, 1fr); } }
.filters[hidden] + .cards { padding-top: 0; }
.cards > li[hidden] { display: none; }
.card { display: flex; flex-direction: column; height: 100%; border: 1px solid #22394D; border-radius: 14px; overflow: hidden; background: #070E14; text-decoration: none; transition: transform .18s ease, border-color .18s ease; }
.card:hover, .card:focus-visible { transform: translateY(-3px); border-color: #9DB3C5; }
.card-cover { display: block; aspect-ratio: 16 / 9; background: #0F2130; border-bottom: 1px solid #22394D; overflow: hidden; }
.card-cover svg { display: block; width: 100%; height: 100%; }
.card-cover .hl { opacity: .9; transition: opacity .2s; }
.card:hover .card-cover .hl, .card:focus-visible .card-cover .hl { opacity: 1; }
.card-body { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px 18px; }
.card-cat { font: 500 11px/1 var(--fp-font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--fp-text); }
/* Two lines of title and three of description, always, so cards line up whatever the text length. */
.card-title { font: 500 18px/1.25 var(--fp-font-display); letter-spacing: -0.02em; color: var(--fp-text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.card-desc { font: 400 14px/1.5 var(--fp-font-lead); color: #B8C8D6; font-variant-numeric: normal; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; min-height: 4.5em; }
.card-meta { margin-top: 4px; font: 400 12px/1.4 var(--fp-font-mono); letter-spacing: 0.04em; color: #9DB3C5; }
@media (prefers-reduced-motion: reduce) { .card { transition: none; } .card:hover, .card:focus-visible { transform: none; } }

/* ---- Playbook ---- */
.track + .track { margin-top: var(--fp-space-section); }
.track-head { max-width: 640px; margin-bottom: 20px; }
.track-title { margin: 0; font: 500 clamp(24px, 3vw, 32px)/1.15 var(--fp-font-display); letter-spacing: -0.03em; color: var(--fp-text); }
.track-blurb { margin: 12px 0 0; font: 400 16px/1.6 var(--fp-font-lead); color: #B8C8D6; }
.lessons { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--fp-border); }
.lessons li { border-bottom: 1px solid var(--fp-border); }
.lessons a { display: grid; grid-template-columns: 56px minmax(0, 1fr); column-gap: 24px; align-items: baseline; padding: 20px 0; text-decoration: none; }
.lesson-n { font: 500 15px/1 var(--fp-font-mono); color: var(--fp-text-label); }
.lessons .post-title { font-size: 20px; }
.lessons a:hover .post-title { color: #FFFFFF; }
.lesson-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding-top: 24px; border-top: 1px solid var(--fp-border); }
.lesson-nav + .post-cta { margin-top: 24px; }
.lesson-link { display: flex; flex-direction: column; gap: 8px; text-decoration: none; }
.lesson-link.next { text-align: right; }
.lesson-link .post-title { font-size: 18px; }
.lesson-link:hover .post-title { text-decoration: underline; text-underline-offset: 4px; }

/* ---- Post ----
   A post or a lesson: a dark title band over the route map (components/PostHero.astro), then a light
   reading area (class "theme-light", site.css). The header, the footer and the lists above stay dark.
   Everything below takes its colours from the theme tokens, so it follows the block it sits in. */
.post .wrap { max-width: 640px; }
.post-hero { position: relative; overflow: hidden; isolation: isolate; padding-block: 72px 64px; }
/* The map is faint behind the title and clearest on the right. It does not draw itself in: people came to read. */
.post-hero .hero-map { -webkit-mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.2) 55%, #000 100%); mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.2) 55%, #000 100%); }
.post-hero .hero-map img, .post-hero .hero-map .lanes { top: -60%; height: 260%; }
.post-hero .hero-map img, .post-hero .lane, .post-hero .vessel, .post-hero .port { animation: none; }
.post-hero .lane { stroke-dashoffset: 0; }
.post-body { padding-top: 48px; }
.post-head .eyebrow { margin: 0 0 20px; }
.post-head .eyebrow a { color: inherit; text-decoration: none; }
.post-head .eyebrow a:hover { color: var(--fp-text); }
.post-h1 { margin: 0; font: 500 clamp(32px, 4.4vw, 48px)/1.08 var(--fp-font-display); letter-spacing: -0.035em; color: var(--fp-text); }
.post-byline { display: flex; flex-wrap: wrap; gap: 6px 28px; margin: 22px 0 0; font: 500 12px/1.4 var(--fp-font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--fp-text-muted); }
.post-byline a { color: inherit; text-decoration: none; }
.post-byline a:hover { text-decoration: underline; text-underline-offset: 3px; }
.post-cover { margin: 0 0 40px; }
.post-cover img { display: block; width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--fp-border); }

/* Reading area as a research brief (components/PostBody.astro, Jerry 2026-11-15):
   numbered section index | article | footnotes beside the text on wide windows; one column below 1240px. */
.post-grid { display: grid; grid-template-columns: minmax(0, 1fr); }
.post-grid > .wrap { width: 100%; }
/* In short: up to three numbered lines for a reader who stops after one screen. */
.post-brief { margin: 0 0 24px; padding: 18px 0 24px; border-top: 1px solid var(--fp-text); border-bottom: 1px solid var(--fp-border); }
.post-brief .post-meta { color: var(--fp-text); }
.post-brief ol { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 14px; counter-reset: brief; }
.post-brief li { position: relative; counter-increment: brief; padding-left: 36px; font: 500 16px/1.5 var(--fp-font); color: var(--fp-text); }
.post-brief li::before { content: counter(brief); position: absolute; left: 0; top: 0; width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid var(--fp-text); border-radius: 4px; font: 500 11px/1 var(--fp-font-mono); color: var(--fp-text); }
/* Section index, the kind that opens on a tap (phones and narrow windows). */
.post-index { margin: 0 0 32px; border-bottom: 1px solid var(--fp-border); scroll-margin-top: 96px; }
.post-index summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 18px; cursor: pointer; list-style: none; }
.post-index summary::-webkit-details-marker { display: none; }
.post-index-count { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--fp-text-muted); }
.post-index-count::after { content: ""; width: 7px; height: 7px; margin-top: -4px; border-right: 1.5px solid var(--fp-text-label); border-bottom: 1.5px solid var(--fp-text-label); transform: rotate(45deg); }
.post-index[open] .post-index-count::after { margin-top: 4px; transform: rotate(-135deg); }
.post-index ol { list-style: none; margin: 0; padding: 0 0 14px; counter-reset: section; }
.post-index li { counter-increment: section; display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: baseline; }
.post-index li::before { content: counter(section, decimal-leading-zero); font: 500 12px/1 var(--fp-font-mono); color: var(--fp-text-label); }
.post-index a { padding: 9px 0; font: 400 16px/1.4 var(--fp-font); color: var(--fp-text); text-decoration: none; }
/* Section index, the kind that stays in the left column (wide windows). */
.post-index-side { display: none; }
.post-index-side ol { list-style: none; margin: 14px 0 0; padding: 0; border-left: 1px solid var(--fp-border); counter-reset: side; }
.post-index-side li { counter-increment: side; }
.post-index-side a { display: block; margin-left: -1px; padding: 8px 0 8px 14px; border-left: 1px solid transparent; font: 400 13.5px/1.4 var(--fp-font); color: var(--fp-text-muted); text-decoration: none; transition: color .15s; }
.post-index-side a::before { content: counter(side, decimal-leading-zero); display: block; margin-bottom: 3px; font: 500 10.5px/1 var(--fp-font-mono); letter-spacing: 0.08em; color: var(--fp-text-label); }
.post-index-side a:hover { color: var(--fp-text); }
.post-index-side a[aria-current] { color: var(--fp-text); border-left-color: var(--fp-text); }
/* Footnotes beside the text (wide windows; assets/js/post.js places them). */
.post-notes { display: none; }
.post-note { position: absolute; left: 0; right: 0; padding-top: 8px; border-top: 1px solid var(--fp-border); font: 400 12.5px/1.5 var(--fp-font); color: var(--fp-text-muted); transition: border-color .2s, color .2s; }
.post-note.is-hit { border-top-color: var(--fp-text); color: var(--fp-text); }
.post-note a { color: var(--fp-text); text-decoration: underline; text-decoration-color: var(--fp-border-strong); text-underline-offset: 2px; }
.post-note-n { margin-right: 8px; font: 500 11px/1 var(--fp-font-mono); color: var(--fp-text-label); }
/* The bar that names the section being read (phones and narrow windows). */
@media (min-width: 1240px) {
  .post .post-hero .wrap { max-width: 1120px; padding-left: 228px; }
  .post-h1 { max-width: 720px; }
  .post-grid { max-width: 1120px; margin: 0 auto; grid-template-columns: 180px minmax(0, 600px) 240px; column-gap: 48px; }
  .post-grid > .wrap { grid-column: 2; margin: 0; }
  .post-index-side { display: block; grid-column: 1; grid-row: 1; align-self: start; position: sticky; top: 112px; }
  .post-notes { display: block; grid-column: 3; grid-row: 1; position: relative; }
  .post-index { display: none; }
}

/* Article body: the allowed components. */
.prose { font: 400 16.5px/1.7 var(--fp-font); color: var(--fp-text-body); font-variant-numeric: normal; }
.prose :where(p, ul, ol, figure, blockquote) { margin: 0; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { margin: 2.6em 0 0; font: 500 27px/1.2 var(--fp-font-display); letter-spacing: -0.025em; color: var(--fp-text); }
/* Numbered sections (three or more): a dark rule and "03 / 05" above each heading. */
.prose.numbered { counter-reset: sec; }
.prose.numbered > h2 { counter-increment: sec; padding-top: 16px; border-top: 1px solid var(--fp-text); }
.prose.numbered > h2::before { content: counter(sec, decimal-leading-zero) " / " var(--sections); display: block; margin-bottom: 14px; font: 500 11.5px/1 var(--fp-font-mono); letter-spacing: 0.1em; color: var(--fp-text-label); }
.prose h3 { margin: 1.8em 0 0; font: 500 20px/1.3 var(--fp-font-display); letter-spacing: -0.01em; color: var(--fp-text); }
.prose h2 + *, .prose h3 + * { margin-top: 0.7em; }
/* A section's point: the italic line right under its heading (site/lib/rehype-article.mjs). */
.prose .section-point { margin-top: 14px; font: 500 19px/1.45 var(--fp-font); letter-spacing: -0.01em; color: var(--fp-text); }
.prose .section-point + * { margin-top: 1.3em; }
.prose strong { color: var(--fp-text); font-weight: 600; }
.prose em { color: var(--fp-text); }
.prose a { color: var(--fp-text); text-decoration: underline; text-decoration-color: var(--fp-border-strong); text-underline-offset: 3px; transition: text-decoration-color .15s; }
.prose a:hover { text-decoration-color: var(--fp-text); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.45em; }
.prose li > ul, .prose li > ol { margin-top: 0.45em; }
.prose ul { list-style: none; padding-left: 1.2em; }
.prose ul > li { position: relative; }
.prose ul > li::before { content: ""; position: absolute; left: -1.1em; top: 0.68em; width: 5px; height: 5px; border-radius: 50%; background: var(--fp-text); }
.prose ol > li::marker { font: 500 0.85em var(--fp-font-mono); color: var(--fp-text-label); }
/* Checklist (- [ ] / - [x]) */
.prose ul.contains-task-list { padding-left: 0; }
.prose li.task-list-item::before { display: none; }
.prose li.task-list-item input { appearance: none; width: 16px; height: 16px; margin: 0 10px 0 0; vertical-align: -2px; border: 1px solid var(--fp-accent); border-radius: 4px; }
.prose li.task-list-item input:checked { background: #9DB3C5 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%23142838' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; border-color: #9DB3C5; }
/* Callout (blockquote) */
.prose blockquote { margin: 1.6em 0 0; padding: 20px 24px; border: 1px solid var(--fp-border); border-left: 2px solid var(--fp-accent); border-radius: 0 10px 10px 0; background: var(--fp-bg-subtle); color: var(--fp-text); }
.prose blockquote > * + * { margin-top: 0.7em; }
/* Table */
.prose .table-wrap { margin-top: 1.6em; overflow-x: auto; border: 1px solid var(--fp-border); border-radius: 10px; }
.prose table { width: 100%; border-collapse: collapse; font: 400 15px/1.5 var(--fp-font); font-variant-numeric: tabular-nums; }
.prose th { padding: 12px 16px; text-align: left; font: 500 11.5px/1.3 var(--fp-font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--fp-text-label); background: var(--fp-bg-subtle); border-bottom: 1px solid var(--fp-border); white-space: nowrap; }
.prose td { padding: 12px 16px; border-top: 1px solid var(--fp-border); color: var(--fp-text-body); }
.prose tr:first-child td { border-top: 0; }
.prose th[align="right"], .prose td[align="right"] { text-align: right; }
/* Figure */
.prose figure { margin: 2em 0 0; }
.prose figure img { display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--fp-border); }
.prose figcaption { margin-top: 10px; font-size: 13.5px; line-height: 1.5; color: var(--fp-text-muted); }
/* Code, divider, footnotes */
.prose code { padding: 0.1em 0.35em; border-radius: 4px; background: var(--fp-bg-subtle); font: 0.88em var(--fp-font-mono); color: var(--fp-text); }
.prose hr { margin: 2.4em 0 0; border: 0; border-top: 1px solid var(--fp-border); }
.prose .footnotes { margin-top: 2.4em; padding-top: 1.2em; border-top: 1px solid var(--fp-border); font-size: 14.5px; color: var(--fp-text-muted); }
.prose .footnotes h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.prose sup a { padding: 4px 3px; margin: -4px -3px; text-decoration: none; font: 400 0.75em var(--fp-font-mono); color: var(--fp-text-label); }
.prose sup a:hover, .prose sup a[aria-expanded="true"] { color: var(--fp-text); }
.prose h2 { scroll-margin-top: 124px; }
@media (min-width: 1240px) { .prose h2 { scroll-margin-top: 96px; } }
/* A footnote shown where its number was tapped (assets/js/post.js). */
.fn-note { display: block; margin: 10px 0 14px; padding: 12px 16px; border: 1px solid var(--fp-border); border-radius: 8px; background: var(--fp-surface); font: 400 14.5px/1.55 var(--fp-font); color: var(--fp-text-body); }
.fn-note-num { margin-right: 10px; font: 500 12px/1 var(--fp-font-mono); color: var(--fp-text-label); }
.fn-note-text + .fn-note-text { display: block; margin-top: 8px; }

/* After the post */
.post-foot { margin-top: 64px; padding-bottom: var(--fp-space-section); }
.post-cta { margin: 0; padding-top: 24px; border-top: 1px solid var(--fp-border); font-size: 16px; color: var(--fp-text-muted); }
.post-cta a { color: var(--fp-text); text-decoration: underline; text-decoration-color: var(--fp-border-strong); text-underline-offset: 3px; }
.post-next { display: flex; flex-direction: column; gap: 8px; margin-top: 32px; text-decoration: none; }
.post-next .post-title { font-size: 20px; }
.post-next:hover .post-title { text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 760px) {
  .posts a { grid-template-columns: minmax(0, 1fr); padding: 24px 0; }
  .lessons a { grid-template-columns: 32px minmax(0, 1fr); column-gap: 12px; }
  .lesson-nav { grid-template-columns: minmax(0, 1fr); }
  .lesson-link.next { text-align: left; }
  .posts .post-meta { grid-row: auto; padding-top: 0; }
  .post-title { font-size: 21px; }
  .prose { font-size: 16px; }
  .prose h2 { font-size: 23px; }
  .post-brief li { font-size: 15.5px; }
  .post-hero { padding-block: 48px 40px; }
  .post-body { padding-top: 32px; }
}
/* Phones: no index row (people scroll rather than jump), and a bold lead-in sits on its own line above its paragraph. */
@media (max-width: 640px) {
  .post-index { display: none; }
  .prose .section-point { font-size: 18.5px; }
  .prose .lead-in { margin-top: 1.5em; }
  .prose .lead-in > strong:first-child { display: block; margin-bottom: 4px; }
}
