/* PtBuildr — shared utilities + global resets.
   Skin tokens (type, radius, hero) live in the site theme `:root`
   (`wp/ptb-theme/style.css`). This file keeps resets, the spacing formula
   (--ptb-space-* × --ptb-density), and component rules that consume var().
   Loaded on front-end + editor. Per-block CSS lives in src/<block>/style.css. */

/* ── Gotcha resets (WP has no Tailwind preflight) ─────────────────────────── */

/* box-sizing (gotcha #1): WP doesn't set border-box; width:100% + padding overflows. */
[class*="wp-block-ptb-"],
[class*="wp-block-ptb-"] *,
[class*="wp-block-ptb-"] *::before,
[class*="wp-block-ptb-"] *::after {
	box-sizing: border-box;
}

/* Root block-gap (gotcha #11): zero margin between top-level header/main/footer
   so full-bleed sections own their vertical spacing (post-content untouched). */
.wp-site-blocks > * {
	margin-block-start: 0;
	margin-block-end: 0;
}

/* post-content block-gap (gotcha #14): remove the layout gap between stacked
   full-bleed section blocks (core block spacing inside post-content unaffected). */
.wp-block-post-content > [class*="wp-block-ptb-"] {
	margin-block: 0;
}

/* Form controls don't inherit the page font in WP (gotcha #13). Zero-specificity
   so explicit per-control font rules still win. */
:where([class*="wp-block-ptb-"]) :where( button, input, select, textarea ) {
	font-family: inherit;
}

/* One resilient focus treatment across light and dark Theme Skins. The white
   inner ring and dark outer ring keep the indicator visible on either tone. */
:where([class*="wp-block-ptb-"]) :where(a, button, input, select, textarea, [tabindex]):focus-visible {
	outline: 3px solid #0f2744;
	outline-offset: 3px;
	box-shadow: 0 0 0 2px #fff;
}
html { scroll-padding-top: 112px; }
.wp-site-blocks { overflow-x: clip; }

/* Reset UA heading/paragraph margins inside our blocks (gotcha #5). :where()
   keeps specificity 0 so per-element spacing classes still win. */
:where([class*="wp-block-ptb-"]) :where(h1, h2, h3, h4, h5, h6, p, figure, ul, ol, blockquote) {
	margin: 0;
}

/* Smooth in-page anchor scrolling (TOC / hash). Respects reduced-motion. */
@media (prefers-reduced-motion: no-preference) {
	html { scroll-behavior: smooth; }
}

/* Type / radius / on-brand / hero knobs: set in the theme, not here.
   Blocks use var(--ptb-section-title) etc. A new site copies the theme :root
   and changes values — do not put client pixels in this file. */


/* ── Spacing scale (density-aware) ─────────────────────────────────────────────
   Component padding / gap / margin route through these (named by base px). One
   knob — --ptb-density — scales the whole system at once for a per-site density
   variant: compact .85 · normal 1 · loose 1.2. Section rhythm is a separate knob
   in theme.json (--wp--custom--section--padding). One-off layout constants
   (15px gutter, sticky offsets, 2px insets…) stay literal by design. token-spec §2b. */
:root {
	--ptb-density: 1;   /* spacing multiplier — compact .85 · normal 1 · loose 1.2 */
	--ptb-leading: 1;   /* line-height multiplier (type twin of density) — tight .92 · normal 1 · airy 1.1.
	                       Every line-height is calc(ratio * --ptb-leading), so one override retunes
	                       reading comfort site-wide; pairs with --ptb-density. token-spec §4a. */
	--ptb-space-4:  calc(4px  * var(--ptb-density));
	--ptb-space-8:  calc(8px  * var(--ptb-density));
	--ptb-space-12: calc(12px * var(--ptb-density));
	--ptb-space-16: calc(16px * var(--ptb-density));
	--ptb-space-20: calc(20px * var(--ptb-density));
	--ptb-space-24: calc(24px * var(--ptb-density));
	--ptb-space-28: calc(28px * var(--ptb-density));
	--ptb-space-32: calc(32px * var(--ptb-density));
	--ptb-space-40: calc(40px * var(--ptb-density));
	--ptb-space-48: calc(48px * var(--ptb-density));
	--ptb-space-64: calc(64px * var(--ptb-density));
}

