/* Blog: the index (blog.html) and posts (blog/*.html). Loaded only on those pages. */

/* ---- index */
.blog-hero { max-width: var(--max-w); margin: 0 auto; padding: 40px 28px 4px; }
.blog-hero h1 { font-size: clamp(38px, 5vw, 60px); line-height: 1; letter-spacing: -.04em; font-weight: 750; }
.blog-hero h1 span { background: var(--accent); color: #15171C; padding: 0 .12em; border-radius: .12em; }
.blog-hero p { color: var(--muted); font-size: 18px; line-height: 1.5; max-width: 640px; margin-top: 14px; }
.blog-grid { max-width: var(--max-w); margin: 0 auto; padding: 28px 28px 56px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.post-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); overflow: hidden; transition: transform .2s cubic-bezier(.2,.8,.2,1), box-shadow .2s, border-color .2s; }
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: var(--border-strong); }
.post-card:active { transform: scale(.99); }
.post-card img { width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; background: #15171C; }
.post-card-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.post-cat { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.post-card h2 { font-size: 20px; line-height: 1.22; letter-spacing: -.02em; font-weight: 650; color: var(--ink); }
.post-card p { color: var(--ink-soft); font-size: 15px; line-height: 1.5; }
.post-meta { margin-top: auto; padding-top: 6px; font-size: 13px; color: var(--muted); }
.post-card.is-featured { grid-column: 1 / -1; display: grid; grid-template-columns: 1.3fr 1fr; }
.post-card.is-featured img { height: 100%; }
.post-card.is-featured .post-card-body { padding: 28px 30px; justify-content: center; }
.post-card.is-featured h2 { font-size: clamp(24px, 2.6vw, 32px); }
.post-card.is-featured p { font-size: 16.5px; }
@media (max-width: 960px) { .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) {
  .blog-hero { padding: 28px 20px 0; }
  .blog-grid { grid-template-columns: 1fr; padding: 20px 20px 48px; gap: 16px; }
  .post-card.is-featured { grid-template-columns: 1fr; }
  .post-card.is-featured .post-card-body { padding: 18px 20px 22px; }
}

/* ---- post */
.post { max-width: 760px; margin: 0 auto; padding: 24px 24px 40px; }
.crumbs { font-size: 14px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a { text-decoration: underline; text-underline-offset: 3px; }
.crumbs a:hover { color: var(--ink); }
.post h1 { font-size: clamp(32px, 4.6vw, 50px); line-height: 1.05; letter-spacing: -.035em; font-weight: 750; margin: 14px 0; color: var(--ink); }
.post-dek { font-size: 19px; line-height: 1.5; color: var(--ink-soft); }
.post-byline { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; color: var(--muted); margin: 16px 0 22px; }
.post-cover { border-radius: 18px; overflow: hidden; border: 1px solid var(--border); background: #15171C; }
.post-cover img { width: 100%; height: auto; }
.toc { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px 20px; margin: 26px 0 6px; }
.toc b { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.toc ol { margin: 8px 0 0 20px; display: grid; gap: 5px; font-size: 15.5px; color: var(--ink-soft); }
.toc a:hover { color: var(--ink); text-decoration: underline; }

.prose { font-size: 18px; line-height: 1.7; color: var(--ink-soft); }
.prose > * + * { margin-top: 1.05em; }
.prose h2 { font-size: 28px; line-height: 1.15; letter-spacing: -.025em; color: var(--ink); font-weight: 700; margin-top: 1.9em; scroll-margin-top: 20px; }
.prose h3 { font-size: 21px; line-height: 1.25; letter-spacing: -.015em; color: var(--ink); font-weight: 650; margin-top: 1.5em; }
.prose strong { color: var(--ink); font-weight: 650; }
.prose a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent-deep); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.3em; display: grid; gap: .45em; }
.prose li::marker { color: var(--muted); }
.prose blockquote { border-left: 4px solid var(--accent); padding: 2px 0 2px 18px; color: var(--ink); font-size: 19px; line-height: 1.55; }
.prose .table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.prose table { width: 100%; border-collapse: collapse; font-size: 15.5px; line-height: 1.45; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 11px 14px; border-bottom: 1px solid var(--border); }
.prose th { color: var(--ink); background: var(--sunken); font-weight: 650; white-space: nowrap; }
.prose tr:last-child td { border-bottom: 0; }
.prose .callout { background: var(--accent-soft); border-radius: 16px; padding: 16px 18px; color: var(--ink); font-size: 16.5px; line-height: 1.55; }
@media (max-width: 640px) { .prose { font-size: 17px; } .prose h2 { font-size: 24px; } .post { padding: 18px 20px 32px; } }

/* ---- figures (plain HTML, so they read well on phones and in dark mode) */
.bfig { margin: 1.8em 0; }
.bfig figcaption { font-size: 14px; line-height: 1.45; color: var(--muted); margin-top: 12px; text-align: center; }
.bfig-title { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }

.bf-flow { list-style: none; padding: 0 !important; display: grid !important; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 14px !important; counter-reset: s; }
.bf-flow li { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px; font-size: 14.5px; line-height: 1.4; counter-increment: s; }
.bf-flow li::before { content: counter(s); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #15171C; font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.bf-flow li:not(:last-child)::after { content: ''; position: absolute; right: -11px; top: 50%; width: 8px; height: 8px; border-top: 2px solid var(--muted-soft); border-right: 2px solid var(--muted-soft); transform: translateY(-50%) rotate(45deg); }
.bf-flow b { display: block; color: var(--ink); font-size: 15.5px; margin-bottom: 3px; }
@media (max-width: 640px) {
  .bf-flow { grid-auto-flow: row; }
  .bf-flow li:not(:last-child)::after { right: auto; left: 26px; top: auto; bottom: -12px; transform: rotate(135deg); }
}

.bf-ladder { list-style: none; padding: 0 !important; display: flex !important; flex-direction: column-reverse; gap: 8px !important; }
.bf-ladder li { margin-left: calc(var(--i) * 6%); background: var(--surface); border: 1px solid var(--border); border-left: 6px solid var(--accent); border-radius: 12px; padding: 12px 14px; display: flex; justify-content: space-between; align-items: baseline; gap: 4px 14px; flex-wrap: wrap; font-size: 15px; line-height: 1.4; }
.bf-ladder b { color: var(--ink); font-size: 16px; }
.bf-ladder span { color: var(--muted); font-size: 14px; }
@media (max-width: 640px) { .bf-ladder li { margin-left: calc(var(--i) * 3%); } }

.bf-shelf { border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: var(--surface); }
.bf-shelf > div { display: grid; grid-template-columns: 170px 1fr; gap: 14px; padding: 14px 16px; border-bottom: 6px solid var(--border-strong); font-size: 15px; line-height: 1.45; }
.bf-shelf > div:last-child { border-bottom: 0; }
.bf-shelf b { color: var(--ink); }
.bf-shelf .hot { background: var(--accent-soft); }
.bf-shelf .hot b::after { content: ' ★'; color: var(--accent-deep); }
@media (max-width: 640px) { .bf-shelf > div { grid-template-columns: 1fr; gap: 2px; } }

.bf-time { list-style: none; padding: 0 0 0 26px !important; position: relative; display: grid !important; gap: 14px !important; }
.bf-time::before { content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--border-strong); }
.bf-time li { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; font-size: 15px; line-height: 1.45; }
.bf-time li::before { content: ''; position: absolute; left: -25px; top: 16px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--bg); }
.bf-time b { display: block; color: var(--ink); }

.bf-eq { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: center; }
.bf-eq span { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; font-size: 15px; font-weight: 600; color: var(--ink); text-align: center; line-height: 1.3; }
.bf-eq span small { display: block; font-weight: 400; font-size: 12.5px; color: var(--muted); }
.bf-eq span.t { background: #15171C; color: #fff; border-color: #15171C; }
.bf-eq i { font-style: normal; font-size: 22px; font-weight: 700; color: var(--muted); }
.bf-eq + .bf-eq { margin-top: 12px; }

.bf-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bf-two > div { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; font-size: 15px; line-height: 1.5; }
.bf-two > div:last-child { border-color: var(--accent-deep); box-shadow: inset 0 0 0 1px var(--accent-deep); }
.bf-two h4 { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.bf-two ul { padding-left: 1.1em; display: grid; gap: 6px; }
@media (max-width: 640px) { .bf-two { grid-template-columns: 1fr; } }

/* ---- end of a post */
.post-cta { margin: 40px 0 0; background: #15171C; color: #fff; border-radius: 22px; padding: 24px; display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.post-cta b { display: block; font-size: 21px; letter-spacing: -.02em; }
.post-cta span { color: rgba(255,255,255,.7); font-size: 15px; }
.post-cta .btn { background: var(--accent); color: #15171C; }
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.post-tags a { font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--ink-soft); }
.related { max-width: var(--max-w); margin: 0 auto; padding: 8px 28px 32px; }
.related h2 { font-size: 24px; letter-spacing: -.02em; margin-bottom: 14px; }
.related .blog-grid { padding: 0; }
@media (max-width: 680px) { .related { padding: 8px 20px 24px; } }
