/* Clear Box blog, mockup 2026-09-27.
   Built from the September 2026 home page: Figtree for headings and body, Atkinson Hyperlegible
   Next for small labels, the chapter label with a rule, display headings with a blue second half,
   evidence-card chips and cards, the DARP card, and project section colors. */

:root {
  --b-paper: #f7f3eb;
  --b-paper-warm: #f1e9db;
  --b-card: #fefdfa;
  --b-ink: #1b2b3a;
  --b-copy: #33434f;
  --b-muted: #5f6d78;
  --b-rule: rgba(27, 43, 58, .14);
  --b-blue: #2f6a99;
  --b-blue-light: #8fb7d9;
  --b-brown: #8a4a1f;
  --b-green: #467456;
  --b-green-dark: #173b3f;
  --b-green-light: #8fd1a8;
  --b-slate: #1e3449;
  --b-sans: "Figtree", "Figtree Fallback", system-ui, -apple-system, sans-serif;
  --b-label: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible Next Fallback", system-ui, sans-serif;
  --b-shadow: 0 24px 50px -40px rgba(27, 43, 58, .35);
}

body.blog { background: var(--b-paper); color: var(--b-ink); font-family: var(--b-sans); }
.blog-wrap { width: min(1120px, calc(100% - 48px)); margin: 0 auto; }
.blog-narrow { width: min(720px, calc(100% - 40px)); margin: 0 auto; }

/* Chapter label with a rule, as on the home page */
.chapter { display: flex; align-items: center; gap: 20px; margin: 0 0 22px; }
.chapter span { font-family: var(--b-label); font-weight: 600; font-size: 1.05rem; color: var(--b-blue); white-space: nowrap; }
.chapter::after { content: ""; flex: 1; height: 1px; background: var(--b-blue); opacity: .32; }

.display { font-family: var(--b-sans); font-weight: 700; letter-spacing: -.025em; line-height: 1.02; color: var(--b-ink); margin: 0; text-wrap: balance; }
.display em { font-style: normal; color: var(--b-blue); }

