/* Blog: index and post pages. Built by site/build.py; tokens come from base.css.
   Calm and white: big type, soft surfaces, one colour (teal) doing the work. Red only for emergency numbers. */
:root { --teal: #236274; --teal-deep: #144458; --teal-wash: #eef5f6; --rest: #8a929c; }

/* ── Shared: headings, lede, title halves ── */
.blog, .sources { padding-top: 64px; padding-bottom: 96px; }
.blog h1, .post h1, .sources h1 { font-size: clamp(2.4rem, 5.6vw, 3.6rem); letter-spacing: -0.035em; line-height: 1.05; color: var(--ink); font-weight: 700; }
.lede { font-size: 1.2rem; color: var(--gray-500); margin: 18px 0 40px; line-height: 1.55; max-width: 40em; }
.rest { color: var(--rest); font-weight: 600; }
.dot { margin: 0 8px; color: var(--gray-300); }
.blog { max-width: 1180px; }

/* ── Index: lead story ── */
.blog-head { margin-bottom: 8px; }
.post-lead { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 48px; align-items: center; text-decoration: none; margin: 8px 0 72px; }
.post-lead .pc-img { display: block; overflow: hidden; border-radius: 24px; background: var(--teal-wash); box-shadow: 0 24px 60px rgba(16,24,40,.10); }
.post-lead img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; transition: transform .6s var(--ease); }
.post-lead:hover img { transform: scale(1.025); }
.post-lead .pc-text { display: block; }
.post-lead .pc-meta { display: block; font-size: .88rem; }
.post-lead h2 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); line-height: 1.12; letter-spacing: -0.03em; color: var(--ink); margin: 12px 0 16px; }
.post-lead p { font-size: 1.15rem; line-height: 1.55; color: var(--gray-600); margin: 0 0 20px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-lead .pc-go { display: flex; width: fit-content; align-items: center; gap: 8px; margin-top: 24px; min-height: 44px; padding: 0 22px; border-radius: 999px; background: var(--teal); color: #fff; font-weight: 600; font-size: .95rem; transition: background .2s; }
.post-lead:hover .pc-go { background: var(--teal-deep); }

/* ── Topic pills (glass) ── */
.post-topics { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px; border-radius: 22px; background: rgba(255,255,255,.7); border: 1px solid rgba(11,31,36,.06); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: var(--shadow-xs); }
.post-topics a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px; color: var(--gray-700); font-size: .9rem; font-weight: 500; text-decoration: none; transition: background .15s, color .15s; }
.post-topics a:hover { background: var(--teal-wash); color: var(--teal-deep); }
#topics { scroll-margin-top: 88px; }

/* ── Group headings ── */
.post-section { margin-top: 80px; }
.post-group { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 28px; scroll-margin-top: 88px; }
.post-group h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); letter-spacing: -0.025em; line-height: 1.15; color: var(--ink); margin: 0; }
.post-group .count { margin-left: 12px; font-size: .95rem; font-weight: 500; letter-spacing: 0; color: var(--gray-400); }
.to-topics { flex: none; display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 4px 0 12px; color: var(--teal); font-size: .9rem; font-weight: 600; text-decoration: none; }
.to-topics:hover { color: var(--teal-deep); text-decoration: underline; text-underline-offset: 3px; }

