/* ============================================================
   Netiva Blog — /blog.css
   Loaded only on /blog/** and the 404 page, after /styles.css
   (SiteLayout extraCss). builder.css is NOT loaded on these pages.

   Rules
   - Every selector is scoped to .blog-* / .post-* classes or to
     body.blog-page (SiteLayout bodyClass).
   - Only styles.css tokens plus the --blog-* tokens below. Every
     --blog-* hex already exists somewhere on the site.
   - EmDash's built-in Portable Text renderers ship attribute-scoped
     CSS that is injected AFTER this file (e.g. `.emdash-image img`
     compiles to 0,3,1). Overrides therefore use a `.blog-page
     .post-prose …` prefix with strictly higher specificity, or the
     renderers' own CSS variables.
   - Breakpoints: 1099 (TOC rail) / 980 / 760 / 560.
   ============================================================ */

/* ---------- 1. tokens ---------- */
:root {
	--blog-lavender: #E6E1F8;                                              /* .agent band, pixel-edge.svg */
	--blog-lavender-ink: color-mix(in oklab, var(--accent-ink) 80%, var(--ink)); /* eyebrow text on lavender */
	--blog-grid-line: color-mix(in oklab, var(--accent) 7%, var(--border-soft));
	--blog-prose-w: 720px;
	--blog-rail-w: 232px;
	--blog-col-gap: 72px;
	--blog-sticky-top: 32px;                                               /* desktop nav is static */
	--blog-code-bg: #0d0d12;
	--blog-code-bar: #15151b;
	--blog-code-ink: #dcdce2;
	--blog-code-muted: #9a9aa6;
	--blog-code-dim: #7b7b86;                                              /* 4.65:1 on --blog-code-bg */
	--blog-code-line: rgba(255, 255, 255, .06);
	--blog-code-ok: #34d399;
	--blog-ok: #22C55E;
	--blog-ok-bg: #F0FDF4;
	--blog-ok-ink: #15803D;
	--blog-warn: #F59E0B;
	--blog-warn-bg: #FFFBEB;
	--blog-warn-ink: #B45309;
	--blog-cat-product: var(--accent);
	--blog-cat-guides: #3b82f6;
	--blog-cat-ai: var(--accent-2);
	--blog-cat-commerce: #F59E0B;
	--blog-cat-changelog: #22C55E;
}
@media (max-width: 980px) {
	:root { --blog-sticky-top: 88px; }                                    /* 64px sticky nav + 24px */
}