.ptb-display, .ptb-h1, .ptb-h2, .ptb-h3, .ptb-h4, .ptb-title {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: var(--ptb-weight-heading);
	color: var(--wp--preset--color--ink);
}
.ptb-display { font-size: var(--ptb-display); line-height: calc(1.1 * var(--ptb-leading)); }
.ptb-h1 { font-size: var(--ptb-h1); line-height: calc(1.1 * var(--ptb-leading)); }
.ptb-h2 { font-size: var(--ptb-h2); line-height: calc(1.15 * var(--ptb-leading)); }
.ptb-h3 { font-size: var(--ptb-h3); line-height: calc(1.25 * var(--ptb-leading)); }
.ptb-h4 { font-size: var(--ptb-h4); line-height: calc(1.3 * var(--ptb-leading)); }
.ptb-lead  { font-size: var(--ptb-lead);  line-height: calc(1.5 * var(--ptb-leading)); }
.ptb-body  { font-size: var(--ptb-body);  line-height: calc(1.6 * var(--ptb-leading)); }
.ptb-base  { font-size: var(--ptb-base);  line-height: calc(1.6 * var(--ptb-leading)); }
.ptb-meta  { font-size: var(--ptb-meta);  line-height: calc(1.5 * var(--ptb-leading)); }
.ptb-small { font-size: var(--ptb-small); line-height: calc(1.5 * var(--ptb-leading)); }
.ptb-label { font-size: var(--ptb-label); line-height: calc(1.4 * var(--ptb-leading)); }
.ptb-micro { font-size: var(--ptb-micro); line-height: calc(1.4 * var(--ptb-leading)); }
/* ↑ Type COMPOSITE utility classes — each bundles size + line-height for its rung.
   Prefer these on text elements (line-height travels with the type) over redeclaring
   font-size + line-height per component. New blocks: use `class="ptb-body"` etc.
   (token-spec §3a). Existing components that sit OFF-rung (prose 1.7, post-aside 1.35,
   footer tagline) keep bespoke line-heights by design. */

/* Fluid section title (32→44, smooth) — replaces the old H2→H1 breakpoint step. */
.ptb-title {
	font-size: var(--ptb-section-title);
	line-height: calc(1.15 * var(--ptb-leading));
}

/* ── Layout primitives ────────────────────────────────────────────────────── */
.ptb-container {
	box-sizing: border-box;
	width: 100%;
	max-width: var(--wp--custom--container, 1200px);
	margin-inline: auto;
	padding-inline: 15px;
}

/* Section vertical rhythm = per-site base (theme.json) × global density knob.
   theme.json sets the base padding; --ptb-density scales it with the rest of the
   spacing system so density covers the page's dominant vertical air, not just
   component internals (token-spec §4a). */
.ptb-section {
	padding-block: calc(var(--wp--custom--section--padding, 72px) * var(--ptb-density));
}
@media (max-width: 991px) {
	.ptb-section { padding-block: calc(var(--wp--custom--section--padding-md, 56px) * var(--ptb-density)); }
}
@media (max-width: 767px) {
	.ptb-section { padding-block: calc(var(--wp--custom--section--padding-sm, 44px) * var(--ptb-density)); }
}
/* Background variant (behavior layer) — any section block taking a `background`
   attribute alternates its tint via these. token-driven, so they reskin too. */
