/* REAL Lab blog: shared layout, typography and figure primitives.
   Loaded after ../styles.css; everything is scoped under .post / .blog-list so the rest of the site is unaffected. */

:root {
  --b-ink: #151a22;
  --b-text: #353c49;
  --b-mute: #6b7382;
  --b-line: #e2e6ec;
  --b-line2: #cdd3dc;
  --b-panel: #f5f7fa;
  --b-panel2: #eef1f5;
  --b-accent: #0a4d8c;
  --b-accent-soft: #e8f0f8;
  --b-mono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* roles (shared with the decision-agents project page) */
  --act: #c39448; --act-ink: #8a6220; --act-soft: #f6ead3;
  --jud: #4d6bf3; --jud-ink: #2f49c4; --jud-soft: #e6eaff;
  --tea: #709b6a; --tea-ink: #47703f; --tea-soft: #e4efdf;
  --dm: #0a4d8c; --dm-soft: #e8f0f8;
  --base: #a9b1bc; --base-2: #cfd5dd; --bad: #c4553f; --good: #3f8a4c;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Post layout ---------- */
main.post { max-width: none; padding: 0 40px; }
.post p { color: var(--b-text); }
.post-head { max-width: 880px; margin: 0 auto; padding: 56px 0 0; }
.post-kicker { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 13.5px; color: var(--b-mute); margin: 0 0 18px; }
.post-kicker a { color: var(--b-accent); font-weight: 600; }
.post-kicker .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--b-line2); }
.post-head h1 { font-size: clamp(30px, 3.6vw, 44px); line-height: 1.14; letter-spacing: -0.022em; margin: 0 0 16px; color: var(--b-ink); }
.post-dek { font-size: 19px; line-height: 1.55; color: var(--b-text); max-width: 880px; margin: 0 0 26px; }
.post-byline { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 18px 32px; padding-bottom: 28px; }
.post-authors { font-size: 15.5px; line-height: 1.6; color: var(--b-ink); max-width: 760px; margin: 0; }
.post-authors sup { font-size: 10.5px; color: var(--b-mute); margin-left: 1px; }
.post-affil { font-size: 13.5px; color: var(--b-mute); margin: 4px 0 0; }
.post-links { display: flex; flex-wrap: wrap; gap: 8px; }
.pill-btn { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 16px; border-radius: 999px; font-size: 14.5px; font-weight: 600; color: var(--b-ink); background: #fff; border: 1px solid var(--b-line2); transition: border-color .15s, background .15s, transform .15s; }
.pill-btn:hover { border-color: var(--b-ink); transform: translateY(-1px); }
.pill-btn.solid { background: var(--b-ink); color: #fff; border-color: var(--b-ink); }
.pill-btn svg { width: 16px; height: 16px; }
.post-banner { position: relative; left: 50%; transform: translateX(-50%); width: min(1080px, calc(100vw - 48px)); margin: 4px 0 0; border-radius: 18px; overflow: hidden; border: 1px solid var(--b-line); background: #f8f3e8; }
.post-banner img { display: block; width: 100%; height: auto; aspect-ratio: 2172 / 544; object-fit: cover; }
.post-banner-cap { font-size: 13px; color: var(--b-mute); margin: 10px 2px 0; }
/* Drawn covers (abstract or animated SVG on warm paper), the alternative to a banner image */
.post-cover { position: relative; left: 50%; transform: translateX(-50%); width: min(1080px, calc(100vw - 48px)); height: clamp(220px, 27vw, 320px); margin: 4px 0 0; border-radius: 18px; border: 1px solid #e8e5db; background: #f4f3ee; display: grid; place-items: center; overflow: hidden; }
.post-cover img { position: absolute; top: 0; bottom: 0; left: 0; right: 0; margin: auto; height: 92%; width: auto; max-width: 92%; display: block; }
.post-card-img.paper { background: #f4f3ee; display: grid; place-items: center; }
.post-card-img.paper img { width: 84%; height: auto; max-height: 100%; object-fit: contain; }
@media (max-width: 720px) { .post-cover { width: calc(100vw - 24px); border-radius: 12px; } }

/* Article column centred on the page; the contents rail sits in the left margin */
.post-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 880px) minmax(0, 1fr); column-gap: 32px; margin: 60px 0 0; }
.post-body > article { grid-column: 2; grid-row: 1; min-width: 0; }

/* Author names that have a People-page card */
.au.has-card { cursor: pointer; border-bottom: 1px dashed var(--b-line2); transition: color .15s, border-color .15s; }
.au.has-card:hover, .au.has-card[aria-expanded="true"] { color: var(--b-accent); border-bottom-color: var(--b-accent); }
.au.has-card:focus-visible { outline: 2px solid var(--b-accent); outline-offset: 2px; border-radius: 3px; }

/* Author card */
.pcard { position: fixed; z-index: 450; left: 0; top: 0; width: 320px; max-width: calc(100vw - 24px); background: #fff; border: 1px solid var(--b-line); border-radius: 16px; overflow: hidden;
  box-shadow: 0 2px 6px rgba(15, 30, 58, .06), 0 26px 50px -26px rgba(15, 30, 58, .5); opacity: 0; visibility: hidden; transform: translateY(6px) scale(.985); transform-origin: var(--ax, 50%) 0;
  transition: opacity .16s ease, transform .2s var(--ease), visibility 0s linear .2s; font-size: 14px; line-height: 1.45; }
.pcard.up { transform-origin: var(--ax, 50%) 100%; transform: translateY(-6px) scale(.985); }
.pcard.on { opacity: 1; visibility: visible; transform: none; transition: opacity .16s ease, transform .2s var(--ease), visibility 0s; }
.pc-strip { height: 4px; background: linear-gradient(90deg, #004EA2 0 25%, #13808C 25% 50%, #4A6FA5 50% 75%, #2E7D5B 75%); }
.pc-head { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; align-items: center; padding: 14px 16px 12px; }
.pc-head img { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; background: var(--b-panel); box-shadow: 0 0 0 1px rgba(15, 30, 58, .06); }
.pc-name { margin: 0 !important; font-size: 16.5px; font-weight: 700; color: var(--b-ink) !important; line-height: 1.25; }
.pc-name a { color: inherit; border-bottom: 1px solid transparent; }
.pc-name a:hover { color: var(--b-accent); border-bottom-color: var(--b-accent); }
.pc-zh { margin-left: 6px; font-weight: 600; color: var(--b-mute); font-size: 14.5px; }
.pc-role { margin: 2px 0 0 !important; font-size: 13px; color: var(--b-text) !important; }
.pc-lab { display: flex; align-items: center; gap: 6px; margin: 4px 0 0 !important; font-size: 12px; color: var(--b-mute) !important; }
.pc-dot { width: 7px; height: 7px; border-radius: 2px; background: var(--b-accent); }
.pc-pubs { margin: 0 12px; padding: 10px 12px; border-radius: 12px; background: var(--b-panel); }
.pc-count { margin: 0 0 4px !important; font-size: 12.5px; color: var(--b-mute) !important; }
.pc-count b { color: var(--b-ink); font-size: 14px; }
.pc-latest { display: block; font-size: 13px; line-height: 1.4; color: var(--b-ink); border-bottom: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pc-latest:hover { color: var(--b-accent); }
.pc-lk { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 5px; background: #fff; border: 1px solid var(--b-line); font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--b-accent); vertical-align: 1px; }
.pc-latest em { display: inline; margin-left: 6px; font-style: normal; font-size: 12px; color: var(--b-mute); }
.pc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px 14px; }
.pc-links { display: flex; flex-wrap: wrap; gap: 5px; }
.pc-link { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--b-line); font-size: 12px; font-weight: 600; color: var(--b-text); transition: border-color .15s, color .15s, background .15s; }
.pc-link svg { width: 13px; height: 13px; }
.pc-link:hover { color: var(--b-accent); border-color: #c7d6e8; background: var(--b-accent-soft); }
.pc-people { flex: none; font-size: 12.5px; font-weight: 600; color: var(--b-accent); border-bottom: 0; }
@media (prefers-reduced-motion: reduce) { .pcard, .pcard.on { transition: none; } }

/* Table of contents: sticky rail on wide screens, collapsible block otherwise */
.toc { grid-column: 1; grid-row: 1; align-self: start; justify-self: start; width: 192px; position: sticky; top: 96px; max-height: calc(100vh - 140px); overflow: auto; font-size: 14px; }
.toc-title { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--b-mute); margin: 0 0 12px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--b-line); }
.toc li { margin: 0; }
.toc a { display: flex; gap: 8px; padding: 5px 0 5px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--b-mute); line-height: 1.35; border-bottom: 0; transition: color .15s, border-color .15s; }
.toc a:hover { color: var(--b-ink); border-bottom: 0; }
.toc a .n { flex: none; width: 14px; color: var(--b-line2); font-variant-numeric: tabular-nums; }
.toc a[aria-current="true"] { color: var(--b-ink); font-weight: 600; border-left-color: var(--b-accent); }
.toc a[aria-current="true"] .n { color: var(--b-accent); }
.toc .sub a { padding-left: 36px; font-size: 13px; }
.toc-inline { display: none; }

/* Typography inside the article */
.post article { font-size: 17px; line-height: 1.75; }
.post article p { margin: 0 0 18px; }
.post article strong { color: var(--b-ink); font-weight: 600; }
.post article a.tx { color: var(--b-accent); border-bottom: 1px solid rgba(10, 77, 140, .28); }
.post article a.tx:hover { border-bottom-color: var(--b-accent); }
.post section { padding: 0; }
.post section.chap { padding-top: 64px; }
.post section.chap:first-child { padding-top: 0; }
.post article h2 { display: flex; gap: 14px; align-items: baseline; font-size: 28px; line-height: 1.22; letter-spacing: -0.015em; text-transform: none; color: var(--b-ink); margin: 0 0 18px; font-weight: 600; scroll-margin-top: 90px; }
.post article h2 .n { color: var(--b-accent); font-variant-numeric: tabular-nums; }
.post article h3 { display: flex; gap: 12px; align-items: baseline; font-size: 20px; line-height: 1.3; color: var(--b-ink); margin: 40px 0 12px; scroll-margin-top: 90px; }
.post article h3 .n { color: var(--b-accent); font-size: 17px; font-variant-numeric: tabular-nums; }
.post .lede { font-size: 18.5px; line-height: 1.65; color: var(--b-ink); }
.post code { font-family: var(--b-mono); font-size: .86em; background: var(--b-panel); border: 1px solid var(--b-line); border-radius: 5px; padding: 1px 5px; color: var(--b-ink); }
.post ul.clean { margin: 0 0 18px; padding-left: 20px; }
.post ul.clean li { margin: 0 0 10px; color: var(--b-text); }
.post ul.clean li::marker { color: var(--b-accent); }
.cite { font-size: .8em; color: var(--b-mute); vertical-align: 1px; border-bottom: 0 !important; }
.cite:hover { color: var(--b-accent); }
.fig-ref { color: var(--b-ink); border-bottom: 1px solid var(--b-line2); }
.fig-ref:hover { border-bottom-color: var(--b-ink); }
.role-a { color: var(--act-ink); font-weight: 600; }
.role-j { color: var(--jud-ink); font-weight: 600; }
.role-t { color: var(--tea-ink); font-weight: 600; }

/* A highlighted "finding" block */
.finding { margin: 24px 0 26px; padding: 16px 20px 16px 18px; border-radius: 12px; background: var(--b-panel); border-left: 3px solid var(--b-accent); }
.finding p { margin: 0 !important; color: var(--b-ink) !important; font-size: 16.5px; line-height: 1.65; }
.finding .k { display: block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--b-accent); margin-bottom: 4px; }
.finding.a { border-left-color: var(--act); } .finding.a .k { color: var(--act-ink); }
.finding.j { border-left-color: var(--jud); } .finding.j .k { color: var(--jud-ink); }
.finding.t { border-left-color: var(--tea); } .finding.t .k { color: var(--tea-ink); }

/* ---------- Figures ---------- */
.fig { margin: 30px 0 34px; }
.fig-box { position: relative; border: 1px solid var(--b-line); border-radius: 16px; background: #fff; padding: 22px 24px 20px; }
.fig figcaption { font-size: 14.5px; line-height: 1.6; color: var(--b-mute); max-width: 780px; margin: 12px 2px 0; }
.fig figcaption b { color: var(--b-ink); font-weight: 600; }
.panel-k { font-size: 12.5px; font-weight: 600; color: var(--b-mute); margin: 0 0 2px !important; }
.panel-t { font-size: 17px; font-weight: 600; color: var(--b-ink) !important; margin: 0 0 2px !important; line-height: 1.35; }
.panel-u { font-size: 13px; color: var(--b-mute) !important; margin: 0 0 12px !important; line-height: 1.45; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; }
.duo > * { min-width: 0; }
.duo > * + * { position: relative; }
.duo > * + *::before { content: ""; position: absolute; left: -20px; top: 0; bottom: 0; width: 1px; background: var(--b-line); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--b-mute); margin: 0 0 10px; line-height: 1.4; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* Segmented controls / chips used by interactive figures */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 3px; border-radius: 999px; background: var(--b-panel2); }
.seg button { font: inherit; font-size: 13.5px; font-weight: 600; line-height: 1.3; color: var(--b-mute); background: none; border: 0; border-radius: 999px; padding: 6px 13px; cursor: pointer; transition: background .2s, color .2s, box-shadow .2s; }
.seg button:hover { color: var(--b-ink); }
.seg button[aria-pressed="true"] { background: #fff; color: var(--b-ink); box-shadow: 0 1px 2px rgba(20, 26, 34, .08), 0 0 0 1px var(--b-line); }
.ctl-row { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between; margin: 0 0 16px; }
.ctl-btn { display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: 12.5px; font-weight: 600; line-height: 1.2; color: var(--b-mute); background: #fff; border: 1px solid var(--b-line); border-radius: 999px; padding: 5px 12px 5px 10px; cursor: pointer; }
.ctl-btn:hover { color: var(--b-ink); border-color: var(--b-line2); }
.ctl-btn svg { width: 12px; height: 12px; }

/* Charts: SVG text styles */
.chart { display: block; width: 100%; height: auto; overflow: visible; font-family: inherit; }
.chart text { font-size: 12px; }
.chart text:not([fill]) { fill: var(--b-mute); }
.chart .lbl { font-size: 12.5px; }
.chart .lbl:not([fill]) { fill: var(--b-text); }
.chart .lbl-b { font-size: 12.5px; font-weight: 600; }
.chart .lbl-b:not([fill]) { fill: var(--b-ink); }
.chart .val { font-size: 11.5px; font-variant-numeric: tabular-nums; }
.chart .val:not([fill]) { fill: var(--b-text); }
.chart .val-b { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.chart .val-b:not([fill]) { fill: var(--b-ink); }
.chart .grid { stroke: #edf0f4; stroke-width: 1; }
.chart .axis { stroke: var(--b-line2); stroke-width: 1; }

/* "Rise when visible": bars grow, lines draw, labels fade; replays when the figure re-enters the viewport */
.rise .rb { transform: scaleY(0); transform-box: fill-box; transform-origin: 50% 100%; }
.rise .rbx { transform: scaleX(0); transform-box: fill-box; transform-origin: 0 50%; }
.rise .rl { stroke-dasharray: 1; stroke-dashoffset: 1; }
.rise .rf { opacity: 0; }
.rise.in .rb, .rise.in .rbx { transform: none; transition: transform .8s cubic-bezier(.2, .75, .25, 1) var(--d, 0ms); }
.rise.in .rl { stroke-dashoffset: 0; transition: stroke-dashoffset .9s cubic-bezier(.4, .1, .3, 1) var(--d, 0ms); }
.rise.in .rf { opacity: 1; transition: opacity .45s ease calc(var(--d, 0ms) + 420ms); }
@media (prefers-reduced-motion: reduce) {
  .rise .rb, .rise .rbx { transform: none !important; }
  .rise .rl { stroke-dashoffset: 0 !important; }
  .rise .rf { opacity: 1 !important; }
}
@media print { .rise .rb, .rise .rbx { transform: none !important; } .rise .rl { stroke-dashoffset: 0 !important; } .rise .rf { opacity: 1 !important; } }

/* Shared hover tooltip (driven by data-tv / data-tl / data-tc / data-tn) */
.btip { position: fixed; z-index: 400; left: 0; top: 0; pointer-events: none; min-width: 120px; max-width: 260px; padding: 9px 12px 10px; border-radius: 10px; background: var(--b-ink); color: #fff; font-size: 12.5px; line-height: 1.4; box-shadow: 0 10px 28px -10px rgba(10, 14, 20, .5); opacity: 0; transition: opacity .12s; }
.btip.on { opacity: 1; }
.btip .tl { color: #c9d0da; display: flex; align-items: center; gap: 7px; }
.btip .tl i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.btip .tv { font-size: 16px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.btip .tn { color: #a8b1be; font-size: 12px; margin-top: 2px; }
[data-tv]:focus { outline: none; }
[data-tv]:focus-visible { outline: 2px solid var(--b-accent); outline-offset: 2px; }

/* Result cards under the TL;DR */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 26px 0 8px; }
.card { display: block; position: relative; padding: 16px 18px 12px; border-radius: 14px; border: 1px solid var(--b-line); background: #fff; color: var(--b-ink); transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; }
.card:hover { transform: translateY(-2px); border-color: var(--b-line2); box-shadow: 0 12px 26px -18px rgba(20, 26, 34, .45); border-bottom-color: var(--b-line2); }
.card-k { font-size: 12.5px; font-weight: 600; color: var(--b-mute); margin: 0 !important; line-height: 1.4; }
.card-t { font-size: 16px; font-weight: 600; line-height: 1.35; margin: 2px 0 8px !important; color: var(--b-ink) !important; }
.card-t::after { content: " →"; color: var(--b-line2); transition: color .2s; }
.card:hover .card-t::after { color: var(--b-ink); }

/* Tables (booktabs style) */
.tbl-wrap { overflow-x: auto; }
.btable { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; line-height: 1.45; }
.btable th, .btable td { padding: 7px 10px; text-align: right; border-bottom: 1px solid var(--b-line); white-space: nowrap; }
.btable th:first-child, .btable td:first-child { text-align: left; }
.btable thead th { font-weight: 600; color: var(--b-ink); border-bottom: 1px solid var(--b-ink); border-top: 1.5px solid var(--b-ink); }
.btable tbody tr:last-child td { border-bottom: 1.5px solid var(--b-ink); }
.btable td { color: var(--b-text); }
.btable.txt th, .btable.txt td { text-align: left; }
.btable.wrap td, .btable.wrap th { white-space: normal; }
.btable.wrap td:last-child, .btable.wrap th:last-child { white-space: nowrap; }

/* Takeaway list */
.takeaways { list-style: none; counter-reset: tk; margin: 0 0 18px; padding: 0; }
.takeaways li { counter-increment: tk; position: relative; padding: 0 0 0 44px; margin: 0 0 18px; color: var(--b-text); }
.takeaways li::before { content: counter(tk); position: absolute; left: 0; top: 1px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13.5px; font-weight: 700; color: var(--b-accent); background: var(--b-accent-soft); }

/* Citation block */
.bibtex { position: relative; margin: 8px 0 18px; }
.bibtex pre { margin: 0; padding: 18px 20px; border: 1px solid var(--b-line); border-radius: 12px; background: var(--b-panel); font: 13px/1.65 var(--b-mono); color: var(--b-ink); white-space: pre-wrap; word-break: break-word; }
.bibtex button { position: absolute; top: 10px; right: 10px; font: inherit; font-size: 12.5px; font-weight: 600; padding: 5px 11px; border-radius: 8px; border: 1px solid var(--b-line); background: #fff; color: var(--b-mute); cursor: pointer; }
.bibtex button:hover { color: var(--b-ink); }
ol.refs { margin: 0; padding-left: 26px; font-size: 14.5px; line-height: 1.55; }
ol.refs li { margin: 0 0 8px; color: var(--b-text); scroll-margin-top: 90px; }
ol.refs li::marker { color: var(--b-mute); }
ol.refs li:target { background: var(--b-accent-soft); border-radius: 4px; }
ol.refs a { color: var(--b-ink); border-bottom: 1px solid var(--b-line2); }

/* ---------- Responsive ---------- */
@media (max-width: 1399px) {
  .post-body { grid-template-columns: minmax(0, 880px); justify-content: center; margin-top: 40px; }
  .post-body > article { grid-column: 1; }
  .toc { display: none; }
  .toc-inline { display: block; margin: 0 0 36px; border: 1px solid var(--b-line); border-radius: 12px; padding: 4px 18px; background: var(--b-panel); }
  .toc-inline summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--b-ink); padding: 10px 0; }
  .toc-inline ol { margin: 0 0 12px; padding-left: 20px; font-size: 14.5px; line-height: 1.8; }
  .toc-inline a { color: var(--b-text); border-bottom: 0; }
}
@media (max-width: 720px) {
  main.post { padding: 0 18px; }
  .post-banner { width: calc(100vw - 24px); }
  .post-head { padding-top: 36px; }
  .post-dek { font-size: 17px; }
  .post article { font-size: 16.5px; }
  .post article h2 { font-size: 24px; }
  .post section.chap { padding-top: 52px; }
  .cards { grid-template-columns: 1fr; }
  .duo { grid-template-columns: 1fr; gap: 28px; }
  .duo > * + *::before { left: 0; right: 0; top: -14px; bottom: auto; width: auto; height: 1px; }
  .fig-box { padding: 16px 14px 14px; border-radius: 14px; }
  .post-banner { border-radius: 12px; }
}

/* ---------- Blog index: the cover is the card's background, details on a paper fade ---------- */
.blog-list { display: grid; gap: 20px; margin: 8px 0 24px; }
.bcard { position: relative; display: flex; align-items: center; min-height: 340px; border-radius: 18px; overflow: hidden; isolation: isolate; color: var(--ink); background: #f8f5ee; border: 1px solid #ebe6da; transition: box-shadow .25s, transform .25s var(--ease); }
.bcard:hover { transform: translateY(-2px); box-shadow: 0 18px 38px -26px rgba(15, 30, 58, .55); border-color: #e2dccd; }
.bcard > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; z-index: -2; transition: transform .7s var(--ease); }
.bcard:hover > img { transform: scale(1.03); }
.bcard.drawing { background: #f4f3ee; }
.bcard.drawing > img { left: auto; width: 58%; object-fit: contain; }
.bcard::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(250, 248, 243, .97) 0%, rgba(250, 248, 243, .93) 40%, rgba(250, 248, 243, .45) 62%, rgba(250, 248, 243, 0) 80%); }
.bcard-in { position: relative; width: 52%; padding: 30px 36px; display: flex; flex-direction: column; gap: 9px; }
.bcard-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; font-size: 13px; color: var(--muted); }
.bcard-meta .tag { padding: 2px 10px; border-radius: 999px; background: #e8f0f8; color: var(--accent); font-weight: 600; }
.bcard h3 { margin: 0; font-size: 25px; line-height: 1.22; letter-spacing: -.01em; color: var(--ink); }
.bcard p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--ink-soft); }
.bcard-more { margin-top: 4px; font-size: 14px; font-weight: 700; color: var(--accent); }
@media (max-width: 720px) {
  .bcard { flex-direction: column; align-items: stretch; min-height: 0; padding-top: 170px; }
  .bcard > img, .bcard.drawing > img { height: 230px; width: 100%; left: 0; bottom: auto; }
  .bcard.drawing > img { object-fit: contain; }
  .bcard::before { background: linear-gradient(180deg, rgba(250, 248, 243, 0) 0, rgba(250, 248, 243, 0) 120px, rgba(250, 248, 243, .95) 200px, #faf8f3 240px); }
  .bcard-in { width: auto; padding: 18px 20px 22px; }
  .bcard h3 { font-size: 21px; }
}

/* Blog index tools: search, advanced filters, paging */
.blog-tools { display: flex; align-items: center; gap: 14px; margin: 4px 0 14px; }
.bt-search { position: relative; display: flex; align-items: center; flex: 0 1 420px; height: 46px; padding: 0 14px 0 44px; border: 1px solid #ddd8cc; border-radius: 14px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.bt-search:focus-within { border-color: #b9c8db; box-shadow: 0 0 0 3px rgba(10, 77, 140, .1); }
.bt-search svg { position: absolute; left: 15px; width: 18px; height: 18px; color: #6b7382; }
.bt-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; font-size: 15.5px; color: var(--ink); }
.bt-search input::placeholder { color: #8a909b; }
.bt-search input::-webkit-search-cancel-button { display: none; }
.bt-clear { border: 0; background: none; font-size: 20px; line-height: 1; color: #8a909b; cursor: pointer; padding: 2px 4px; }
.bt-clear:hover { color: var(--ink); }
.bt-count { font-size: 13.5px; color: var(--muted); }
.bt-filter { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border: 1px solid #ddd8cc; border-radius: 10px; background: #fff; font: inherit; font-size: 14.5px; font-weight: 600; color: #4a5160; cursor: pointer; transition: border-color .15s, background .15s; }
.bt-filter svg { width: 17px; height: 17px; }
.bt-filter:hover, .bt-filter[aria-expanded="true"] { border-color: #c9c2b2; background: #faf8f3; }
.bt-filter.on { color: var(--accent); border-color: #b9c8db; }
.blog-filters { display: grid; gap: 10px; margin: 0 0 18px; padding: 14px 16px; border: 1px solid #ebe6da; border-radius: 14px; background: #faf8f3; }
.bf-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.bf-k { width: 52px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.bf-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bf-chip { border: 1px solid #ddd8cc; background: #fff; border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 13.5px; color: #4a5160; cursor: pointer; }
.bf-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.blog-filters select { font: inherit; font-size: 14px; padding: 5px 8px; border: 1px solid #ddd8cc; border-radius: 8px; background: #fff; color: var(--ink); }
.bf-reset { margin-left: auto; border: 0; background: none; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--accent); cursor: pointer; }
.blog-empty { margin: 8px 0 24px; color: var(--muted); }
.blog-empty button { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; }
.blog-more-wrap { display: flex; justify-content: center; margin: 6px 0 20px; }
.blog-more { height: 44px; padding: 0 26px; border: 1px solid #ddd8cc; border-radius: 999px; background: #fff; font: inherit; font-size: 14.5px; font-weight: 600; color: var(--ink); cursor: pointer; transition: border-color .15s, background .15s; }
.blog-more:hover { border-color: #c9c2b2; background: #faf8f3; }
.bcard[hidden] { display: none; }
@media (max-width: 640px) {
  .blog-tools { flex-wrap: wrap; }
  .bt-search { flex: 1 1 100%; }
  .bt-filter { margin-left: 0; }
}
.blog-filters[hidden] { display: none; }
/* Video covers: a clip fills the cover frame (post header and blog card) */
.post-cover.video { height: auto; aspect-ratio: 16 / 7; background: #0d1117; border-color: #1f2630; }
.post-cover.video video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.bcard > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; z-index: -2; }
@media (max-width: 720px) { .bcard > video { height: 230px; bottom: auto; } .post-cover.video { aspect-ratio: 16 / 9; } }