/* ---------- 2. base, utilities, a11y ---------- */
.blog-page [hidden] { display: none !important; }
.sr-only {
	position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
	clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.blog-page .skip-link {
	position: absolute; left: 12px; top: -64px; z-index: 100; padding: 12px 16px;
	border-radius: var(--radius-sm); background: var(--ink); color: #fff; font: 600 14px/1 var(--font);
	box-shadow: var(--shadow-md); transition: top .15s ease;
}
.blog-page .skip-link:focus { top: 12px; }
.blog-page main:focus { outline: none; }
.blog-page :focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.blog-page :is(.cta-box, .post-code, .post-preview-bar) :focus-visible { outline-color: #fff; }
.blog-page ::selection { background: color-mix(in oklab, var(--accent) 22%, transparent); }

/* reveal: 'backwards' releases the transform after the entrance so hover lifts work */
.blog-page.js-reveal .reveal { animation-fill-mode: backwards; }
.blog-page .blog-delay-1 { animation-delay: 70ms; }
.blog-page .blog-delay-2 { animation-delay: 140ms; }
.blog-page .blog-delay-3 { animation-delay: 210ms; }

/* reserve Lucide boxes before lucide.createIcons() swaps <i> → <svg>
   (:where keeps specificity at 0,1,0 so rules like `.nav-toggle .ic-close` still win) */
.blog-page :where(i[data-lucide]) { display: inline-block; flex-shrink: 0; vertical-align: middle; }
.blog-page :where(i[data-lucide][width="12"]) { width: 12px; height: 12px; }
.blog-page :where(i[data-lucide][width="13"]) { width: 13px; height: 13px; }
.blog-page :where(i[data-lucide][width="14"]) { width: 14px; height: 14px; }
.blog-page :where(i[data-lucide][width="15"]) { width: 15px; height: 15px; }
.blog-page :where(i[data-lucide][width="16"]) { width: 16px; height: 16px; }
.blog-page :where(i[data-lucide][width="17"]) { width: 17px; height: 17px; }
.blog-page :where(i[data-lucide][width="18"]) { width: 18px; height: 18px; }
.blog-page :where(i[data-lucide][width="22"]) { width: 22px; height: 22px; }
.blog-page :where(i[data-lucide][width="24"]) { width: 24px; height: 24px; }
.blog-page :where(i[data-lucide][width="30"]) { width: 30px; height: 30px; }

/* icon/label swap for copy buttons (blog.js toggles .is-copied) */
.blog-swap-done { display: none; }
.is-copied .blog-swap-idle { display: none; }
.is-copied .blog-swap-done { display: inline-block; }

/* category hues (generated covers). Default lives on :where() so [data-cat] always wins,
   and descendants of a [data-cat] card inherit the hue. */
:where(.blog-page) { --blog-cat: var(--accent); }
[data-cat="product"] { --blog-cat: var(--blog-cat-product); }
[data-cat="guides"] { --blog-cat: var(--blog-cat-guides); }
[data-cat="ai"] { --blog-cat: var(--blog-cat-ai); }
[data-cat="commerce"] { --blog-cat: var(--blog-cat-commerce); }
[data-cat="changelog"] { --blog-cat: var(--blog-cat-changelog); }

/* ---------- 3. shared pieces: stretched link, avatar, byline, meta, chips, tags ---------- */
.blog-stretch { color: inherit; }
.blog-stretch::after { content: ""; position: absolute; inset: 0; z-index: 2; border-radius: var(--radius); }
.blog-feature .blog-stretch::after { border-radius: 18px; }
.blog-stretch:hover { color: inherit; }
@supports selector(:has(*)) {
	.blog-page .blog-stretch:focus-visible { outline: none; }
	.blog-card:has(.blog-stretch:focus-visible),
	.blog-feature:has(.blog-stretch:focus-visible) { outline: 2px solid var(--accent-ink); outline-offset: 3px; }
}

.blog-avatars { display: inline-flex; flex-shrink: 0; }
.blog-avatar {
	--blog-av: 38px;
	position: relative; width: var(--blog-av); height: var(--blog-av); flex-shrink: 0;
	display: inline-flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 99px;
	background: linear-gradient(135deg, hsl(var(--blog-h, 250) 70% 62%), hsl(calc(var(--blog-h, 250) + 40) 72% 56%));
	color: #fff; font: 700 calc(var(--blog-av) * .36)/1 var(--font); letter-spacing: .02em;
	text-shadow: 0 1px 2px rgba(0, 0, 0, .18); box-shadow: 0 0 0 2px var(--surface);
	-webkit-user-select: none; user-select: none;
}
/* same hues at a fixed OKLCH lightness, so white initials reach ~4.5:1 or better on every hue
   (the plain hsl() gradient above is the homepage .quote .who look and stays as the fallback) */
@supports (color: oklch(from red l c h)) {
	.blog-avatar {
		background: linear-gradient(135deg, oklch(from hsl(var(--blog-h, 250) 70% 62%) .535 c h), oklch(from hsl(calc(var(--blog-h, 250) + 40) 72% 56%) .5 c h));
	}
}
.blog-avatar img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.blog-avatars .blog-avatar + .blog-avatar { margin-left: -10px; }
.blog-byline--sm .blog-avatar { --blog-av: 28px; }
.blog-byline--lg .blog-avatar { --blog-av: 44px; }
.blog-avatar.blog-avatar--xl { --blog-av: 64px; }

.blog-byline { display: flex; align-items: center; gap: 11px; min-width: 0; }
.blog-byline--sm { gap: 9px; }
.blog-byline__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.blog-byline__name { font: 600 13.5px/1.3 var(--font); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blog-byline--sm .blog-byline__name { font-size: 13px; }
.blog-byline--lg .blog-byline__name { font-size: 14.5px; }
a.blog-byline__name:hover { color: var(--accent-ink); }
.blog-byline__role { font: 400 12.5px/1.3 var(--font); color: var(--muted); }

.blog-meta {
	display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 8px;
	font: 500 12px/1.4 var(--mono); letter-spacing: .02em; text-transform: uppercase; color: var(--muted);
}
.blog-meta > * { white-space: nowrap; }
.blog-meta__sep { color: var(--divider); }

.blog-cats { margin-top: 28px; }
.blog-cats__list {
	position: relative; list-style: none; margin: 0; padding: 4px 0 10px;
	display: flex; align-items: center; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain;
	scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
/* no scroll snapping: it pulls a keyboard-focused chip back under the edge fade (blog.js scrolls it into view) */
.blog-cats__list::-webkit-scrollbar { display: none; }
.blog-cats__list > li { flex: 0 0 auto; display: flex; }
.blog-cats__list > li:first-child { margin-left: auto; }      /* centred when it fits, scrollable when it doesn't */
.blog-cats__list > li:last-child { margin-right: auto; }
.blog-cats__list > li.blog-cats__sep { width: 1px; height: 20px; margin-inline: 4px; background: var(--border); }
.blog-chip {
	display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 99px;
	border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm);
	font: 600 13.5px/1 var(--font); color: var(--ink-2); white-space: nowrap;
	transition: color .15s, background .15s, border-color .15s, box-shadow .2s;
}
.blog-chip svg { color: var(--muted); transition: color .15s; }
.blog-chip:hover { color: var(--ink); border-color: color-mix(in oklab, var(--accent) 30%, var(--border)); box-shadow: var(--shadow); }
.blog-chip:hover svg { color: var(--accent); }
.blog-chip[aria-current="page"] {
	background: var(--accent-tint); color: var(--accent-ink); box-shadow: none;
	border-color: color-mix(in oklab, var(--accent) 35%, var(--border));
}
.blog-chip[aria-current="page"] svg { color: var(--accent); }
.blog-chip__n { margin-left: 1px; padding: 3px 6px; border-radius: 99px; background: var(--bg); font: 500 11px/1 var(--mono); color: var(--muted); }
.blog-chip[aria-current="page"] .blog-chip__n { background: var(--surface); color: var(--accent-ink); }
.blog-chip.blog-chip--icon { width: 36px; padding: 0; justify-content: center; }

.blog-tag {
	display: inline-flex; align-items: center; gap: 5px; height: 36px; padding: 0 12px; border-radius: 99px;
	background: var(--accent-tint); color: var(--accent-ink); font: 500 13px/1 var(--font);
	box-shadow: inset 0 0 0 1px transparent; transition: box-shadow .15s;
}
.blog-tag svg { opacity: .8; }
.blog-tag:hover { box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--accent) 40%, transparent); }

/* ---------- 4. covers (real + generated fallback) ---------- */
.blog-cover {
	position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; isolation: isolate;
	border-radius: 8px; border: 1px solid var(--border-soft); background: var(--surface-2);
}
/* 0,2,1: beats EmDash's scoped `.emdash-image-media { height:auto }` (0,2,0) */
.blog-page .blog-cover img {
	display: block; width: 100%; height: 100%; max-width: none; object-fit: cover;
	transition: transform .5s cubic-bezier(.2, .7, .2, 1);
}
.blog-card:hover .blog-cover img,
.blog-feature:hover .blog-cover img { transform: scale(1.025); }

.blog-cover--fallback {
	display: grid; place-content: center; justify-items: center; gap: 12px;
	background-color: color-mix(in oklab, var(--blog-cat, var(--accent)) 6%, var(--surface-2));
	background-image:
		radial-gradient(90% 80% at 100% 0%, color-mix(in oklab, var(--blog-cat, var(--accent)) 24%, transparent), transparent 62%),
		radial-gradient(80% 70% at 0% 100%, color-mix(in oklab, var(--accent-2) 14%, transparent), transparent 60%),
		linear-gradient(var(--blog-grid-line) 1px, transparent 1px),
		linear-gradient(90deg, var(--blog-grid-line) 1px, transparent 1px);
	background-size: auto, auto, 22px 22px, 22px 22px;
	background-position: 0 0, 0 0, -1px -1px, -1px -1px;
}
/* pixel dissolve from pixel-edge.svg, recoloured per category via mask */
.blog-cover--fallback::after {
	content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 80px; z-index: -1;
	background: color-mix(in oklab, var(--blog-cat, var(--accent)) 22%, var(--surface));
	-webkit-mask: url("/assets/pixel-edge.svg") repeat-x bottom center / 180px 80px;
	mask: url("/assets/pixel-edge.svg") repeat-x bottom center / 180px 80px;
}
.blog-cover__tile {
	width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center;
	background: var(--surface); color: color-mix(in oklab, var(--blog-cat, var(--accent)) 78%, var(--ink));
	border: 1px solid color-mix(in oklab, var(--blog-cat, var(--accent)) 22%, var(--border)); box-shadow: var(--shadow-md);
	transition: background .25s ease, color .25s ease, border-color .25s ease;
}
.blog-card:hover .blog-cover__tile,
.blog-feature:hover .blog-cover__tile { background: var(--blog-cat, var(--accent)); color: #fff; border-color: transparent; }
.blog-cover__label {
	font: 600 10.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase;
	color: color-mix(in oklab, var(--blog-cat, var(--accent)) 55%, var(--ink-2));
}
.blog-feature .blog-cover__tile,
.post-cover .blog-cover__tile { width: 76px; height: 76px; border-radius: 20px; }

/* ---------- 5. index: hero, featured, grid, pager, empty ---------- */
/* clip only horizontally so button/chip shadows at the bottom of the hero aren't cut off
   (older browsers without `overflow: clip` fall back to styles.css `overflow: hidden`) */
.blog-hero.hero-product { padding: 60px 0 0; overflow-x: clip; overflow-y: visible; }
.blog-hero__title { margin-top: 16px; text-wrap: balance; }
/* balance doesn't carry across the <br>: balance the accent line on its own */
.blog-hero__title .hl-accent { display: inline-block; text-wrap: balance; }
/* 0,3,0: beats styles.css `.section-head .lead { margin-top:16px }` — matches /store's 20px gap */
:is(.blog-hero, .blog-404) .section-head .blog-hero__lead { margin: 20px auto 0; max-width: 600px; }
.blog-section { padding: 44px 0 88px; }

.blog-feature {
	position: relative; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); align-items: center; gap: 8px;
	padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-md);
	transition: transform .2s ease, box-shadow .2s ease, border-color .2s;
}
.blog-feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in oklab, var(--accent) 30%, var(--border)); }
.blog-feature__media { position: relative; min-width: 0; }
/* cover is always 16:10 and never wider than its column */
.blog-feature .blog-cover { width: 100%; height: auto; aspect-ratio: 16 / 10; border-radius: 11px; }
.blog-feature__body { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; padding: 26px 34px 22px 30px; }
.blog-feature__title { margin-top: 14px; font-size: clamp(26px, 2.6vw, 34px); line-height: 1.12; text-wrap: balance; overflow-wrap: break-word; }
.blog-feature__excerpt {
	margin: 14px 0 0; font-size: 16px; line-height: 1.6; color: var(--muted);
	display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.blog-feature__foot {
	align-self: stretch; margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--border-soft);
	display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px 20px;
}
.blog-feature__more { display: inline-flex; align-items: center; gap: 6px; font: 600 14px/1 var(--font); color: var(--accent-ink); white-space: nowrap; }
.blog-feature__more svg { transition: transform .2s ease; }
.blog-feature:hover .blog-feature__more svg { transform: translateX(3px); }
.blog-flag {
	position: absolute; top: 12px; left: 12px; z-index: 1; display: inline-flex; align-items: center; gap: 6px;
	padding: 6px 10px; border-radius: 99px; background: color-mix(in oklab, var(--surface) 90%, transparent);
	-webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: var(--shadow-sm);
	font: 600 11px/1 var(--font); letter-spacing: .04em; text-transform: uppercase; color: var(--accent-ink);
}
.blog-flag svg { color: var(--accent); }