/* ── Cards: no boxes, just picture and words ── */
.post-list { display: grid; gap: 44px 28px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.post-card { display: flex; flex-direction: column; gap: 18px; text-decoration: none; min-width: 0; }
.pc-img { display: block; overflow: hidden; border-radius: 18px; background: var(--teal-wash); }
.post-card img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: center 40%; transition: transform .5s var(--ease); }
.post-card:hover img { transform: scale(1.04); }
.pc-text { display: flex; flex-direction: column; min-width: 0; }
.pc-topic { font-size: .78rem; font-weight: 600; letter-spacing: .02em; color: var(--teal); }
.post-card h3 { font-size: 1.12rem; line-height: 1.32; letter-spacing: -0.015em; color: var(--ink); margin: 6px 0 8px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.post-card:hover h3 { text-decoration: underline; text-decoration-color: var(--gray-300); text-underline-offset: 4px; }
.post-card p { font-size: .94rem; line-height: 1.55; color: var(--gray-500); margin: 0 0 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pc-meta { font-size: .8rem; color: var(--gray-400); }
.pc-meta .dot { margin: 0 6px; }

/* ── Post page ── */
.post { --measure: 68ch; padding: 48px 24px 96px; }
.post-head, .post-body { max-width: var(--measure); margin: 0 auto; }
.post .back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: .9rem; font-weight: 500; color: var(--gray-500); text-decoration: none; margin-bottom: 20px; }
.post .back:hover { color: var(--teal); }
.post-meta { font-size: .9rem; color: var(--gray-500); margin: 0 0 16px; }
.post-meta a { color: var(--teal); font-weight: 600; text-decoration: none; }
.post-meta a:hover { text-decoration: underline; text-underline-offset: 3px; }
.post .post-head h1 { font-size: clamp(2.1rem, 4.6vw, 3.2rem); line-height: 1.08; }
.post .lede { font-size: clamp(1.15rem, 1.8vw, 1.35rem); color: var(--gray-600); margin: 22px 0 0; }
.post-hero { max-width: 1080px; margin: 48px auto 56px; }
.post-hero img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 24px; box-shadow: 0 24px 60px rgba(16,24,40,.10); }

.post-body p, .post-body li { font-size: 1.15rem; line-height: 1.75; color: var(--gray-700); }
.post-body p { margin: 0 0 24px; }
.post-body h2 { font-size: clamp(1.5rem, 2.4vw, 1.85rem); line-height: 1.2; letter-spacing: -0.025em; color: var(--ink); margin: 56px 0 16px; }
.post-body h3 { font-size: 1.25rem; letter-spacing: -0.015em; color: var(--ink); margin: 36px 0 12px; }
.post-body strong { color: var(--ink); font-weight: 600; }
.post-body ul, .post-body ol { margin: 0 0 28px; padding-left: 1.4em; display: grid; gap: 10px; }
.post-body li::marker { color: var(--teal); font-weight: 600; }
.post-body a { color: var(--teal-deep); text-decoration-color: color-mix(in srgb, var(--teal) 40%, transparent); text-underline-offset: 3px; }
.post-body a:hover { text-decoration-color: currentColor; }

/* Pull quote: big, quiet, a thin teal rule */
.post-body blockquote { margin: 44px 0; padding: 22px 28px; background:linear-gradient(135deg,rgba(255,255,255,.85),rgba(232,243,248,.6)); border:1px solid rgba(255,255,255,.9); box-shadow:0 1px 2px rgba(15,40,60,.04),0 8px 24px rgba(15,40,60,.06),inset 0 1px 0 rgba(255,255,255,.9); -webkit-backdrop-filter:blur(14px) saturate(1.4); backdrop-filter:blur(14px) saturate(1.4); border-radius:var(--radius-lg,16px); font-family: var(--serif); font-size: clamp(1.3rem, 2.2vw, 1.6rem); line-height: 1.4; font-weight: 500; letter-spacing: -0.01em; color: var(--ink); }

/* Big button inside a post */
.post .post-cta { margin: 36px 0 40px; }
.post .post-cta .btn { font-size: 1.05rem; padding: 16px 30px; border-radius: 999px; text-decoration: none; color: #fff; background: var(--teal); justify-content: center; max-width: 100%; text-align: center; box-shadow: 0 8px 24px rgba(35,98,116,.22); }
.post .post-cta .btn:hover { background: var(--teal-deep); }

/* What to do next: one calm card, rows not boxes */
.post .post-next { margin: 64px 0 0; padding: 12px; border-radius: 24px; background: rgba(255,255,255,.8); border: 1px solid rgba(11,31,36,.07); box-shadow: 0 12px 34px rgba(16,24,40,.06); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); display: grid; }
.post .post-next-title { font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; color: var(--gray-400); margin: 12px 16px 6px; }
.post .post-next a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 0 16px; border-radius: 14px; font-size: 1.05rem; font-weight: 600; color: var(--ink); text-decoration: none; transition: background .15s; }
.post .post-next a + a { box-shadow: 0 -1px 0 var(--gray-150); }
.post .post-next a::after { content: ""; flex: none; width: 18px; height: 18px; background: var(--teal); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12h14M12 5l7 7-7 7' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12h14M12 5l7 7-7 7' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; transition: transform .2s; }
.post .post-next a:hover { background: var(--teal-wash); box-shadow: none; }
.post .post-next a:hover::after { transform: translateX(3px); }