.ptb-section.is-bg-surface { background: var(--wp--preset--color--surface); }
.ptb-section.is-bg-accent  { background: var(--wp--preset--color--accent-soft); }
.ptb-section.is-bg-page    { background: var(--wp--preset--color--page); }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.ptb-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: var(--ptb-space-12) var(--ptb-space-24);
	font-size: var(--ptb-body);
	font-weight: var(--ptb-weight-medium);
	line-height: calc(1.4 * var(--ptb-leading));
	border-radius: var(--ptb-btn-radius);
	border: var(--ptb-border-width) solid transparent;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease,
		transform 0.2s ease, box-shadow 0.2s ease;
}
.ptb-btn:hover { transform: translateY(-1px); }
.ptb-btn-primary {
	background-color: var(--wp--preset--color--brand);
	border-color: var(--wp--preset--color--brand);
}
.ptb-btn-primary:hover {
	background-color: var(--wp--preset--color--brand-hover);
	border-color: var(--wp--preset--color--brand-hover);
}
.ptb-btn-outline {
	background-color: transparent;
	border-color: var(--wp--preset--color--brand);
}
.ptb-btn-outline:hover {
	background-color: var(--wp--preset--color--brand);
}
/* Solid accent button — the "pop" CTA color (badges/highlights too). Hover darkens
   the accent itself so no per-skin accent-hover token is needed. */
.ptb-btn-accent {
	background-color: var(--wp--preset--color--accent);
	border-color: var(--wp--preset--color--accent);
}
.ptb-btn-accent:hover { filter: brightness(0.94); }
/* Button TEXT color via compound class selectors (specificity 0,3,0) so theme.json's
   link element styling — `:root :where(a):hover { color }` (0,2,0), loaded after this
   file — can't recolor button text on hover. */
.ptb-btn.ptb-btn-primary,
.ptb-btn.ptb-btn-primary:hover,
.ptb-btn.ptb-btn-primary:focus { color: var(--ptb-on-brand); }
.ptb-btn.ptb-btn-outline { color: var(--wp--preset--color--brand); }
.ptb-btn.ptb-btn-outline:hover,
.ptb-btn.ptb-btn-outline:focus { color: var(--ptb-on-brand); }
.ptb-btn.ptb-btn-accent,
.ptb-btn.ptb-btn-accent:hover,
.ptb-btn.ptb-btn-accent:focus { color: var(--ptb-on-accent); }

/* ── More link ───────────────────────────────────────────────────────────── */
.ptb-more-link {
	display: inline-flex;
	align-items: center;
	gap: var(--ptb-space-8);
	font-weight: var(--ptb-weight-strong);
	color: var(--wp--preset--color--brand-hover);
	text-decoration: none;
}
.ptb-more-link:hover { color: var(--wp--preset--color--brand); }

/* ── Eyebrow pill ─────────────────────────────────────────────────────────── */
.ptb-eyebrow {
	display: inline-block;
	background-color: var(--wp--preset--color--accent-soft);
	color: var(--wp--preset--color--brand-hover);
	padding: 6px var(--ptb-space-16);
	font-size: var(--ptb-meta);
	font-weight: var(--ptb-weight-strong);
	line-height: calc(1.4 * var(--ptb-leading));
	border-radius: 9999px;
}

/* ── Section heading (eyebrow + title + optional lead) ────────────────────── */
.ptb-shead .ptb-title { margin-top: var(--ptb-space-16); }
.ptb-shead.is-center { text-align: center; }
.ptb-shead__lead {
	margin: var(--ptb-space-16) 0 var(--ptb-space-40);
	max-width: 640px;
	font-size: var(--ptb-body);
	line-height: calc(1.6 * var(--ptb-leading));
	color: var(--wp--preset--color--muted);
}

/* ── Breadcrumb ──────────────────────────────────────────────────────────── */
.ptb-breadcrumb {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--ptb-breadcrumb-gap, var(--ptb-space-8));
	font-size: var(--ptb-breadcrumb-font-size, var(--ptb-small));
	font-weight: var(--ptb-breadcrumb-weight, 400);
	color: var(--ptb-breadcrumb-color, var(--wp--preset--color--muted));
}
.ptb-breadcrumb__icon { display: block; flex: none; color: var(--ptb-breadcrumb-icon-color, currentColor); }
.ptb-breadcrumb :where(a, .ptb-breadcrumb__separator, .ptb-breadcrumb__current) {
	color: inherit;
	text-decoration: none;
}
.ptb-breadcrumb a:hover { color: var(--ptb-breadcrumb-hover, var(--wp--preset--color--brand-hover)); }
.ptb-breadcrumb.is-text-page { margin-bottom: var(--ptb-space-24); }
.ptb-breadcrumb.is-text-page .ptb-breadcrumb__current { color: var(--wp--preset--color--ink-soft); }