/* Chips: type is neutral, project tags carry their section color */
.chip { display: inline-flex; align-items: center; min-height: 26px; padding: 3px 11px; border-radius: 999px; font-family: var(--b-label); font-size: .8125rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; text-decoration: none; line-height: 1.2; }
.chip-type { background: #e3e7eb; color: var(--b-slate); }
.chip-commonllama { background: #e2ede3; color: var(--b-green); }
.chip-commonframe { background: var(--b-paper-warm); color: var(--b-brown); }
.chip-darp { background: #e4eef5; color: var(--b-blue); }
.chip-oer { background: #e9edf2; color: var(--b-slate); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------------- Landing ---------------- */
.blog-hero { padding: 72px 0 36px; }
.blog-hero .display { font-size: clamp(2.6rem, 5.5vw, 4.25rem); max-width: 1040px; }
.blog-hero p { max-width: 860px; margin: 22px 0 0; font-size: 1.25rem; line-height: 1.55; color: var(--b-copy); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 28px; }
.filter { font-family: var(--b-label); font-size: .9375rem; font-weight: 600; min-height: 40px; padding: 8px 16px; border-radius: 6px; border: 1px solid var(--b-rule); background: var(--b-card); color: var(--b-ink); cursor: pointer; }
.filter[aria-pressed="true"] { background: var(--b-blue); border-color: var(--b-blue); color: #fff; }
.filter:focus-visible { outline: 3px solid var(--b-blue-light); outline-offset: 3px; }

.post-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; padding-bottom: 96px; }
.post-card { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 26px 26px 24px; border-radius: 12px; background: var(--b-card); box-shadow: var(--b-shadow); text-decoration: none; color: inherit; border-top: 4px solid var(--b-rule); transition: transform .18s ease, box-shadow .18s ease; }
.post-card:hover { transform: translateY(-2px); box-shadow: 0 30px 60px -38px rgba(27, 43, 58, .45); }
.post-card:focus-visible { outline: 3px solid var(--b-blue); outline-offset: 4px; }
.post-card.tag-commonllama { border-top-color: var(--b-green); }
.post-card.tag-commonframe { border-top-color: var(--b-brown); }
.post-card.tag-darp { border-top-color: var(--b-blue); }
.post-card h2 { margin: 0; font-size: 1.625rem; line-height: 1.15; font-weight: 700; letter-spacing: -.01em; }
.post-card .deck { margin: 0; color: var(--b-copy); font-size: 1.0625rem; line-height: 1.5; }
.post-card .meta { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--b-rule); font-family: var(--b-label); font-size: .875rem; color: var(--b-muted); }
.post-card .meta strong { color: var(--b-ink); font-weight: 600; }
.post-card.featured { grid-column: 1 / -1; padding: 34px 34px 30px; }
.post-card.featured h2 { font-size: clamp(2rem, 3.4vw, 2.6rem); }
.post-card.sample { opacity: .72; }
.sample-note { font-family: var(--b-label); font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--b-muted); }

/* ---------------- Post ---------------- */
.post-head { padding: 64px 0 0; }
.post-head .chips { margin-bottom: 22px; }
.post-head .display { font-size: clamp(2.5rem, 5.4vw, 4rem); }
.post-deck { margin: 18px 0 0; font-size: 1.375rem; line-height: 1.45; color: var(--b-copy); }
.byline { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 28px 0 0; padding: 16px 0; border-top: 1px solid var(--b-rule); border-bottom: 1px solid var(--b-rule); font-family: var(--b-label); font-size: .9375rem; color: var(--b-muted); }
.byline strong { color: var(--b-ink); font-weight: 600; }

.post-body { padding: 36px 0 12px; }
.post-body p { margin: 0 0 22px; font-size: 1.125rem; line-height: 1.68; color: var(--b-ink); }
.post-body h2 { display: flex; align-items: center; gap: 14px; margin: 52px 0 18px; font-size: 1.625rem; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
.post-body h2::before { content: ""; flex: none; width: 28px; height: 3px; border-radius: 2px; background: var(--b-accent, var(--b-blue)); }
.post-body a { color: var(--b-blue); text-underline-offset: .18em; }
.post-body strong { font-weight: 700; }

.post-commonllama { --b-accent: var(--b-green); }

/* Pull line */
.pull { margin: 34px 0; padding: 22px 26px; border-radius: 12px; background: #e2ede3; color: var(--b-green-dark); font-size: 1.375rem; line-height: 1.4; font-weight: 600; }

/* Stat pair, evidence-card style */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 30px 0; }
.stat { padding: 20px 22px; border-radius: 12px; box-shadow: var(--b-shadow); }
.stat .label { display: block; font-family: var(--b-label); font-size: .8125rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }
.stat strong { display: block; margin: 8px 0 4px; font-size: 2rem; line-height: 1.05; letter-spacing: -.02em; }
.stat small { font-size: .9375rem; color: var(--b-copy); }
.stat-good { background: #e2ede3; } .stat-good .label, .stat-good strong { color: var(--b-green-dark); }
.stat-slow { background: var(--b-paper-warm); } .stat-slow .label, .stat-slow strong { color: var(--b-brown); }

/* Aside card */
.aside-card { margin: 30px 0; padding: 22px 24px; border-radius: 12px; background: #e4eef5; }
.aside-card .label { display: block; margin-bottom: 8px; font-family: var(--b-label); font-size: .8125rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--b-blue); }
.aside-card p { margin: 0; font-size: 1.0625rem; line-height: 1.6; }

/* DARP record, same card as the home page */
.darp-card { margin: 44px 0 0; padding: 30px 34px; border-radius: 12px; background: #fbfcfd; box-shadow: 0 40px 80px -50px rgba(47, 106, 153, .5); font-family: var(--b-label); }
.darp-card .label { display: block; margin-bottom: 16px; font-size: .8125rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--b-blue); }
.darp-card .row { display: grid; grid-template-columns: 110px 1fr; gap: 10px; margin: 0 0 12px; font-size: 1.0625rem; }
.darp-card .row b { color: var(--b-blue); }
.darp-card .pending { color: var(--b-muted); font-style: italic; }
.darp-card small { display: block; margin-top: 12px; padding-top: 12px; border-top: 1px solid #dce6ee; color: var(--b-muted); font: .875rem/1.5 var(--b-sans); }

/* Project card, commonllama section colors */
.project-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 18px; margin: 36px 0 0; padding: 28px 30px; border-radius: 14px 22px 12px 24px; background: var(--b-green-dark); color: #eaf2ee; }
.project-card .name { font-family: var(--b-label); font-size: .8125rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--b-green-light); }
.project-card p { margin: 6px 0 0; font-size: 1.125rem; line-height: 1.45; color: #c6dacf; }
.project-card a { display: inline-flex; align-items: center; min-height: 44px; padding: 9px 16px; border-radius: 6px; background: var(--b-green); color: #fff; font-weight: 600; text-decoration: none; white-space: nowrap; }

.post-foot { display: flex; justify-content: space-between; gap: 16px; margin: 36px 0 96px; padding-top: 22px; border-top: 1px solid var(--b-rule); font-family: var(--b-label); font-weight: 600; }
.post-foot a { color: var(--b-blue); text-decoration: none; }

@media (max-width: 760px) {
  .blog-wrap { width: calc(100% - 32px); }
  .blog-hero { padding-top: 44px; }
  .post-grid { grid-template-columns: 1fr; }
  .post-card, .post-card.featured { padding: 22px 20px; }
  .stats { grid-template-columns: 1fr; }
  .project-card { grid-template-columns: 1fr; }
  .darp-card { padding: 24px 20px; }
  .darp-card .row { grid-template-columns: 84px 1fr; }
  .post-head { padding-top: 40px; }
}

/* commonllama posts: the project name in the title takes its brand green. */
.post-commonllama .post-head .display em { color: var(--b-green); }

/* Filtering: hidden cards must win over .post-card display:flex. */
.post-card[hidden] { display: none; }
.empty-state { grid-column: 1 / -1; margin: 0; padding: 28px 26px; border-radius: 12px; border: 1px dashed rgba(27, 43, 58, .24); color: var(--b-muted); font-size: 1.0625rem; }
.empty-state[hidden] { display: none; }

/* Card titles: a project name takes its brand color. */
.post-card h2 em { font-style: normal; }
.post-card.tag-commonllama h2 em { color: var(--b-green); }
.post-card.tag-commonframe h2 em { color: var(--b-brown); }
.post-card.tag-darp h2 em { color: var(--b-blue); }

/* The project name in running text takes its brand color. */
.post-body .brand-cl { color: var(--b-green); font-weight: 700; }

/* Post banner under the byline */
.post-banner { margin: 28px 0 0; }
.post-banner img { display: block; width: 100%; height: auto; border-radius: 18px; }

/* Featured card with an image (newest post). The image sits beside the text
   on wide screens and above it on phones. Other cards stay text-only. */
.post-card.featured.has-media { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 32px; align-items: center; padding: 18px 18px 18px 34px; }
.post-card.featured.has-media .post-card-body { display: flex; flex-direction: column; gap: 14px; padding: 16px 0; }
.post-card-media { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: cover; border-radius: 10px 18px 10px 16px; }
@media (max-width: 760px) {
  .post-card.featured.has-media { grid-template-columns: 1fr; gap: 18px; padding: 14px 14px 22px; }
  .post-card.featured.has-media .post-card-media { order: -1; }
  .post-card.featured.has-media .post-card-body { padding: 0 8px; }
}