.blog-grid { list-style: none; margin: 20px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.blog-grid > li { display: flex; min-width: 0; }
/* one or two cards under a centred hero: keep the 3-column card width and centre the row */
@media (min-width: 981px) {
	.blog-section .blog-grid:not(:has(> li:nth-child(3))) { grid-template-columns: repeat(auto-fit, calc((100% - 40px) / 3)); justify-content: center; }
}
.blog-card {
	position: relative; flex: 1; display: flex; flex-direction: column; min-width: 0; padding: 8px;
	background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
	transition: transform .2s ease, box-shadow .2s ease, border-color .2s;
}
.blog-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: color-mix(in oklab, var(--accent) 30%, var(--border)); }
.blog-card > .blog-cover { flex-shrink: 0; }
.blog-card__body { flex: 1; display: flex; flex-direction: column; align-items: flex-start; min-width: 0; padding: 16px 14px 12px; }
.blog-card__title {
	margin-top: 12px; font-size: 19px; line-height: 1.3; letter-spacing: -.015em; overflow-wrap: break-word;
	display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.blog-card__excerpt {
	margin: 8px 0 0; font-size: 14.5px; line-height: 1.55; color: var(--muted);
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.blog-card__foot {
	align-self: stretch; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border-soft);
	display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px;
}
/* guaranteed gap above the foot rule, whether or not there is an excerpt */
.blog-card__body > :has(+ .blog-card__foot) { margin-bottom: 18px; }
.blog-card__foot .blog-byline { flex: 1 1 auto; }
.blog-card__foot .blog-meta { flex-shrink: 0; }

.blog-card--promo {
	justify-content: space-between; padding: 26px 24px; overflow: hidden; color: #fff; border-color: transparent;
	background:
		radial-gradient(120% 140% at 15% 0%, color-mix(in oklab, var(--accent-2) 55%, var(--accent)) 0%, transparent 55%),
		linear-gradient(135deg, var(--accent) 0%, var(--accent-ink) 100%);
	box-shadow: var(--shadow-md);
}
.blog-card--promo:hover { border-color: transparent; }
.blog-card--promo h3 { position: relative; color: #fff; font-size: 22px; letter-spacing: -.02em; }
.blog-card--promo p { position: relative; margin: 10px 0 0; font-size: 14.5px; line-height: 1.55; color: rgba(255, 255, 255, .88); }
.blog-card--promo .btn { position: relative; align-self: flex-start; margin-top: 22px; background: #fff; color: var(--accent-ink); }
.blog-card--promo .cta-orbit { width: 300px; right: -90px; bottom: -70px; }

.blog-pager { margin-top: 48px; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 12px; }
.blog-pager__page { padding: 0 8px; font: 500 12px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }

.blog-empty { margin-top: 20px; padding: 56px 24px 60px; text-align: center; background: var(--surface-2); border: 1px dashed var(--divider); border-radius: var(--radius); }
.blog-empty__tile { width: 52px; height: 52px; margin: 0 auto 20px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: var(--accent-tint); color: var(--accent-ink); }
.blog-empty h2, .blog-empty h3 { font-size: 22px; line-height: 1.25; letter-spacing: -.02em; }
.blog-empty p { margin: 10px auto 0; max-width: 46ch; font-size: 15px; line-height: 1.6; color: var(--muted); }
.blog-empty__actions { margin-top: 24px; display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
.blog-empty__actions:empty { display: none; }

/* ---------- 6. archives + search ---------- */
.blog-archive__back {
	/* 36px touch target; the negative top margin keeps the hero where it was */
	display: flex; width: fit-content; min-height: 36px; align-items: center; gap: 6px; margin: -5px auto 17px; padding: 0 2px;
	font: 500 13.5px/1 var(--font); color: var(--muted); transition: color .15s;
}
.blog-archive__back:hover { color: var(--accent-ink); }
.blog-avatar.blog-archive__avatar { display: flex; margin: 0 auto 18px; }
.blog-archive__title { margin-top: 16px; font-size: clamp(36px, 4.8vw, 56px); line-height: 1.05; text-wrap: balance; overflow-wrap: break-word; }
.blog-meta.blog-archive__count { display: flex; justify-content: center; margin-top: 18px; }
.blog-archive__links { margin-top: 20px; display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }

/* search (/blog/search): form lives in the BlogHero "after" slot */
.blog-search { display: flex; gap: 10px; width: 100%; max-width: 560px; margin: 28px auto 0; }
.blog-search__input {
	flex: 1; min-width: 0; height: 46px; padding: 0 16px; border-radius: var(--radius-sm);
	border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm);
	font: 400 16px/1 var(--font); color: var(--ink); -webkit-appearance: none; appearance: none;
	transition: border-color .15s;
}
.blog-search__input::placeholder { color: var(--muted); }
.blog-search__input:hover { border-color: color-mix(in oklab, var(--ink) 18%, var(--border)); }
.blog-search__input::-webkit-search-cancel-button { cursor: pointer; }
.blog-search .btn { height: 46px; flex-shrink: 0; }
.blog-search__summary { max-width: 760px; margin: 0 auto; font: 600 15px/1.4 var(--font); letter-spacing: 0; color: var(--muted); }
.blog-search__results { list-style: none; max-width: 760px; padding: 0; display: grid; gap: 12px; }
.blog-page .blog-section .blog-search__results { margin: 16px auto 0; }
.blog-search__link {
	display: block; padding: 18px 20px; background: var(--surface); border: 1px solid var(--border);
	border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s;
}
.blog-search__link:hover { border-color: color-mix(in oklab, var(--accent) 30%, var(--border)); box-shadow: var(--shadow-md); }
.blog-search__title { display: block; font: 700 18px/1.3 var(--font); letter-spacing: -.015em; color: var(--ink); overflow-wrap: break-word; }
.blog-search__link:hover .blog-search__title { color: var(--accent-ink); }
.blog-search__snippet { display: block; margin-top: 6px; font-size: 14.5px; line-height: 1.55; color: var(--muted); overflow-wrap: break-word; }
:is(.blog-search__title, .blog-search__snippet) mark { padding: 0 .15em; border-radius: 3px; background: var(--accent-tint); color: var(--accent-ink); }
.blog-search__link .blog-meta { margin-top: 10px; }
.blog-search__results + .blog-empty,
.blog-search__summary + .blog-empty { margin-top: 16px; }

/* ---------- 7. post: shell, header, cover, rail, TOC ---------- */
.post { padding: 40px 0 88px; }
.post.post--before-pixel { padding-bottom: 180px; }        /* room for the 160px pixel band overlap */
.post-layout {
	display: grid; justify-content: center; column-gap: var(--blog-col-gap);
	grid-template-columns: minmax(0, var(--blog-prose-w)) var(--blog-rail-w);
	grid-template-areas: "head head" "cover cover" "body rail";
}
.post-header { grid-area: head; min-width: 0; }
.post-cover { grid-area: cover; min-width: 0; }
.post-body { grid-area: body; min-width: 0; margin-top: 56px; }
.post-rail { grid-area: rail; min-width: 0; margin-top: 56px; }

.post-crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; font: 500 12.5px/1 var(--mono); color: var(--muted); }
.post-crumbs li { display: flex; align-items: center; min-width: 0; }
.post-crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--divider); }
/* 36px-tall hit area; the negative margins keep the row at its visual height */
.post-crumbs a { display: inline-block; margin: -6px -4px; padding: 12px 4px; color: var(--muted); transition: color .15s; }
.post-crumbs a:hover { color: var(--accent-ink); }
.post-crumbs [aria-current] { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40ch; }
.post-header .eyebrow { margin-top: 22px; }
.post-title { margin-top: 16px; max-width: 24ch; font-size: clamp(34px, 4.4vw, 52px); line-height: 1.06; text-wrap: balance; overflow-wrap: break-word; }
.post-header .post-dek { margin: 18px 0 0; max-width: 640px; text-wrap: pretty; }
.post-byline-row {
	margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--border-soft);
	display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px 24px;
}