/* Sources: small and tidy */
.post-sources { margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--gray-150); }
.post-body .post-sources h2 { font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; color: var(--gray-400); margin: 0 0 14px; }
.post-body .post-sources ul, .post-body .post-sources ol { gap: 10px; padding-left: 1.2em; }
.post-body .post-sources li, .post-body .post-sources p { font-size: .88rem; line-height: 1.55; color: var(--gray-500); }
.post-body .post-sources a { color: var(--gray-600); text-decoration-color: var(--gray-300); }
.post-body .post-sources li::marker { color: var(--gray-300); }

/* Related posts */
.post-related { max-width: 1080px; margin: 96px auto 0; padding-top: 56px; border-top: 1px solid var(--gray-150); }
.post-related .post-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ── Tablet ── */
@media (max-width: 900px) {
  .post-lead { grid-template-columns: 1fr; gap: 24px; margin-bottom: 56px; }
  .post-related .post-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ── Phone: the index is a scan list, not a stack of posters. Picture left, title right.
   50 posts fit in a few screens, not thirty. ── */
@media (max-width: 600px) {
  .blog { padding-top: 36px; padding-bottom: 64px; }
  .blog .lede { margin-bottom: 28px; font-size: 1.08rem; }
  .post-lead { margin: 0 0 40px; gap: 18px; }
  .post-lead .pc-img { border-radius: 18px; }
  .post-lead h2 { font-size: 1.6rem; margin: 8px 0 10px; }
  .post-lead p { font-size: 1rem; -webkit-line-clamp: 3; margin-bottom: 12px; }
  .post-lead .pc-go { display: flex; justify-content: center; margin-top: 18px; min-height: 48px; }
  /* One swipeable row of topics, not a tall box */
  .post-topics { flex-wrap: nowrap; overflow-x: auto; gap: 4px; padding: 6px; margin: 0 -24px; border-radius: 0; border-left: 0; border-right: 0; scrollbar-width: none; -webkit-mask: linear-gradient(90deg, #000 88%, transparent); mask: linear-gradient(90deg, #000 88%, transparent); }
  .post-topics::-webkit-scrollbar { display: none; }
  .post-topics a { flex: none; padding: 0 14px; font-size: .88rem; background: var(--teal-wash); color: var(--teal-deep); }
  .post-topics a:first-child { margin-left: 18px; }
  .post-section { margin-top: 48px; }
  .post-group { margin-bottom: 16px; }
  .post-group h2 { font-size: 1.3rem; }
  .post-group .count { display: block; margin: 4px 0 0; font-size: .85rem; }
  .post-list { gap: 18px; grid-template-columns: 1fr !important; }
  .post-card { flex-direction: row; align-items: center; gap: 14px; }
  .post-card .pc-img { flex: none; width: 104px; border-radius: 14px; }
  .post-card img { width: 104px; height: 104px; aspect-ratio: 1; }
  .post-card h3 { font-size: 1rem; line-height: 1.3; margin: 3px 0 4px; -webkit-line-clamp: 3; }
  .post-card p { display: none; }
  .pc-topic { font-size: .72rem; }
  .pc-meta { font-size: .75rem; }

  .post { padding: 24px 20px 64px; }
  .post .back { margin-bottom: 8px; }
  .post-meta { font-size: .82rem; }
  .post .post-head h1 { font-size: 2rem; }
  .post .lede { font-size: 1.1rem; }
  .post-hero { margin: 28px -4px 36px; }
  .post-hero img { border-radius: 18px; aspect-ratio: 4 / 3; }
  .post-body p, .post-body li { font-size: 1.08rem; line-height: 1.7; }
  .post-body h2 { margin-top: 44px; }
  .post-body blockquote { padding-left: 20px; font-size: 1.25rem; }
  .post .post-cta .btn { display: flex; width: 100%; }
  .post .post-next { margin-top: 48px; padding: 8px; border-radius: 20px; }
  .post-related { margin-top: 64px; padding-top: 40px; }
}
