/* Blog: the list of posts and the post page. Loaded after styles.css on /blog/ pages only. */

.blog-page .nav { background: color-mix(in srgb, var(--bg) 88%, transparent); }

/* Breadcrumb */
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: 14px; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 6px; opacity: 0.6; }
.crumbs a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
.crumbs a:hover { color: var(--ink); text-decoration-color: currentColor; }
.crumbs [aria-current] { color: var(--ink); max-width: 40ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Date, reading time and topic chips */
.post-meta { display: flex; flex-wrap: wrap; gap: 4px 0; font-size: 14px; color: var(--muted); }
.post-meta > * + *::before { content: "·"; margin: 0 8px; }
.chips { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 5px 12px; border-radius: 999px; background: var(--tint); color: var(--ink); font-size: 14px; line-height: 1.3; transition: background-color 0.2s, color 0.2s; }
.chip:hover { background: var(--btn); color: var(--btn-ink); }

/* A soft version of the hero glow at the top of every blog page */
.blog-head, .post-head { position: relative; isolation: isolate; }
.blog-glow { position: absolute; inset: -140px 0 auto 0; height: 560px; z-index: -1; pointer-events: none; overflow: hidden; opacity: calc(var(--glow-o, 1) * 0.55); }
.blog-glow i { position: absolute; display: block; border-radius: 50%; background: var(--glow, var(--accent)); filter: blur(90px); }
.blog-glow i:nth-child(1) { left: -20%; right: -20%; top: 120px; height: 300px; opacity: 0.8; }
.blog-glow i:nth-child(2) { left: 15%; right: 15%; top: 180px; height: 150px; filter: blur(60px); }

/* ---------- List page ---------- */
.blog-head { padding: clamp(128px, 14vw, 180px) var(--pad-x) clamp(48px, 6vw, 72px); display: grid; gap: 24px; justify-items: start; }
.blog-head h1 { font-size: clamp(40px, 5.4vw, 80px); line-height: 1; letter-spacing: -0.045em; max-width: 15em; }
.blog-head h1 em { font-size: 1.08em; }
.topics { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.topic { border: 0; border-radius: 999px; padding: 10px 16px; background: var(--tint); font-size: 15px; cursor: pointer; transition: background-color 0.2s, color 0.2s, transform 0.2s var(--ease); }
.topic span { margin-left: 4px; opacity: 0.6; font-variant-numeric: tabular-nums; }
.topic:hover { transform: translateY(-2px); }
.topic.is-on { background: var(--btn); color: var(--btn-ink); }

.blog-featured { padding: 0 var(--pad-x); }
.feature { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(28px, 4vw, 64px); align-items: center; }
.feature-img { display: block; overflow: hidden; border-radius: var(--radius); }
.feature-img img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; transition: transform 0.6s var(--ease); }
.feature:hover .feature-img img { transform: scale(1.03); }
.feature-text { display: grid; gap: 18px; justify-items: start; }
.feature-text h2 { font-size: clamp(30px, 3.2vw, 46px); line-height: 1.05; letter-spacing: -0.035em; }
.feature-text h2 a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.feature-text .lead { color: var(--muted); }
.feature-text .btn { margin-top: 6px; }

.blog-list { padding: clamp(72px, 9vw, 128px) var(--pad-x) var(--gap-section); }
.blog-list > h2 { font-size: var(--fs-h3); margin-bottom: 20px; }
.post-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.post-row { position: relative; display: grid; grid-template-columns: 170px minmax(0, 1fr) 240px; gap: clamp(20px, 3vw, 40px); align-items: center; padding: 24px; margin: 0 -24px; border-radius: var(--radius); transition: background-color 0.25s; }
.post-row:hover { background: var(--tint); }
.post-row-meta { align-self: start; padding-top: 6px; display: grid; gap: 2px; font-size: 14px; color: var(--muted); }
.post-row-text { display: grid; gap: 10px; justify-items: start; }
.post-row h3 { font-size: clamp(22px, 2vw, 28px); }
.post-row h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.post-row:hover h3 a { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.post-row p { color: var(--muted); max-width: 60ch; }
.post-row-img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 16px; }
.blog-empty { padding: 24px 0; color: var(--muted); }
[data-topics][hidden] { display: none; }

/* ---------- Post page ---------- */
.post-head { padding: clamp(120px, 13vw, 168px) var(--pad-x) 40px; }
.post-head > :not(.blog-glow) { max-width: 860px; margin-left: auto; margin-right: auto; }
.post-head { display: grid; gap: 22px; }
.post-head h1 { font-size: clamp(36px, 4.6vw, 64px); line-height: 1.04; letter-spacing: -0.04em; width: 100%; }
.post-lede { font-size: var(--fs-lead); line-height: 1.5; color: var(--muted); width: 100%; }
.byline { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; width: 100%; }
.byline img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; object-position: 50% 15%; filter: grayscale(1); background: var(--tint); }
.byline > div:first-of-type { display: grid; line-height: 1.3; }
.byline a { font-weight: 500; }
.byline a:hover { text-decoration: underline; text-underline-offset: 3px; }
.byline span { font-size: 14px; color: var(--muted); }
.byline .post-meta { margin-left: auto; }