.post-share { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.post-share__label { margin-right: 4px; font: 600 11px/1 var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.post-share__btn {
	position: relative; width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
	border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm);
	color: var(--muted); font: inherit; cursor: pointer; transition: color .15s, border-color .15s, background .15s;
}
.post-share__btn:hover { color: var(--ink); border-color: color-mix(in oklab, var(--ink) 20%, var(--border)); }
.post-share__btn > svg { width: 16px; height: 16px; }
.post-share__btn > svg:not(.lucide) { width: 15px; height: 15px; }
.post-share__btn.is-copied { color: var(--blog-ok-ink); border-color: color-mix(in oklab, var(--blog-ok) 45%, var(--border)); background: var(--blog-ok-bg); }
.post-share__btn[data-tip]::after {
	content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translate(-50%, 4px);
	padding: 6px 8px; border-radius: 7px; background: var(--ink); color: #fff; font: 500 11.5px/1 var(--font);
	white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s;
}
.post-share__btn.is-copied[data-tip]::after { opacity: 1; transform: translate(-50%, 0); }

.post-cover { margin: 40px 0 0; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); }
.post-cover .blog-cover.post-cover__media { aspect-ratio: 16 / 9; border-radius: 10px; }
.post-cover > figcaption { margin: 10px 4px 2px; text-align: center; font-size: 13.5px; line-height: 1.5; color: var(--muted); }