/* ── Page header (archive / inner page hero, no image) ────────────────────── */
.ptb-page-header { padding-block: var(--ptb-space-48) var(--ptb-space-64); background: var(--wp--preset--color--surface); }
@media (min-width: 768px) { .ptb-page-header { padding-block: 96px var(--ptb-space-64); } }
.ptb-page-header.is-bg-accent { background: var(--wp--preset--color--accent-soft); }
.ptb-page-header.is-bg-none { background: transparent; }
/* Header content spans the full page container; the lead caps its own width for readability. */
.ptb-page-header__title {
	margin-top: var(--ptb-space-16);
	font-family: var(--wp--preset--font-family--heading);
	font-weight: var(--ptb-weight-heading);
	font-size: var(--ptb-display);
	line-height: calc(1.15 * var(--ptb-leading));
	color: var(--wp--preset--color--ink);
}
.ptb-page-header__lead {
	margin-top: var(--ptb-space-20);
	max-width: 640px;
	font-size: var(--ptb-body);
	line-height: calc(1.6 * var(--ptb-leading));
	color: var(--wp--preset--color--muted);
}

/* ── 404 ──────────────────────────────────────────────────────────────────── */
.ptb-404 { text-align: center; }
.ptb-404__inner { margin-inline: auto; }
.ptb-404__code {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 800; /* one-off extra-heavy display numeral (intentional literal) */
	font-size: clamp(64px, 14vw, 120px);
	line-height: calc(1 * var(--ptb-leading));
	color: var(--wp--preset--color--brand);
	letter-spacing: -0.02em;
}
.ptb-404__title { margin-top: var(--ptb-space-8); font-size: var(--ptb-h2); color: var(--wp--preset--color--ink); }
.ptb-404__text { margin-top: var(--ptb-space-16); margin-inline: auto; }
.ptb-404__actions { margin-top: var(--ptb-space-32); display: flex; flex-wrap: wrap; gap: var(--ptb-space-12); justify-content: center; }

/* ── Callout ──────────────────────────────────────────────────────────────── */
.ptb-callout {
	border-radius: var(--ptb-radius-sm);
	padding: var(--ptb-space-24);
	background: var(--wp--preset--color--accent-soft);
	color: var(--wp--preset--color--ink);
}
@media (min-width: 768px) { .ptb-callout { padding: var(--ptb-space-32); } }
.ptb-callout__title {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: var(--ptb-weight-heading);
	font-size: var(--ptb-lead);
	color: var(--wp--preset--color--ink);
}
@media (min-width: 768px) { .ptb-callout__title { font-size: var(--ptb-h4); } }
.ptb-callout__body {
	margin-top: var(--ptb-space-8);
	font-size: var(--ptb-base);
	line-height: calc(1.6 * var(--ptb-leading));
	color: var(--wp--preset--color--ink-soft);
}
.ptb-callout__action {
	margin-top: var(--ptb-space-16);
	display: inline-flex;
	align-items: center;
	gap: var(--ptb-space-8);
	font-size: var(--ptb-meta);
	font-weight: var(--ptb-weight-strong);
	color: var(--wp--preset--color--brand-hover);
	text-decoration: none;
}
.ptb-callout__action:hover { color: var(--wp--preset--color--brand); }

/* ── Blog post card (homepage teaser + blog archive) ──────────────────────── */
.ptb-post-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	border: var(--ptb-border-width) solid var(--wp--preset--color--line);
	border-radius: var(--ptb-radius-sm);
	background: var(--wp--preset--color--surface);
	overflow: hidden;
	text-decoration: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.ptb-post-card:hover {
	border-color: var(--wp--preset--color--brand);
	box-shadow: var(--ptb-shadow-card);
	transform: translateY(-1px);
}
/* height:auto is required — the <img> carries width="640" height="480" attrs;
   without it that presentational height pins the box and aspect-ratio is ignored
   (image renders portrait + cropped). */