.post-hero { margin: 0 auto; padding: 0 var(--pad-x); max-width: calc(1240px + 2 * var(--gutter)); }
.post-hero img { width: 100%; height: auto; aspect-ratio: 21 / 9; object-fit: cover; border-radius: 28px; }
.post-hero figcaption { margin-top: 12px; font-size: 14px; color: var(--muted); }

.post-layout { display: grid; grid-template-columns: 220px minmax(0, 720px); justify-content: center; gap: clamp(40px, 5vw, 80px); padding: clamp(48px, 6vw, 80px) var(--pad-x); }
.toc { position: sticky; top: 100px; align-self: start; font-size: 15px; }
.toc p { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.toc a { display: block; padding: 6px 12px; margin-left: -12px; border-radius: 10px; color: var(--muted); line-height: 1.35; transition: background-color 0.2s, color 0.2s; }
.toc a:hover { color: var(--ink); background: var(--tint); }
.toc a.is-active { color: var(--ink); background: var(--tint); font-weight: 500; }

/* Article text */
.prose { font-size: 18px; line-height: 1.7; color: var(--ink); }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: clamp(26px, 2.4vw, 34px); line-height: 1.15; letter-spacing: -0.025em; margin-top: 2em; scroll-margin-top: 100px; }
.prose h2 + * { margin-top: 0.7em; }
.prose h3 { font-size: 22px; margin-top: 1.6em; }
.prose a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.prose strong { font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.4em; }
.prose li::marker { color: var(--muted); }
.prose blockquote { margin: 2em 0; padding: 28px 32px; border-radius: 20px; background: var(--tint); }
.prose blockquote p { font-family: var(--serif); font-style: italic; font-size: clamp(22px, 2vw, 28px); line-height: 1.3; letter-spacing: -0.01em; }
.prose code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 0.86em; padding: 0.12em 0.4em; border-radius: 6px; background: var(--tint); } /* taste-skill-ignore: code is content, it needs a monospace face */
.prose pre { margin-top: 1.4em; padding: 22px 24px; border-radius: 18px; background: var(--band); color: var(--band-ink); overflow-x: auto; font-size: 14.5px; line-height: 1.6; }
.prose pre code { padding: 0; background: none; font-size: inherit; }
.table-wrap { overflow-x: auto; border-radius: 16px; background: var(--tint); }
.prose table { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.45; }
.prose th, .prose td { text-align: left; padding: 14px 18px; vertical-align: top; }
.prose th { font-weight: 500; background: color-mix(in srgb, var(--accent) 16%, var(--tint)); }
.prose tr:nth-child(even) td { background: color-mix(in srgb, var(--bg) 55%, var(--tint)); }

/* A small chart inside an article */
.post-chart { margin: 2em 0; padding: 24px; border-radius: 20px; background: var(--tint); display: grid; gap: 12px; }
.pc-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) 44px; align-items: center; gap: 12px; font-size: 15px; }
.pc-row i { display: block; height: 14px; width: calc(var(--v) / 125 * 100%); border-radius: 0 4px 4px 0; background: color-mix(in srgb, var(--muted) 45%, var(--tint)); }
.pc-row.is-after i { background: var(--accent); }
.pc-row b { font-weight: 600; }
.post-chart figcaption { font-size: 14px; color: var(--muted); margin-top: 4px; }

/* Author card */
.post-end { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 28px; align-items: start; max-width: 920px; margin: 0 auto; padding: 32px; border-radius: 28px; background: var(--tint); margin-inline: max(var(--gutter), calc((100% - 920px) / 2)); }
.post-end img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; object-position: 50% 15%; filter: grayscale(1); }
.post-end > div { display: grid; gap: 12px; }
.post-end-name { font-size: 20px; font-weight: 500; }
.post-end-name a { text-decoration: underline; text-underline-offset: 4px; }
.post-end p:not(.post-end-name) { color: var(--muted); max-width: 56ch; }
.post-end .row { margin-top: 6px; }

/* Keep reading */
.more-posts { padding: var(--gap-section) var(--pad-x); }
.more-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px 24px; margin-bottom: clamp(28px, 4vw, 48px); }
.more-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 3vw, 40px); }
.more-grid .note img { aspect-ratio: 16 / 10; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .post-layout { grid-template-columns: minmax(0, 720px); }
  .toc { display: none; }
  .more-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .feature { grid-template-columns: 1fr; }
  .post-row { grid-template-columns: 1fr; gap: 12px; padding: 18px; margin: 0 -18px; }
  .post-row-img { order: -1; }
  .post-row-meta { padding-top: 0; display: flex; gap: 0; }
  .post-row-meta > * + *::before { content: "·"; margin: 0 8px; }
  .post-hero img { aspect-ratio: 16 / 10; border-radius: 20px; }
  .byline .post-meta { margin-left: 0; width: 100%; }
  .post-end { grid-template-columns: 1fr; padding: 24px; }
  .more-grid { grid-template-columns: 1fr; }
  .prose { font-size: 17px; }
  .prose blockquote { padding: 22px; }
  .crumbs li[aria-current] { display: none; }
  .crumbs li:nth-last-child(2)::after { content: ""; }
  .prose table { font-size: 15px; }
  .prose th, .prose td { padding: 10px 12px; }
}