.post-rail__inner {
	position: sticky; top: var(--blog-sticky-top); max-height: calc(100vh - var(--blog-sticky-top) * 2);
	overflow: auto; overscroll-behavior: contain; scrollbar-width: thin;
	display: flex; flex-direction: column; gap: 24px;
	/* 6px side padding gives full-width TOC links room for the 4px focus ring inside this scroll box;
	   the -4px margins keep the content box where it was (2px in from the rail) */
	margin-inline: -4px; padding: 2px 6px 8px;
}
.post-toc__title { display: flex; align-items: center; gap: 7px; margin: 0 0 12px; font: 600 11px/1 var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.post-toc__list, .post-toc__list ol { list-style: none; margin: 0; padding: 0; }
.post-toc__list { border-left: 1px solid var(--border); }
.post-toc__link {
	display: block; margin-left: -1px; padding: 6px 0 6px 14px; border-left: 2px solid transparent;
	font: 500 13.5px/1.4 var(--font); color: var(--muted); overflow-wrap: break-word; transition: color .15s, border-color .15s;
}
.post-toc__list ol .post-toc__link { padding-left: 26px; font-size: 13px; }
.post-toc__link:hover { color: var(--ink); }
.post-toc__link[aria-current] { color: var(--accent-ink); border-left-color: var(--accent); font-weight: 600; }
.post-toc__top { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; padding: 4px 0 4px 15px; font: 500 12.5px/1 var(--font); color: var(--muted); transition: color .15s; }
.post-toc__top:hover { color: var(--accent-ink); }
.post-rail__promo { padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.post-rail__tile { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: var(--accent-tint); color: var(--accent-ink); }
.post-rail__promo p { margin: 12px 0 14px; font: 600 14.5px/1.4 var(--font); color: var(--ink); }

.post-toc-inline { display: none; margin: 0 0 32px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm); }
.post-toc-inline > summary {
	list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 16px;
	border-radius: 12px; font: 600 14px/1 var(--font); color: var(--ink); -webkit-user-select: none; user-select: none;
}
.post-toc-inline > summary::-webkit-details-marker { display: none; }
.post-toc-inline > summary svg { color: var(--muted); }
.post-toc-inline__chev { margin-left: auto; transition: transform .2s ease; }
.post-toc-inline[open] .post-toc-inline__chev { transform: rotate(180deg); }
.post-toc-inline .post-toc__list { margin: 2px 16px 16px; }

/* reading progress: CSS scroll-driven where supported, blog.js sets --p otherwise */
.post-progress { position: fixed; top: 0; left: 0; right: 0; z-index: 60; height: 3px; pointer-events: none; }
.post-progress__bar { display: block; height: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }
@supports (animation-timeline: view()) and (timeline-scope: none) {
	.blog-post, .post-page { timeline-scope: --post-read; }
	.post-body { view-timeline: --post-read block; }
	.post-progress__bar {
		animation: blog-progress linear both;
		animation-timeline: --post-read;
		animation-range: contain 0% contain 100%;
	}
}
@keyframes blog-progress {
	from { transform: scaleX(0); }
	to { transform: scaleX(1); }
}

/* draft preview bar ("dark world" strip, like .ws-titlebar) */
.post-preview-bar { position: sticky; top: 0; z-index: 55; background: #15151b; color: #dcdce2; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.post-preview-bar .wrap { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; min-height: 44px; padding-block: 8px; font: 400 13px/1.4 var(--font); }
.post-preview-bar__chip {
	display: inline-flex; align-items: center; gap: 7px; padding: 5px 9px; border-radius: 6px;
	background: rgba(245, 158, 11, .14); color: #fbbf24; font: 600 11px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
}
.post-preview-bar__dot { width: 7px; height: 7px; border-radius: 99px; background: #F59E0B; animation: blog-pulse 1.8s ease-out infinite; }
@keyframes blog-pulse {
	0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, .5); }
	70%, 100% { box-shadow: 0 0 0 7px rgba(245, 158, 11, 0); }
}
.post-preview-bar__link {
	margin-left: auto; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 8px;
	border: 1px solid rgba(255, 255, 255, .14); color: #fafafa; font: 600 12.5px/1 var(--font);
}
.post-preview-bar__link:hover { background: rgba(255, 255, 255, .08); }

/* ---------- 8. prose ---------- */
.post-prose {
	/* theme EmDash built-in renderers through their variables */
	--color-muted: var(--muted);
	--color-border: var(--border-soft);
	--color-surface: var(--surface-2);
	--color-bg-subtle: transparent;
	--emdash-caption-color: var(--muted);
	--emdash-break-color: var(--border);
	--emdash-break-dots-color: var(--muted);
	--emdash-button-bg: var(--accent);
	--emdash-button-bg-hover: var(--accent-ink);
	--emdash-button-color: #fff;
	--emdash-file-bg: var(--surface);
	--emdash-file-border: var(--border);
	--emdash-file-color: var(--ink);
	--emdash-file-icon-color: var(--accent-ink);
	--emdash-pullquote-border: color-mix(in oklab, var(--accent) 35%, var(--border));
	--emdash-pullquote-color: var(--ink);
	--emdash-pullquote-citation-color: var(--muted);
	--emdash-cover-fallback-bg: var(--ink);
	--emdash-cover-text-color: #fff;
	display: flow-root; font-size: 18px; line-height: 1.75; color: var(--ink-2); overflow-wrap: break-word;
}
.post-prose :where(p, ul, ol, li, blockquote, figure, pre, table, hr, h1, h2, h3, h4, h5, h6) { margin: 0; }
.post-prose :where(p) { text-wrap: pretty; }

/* vertical rhythm for our own blocks (all 0,1,0 so the order below decides) */
.post-prose > * + * { margin-top: 1.25em; }
.post-prose > :where(blockquote, hr, .post-code, .post-callout, .post-shot, .post-divider),
.post-prose > :where(blockquote, hr, .post-code, .post-callout, .post-shot, .post-divider) + * { margin-top: 1.9em; }
.post-prose > :where(hr, .post-divider),
.post-prose > :where(hr, .post-divider) + * { margin-top: 2.6em; }
.post-prose > :where(h1, h2) { margin-top: 2.1em; }
.post-prose > :where(h3) { margin-top: 1.8em; }
.post-prose > :where(h4, h5, h6) { margin-top: 1.6em; }
.post-prose > :where(h1, h2, h3, h4, h5, h6) + * { margin-top: .6em; }
.post-prose > :where(h1, h2, h3, h4, h5, h6) + :where(h1, h2, h3, h4, h5, h6) { margin-top: .9em; }
.post-prose > :first-child { margin-top: 0; }

/* EmDash built-in wrappers carry their own block margins (0,2,0) — reset and re-apply the rhythm */
.blog-page .post-prose > :is(.emdash-image, .emdash-gallery, .emdash-embed, .emdash-table-wrapper, .emdash-code, .emdash-columns, .emdash-cover, .emdash-buttons, .emdash-file, .emdash-pullquote, .emdash-html-block, .emdash-break) { margin-block: 0; }
.blog-page .post-prose > * + :is(.emdash-image, .emdash-gallery, .emdash-embed, .emdash-table-wrapper, .emdash-code, .emdash-columns, .emdash-cover, .emdash-buttons, .emdash-file, .emdash-pullquote, .emdash-html-block, .emdash-break),
.blog-page .post-prose > :is(.emdash-image, .emdash-gallery, .emdash-embed, .emdash-table-wrapper, .emdash-code, .emdash-columns, .emdash-cover, .emdash-buttons, .emdash-file, .emdash-pullquote, .emdash-html-block, .emdash-break) + * { margin-top: 1.9em; }
.blog-page .post-prose > :is(h1, h2, h3, h4, h5, h6) + :is(.emdash-image, .emdash-gallery, .emdash-embed, .emdash-table-wrapper, .emdash-code, .emdash-columns, .emdash-cover, .emdash-buttons, .emdash-file, .emdash-pullquote, .emdash-html-block) { margin-top: .8em; }
.blog-page .post-prose > :is(.emdash-image, .emdash-gallery, .emdash-embed, .emdash-table-wrapper, .emdash-code, .emdash-columns, .emdash-cover, .emdash-buttons, .emdash-file, .emdash-pullquote, .emdash-html-block) + :where(h1, h2) { margin-top: 2.1em; }
.blog-page .post-prose > :first-child { margin-top: 0; }

/* headings */
.post-prose :is(h1, h2, h3, h4, h5, h6) { clear: both; color: var(--ink); scroll-margin-top: var(--blog-sticky-top); text-wrap: balance; }
.post-prose :is(h1, h2) { font-size: clamp(24px, 2.4vw, 30px); line-height: 1.2; letter-spacing: -.025em; }
.post-prose h3 { font-size: 21px; line-height: 1.35; letter-spacing: -.015em; }
.post-prose h4 { font: 700 18px/1.4 var(--font); letter-spacing: -.01em; }
.post-prose :is(h5, h6) { font: 600 12.5px/1.4 var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
/* PostBlock renders its own headings, so EmDash's (Block-scoped) alignment classes don't reach them */
.post-prose .has-text-align-center { text-align: center; }
.post-prose .has-text-align-right { text-align: right; }
.post-prose .has-text-align-justify { text-align: justify; }
.post-h__anchor {
	margin-left: .3em; padding: 0 .1em; color: var(--divider); font-weight: 500; text-decoration: none;
	opacity: 0; transition: opacity .15s, color .15s;
}
.post-h:hover .post-h__anchor,
.post-h__anchor:focus { opacity: 1; }
.post-h__anchor:hover { color: var(--accent-ink); }

/* inline text */
.post-prose a:not([class]) {
	color: var(--accent-ink); font-weight: 500;
	text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px;
	text-decoration-color: color-mix(in oklab, var(--accent) 40%, transparent);
	transition: text-decoration-color .15s;
}
.post-prose a:not([class]):hover { text-decoration-color: currentColor; }
.post-prose a[target="_blank"]:not([class])::after { content: "\2197"; display: inline-block; margin-left: .12em; font-size: .78em; text-decoration: none; }
.post-prose :is(strong, b) { font-weight: 600; color: var(--ink); }
.post-prose :is(s, del) { text-decoration-color: var(--muted); }
.post-prose u { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.post-prose :is(sub, sup) { font-size: .72em; line-height: 0; }
.post-prose abbr[title] { text-decoration: underline dotted var(--divider); }

/* lists — square "pixel" bullets */
.post-prose :is(ul, ol) { padding-left: 1.45em; }
.post-prose ul { list-style-type: square; }
.post-prose ul ul { list-style-type: circle; }
.post-prose ul > li::marker { color: var(--accent); }
.post-prose ul ul > li::marker { color: var(--accent-2); }
.post-prose ol > li { padding-left: .25em; }
.post-prose ol > li::marker { font: 600 .82em var(--mono); color: var(--accent-ink); }
.post-prose li + li,
.post-prose li > :is(ul, ol) { margin-top: .45em; }
.post-prose li > p + p { margin-top: .5em; }

/* quotes */
.post-prose blockquote {
	padding: 2px 0 2px 24px; border-left: 3px solid var(--accent);
	color: var(--ink); font-size: 1.08em; font-weight: 500; line-height: 1.6; letter-spacing: -.005em;
}
.post-prose blockquote > * + * { margin-top: .8em; }
.post-prose blockquote cite { display: block; margin-top: .8em; font-size: .82em; font-style: normal; font-weight: 500; color: var(--muted); }

/* rules + pixel divider (PostBreak) */
.post-prose hr { height: 0; border: 0; border-top: 1px solid var(--border); }
.post-divider { display: flex; justify-content: center; gap: 8px; }
.post-divider span { width: 6px; height: 6px; border-radius: 1.5px; background: var(--border); }
.post-divider span:nth-child(2) { background: var(--accent); }
.post-divider.post-divider--space { height: 1.5em; }

/* inline code, kbd, mark */
.post-prose :not(pre) > code {
	padding: .2em .42em; border-radius: 6px; font: 500 .84em/1 var(--mono);
	background: var(--accent-tint); color: var(--accent-ink);
	border: 1px solid color-mix(in oklab, var(--accent) 14%, transparent);
	-webkit-box-decoration-break: clone; box-decoration-break: clone; overflow-wrap: anywhere;
}
.post-prose a:not([class]) code { color: inherit; }
.post-prose kbd {
	display: inline-block; padding: .3em .5em; border-radius: 6px; border: 1px solid var(--border); border-bottom-width: 2px;
	background: var(--surface); color: var(--ink-2); font: 500 .78em/1 var(--mono); vertical-align: .1em;
}
.post-prose mark { padding: .05em .2em; border-radius: 3px; background: color-mix(in oklab, var(--accent) 16%, transparent); color: var(--ink); }

/* images (EmDash PTImage → figure.emdash-image; its scoped img/figcaption rules are 0,3,1) */
.blog-page .post-prose figure.emdash-image img {
	display: block; max-width: 100%; height: auto; margin-inline: auto;
	border-radius: 12px; border: 1px solid var(--border-soft); background: var(--surface-2);
}
.blog-page .post-prose figure.emdash-image > figcaption,
.blog-page .post-prose figure.emdash-embed > figcaption {
	margin-top: 12px; text-align: center; font-size: 13.5px; line-height: 1.5; color: var(--muted);
}
.blog-page .post-prose > .emdash-image:is(.emdash-image--align-left, .emdash-image--align-right) { margin-bottom: 1em; }
@media (min-width: 641px) {
	.blog-page .post-prose > .emdash-image:is(.emdash-image--align-left, .emdash-image--align-right) { margin-top: .4em; }
	.blog-page .post-prose > .emdash-image.emdash-image--align-left { margin-right: 1.6em; }
	.blog-page .post-prose > .emdash-image.emdash-image--align-right { margin-left: 1.6em; }
}
/* galleries + embeds */
.blog-page .post-prose .emdash-gallery-item figure,
.blog-page .post-prose figure.emdash-gallery-item { margin: 0; }
.blog-page .post-prose figure.emdash-gallery-item img { display: block; border-radius: 10px; border: 1px solid var(--border-soft); background: var(--surface-2); }
.blog-page .post-prose figure.emdash-gallery-item > figcaption { margin-top: 6px; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.blog-page .post-prose .emdash-embed-video { border-radius: 14px; border: 1px solid var(--border); background: var(--ink); box-shadow: var(--shadow-md); }
.blog-page .post-prose .emdash-embed-html iframe { max-width: 100%; }
.blog-page .post-prose .emdash-html-block :is(img, video, iframe) { max-width: 100%; height: auto; }

/* browser-frame screenshot (PostImage with "host/path | caption"; reuses styles.css .bw) */
.post-shot .bw { box-shadow: var(--shadow-md); }
.post-shot .bw-bar { height: 38px; gap: 12px; }
.post-shot .lights i:nth-child(1) { background: #ff5f57; }
.post-shot .lights i:nth-child(2) { background: #febc2e; }
.post-shot .lights i:nth-child(3) { background: #28c840; }
.post-shot .bw-url { min-width: 0; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blog-page .post-shot figure.emdash-image { margin: 0; }
.blog-page .post-prose .post-shot figure.emdash-image img { width: 100%; border: 0; border-radius: 0; }
.post-shot > figcaption { margin-top: 12px; text-align: center; font-size: 13.5px; line-height: 1.5; color: var(--muted); }

/* code blocks (PostCode, .codepeek language; plain lines, no highlighter) */
.post-code { overflow: hidden; border-radius: var(--radius); border: 1px solid rgba(255, 255, 255, .09); background: var(--blog-code-bg); box-shadow: var(--shadow-md); }
.post-code__bar { display: flex; align-items: flex-end; gap: 2px; min-width: 0; padding: 8px 8px 0; background: var(--blog-code-bar); border-bottom: 1px solid var(--blog-code-line); }
.post-code__tab {
	min-width: 0; max-width: 70%; padding: 9px 14px; border-radius: 8px 8px 0 0;
	background: var(--blog-code-bg); color: #fafafa; font: 500 12px/1 var(--mono);
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.post-code__lang { align-self: center; flex-shrink: 0; margin: 0 0 8px 8px; font: 500 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--blog-code-muted); }
.post-code__copy {
	position: relative; align-self: center; flex-shrink: 0; margin: 0 0 8px auto; height: 28px; padding: 0 10px;
	display: inline-flex; align-items: center; gap: 6px;
	border: 1px solid rgba(255, 255, 255, .08); border-radius: 7px; background: transparent; color: var(--blog-code-muted);
	font: 500 11.5px/1 var(--mono); cursor: pointer; transition: color .15s, background .15s, border-color .15s;
}
.post-code__copy::after { content: ""; position: absolute; inset: -5px; }   /* 36px hit area (26px padding box + 2×5), same bar */
.post-code__copy:hover { color: #fafafa; background: rgba(255, 255, 255, .06); }
.post-code__copy.is-copied { color: var(--blog-code-ok); border-color: color-mix(in oklab, var(--blog-code-ok) 35%, transparent); }
.post-code pre {
	margin: 0; padding: 16px 0 18px; overflow-x: auto; overscroll-behavior-x: contain;
	background-color: var(--blog-code-bg); color: var(--blog-code-ink);
	font: 400 13.5px/1.75 var(--mono); white-space: pre; tab-size: 2; counter-reset: blog-ln;
	scrollbar-width: thin; scrollbar-color: #41414b transparent;
}
.blog-page .post-code pre:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.post-code pre code {
	display: block; min-width: max-content; padding: 0 22px 0 4px;
	font: inherit; color: inherit; background: none; border: 0; border-radius: 0;
}
.post-code .line { counter-increment: blog-ln; }
.post-code:not(.post-code--no-ln) .line::before {
	content: counter(blog-ln); position: sticky; left: 0; display: inline-block; width: 2.6em; padding-right: 1.1em;
	margin-right: .4em; text-align: right; color: var(--blog-code-dim); background: var(--blog-code-bg);
	-webkit-user-select: none; user-select: none;
}
.post-code.post-code--no-ln pre code { padding-left: 20px; }

/* tables (EmDash built-in; outer cell borders hidden, the wrapper draws the frame) */
.blog-page .post-prose .emdash-table-wrapper {
	max-width: 100%; border: 1px solid var(--border); border-radius: 12px;
	background: var(--surface); box-shadow: var(--shadow-sm); scrollbar-width: thin;
}
.blog-page .post-prose .emdash-table { border-style: hidden; font-size: 15px; line-height: 1.5; }
.blog-page .post-prose .emdash-table-wrapper .emdash-table :is(th, td) { padding: 11px 14px; border-color: var(--border-soft); }
.blog-page .post-prose .emdash-table-wrapper .emdash-table thead th {
	background: var(--surface-2); border-bottom-color: var(--border);
	font: 600 11.5px/1.3 var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.blog-page .post-prose .emdash-table-wrapper .emdash-table tbody th { font-weight: 600; color: var(--ink); }
.blog-page .post-prose .emdash-table-wrapper .emdash-table td { color: var(--ink-2); }
.blog-page .post-prose .emdash-table-wrapper .emdash-table :is(th, td) code { font-size: .8em; }

/* callouts (from "Note:/Tip:/Warning:" quotes) */
.post-callout {
	--blog-c: var(--accent); --blog-c-bg: var(--accent-tint); --blog-c-ink: var(--accent-ink);
	display: flex; gap: 14px; padding: 18px 20px; border-radius: 12px;
	background: var(--blog-c-bg); border: 1px solid color-mix(in oklab, var(--blog-c) 22%, var(--border)); border-left: 3px solid var(--blog-c);
	font-size: 16px; line-height: 1.65; color: var(--ink-2);
}
.post-callout.post-callout--tip { --blog-c: var(--blog-ok); --blog-c-bg: var(--blog-ok-bg); --blog-c-ink: var(--blog-ok-ink); }
.post-callout.post-callout--warning { --blog-c: var(--blog-warn); --blog-c-bg: var(--blog-warn-bg); --blog-c-ink: var(--blog-warn-ink); }
.post-callout__icon {
	width: 34px; height: 34px; flex-shrink: 0; border-radius: 9px; display: flex; align-items: center; justify-content: center;
	background: var(--surface); color: var(--blog-c-ink); border: 1px solid color-mix(in oklab, var(--blog-c) 22%, var(--border));
}
.post-callout__body { flex: 1; min-width: 0; }
.post-callout__title { display: block; margin: 6px 0 4px; font: 600 15px/1.4 var(--font); color: var(--ink); }
.post-callout__body :where(p) { margin: 0; }
.post-callout__body > * + * { margin-top: .7em; }
.post-callout__body :is(ul, ol) { padding-left: 1.3em; }
.post-callout a:not([class]) { color: var(--blog-c-ink); }

/* other built-ins that need more than variables (all 0,3,0 vs EmDash 0,2,0) */
.blog-page .post-prose .emdash-pullquote { border-width: 1px 0; padding: 28px 8px; }
.blog-page .post-prose .emdash-pullquote__text { padding: 0; border: 0; font: 600 clamp(22px, 2.4vw, 27px)/1.35 var(--font); font-style: normal; letter-spacing: -.02em; text-wrap: balance; }
.blog-page .post-prose .emdash-pullquote__citation { font-size: 14px; }
.blog-page .post-prose .emdash-button { border-radius: var(--radius-sm); font-weight: 600; font-size: 15px; line-height: 1.2; text-decoration: none; }
.blog-page .post-prose .emdash-file { border-radius: 12px; box-shadow: var(--shadow-sm); }
.blog-page .post-prose .emdash-file__download { border-radius: 8px; }
.blog-page .post-prose .emdash-cover { border-radius: 14px; }
.blog-page .post-prose .emdash-columns > .emdash-column > * + * { margin-top: 1em; }

/* ---------- 9. post end matter ---------- */
.post-end { margin-top: 56px; display: flex; flex-direction: column; gap: 28px; }
.post-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding-top: 28px; border-top: 1px solid var(--border-soft); }
.post-tags__label { margin-right: 6px; font: 600 11px/1 var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.post-author {
	display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 18px; padding: 24px;
	background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.post-author p { margin: 0; }
.post-author__label { display: block; font: 600 11px/1 var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.post-author .post-author__name { margin-top: 8px; font: 700 17px/1.3 var(--font); letter-spacing: -.01em; color: var(--ink); }
.post-author .post-author__role { margin-top: 2px; font-size: 13.5px; line-height: 1.4; color: var(--muted); }
.post-author .post-author__bio { margin-top: 12px; font-size: 15px; line-height: 1.6; color: var(--ink-2); }
.post-author__links { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 0 18px; }
.post-author__link { display: inline-flex; min-height: 36px; align-items: center; gap: 6px; padding: 0; font: 600 14px/1 var(--font); color: var(--accent-ink); }
.post-author__link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 10. lavender related band + pixel transitions (from builder.css .pixel-transition, renamed) ---------- */
.blog-pixel {
	position: relative; z-index: 1; height: 160px; margin-top: -160px; pointer-events: none;
	background: url("/assets/pixel-edge.svg") repeat-x bottom center / 360px 160px;
}
.blog-pixel.blog-pixel--flip { margin-top: 0; margin-bottom: -160px; transform: scaleY(-1); }
.blog-related { padding: 88px 0; background: var(--blog-lavender); }
.blog-related__head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 16px 24px; }
.blog-related .eyebrow { color: var(--blog-lavender-ink); }
.blog-related__title { margin-top: 12px; font-size: clamp(26px, 3vw, 36px); }
.blog-related p:not([class]) { color: var(--ink-2); }
.blog-related .btn--ghost { background: var(--surface); }
.blog-related .blog-grid { margin-top: 36px; }
.blog-related .blog-card { border-color: color-mix(in oklab, var(--accent) 12%, var(--border)); }
.cta-band.blog-after-pixel { padding-top: 180px; }         /* the flipped band overlaps 160px into the CTA */

/* ---------- 11. CTA (CtaBand with class="blog-cta"; orbit size comes from CtaBand's inline style) ---------- */
.blog-cta .cta-box h2 { text-wrap: balance; }

/* ---------- 12. 404 ---------- */
.blog-404.hero-product { padding-bottom: 96px; }
/* 0,3,0 over styles.css `.hero-product .section-head { max-width:760px }`: keeps the headline on two lines (line + accent) */
.blog-404.hero-product .section-head { max-width: 880px; }
.blog-404 .blog-hero__title { margin-top: 16px; }
.blog-404 .hero-cta.blog-404__cta { justify-content: center; }
.blog-404 .bw { max-width: 760px; margin-inline: auto; }
.blog-404 .lights i:nth-child(1) { background: #ff5f57; }
.blog-404 .lights i:nth-child(2) { background: #febc2e; }
.blog-404 .lights i:nth-child(3) { background: #28c840; }
.blog-404__canvas {
	position: relative; height: 280px; overflow: hidden; display: grid; place-items: center;
	background-color: var(--bg);
	background-image: linear-gradient(var(--border-soft) 1px, transparent 1px), linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
	background-size: 22px 22px;
}
.blog-404__code {
	position: relative; font: 700 clamp(84px, 14vw, 148px)/1 var(--mono); letter-spacing: -.04em; color: var(--accent);
	background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.blog-404__block {
	position: absolute; width: 150px; padding: 12px; display: flex; flex-direction: column; gap: 7px;
	background: var(--surface); border: 1px solid var(--border); border-radius: 11px; box-shadow: var(--shadow-sm);
}
.blog-404__block span { height: 8px; border-radius: 99px; background: var(--border); }
.blog-404__block span + span { width: 60%; }
.blog-404__block--a { top: 32px; left: 8%; transform: rotate(-6deg); }
.blog-404__block--b { right: 9%; bottom: 30px; transform: rotate(5deg); }
.feature-grid.blog-404__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 56px; text-align: left; }
.blog-404__grid .feature { display: block; }
.blog-404__grid .feature p { text-wrap: pretty; }

/* ---------- 13. responsive (1099 / 980 / 760 / 560) ---------- */
@media (max-width: 1099px) {
	.post-layout { grid-template-columns: minmax(0, var(--blog-prose-w)); grid-template-areas: "head" "cover" "body"; }
	.post-rail { display: none; }
	.post-toc-inline { display: block; }
}
@media (max-width: 980px) {
	.blog-hero.hero-product { padding-top: 48px; }
	.blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.post { padding-top: 28px; }
	.post-body { margin-top: 44px; }
	.post-progress { top: 64px; }                      /* under the sticky mobile nav */
	.post-preview-bar { top: 64px; }
	.blog-related { padding: 72px 0; }
	.feature-grid.blog-404__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* tablets keep the two-column featured card (a full-width 16:10 cover would outgrow the viewport) */
@media (min-width: 761px) and (max-width: 980px) {
	.blog-feature__body { padding: 18px 22px 16px 18px; }
	.blog-feature__foot { margin-top: 20px; padding-top: 16px; }
}
@media (max-width: 760px) {
	.blog-feature { grid-template-columns: minmax(0, 1fr); gap: 0; }
	.blog-feature__body { padding: 22px 20px 16px; }
	.blog-cats__list {
		margin-inline: -24px; padding-inline: 24px; scroll-padding-inline: 24px;
		-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
		mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
	}
	.blog-cats__list > li:first-child { margin-left: 0; }
	.blog-cats__list > li:last-child { margin-right: 0; }
	.post-byline-row { flex-direction: column; align-items: flex-start; }
	.post-cover { margin-top: 28px; padding: 6px; border-radius: 14px; }
	.post-cover .blog-cover.post-cover__media { aspect-ratio: 16 / 10; border-radius: 9px; }
	.post-author { grid-template-columns: minmax(0, 1fr); padding: 20px; }
	.blog-pager .btn { flex: 1 1 0; }
	.blog-404__block--a { left: 4%; }
	.blog-404__block--b { right: 4%; }
}
@media (max-width: 560px) {
	.blog-grid { grid-template-columns: minmax(0, 1fr); }
	.blog-pager__page { order: -1; flex-basis: 100%; text-align: center; }   /* "Page N" above two equal buttons */
	.blog-feature__body { padding: 20px 14px 12px; }
	.blog-feature__excerpt { font-size: 15px; }
	.post-title { max-width: none; }
	.post-prose { font-size: 17px; line-height: 1.7; }
	.post-code pre { font-size: 12.5px; }
	.post-code:not(.post-code--no-ln) .line::before { width: 2.2em; padding-right: .8em; margin-right: .3em; }
	.post-code.post-code--no-ln pre code { padding-left: 16px; }
	.post-shot .bw-url { display: none; }
	.post-callout { gap: 12px; padding: 16px; }
	.post-callout__icon { width: 30px; height: 30px; }
	.post-callout__title { margin-top: 4px; }
	.blog-page .post-prose .emdash-table { font-size: 14px; }
	.blog-empty { padding: 44px 20px 48px; }
	.blog-search { flex-direction: column; }
	.blog-page .blog-search .blog-search__input { flex: 0 0 auto; }
	.blog-search__link { padding: 16px 18px; }
	.blog-404__canvas { height: 200px; }
	.blog-404__block { display: none; }
	.feature-grid.blog-404__grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 14. reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
	html:has(body.blog-page) { scroll-behavior: auto; }
	.blog-page.js-reveal .reveal { animation: none; }
	.blog-page *,
	.blog-page *::before,
	.blog-page *::after { transition-duration: .01ms !important; }
	.post-preview-bar__dot { animation: none; }
	.blog-card:hover,
	.blog-feature:hover,
	.blog-card:hover .blog-cover img,
	.blog-feature:hover .blog-cover img { transform: none; }
}