.ptb-post-card__img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.ptb-post-card__body { display: flex; flex-direction: column; flex: 1; padding: var(--ptb-space-24); }
.ptb-post-card__meta {
	display: flex;
	align-items: center;
	gap: var(--ptb-space-8);
	font-size: var(--ptb-label);
	line-height: calc(1.4 * var(--ptb-leading));
	font-weight: var(--ptb-weight-strong);
	color: var(--wp--preset--color--brand-hover);
}
.ptb-post-card__title {
	margin-top: var(--ptb-space-12);
	font-family: var(--wp--preset--font-family--heading);
	font-weight: var(--ptb-weight-heading);
	font-size: var(--ptb-lead);
	line-height: calc(1.5 * var(--ptb-leading));
	color: var(--wp--preset--color--ink);
}
.ptb-post-card:hover .ptb-post-card__title { color: var(--wp--preset--color--brand-hover); }
.ptb-post-card__summary {
	margin-top: var(--ptb-space-8);
	font-size: var(--ptb-meta);
	line-height: calc(1.5 * var(--ptb-leading));
	color: var(--wp--preset--color--muted);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.ptb-post-card__foot {
	margin-top: auto;
	padding-top: var(--ptb-space-20);
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: var(--ptb-label);
	line-height: calc(1.4 * var(--ptb-leading));
	color: var(--wp--preset--color--muted);
}
.ptb-post-card__arrow { color: var(--wp--preset--color--brand); transition: transform 0.2s ease; }
.ptb-post-card:hover .ptb-post-card__arrow { transform: translateX(4px); }

/* ── FAQ accordion item (homepage teaser + /faq page) ─────────────────────── */
.ptb-faqt__item {
	background: var(--wp--preset--color--surface);
	border: var(--ptb-border-width) solid var(--wp--preset--color--line);
	border-radius: var(--ptb-radius-sm);
}
.ptb-faqt__q {
	display: flex;
	width: 100%;
	align-items: center;
	justify-content: space-between;
	gap: var(--ptb-space-24);
	padding: var(--ptb-space-20) var(--ptb-space-24);
	text-align: left;
	font-weight: var(--ptb-weight-strong);
	font-size: var(--ptb-body);
	color: var(--wp--preset--color--ink);
	background: none;
	border: 0;
	cursor: pointer;
}
@media (min-width: 768px) { .ptb-faqt__q { padding: var(--ptb-space-24) var(--ptb-space-32); font-size: var(--ptb-lead); } }
.ptb-faqt__icon { width: 20px; height: 20px; flex-shrink: 0; color: var(--wp--preset--color--brand); }
.ptb-faqt__icon--minus { display: none; }
.ptb-faqt__item.is-open .ptb-faqt__icon--plus { display: none; }
.ptb-faqt__item.is-open .ptb-faqt__icon--minus { display: block; }
.ptb-faqt__answer[hidden] { display: none; }
.ptb-faqt__answer-inner p {
	padding: 0 var(--ptb-space-24) var(--ptb-space-24);
	font-size: var(--ptb-base);
	line-height: calc(1.6 * var(--ptb-leading));
	color: var(--wp--preset--color--muted);
}
@media (min-width: 768px) { .ptb-faqt__answer-inner p { padding: 0 var(--ptb-space-32) var(--ptb-space-24); } }

/* ── Pagination ──────────────────────────────────────────────────────────── */
.ptb-pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin-top: 40px;
}
.ptb-pagination .wp-block-query-pagination-numbers {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
}
.ptb-pagination :where(.page-numbers, .wp-block-query-pagination-previous, .wp-block-query-pagination-next) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	border: 1px solid var(--wp--preset--color--line, #eee);
	border-radius: 6px;
	font-size: 14px;
	font-weight: 500;
	color: var(--wp--preset--color--ink, #333);
	text-decoration: none;
	transition: background .2s, color .2s, border-color .2s;
}
.ptb-pagination :where(a.page-numbers, .wp-block-query-pagination-previous, .wp-block-query-pagination-next):hover {
	border-color: var(--wp--preset--color--brand, #5588A3);
	color: var(--wp--preset--color--brand, #5588A3);
}
.ptb-pagination .page-numbers.current {
	background: var(--wp--preset--color--brand, #5588A3);
	border-color: var(--wp--preset--color--brand, #5588A3);
	color: #fff;
}
.ptb-pagination :where(.prev, .next, .wp-block-query-pagination-previous, .wp-block-query-pagination-next) {
	font-size: 18px;
}
.ptb-pagination .page-numbers.disabled {
	color: rgba(0, 0, 0, 0.25);
	pointer-events: none;
}

/* ── Catalog card ────────────────────────────────────────────────────────── */
.ptb-catalog-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
	text-decoration: none;
}
.ptb-catalog-card__media {
	display: block;
	overflow: hidden;
}
.ptb-catalog-card__image {
	display: block;
	width: 100%;
	height: 100%;
}

/* ── Duplicated media marquee ────────────────────────────────────────────── */
.ptb-marquee__clip { overflow: hidden; }
.ptb-marquee .ptb-marquee__track {
	display: flex;
	flex-wrap: nowrap;
	width: max-content;
	animation: ptb-marquee-loop var(--ptb-marquee-dur) linear infinite;
}
.ptb-marquee:hover .ptb-marquee__track,
.ptb-marquee:focus-within .ptb-marquee__track { animation-play-state: paused; }
.ptb-marquee .ptb-marquee__item { flex: 0 0 auto; }
@keyframes ptb-marquee-loop {
	from { transform: translateX(0); }
	to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
	.ptb-marquee__clip { overflow-x: auto; }
	.ptb-marquee .ptb-marquee__track {
		animation: none;
		transform: none;
	}
	.ptb-marquee .ptb-marquee__item[aria-hidden="true"] { display: none; }
}


/* ── Page-step carousel ──────────────────────────────────────────────────── */
.ptb-carousel { position: relative; }
.ptb-carousel__viewport {
	position: relative;
	overflow: visible;
	box-sizing: border-box;
}
.ptb-carousel__clip {
	overflow: hidden;
	width: 100%;
	container-type: inline-size;
}
[data-ptb-carousel-track] {
	display: flex;
	flex-wrap: nowrap;
	width: max-content;
	transition: transform var(--ptb-carousel-transition-duration, 0s) ease;
	will-change: transform;
}
@media (prefers-reduced-motion: reduce) {
	[data-ptb-carousel-track] { transition: none; }
}
.ptb-carousel__nav {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	cursor: pointer;
	transform: translateY(-50%);
}
.ptb-carousel__dots {
	display: flex;
	justify-content: center;
}
.ptb-carousel__dot { cursor: pointer; }
.ptb-carousel__dot {
	box-sizing: content-box;
	min-width: 8px;
	min-height: 8px;
	padding: 8px;
	background-clip: content-box;
}
.ptb-carousel__pause,
.ptb-hero__pause {
	position: absolute;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	border: 0;
	white-space: nowrap;
}
.ptb-carousel__pause:focus-visible,
.ptb-hero__pause:focus-visible {
	position: relative;
	clip: auto;
	clip-path: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	margin: 0;
	border-radius: 9999px;
	background: rgba(255, 255, 255, 0.88);
	color: #0f2744;
	font-size: 12px;
	line-height: 1;
}

/* ── Table of contents (long-form pages) ──────────────────────────────────── */
.ptb-toc__label { margin: 0; font-size: var(--ptb-micro); font-weight: var(--ptb-weight-strong); text-transform: uppercase; letter-spacing: 0.04em; color: var(--wp--preset--color--muted); }
.ptb-toc__list { margin-top: var(--ptb-space-12); padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--ptb-space-8); }
.ptb-toc__link { display: block; border-left: 2px solid var(--wp--preset--color--line); padding-left: var(--ptb-space-12); font-size: var(--ptb-small); line-height: calc(1.4 * var(--ptb-leading)); color: var(--wp--preset--color--muted); text-decoration: none; transition: color 0.2s ease, border-color 0.2s ease; }
.ptb-toc__link:hover { color: var(--wp--preset--color--ink-soft); }
.ptb-toc__link.is-active { border-left-color: var(--wp--preset--color--brand); color: var(--wp--preset--color--brand-hover); font-weight: var(--ptb-weight-strong); }

/* ── Long-form prose ──────────────────────────────────────────────────────── */
.ptb-prose { font-size: var(--ptb-body); line-height: calc(1.7 * var(--ptb-leading)); color: var(--wp--preset--color--ink-soft); }
.ptb-prose > :first-child { margin-top: 0; }
.ptb-prose h2 { font-family: var(--wp--preset--font-family--heading); font-weight: var(--ptb-weight-heading); color: var(--wp--preset--color--ink); font-size: var(--ptb-h3); line-height: calc(1.3 * var(--ptb-leading)); margin-top: var(--ptb-space-32); margin-bottom: var(--ptb-space-12); scroll-margin-top: 112px; }
.ptb-prose h3 { font-family: var(--wp--preset--font-family--heading); font-weight: var(--ptb-weight-heading); color: var(--wp--preset--color--ink); font-size: var(--ptb-lead); margin-top: var(--ptb-space-24); margin-bottom: var(--ptb-space-8); scroll-margin-top: 112px; }
/* Deeper levels real articles use. Body is 18px, so h4 sits at body size (bold +
   heading font distinguish it); h5/h6 read as small-caps eyebrow headings. */
.ptb-prose h4 { font-family: var(--wp--preset--font-family--heading); font-weight: var(--ptb-weight-heading); color: var(--wp--preset--color--ink); font-size: var(--ptb-body); margin-top: var(--ptb-space-24); margin-bottom: var(--ptb-space-4); }
.ptb-prose h5 { font-family: var(--wp--preset--font-family--heading); font-weight: var(--ptb-weight-heading); color: var(--wp--preset--color--ink); font-size: var(--ptb-base); margin-top: var(--ptb-space-20); margin-bottom: var(--ptb-space-4); }
.ptb-prose h6 { font-weight: var(--ptb-weight-strong); color: var(--wp--preset--color--muted); font-size: var(--ptb-small); text-transform: uppercase; letter-spacing: 0.04em; margin-top: var(--ptb-space-20); margin-bottom: var(--ptb-space-4); }
.ptb-prose p { margin-block: var(--ptb-space-16); }
.ptb-prose ul, .ptb-prose ol { margin-block: var(--ptb-space-16); padding-left: var(--ptb-space-24); }
.ptb-prose ul { list-style: disc; }
.ptb-prose ol { list-style: decimal; }
.ptb-prose li { margin-block: var(--ptb-space-4); }
.ptb-prose a { color: var(--wp--preset--color--brand-hover); text-decoration: underline; text-underline-offset: 2px; }
.ptb-prose strong { font-weight: var(--ptb-weight-strong); color: var(--wp--preset--color--ink); }
/* Rich article elements (images, figures, quotes, tables, code). */
.ptb-prose :where(img, figure, .wp-block-image) { margin-block: var(--ptb-space-24); }
.ptb-prose img { max-width: 100%; height: auto; display: block; border-radius: var(--ptb-radius); }
.ptb-prose figcaption { margin-top: var(--ptb-space-8); font-size: var(--ptb-small); color: var(--wp--preset--color--muted); text-align: center; }
.ptb-prose blockquote {
	margin-block: var(--ptb-space-24);
	padding: var(--ptb-space-4) 0 var(--ptb-space-4) var(--ptb-space-24);
	border-left: 3px solid var(--wp--preset--color--brand);
	font-size: var(--ptb-lead);
	line-height: calc(1.5 * var(--ptb-leading));
	color: var(--wp--preset--color--ink);
}
.ptb-prose blockquote p { margin-block: var(--ptb-space-8); }
.ptb-prose blockquote cite { display: block; margin-top: var(--ptb-space-8); font-size: var(--ptb-small); font-style: normal; color: var(--wp--preset--color--muted); }
.ptb-prose :where(code, kbd, samp) { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; background: var(--wp--preset--color--surface); border: var(--ptb-border-width) solid var(--wp--preset--color--line); border-radius: var(--ptb-radius-sm); padding: 0.1em 0.4em; }
.ptb-prose :where(pre, .wp-block-code) {
	margin-block: var(--ptb-space-24);
	padding: var(--ptb-space-20);
	background: var(--wp--preset--color--footer);
	color: var(--wp--preset--color--surface);
	border-radius: var(--ptb-radius);
	overflow-x: auto;
	font-size: var(--ptb-small);
	line-height: calc(1.6 * var(--ptb-leading));
}
.ptb-prose :where(pre, .wp-block-code) code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
/* Tables — selectors must out-specify WP core's `.wp-block-table td,th` (0,1,1),
   so cell rules are scoped under `.wp-block-table` (0,2,1). */
.ptb-prose .wp-block-table { margin-block: var(--ptb-space-24); }
.ptb-prose .wp-block-table table, .ptb-prose > table { width: 100%; border-collapse: collapse; font-size: var(--ptb-base); }
.ptb-prose .wp-block-table :is(th, td), .ptb-prose > table :is(th, td) { padding: var(--ptb-space-12) var(--ptb-space-16); border: var(--ptb-border-width) solid var(--wp--preset--color--line); text-align: left; }
.ptb-prose .wp-block-table th, .ptb-prose > table th { background: var(--wp--preset--color--surface); font-weight: var(--ptb-weight-strong); color: var(--wp--preset--color--ink); }
/* WP core gives thead a 3px currentColor bottom border (and tfoot a top one); retone to the token line. */
.ptb-prose .wp-block-table thead, .ptb-prose > table thead { border-bottom: var(--ptb-border-width) solid var(--wp--preset--color--line); }
.ptb-prose .wp-block-table tfoot, .ptb-prose > table tfoot { border-top: var(--ptb-border-width) solid var(--wp--preset--color--line); }
.ptb-prose :where(hr, .wp-block-separator) { margin-block: var(--ptb-space-32); border: 0; border-top: var(--ptb-border-width) solid var(--wp--preset--color--line); }

/* Featured image on single / detail templates. Token-driven (WP strips var() from
   the block's border-radius style support, so it lives here, not inline). */
.ptb-cover { margin-block: var(--ptb-space-24); }
.ptb-cover img { display: block; border-radius: var(--ptb-radius); }

/* ── Text Page template (long-form: hero + sticky TOC + post-content) ─────── */
.ptb-textpage__main { background: transparent; }
.ptb-textpage__grid { display: grid; grid-template-columns: 1fr; gap: var(--ptb-space-48); }
@media (min-width: 1024px) { .ptb-textpage__grid { grid-template-columns: 220px 1fr; } }
.ptb-textpage__grid > .wp-block-post-content { min-width: 0; }
.ptb-textpage__aside { display: none; }
@media (min-width: 1024px) { .ptb-textpage__aside { display: block; } }
/* gotcha #22: sticky TOC top must clear the sticky header (tune per project — measure in browser). */
.ptb-textpage__sticky { position: sticky; top: 112px; }
.ptb-textpage > *, .ptb-textpage__main > *, .ptb-textpage__grid > * { margin-block: 0; }
.ptb-prose .ptb-textpage__draft {
	display: inline-flex;
	align-items: center;
	margin: 0 0 var(--ptb-space-24);
	padding: var(--ptb-space-4) var(--ptb-space-12);
	border-radius: 9999px;
	background: var(--wp--preset--color--accent-soft);
	font-size: var(--ptb-micro);
	font-weight: var(--ptb-weight-strong);
	color: var(--wp--preset--color--brand-hover);
}
