/* =========================================================================
   Beziworld React Theme — base layer.
   Token bridge (theme.json presets -> short component tokens) + dark mode +
   the full component system from the design mockups. Cascade order is fixed
   by the @layer declaration so the WooCommerce and Interactivity layers can
   always override predictably.
   ========================================================================= */
@layer base, components, woocommerce, interactivity, utilities;

@layer base {

	/* ----- Token bridge ------------------------------------------------- */
	:root {
		--paper: var(--wp--preset--color--paper);
		--paper-2: var(--wp--preset--color--paper-2);
		--paper-3: var(--wp--preset--color--paper-3);
		--ink: var(--wp--preset--color--ink);
		--ink-soft: var(--wp--preset--color--ink-soft);
		--ink-faint: var(--wp--preset--color--ink-faint);
		--line: var(--wp--preset--color--line);
		--line-strong: var(--wp--preset--color--line-strong);
		--accent: var(--wp--preset--color--accent);
		--accent-ink: var(--wp--preset--color--accent-ink);
		--ok: var(--wp--preset--color--ok);

		--accent-press: color-mix(in oklab, var(--accent) 86%, #000);
		--accent-wash: color-mix(in oklab, var(--accent) 12%, transparent);

		--brand-grad: var(--wp--preset--gradient--brand);

		--font-head: var(--wp--preset--font-family--head);
		--font-body: var(--wp--preset--font-family--body);
		--font-mono: var(--wp--preset--font-family--mono);

		--radius: var(--wp--custom--radius, 4px);
		--radius-lg: var(--wp--custom--radius-lg, 8px);

		--w-content: 42rem;
		--w-wide: 78rem;
		--gutter: var(--wp--custom--gutter, clamp(1.25rem, 4vw, 3rem));

		--shadow-sm: var(--wp--preset--shadow--sm);
		--shadow-md: var(--wp--preset--shadow--md);

		--header-h: var(--wp--custom--header-height, 76px);
	}

	/* Dark mode: re-point the WP color presets so block-rendered content and
	   the component layer both switch with one attribute on <html>. */
	[data-theme="dark"] {
		--wp--preset--color--paper: oklch(0.205 0.018 222);
		--wp--preset--color--paper-2: oklch(0.245 0.020 222);
		--wp--preset--color--paper-3: oklch(0.288 0.022 222);
		--wp--preset--color--ink: oklch(0.955 0.006 210);
		--wp--preset--color--ink-soft: oklch(0.78 0.010 208);
		--wp--preset--color--ink-faint: oklch(0.62 0.012 208);
		--wp--preset--color--line: oklch(0.34 0.016 218);
		--wp--preset--color--line-strong: oklch(0.45 0.018 218);
		--wp--preset--color--accent: oklch(0.74 0.105 186);
		--wp--preset--color--accent-ink: oklch(0.17 0.02 220);
		--wp--preset--color--ok: oklch(0.74 0.13 158);

		--accent-press: color-mix(in oklab, var(--accent) 80%, #fff);
		--accent-wash: color-mix(in oklab, var(--accent) 16%, transparent);

		--shadow-sm: 0 1px 2px oklch(0 0 0 / 0.4);
		--shadow-md: 0 12px 40px oklch(0 0 0 / 0.5), 0 2px 8px oklch(0 0 0 / 0.4);
	}

	/* ----- Reset -------------------------------------------------------- */
	*, *::before, *::after { box-sizing: border-box; }
	html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
	body {
		font-family: var(--font-body);
		background: var(--paper);
		color: var(--ink);
		line-height: 1.6;
		-webkit-font-smoothing: antialiased;
		text-rendering: optimizeLegibility;
		transition: background-color 0.35s ease, color 0.35s ease;
	}
	img, svg, video { display: block; max-width: 100%; }
	button, input, textarea, select { font: inherit; color: inherit; }
	:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

	/* ----- Typography --------------------------------------------------- */
	.eyebrow {
		font-family: var(--font-mono);
		font-size: 0.72rem;
		letter-spacing: 0.18em;
		text-transform: uppercase;
		color: var(--accent);
		font-weight: 500;
	}
	.font-mono { font-family: var(--font-mono); }
	.muted { color: var(--ink-soft); }
	.faint { color: var(--ink-faint); }

	/* ----- Layout ------------------------------------------------------- */
	.wrap-wide { width: min(100% - var(--gutter) * 2, var(--w-wide)); margin-inline: auto; }
	.wrap-content { width: min(100% - var(--gutter) * 2, var(--w-content)); margin-inline: auto; }
	.section { padding-block: clamp(3rem, 7vw, 6rem); }
	.section-tight { padding-block: clamp(2rem, 4vw, 3rem); }
	.stack > * + * { margin-top: 1.1rem; }

	.skip-link {
		position: fixed; top: -100px; left: 1rem; z-index: 200;
		background: var(--accent); color: var(--accent-ink);
		padding: 0.6rem 1rem; border-radius: var(--radius); font-weight: 600;
	}
	.skip-link:focus { top: 1rem; }
}

@layer components {

	/* ----- Header ------------------------------------------------------- */
	.site-header {
		position: sticky; top: 0; z-index: 60;
		background: color-mix(in oklab, var(--paper) 86%, transparent);
		backdrop-filter: saturate(1.4) blur(14px);
		border-bottom: 1px solid var(--line);
	}
	.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 1.5rem; }
	.brand { display: flex; align-items: center; gap: 0.65rem; margin-right: auto; }
	.brand-mark { width: 38px; height: 38px; flex: none; object-fit: contain; }
	.brand-name { font-family: var(--font-head); font-size: 1.32rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.05; }
	.brand-tag { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); display: block; margin-top: -2px; }

	.primary-nav { display: flex; align-items: center; gap: 0.25rem; }
	.nav-link {
		position: relative; padding: 0.5rem 0.85rem; border-radius: var(--radius);
		font-weight: 500; font-size: 0.96rem; color: var(--ink-soft);
		transition: color 0.18s ease, background 0.18s ease;
	}
	.nav-link:hover { color: var(--ink); background: var(--paper-2); }
	.nav-link.is-active { color: var(--ink); }
	.nav-link.is-active::after {
		content: ""; position: absolute; left: 0.85rem; right: 0.85rem; bottom: 0.18rem;
		height: 2px; background: var(--accent); border-radius: 2px;
	}
	.header-tools { display: flex; align-items: center; gap: 0.4rem; }

	.icon-btn {
		width: 42px; height: 42px; border-radius: var(--radius);
		display: grid; place-items: center; color: var(--ink-soft);
		border: 1px solid transparent; background: none; cursor: pointer;
		transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
	}
	.icon-btn:hover { background: var(--paper-2); color: var(--ink); border-color: var(--line); }
	.icon-btn svg { width: 20px; height: 20px; }
	.menu-toggle { display: none; }

	/* ----- Mobile drawer ------------------------------------------------ */
	.drawer-scrim {
		position: fixed; inset: 0; z-index: 80;
		background: oklch(0.2 0.03 222 / 0.5);
		opacity: 0; pointer-events: none; transition: opacity 0.28s ease;
	}
	.drawer-scrim.is-open { opacity: 1; pointer-events: auto; }
	.drawer {
		position: fixed; top: 0; right: 0; bottom: 0; z-index: 90;
		width: min(86vw, 360px);
		background: var(--paper); border-left: 1px solid var(--line);
		padding: 1.25rem;
		transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
		display: flex; flex-direction: column; gap: 0.4rem;
		box-shadow: var(--shadow-md);
	}
	.drawer.is-open { transform: translateX(0); }
	.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--line); }
	.drawer-link {
		display: flex; align-items: center; justify-content: space-between;
		padding: 0.85rem 0.5rem; border-radius: var(--radius);
		font-family: var(--font-head); font-size: 1.3rem; font-weight: 500; color: var(--ink-soft);
		border-bottom: 1px solid var(--line);
	}
	.drawer-link:hover, .drawer-link.is-active { color: var(--ink); }
	.drawer-link.is-active { color: var(--accent); }

	/* ----- Buttons / chips ---------------------------------------------- */
	.btn {
		display: inline-flex; align-items: center; gap: 0.5rem;
		padding: 0.72rem 1.3rem; border-radius: var(--radius);
		font-weight: 600; font-size: 0.95rem; line-height: 1; cursor: pointer; border: none;
		transition: transform 0.12s ease, background 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
	}
	.btn:active { transform: translateY(1px); }
	.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-sm); }
	.btn-primary:hover { background: var(--accent-press); box-shadow: var(--shadow-md); }
	.btn-ghost { border: 1px solid var(--line-strong); color: var(--ink); background: none; }
	.btn-ghost:hover { background: var(--paper-2); border-color: var(--ink-faint); }
	.btn-text { color: var(--accent); padding: 0; font-weight: 600; display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap; background: none; border: none; cursor: pointer; }
	.btn-text:hover { gap: 0.6rem; }
	.btn svg, .btn-text svg { width: 17px; height: 17px; }

	.tag {
		display: inline-flex; align-items: center; gap: 0.35rem;
		font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.06em;
		text-transform: uppercase; font-weight: 500;
		padding: 0.3rem 0.6rem; border-radius: 999px;
		background: var(--accent-wash); color: var(--accent);
		border: 1px solid color-mix(in oklab, var(--accent) 30%, transparent);
	}
	.tag.is-muted { background: var(--paper-2); color: var(--ink-soft); border-color: var(--line); }
	.tag-btn { cursor: pointer; }
	.tag-btn:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

	.chip-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
	.chip {
		padding: 0.5rem 1rem; border-radius: 999px; font-size: 0.9rem; font-weight: 500;
		border: 1px solid var(--line-strong); color: var(--ink-soft); background: none; cursor: pointer;
		transition: all 0.16s ease;
	}
	.chip:hover { color: var(--ink); border-color: var(--ink-faint); }
	.chip.is-active { background: var(--ink); color: var(--paper); border-color: var(--ink); }

	/* ----- Placeholders ------------------------------------------------- */
	.ph {
		position: relative; overflow: hidden; border-radius: var(--radius-lg);
		background-color: var(--paper-3);
		background-image: repeating-linear-gradient(-45deg, transparent 0 11px, color-mix(in oklab, var(--ink) 7%, transparent) 11px 12px);
		display: grid; place-items: center; color: var(--ink-faint);
		border: 1px solid var(--line);
	}
	.ph::after {
		content: attr(data-label);
		font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.04em;
		background: var(--paper); padding: 0.35rem 0.7rem; border-radius: 999px;
		border: 1px solid var(--line); color: var(--ink-soft); box-shadow: var(--shadow-sm);
	}
	.ph.ratio-16-9 { aspect-ratio: 16 / 9; }
	.ph.ratio-4-3 { aspect-ratio: 4 / 3; }
	.ph.ratio-3-2 { aspect-ratio: 3 / 2; }
	.ph.ratio-1-1 { aspect-ratio: 1 / 1; }

	.avatar {
		border-radius: 50%; aspect-ratio: 1; width: var(--sz, 44px); flex: none;
		background: var(--accent-wash); color: var(--accent);
		display: grid; place-items: center;
		font-family: var(--font-head); font-weight: 600;
		border: 1px solid color-mix(in oklab, var(--accent) 24%, transparent);
	}

	/* ----- Hero --------------------------------------------------------- */
	.hero { padding-block: clamp(2.5rem, 6vw, 5rem) clamp(2rem, 4vw, 3.5rem); }
	.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
	.hero h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); font-weight: 500; letter-spacing: -0.025em; }
	.hero h1 em { font-style: italic; color: var(--accent); }
	.hero-lede { font-size: clamp(1.1rem, 2vw, 1.3rem); color: var(--ink-soft); max-width: 34ch; margin-top: 1.5rem; }
	.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
	.hero-meta { display: flex; gap: 2rem; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
	.hero-stat .n { font-family: var(--font-head); font-size: 1.9rem; font-weight: 600; }
	.hero-stat .l { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }
	.hero-art { position: relative; }
	.hero-art .ph { aspect-ratio: 4 / 5; background-color: color-mix(in oklab, var(--accent) 9%, var(--paper-3)); }
	.hero-badge {
		position: absolute; bottom: -18px; left: -18px;
		background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
		padding: 0.9rem 1.1rem; box-shadow: var(--shadow-md); max-width: 230px;
	}

	/* ----- Section header ----------------------------------------------- */
	.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 2.25rem; flex-wrap: wrap; }
	.sec-head h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); }
	.sec-head p { color: var(--ink-soft); margin-top: 0.4rem; }
	.divider { height: 1px; background: var(--line); border: 0; }

	/* ----- Post cards --------------------------------------------------- */
	.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: clamp(1.5rem, 3vw, 2.5rem); }
	.card { display: flex; flex-direction: column; gap: 1rem; cursor: pointer; }
	.card .ph { aspect-ratio: 3 / 2; transition: transform 0.4s cubic-bezier(0.2, 0, 0, 1); }
	.card-media { overflow: hidden; border-radius: var(--radius-lg); }
	.card:hover .card-media .ph { transform: scale(1.035); }
	.card-meta { display: flex; align-items: center; gap: 0.6rem; font-size: 0.82rem; color: var(--ink-faint); font-family: var(--font-mono); letter-spacing: 0.02em; }
	.card-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }
	.card h3 { font-size: 1.5rem; }
	.card:hover h3 { color: var(--accent); }
	.card p { color: var(--ink-soft); font-size: 0.98rem; }
	.card-foot { display: flex; align-items: center; gap: 0.6rem; margin-top: auto; padding-top: 0.4rem; font-size: 0.88rem; }

	.card-feature { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
	.card-feature .card-media .ph { aspect-ratio: 4 / 3; }
	.card-feature h3 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); }
	.card-feature p { font-size: 1.08rem; margin-top: 0.5rem; }

	.post-row { display: grid; grid-template-columns: 200px 1fr; gap: 1.75rem; padding-block: 2rem; border-bottom: 1px solid var(--line); cursor: pointer; align-items: start; }
	.post-row:first-child { border-top: 1px solid var(--line); }
	.post-row .ph { aspect-ratio: 3 / 2; }
	.post-row h3 { font-size: 1.65rem; }
	.post-row:hover h3 { color: var(--accent); }
	.post-num { font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-faint); }

	/* ----- Content + sidebar -------------------------------------------- */
	.with-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 312px; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
	.sidebar { position: sticky; top: calc(var(--header-h) + 1.5rem); display: flex; flex-direction: column; gap: 1.5rem; }
	.widget { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.4rem; background: var(--paper-2); }
	.widget-title { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem; }
	.widget-title::before { content: ""; width: 14px; height: 2px; background: var(--accent); }
	.widget-list > li { padding-block: 0.7rem; border-bottom: 1px dashed var(--line); }
	.widget-list > li:last-child { border-bottom: 0; padding-bottom: 0; }
	.widget-list a { display: flex; gap: 0.75rem; align-items: baseline; justify-content: space-between; }
	.widget-list a:hover .wl-title { color: var(--accent); }
	.wl-title { font-weight: 500; font-size: 0.96rem; }
	.wl-date { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-faint); white-space: nowrap; }
	.cat-row { display: flex; align-items: center; justify-content: space-between; }
	.cat-count { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-faint); background: var(--paper-3); border-radius: 999px; padding: 0.1rem 0.55rem; }
	.search-field { position: relative; display: flex; }
	.search-field input {
		width: 100%; padding: 0.7rem 0.9rem 0.7rem 2.4rem; border-radius: var(--radius);
		border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink);
		transition: border-color 0.18s ease, box-shadow 0.18s ease;
	}
	.search-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
	.search-field .s-icon { position: absolute; left: 0.8rem; top: 50%; transform: translateY(-50%); color: var(--ink-faint); width: 17px; height: 17px; pointer-events: none; }
	.widget-cta { background: var(--ink); color: var(--paper); border-color: var(--ink); }
	.widget-cta .widget-title { color: color-mix(in oklab, var(--paper) 70%, transparent); }
	.widget-cta .widget-title::before { background: var(--accent); }
	.widget-cta h4 { font-family: var(--font-head); color: var(--paper); font-size: 1.2rem; margin-bottom: 0.4rem; }
	.widget-cta p { color: color-mix(in oklab, var(--paper) 72%, transparent); font-size: 0.9rem; margin-bottom: 1rem; }
	.widget-cta input { background: color-mix(in oklab, var(--paper) 12%, transparent); border-color: color-mix(in oklab, var(--paper) 22%, transparent); color: var(--paper); }
	.tag-cloud { display: flex; flex-wrap: wrap; gap: 0.5rem; }

	/* ----- Single post (prose) ------------------------------------------ */
	.post-hero { padding-block: clamp(2.5rem, 5vw, 4rem) 0; }
	.post-hero .tag { margin-bottom: 1.25rem; }
	.post-title { font-size: clamp(2.2rem, 5vw, 3.8rem); font-weight: 500; letter-spacing: -0.02em; max-width: 18ch; }
	.post-byline { display: flex; align-items: center; gap: 0.9rem; margin-top: 2rem; flex-wrap: wrap; }
	.post-byline .meta { font-size: 0.9rem; }
	.post-byline .meta .name { font-weight: 600; color: var(--ink); }
	.post-byline .sep { width: 1px; height: 28px; background: var(--line); }
	.post-feature { margin-block: clamp(2rem, 5vw, 3.5rem); }
	.post-feature .ph { aspect-ratio: 16 / 9; }
	/**
	 * Featured-image fallback: the static striped placeholder is hidden once a
	 * real featured image is present, so the placeholder shows only when the
	 * post has no thumbnail (matching the design mockup for demo content).
	 */
	.post-feature:has(.wp-block-post-featured-image img) .post-feature-ph { display: none; }
	.post-feature figcaption { font-family: var(--font-mono); font-size: 0.74rem; color: var(--ink-faint); margin-top: 0.6rem; text-align: center; }

	.prose { font-size: 1.14rem; line-height: 1.75; color: var(--ink); }
	.prose > * + * { margin-top: 1.5rem; }
	.prose .lead { font-size: 1.32rem; line-height: 1.5; color: var(--ink-soft); font-family: var(--font-head); font-weight: 400; }
	.prose h2 { font-size: 1.9rem; margin-top: 3rem; }
	.prose h3 { font-size: 1.4rem; margin-top: 2.25rem; }
	.prose a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 2.5px; }
	.prose ul, .prose ol { padding-left: 1.3rem; display: flex; flex-direction: column; gap: 0.6rem; }
	.prose ul { list-style: none; }
	.prose ul li { position: relative; padding-left: 1.2rem; }
	.prose ul li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 7px; height: 7px; background: var(--accent); border-radius: 2px; }
	.prose ol { list-style: decimal; }
	.prose blockquote {
		border-left: 3px solid var(--accent); padding: 0.5rem 0 0.5rem 1.6rem; margin-left: 0;
		font-family: var(--font-head); font-size: 1.5rem; line-height: 1.4; font-style: italic; color: var(--ink);
	}
	.prose figure .ph { aspect-ratio: 16 / 9; }
	.prose figcaption { font-family: var(--font-mono); font-size: 0.74rem; color: var(--ink-faint); margin-top: 0.6rem; }
	.prose hr { margin-block: 2.5rem; }
	.pull-callout { background: var(--paper-2); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 1.25rem 1.5rem; }

	.post-foot-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line); }
	.author-card { display: flex; gap: 1.25rem; align-items: flex-start; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.75rem; margin-top: 2.5rem; }
	.author-card .avatar { --sz: 64px; font-size: 1.4rem; }
	.share-row { display: flex; align-items: center; gap: 0.6rem; margin-top: 2rem; }
	.share-row .icon-btn { border: 1px solid var(--line); }
	.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3rem; }
	.post-nav a { padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius-lg); transition: border-color 0.18s ease, background 0.18s ease; }
	.post-nav a:hover { border-color: var(--ink-faint); background: var(--paper-2); }
	.post-nav .dir { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); }
	.post-nav .pn-title { font-family: var(--font-head); font-size: 1.15rem; margin-top: 0.5rem; }
	.post-nav a.next { text-align: right; }

	/* ----- Static page -------------------------------------------------- */
	.page-head { padding-block: clamp(3rem, 7vw, 6rem) clamp(1.5rem, 3vw, 2.5rem); border-bottom: 1px solid var(--line); }
	.page-head h1 { font-size: clamp(2.4rem, 5vw, 4rem); font-weight: 500; }
	.page-head p { color: var(--ink-soft); font-size: 1.2rem; margin-top: 1rem; max-width: 50ch; }
	.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
	.feature-cell { padding: 1.75rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper-2); }
	.feature-cell .num { font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent); letter-spacing: 0.1em; }
	.feature-cell h3 { font-size: 1.3rem; margin-block: 0.8rem 0.5rem; }
	.feature-cell p { color: var(--ink-soft); font-size: 0.96rem; }

	/* ----- Pagination --------------------------------------------------- */
	.pagination { display: flex; align-items: center; justify-content: center; gap: 0.4rem; margin-top: 3.5rem; }
	.page-btn { min-width: 44px; height: 44px; padding: 0 0.5rem; border-radius: var(--radius); display: grid; place-items: center; border: 1px solid var(--line); color: var(--ink-soft); font-weight: 500; font-family: var(--font-mono); font-size: 0.9rem; background: none; cursor: pointer; transition: all 0.16s ease; }
	.page-btn:hover { border-color: var(--ink-faint); color: var(--ink); }
	.page-btn.is-active, .page-btn[aria-current="page"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
	.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

	/* ----- Search view -------------------------------------------------- */
	.search-hero { padding-block: clamp(2.5rem, 5vw, 4rem); }
	.search-big { position: relative; max-width: 640px; }
	.search-big input {
		width: 100%; padding: 1.1rem 1.2rem 1.1rem 3.2rem; font-size: 1.2rem;
		border-radius: var(--radius-lg); border: 1px solid var(--line-strong); background: var(--paper-2); color: var(--ink);
	}
	.search-big input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-wash); }
	.search-big .s-icon { position: absolute; left: 1.1rem; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; color: var(--ink-faint); }
	.result-count { font-family: var(--font-mono); font-size: 0.85rem; color: var(--ink-soft); margin-top: 1.25rem; }

	.empty-state { text-align: center; padding-block: clamp(3rem, 8vw, 7rem); }
	.empty-code { font-family: var(--font-head); font-size: clamp(5rem, 18vw, 11rem); font-weight: 600; line-height: 0.9; color: var(--accent); letter-spacing: -0.04em; }
	.empty-state h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-top: 1rem; }
	.empty-state p { color: var(--ink-soft); margin-top: 0.75rem; max-width: 44ch; margin-inline: auto; }
	.empty-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; margin-top: 2rem; }

	/* ----- Footer ------------------------------------------------------- */
	.site-footer { background: var(--paper-2); border-top: 1px solid var(--line); margin-top: clamp(3rem, 7vw, 6rem); }
	.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2.5rem; padding-block: clamp(3rem, 6vw, 4.5rem); }
	.footer-brand .brand { margin-right: 0; margin-bottom: 1rem; }
	.footer-brand p { color: var(--ink-soft); font-size: 0.95rem; max-width: 32ch; }
	.footer-social { display: flex; gap: 0.5rem; margin-top: 1.25rem; }
	.footer-col h4 { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-faint); font-weight: 500; margin-bottom: 1.1rem; }
	.footer-col ul { display: flex; flex-direction: column; gap: 0.7rem; list-style: none; padding: 0; }
	.footer-col a { color: var(--ink-soft); font-size: 0.95rem; transition: color 0.16s ease; }
	.footer-col a:hover { color: var(--accent); }
	.footer-bottom { border-top: 1px solid var(--line); padding-block: 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
	.footer-bottom p { font-size: 0.85rem; color: var(--ink-faint); font-family: var(--font-mono); }

	/* ----- Animations --------------------------------------------------- */
	@keyframes beziworld-fade-up { from { transform: translateY(14px); } to { transform: none; } }
	.anim { animation: beziworld-fade-up 0.5s cubic-bezier(0.2, 0, 0, 1) both; }
}

@media (prefers-reduced-motion: reduce) {
	.anim { animation: none; }
	* { scroll-behavior: auto !important; }
}

/* ----- Responsive ------------------------------------------------------ */
@media (max-width: 1080px) {
	.with-sidebar { grid-template-columns: 1fr; }
	.sidebar { position: static; flex-direction: row; flex-wrap: wrap; }
	.sidebar > .widget { flex: 1 1 280px; }
}
@media (max-width: 900px) {
	.footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
	.footer-brand { grid-column: 1 / -1; }
	.trio { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
	.primary-nav { display: none; }
	.header-tools .desktop-only { display: none; }
	.menu-toggle { display: grid; }
	.hero-grid { grid-template-columns: 1fr; }
	.hero-art { order: -1; }
	.hero-art .ph { aspect-ratio: 16 / 10; }
	.hero-badge { display: none; }
	.card-feature { grid-template-columns: 1fr; }
	.post-row { grid-template-columns: 1fr; gap: 1rem; }
	.post-row .ph { aspect-ratio: 2 / 1; }
	.post-nav { grid-template-columns: 1fr; }
	.post-nav a.next { text-align: left; }
}
@media (max-width: 560px) {
	.sidebar { flex-direction: column; }
	.footer-grid { grid-template-columns: 1fr; }
	.hero-meta { gap: 1.25rem; }
	.author-card { flex-direction: column; gap: 1rem; }
	.post-grid { grid-template-columns: 1fr; }
}

/* =========================================================================
   Block styles (registered in inc/BlockStyles.php).
   Placed in the utilities layer so they win predictably and apply in both the
   front end and the block editor (base.css is registered as an editor style).
   ========================================================================= */
@layer utilities {

	/* core/button — "Kontur" (outline) */
	.wp-block-button.is-style-outline > .wp-block-button__link {
		background: transparent;
		color: var(--ink);
		border: 1px solid var(--line-strong);
		box-shadow: none;
	}
	.wp-block-button.is-style-outline > .wp-block-button__link:hover {
		background: var(--paper-2);
		border-color: var(--ink-faint);
	}

	/* core/button — "Tekstowy" (text link) */
	.wp-block-button.is-style-text > .wp-block-button__link {
		background: transparent;
		color: var(--accent);
		padding-inline: 0;
		box-shadow: none;
		font-weight: 600;
	}
	.wp-block-button.is-style-text > .wp-block-button__link:hover {
		text-decoration: underline;
	}

	/* core/group — "Karta" (card surface) */
	.wp-block-group.is-style-card {
		background: var(--paper-2);
		border: 1px solid var(--line);
		border-radius: var(--radius-lg);
		padding: clamp(1.4rem, 3vw, 2rem);
	}

	/* core/quote — "Redakcyjny" (editorial) */
	.wp-block-quote.is-style-editorial {
		border-left: 3px solid var(--accent);
		padding-left: 1.6rem;
		font-family: var(--font-head);
		font-style: italic;
		font-size: 1.4rem;
		line-height: 1.4;
		color: var(--ink);
	}
	.wp-block-quote.is-style-editorial cite {
		font-family: var(--font-mono);
		font-style: normal;
		font-size: 0.8rem;
		color: var(--ink-faint);
	}

	/* core/columns — "Wyróżniony" (feature emphasis) */
	.wp-block-columns.is-style-feature {
		gap: clamp(1.5rem, 4vw, 3rem);
		align-items: center;
	}
	.wp-block-columns.is-style-feature > .wp-block-column:first-child {
		font-size: 1.05em;
	}

	/* -------------------------------------------------------------------------
	   Featured-image fallback for card / post-row media.

	   The mockup always shows a striped .ph placeholder inside .card-media.
	   When a real featured image is present, core/post-featured-image renders a
	   <figure> with an <img>; the adjacent .ph-fallback is hidden. When no image
	   exists, the figure renders empty, so the placeholder remains visible.
	   ------------------------------------------------------------------------- */
	.card-media { position: relative; }
	.card-media .wp-block-post-featured-image { margin: 0; }
	.card-media .wp-block-post-featured-image img {
		display: block;
		width: 100%;
		height: 100%;
		object-fit: cover;
		border-radius: var(--radius-lg);
	}
	.card-media:has(.wp-block-post-featured-image img) .ph-fallback { display: none; }

	/* Keep mockup layout classes from being overridden by block wrappers. */
	.card-feature.wp-block-group {
		display: grid;
		grid-template-columns: 1.1fr 1fr;
		gap: clamp(1.5rem, 4vw, 3rem);
		align-items: center;
	}
	@media (max-width: 820px) {
		.card-feature.wp-block-group { grid-template-columns: 1fr; }
	}
	.post-row.wp-block-group {
		display: grid;
		grid-template-columns: 200px 1fr;
		gap: 1.75rem;
		align-items: start;
	}
	@media (max-width: 560px) {
		.post-row.wp-block-group { grid-template-columns: 1fr; gap: 1rem; }
	}

	/* -------------------------------------------------------------------------
	   Blog archive (BlogView) wiring.

	   The sidebar lives in a reusable template part whose block wrapper would
	   otherwise become the second grid cell of .with-sidebar. display:contents
	   promotes the inner <aside class="sidebar"> to be the real grid child so
	   the mockup two-column layout and the sticky behaviour are preserved.
	   ------------------------------------------------------------------------- */
	.with-sidebar > .wp-block-template-part { display: contents; }

	/* core/categories rendered as the mockup chip row. */
	.chip-row > .wp-block-categories,
	.chip-row .wp-block-categories.is-style-chips {
		display: flex;
		flex-wrap: wrap;
		gap: 0.5rem;
		margin: 0;
		padding: 0;
		list-style: none;
	}
	.chip-row .wp-block-categories li { margin: 0; }
	.chip-row .wp-block-categories a {
		display: inline-flex;
		align-items: center;
		padding: 0.45rem 0.95rem;
		border: 1px solid var(--line);
		border-radius: 999px;
		font-size: 0.88rem;
		font-weight: 500;
		color: var(--ink-soft);
		background: none;
		transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
	}
	.chip-row .wp-block-categories a:hover {
		color: var(--ink);
		border-color: var(--ink-faint);
	}

	/* core/categories rendered as a key/value list inside the sidebar widget. */
	.sidebar .widget-list.cat-list li { display: block; }
	.sidebar .widget-list.cat-list a {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 0.75rem;
	}
	.sidebar .widget-list.cat-list a:hover { color: var(--accent); }
}

/* =========================================================================
   Responsive / block-wrapper neutralisation.

   WordPress wraps theme markup in .wp-block-group / .wp-block-columns and,
   whenever a layout is configured, emits .is-layout-flex / .is-layout-grid
   together with generated gap, grid-template-columns, and flex declarations
   that override the mockup layout classes. The rules below force the bespoke
   mockup grids (.hero-grid, .with-sidebar, .post-grid, .product-grid,
   .card-feature, .cart-layout, .checkout-layout, .account-layout,
   .product-layout, .footer-grid) to win regardless of the block wrapper, and
   re-assert the mockup breakpoints (1080 / 900 / 820 / 560px). Everything here
   is additive and lives in the utilities layer so it resolves after base,
   components, woocommerce, and interactivity.
   ========================================================================= */
@layer utilities {

	/* -------------------------------------------------------------------------
	   Width constraints inside full-width (alignfull) block groups.

	   useRootPaddingAwareAlignments + alignfull groups stretch children to the
	   viewport. .wrap-wide / .wrap-content must still constrain their inner
	   width and centre, even when WP layout support tries to set its own
	   content/wide sizing on the same node.
	   ------------------------------------------------------------------------- */
	.wrap-wide,
	.wp-block-group.wrap-wide,
	.alignfull > .wrap-wide {
		width: min(100% - var(--gutter) * 2, var(--w-wide));
		max-width: none;
		margin-inline: auto;
	}
	.wrap-content,
	.wp-block-group.wrap-content,
	.alignfull > .wrap-content {
		width: min(100% - var(--gutter) * 2, var(--w-content));
		max-width: none;
		margin-inline: auto;
	}
	/* Neutralise WP injected horizontal padding on the wrap containers so the
	   gutter math above is the single source of side spacing. */
	.wp-block-group.wrap-wide,
	.wp-block-group.wrap-content {
		padding-inline: 0;
	}

	/* -------------------------------------------------------------------------
	   Generic block-wrapper neutralisation for the bespoke layout grids.

	   When a layout class also carries a WP layout wrapper, strip the generated
	   flex/grid behaviour (gap + auto columns + flex-wrap) so the explicit
	   grid-template-columns / gap from the component layer is authoritative.
	   ------------------------------------------------------------------------- */
	.hero-grid.is-layout-flex,
	.hero-grid.is-layout-grid,
	.with-sidebar.is-layout-flex,
	.with-sidebar.is-layout-grid,
	.post-grid.is-layout-flex,
	.post-grid.is-layout-grid,
	.product-grid.is-layout-flex,
	.product-grid.is-layout-grid,
	.card-feature.is-layout-flex,
	.card-feature.is-layout-grid,
	.product-layout.is-layout-flex,
	.product-layout.is-layout-grid,
	.cart-layout.is-layout-flex,
	.cart-layout.is-layout-grid,
	.checkout-layout.is-layout-flex,
	.checkout-layout.is-layout-grid,
	.account-layout.is-layout-flex,
	.account-layout.is-layout-grid,
	.footer-grid.is-layout-flex,
	.footer-grid.is-layout-grid {
		display: grid;
		gap: revert-layer;
	}
	/* core/columns + core/column wrappers: when the column container carries a
	   mockup grid class, drop the flex sizing WP applies to each .wp-block-column
	   child so the grid tracks below control sizing. */
	.hero-grid > .wp-block-column,
	.with-sidebar > .wp-block-column,
	.card-feature > .wp-block-column,
	.product-layout > .wp-block-column,
	.cart-layout > .wp-block-column,
	.checkout-layout > .wp-block-column,
	.account-layout > .wp-block-column,
	.footer-grid > .wp-block-column {
		flex-basis: auto !important;
		min-width: 0;
	}

	/* -------------------------------------------------------------------------
	   Explicit grid definitions re-asserted against .wp-block-group /
	   .wp-block-columns. These mirror the component-layer definitions exactly so
	   that, even when WP injects a competing grid-template-columns or gap, the
	   mockup layout is reproduced 1:1.
	   ------------------------------------------------------------------------- */
	.hero-grid.wp-block-group,
	.hero-grid.wp-block-columns {
		grid-template-columns: 1.05fr 0.95fr;
		gap: clamp(2rem, 5vw, 4rem);
		align-items: center;
	}
	.with-sidebar.wp-block-group,
	.with-sidebar.wp-block-columns {
		grid-template-columns: minmax(0, 1fr) 312px;
		gap: clamp(2rem, 5vw, 4.5rem);
		align-items: start;
	}
	.post-grid.wp-block-group {
		grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
		gap: clamp(1.5rem, 3vw, 2.5rem);
	}
	.product-grid.wp-block-group {
		grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
		gap: clamp(1.25rem, 3vw, 2rem);
	}
	.product-layout.wp-block-group,
	.product-layout.wp-block-columns {
		grid-template-columns: 1.05fr 0.95fr;
		gap: clamp(2rem, 5vw, 4.5rem);
		align-items: start;
	}
	.cart-layout.wp-block-group,
	.cart-layout.wp-block-columns {
		grid-template-columns: 1.6fr 0.9fr;
		gap: clamp(2rem, 4vw, 3.5rem);
		align-items: start;
	}
	.checkout-layout.wp-block-group,
	.checkout-layout.wp-block-columns {
		grid-template-columns: 1.4fr 0.9fr;
		gap: clamp(2rem, 4vw, 3.5rem);
		align-items: start;
	}
	.account-layout.wp-block-group,
	.account-layout.wp-block-columns {
		grid-template-columns: 230px 1fr;
		gap: clamp(2rem, 4vw, 3.5rem);
		align-items: start;
	}
	.footer-grid.wp-block-group,
	.footer-grid.wp-block-columns {
		grid-template-columns: 1.4fr 1fr 1fr 1fr;
		gap: 2.5rem;
	}

	/* -------------------------------------------------------------------------
	   Mobile header: core/navigation responsive collapse at the mockup 820px
	   breakpoint.

	   The header part uses core/navigation with overlayMenu:"mobile", whose
	   default open/close toggles only appear below WP's own ~600px breakpoint.
	   Re-point that to the mockup breakpoint so the hamburger + overlay take
	   over under 820px (matching the .primary-nav display:none / .menu-toggle
	   display:grid behaviour in the component layer).
	   ------------------------------------------------------------------------- */
	@media (max-width: 820px) {
		/* The component layer hides .primary-nav wholesale at this breakpoint for
		   the standalone-<nav> mockup. In the block theme the hamburger button is
		   a child of .wp-block-navigation.primary-nav, so keep the wrapper itself
		   visible and instead hide only the inline menu container. */
		.wp-block-navigation.primary-nav {
			display: flex;
		}
		/* Hide the inline horizontal menu, expose the open (hamburger) button. */
		.wp-block-navigation.primary-nav .wp-block-navigation__responsive-container:not(.is-menu-open) {
			display: none;
		}
		.wp-block-navigation.primary-nav .wp-block-navigation__responsive-container-open {
			display: flex;
		}
	}
	@media (min-width: 821px) {
		/* Above the breakpoint keep the desktop inline menu and hide the toggle,
		   even if core marked the menu as a mobile overlay. */
		.wp-block-navigation.primary-nav .wp-block-navigation__responsive-container:not(.is-menu-open) {
			display: flex;
			position: static;
			width: auto;
			background: transparent;
			z-index: auto;
		}
		.wp-block-navigation.primary-nav .wp-block-navigation__responsive-container-open {
			display: none;
		}
		/* The open overlay container resets to inline flow above the breakpoint. */
		.wp-block-navigation.primary-nav .wp-block-navigation__responsive-container.is-menu-open {
			position: static;
		}
	}

	/* -------------------------------------------------------------------------
	   Responsive reflow re-asserted on the block-wrapped grids.

	   The component layer already carries these breakpoints for the plain
	   mockup classes; repeat them here scoped to the block wrappers so the
	   single-column reflow survives WP's generated layout styles.
	   ------------------------------------------------------------------------- */
	@media (max-width: 1080px) {
		.with-sidebar.wp-block-group,
		.with-sidebar.wp-block-columns {
			grid-template-columns: 1fr;
		}
	}
	@media (max-width: 900px) {
		.footer-grid.wp-block-group,
		.footer-grid.wp-block-columns {
			grid-template-columns: 1fr 1fr;
			gap: 2rem;
		}
		.product-layout.wp-block-group,
		.product-layout.wp-block-columns,
		.cart-layout.wp-block-group,
		.cart-layout.wp-block-columns,
		.checkout-layout.wp-block-group,
		.checkout-layout.wp-block-columns,
		.account-layout.wp-block-group,
		.account-layout.wp-block-columns {
			grid-template-columns: 1fr;
		}
	}
	@media (max-width: 820px) {
		.hero-grid.wp-block-group,
		.hero-grid.wp-block-columns {
			grid-template-columns: 1fr;
		}
	}
	@media (max-width: 560px) {
		.post-grid.wp-block-group {
			grid-template-columns: 1fr;
		}
		.footer-grid.wp-block-group,
		.footer-grid.wp-block-columns {
			grid-template-columns: 1fr;
		}
	}

	/* -------------------------------------------------------------------------
	   Comment list + form bridge (from comments-note.md).

	   core/comment blocks wrap output in extra elements the mockup selectors do
	   not target; these rules map the core markup onto the mockup look and keep
	   the layout responsive. Verified against the .comment / .comment-form
	   classes defined in woocommerce.css.
	   ------------------------------------------------------------------------- */
	.comment .wp-block-avatar img {
		width: 46px;
		height: 46px;
		border-radius: 999px;
		flex: none;
	}
	.comment.reply .wp-block-avatar img,
	.wp-block-comment[data-depth="2"] .wp-block-avatar img {
		width: 40px;
		height: 40px;
	}
	.comment-body .wp-block-comment-content { margin: 0; }
	.comment-body .cm-head .wp-block-comment-author-name,
	.comment-body .cm-head .wp-block-comment-date { margin: 0; }
	.comment-body .cm-name a { color: inherit; text-decoration: none; }

	/* Reply nesting: core/comment-template indents replies via nested
	   .wp-block-comment instead of the mockup .comment.reply modifier. */
	.wp-block-comment .wp-block-comment .comment {
		margin-left: 3.2rem;
		border-top: 1px solid var(--line);
	}
	@media (max-width: 560px) {
		.wp-block-comment .wp-block-comment .comment {
			margin-left: 1.25rem;
		}
	}

	/* Comment form: trim core/post-comments-form to the mockup field set and
	   reflow name + email two-up, collapsing to a single column on mobile. */
	.comment-form .comment-notes,
	.comment-form .comment-form-url,
	.comment-form .comment-form-cookies-consent { display: none; }
	.comment-form form,
	.comment-form #commentform {
		display: flex;
		flex-wrap: wrap;
		flex-direction: row;
		gap: 1rem;
	}
	.comment-form .comment-form-author,
	.comment-form .comment-form-email {
		flex: 1 1 calc(50% - 0.5rem);
		margin: 0;
	}
	.comment-form .comment-form-comment { flex: 1 1 100%; margin: 0; }
	.comment-form label {
		display: block;
		font-size: 0.82rem;
		font-weight: 600;
		margin-bottom: 0.4rem;
	}
	.comment-form input[type="text"],
	.comment-form input[type="email"],
	.comment-form textarea {
		width: 100%;
		padding: 0.7rem 0.9rem;
		border: 1px solid var(--line);
		border-radius: var(--radius);
		background: var(--paper);
		font: inherit;
	}
	.comment-form .form-submit {
		flex: 1 1 100%;
		margin: 0;
	}
	@media (max-width: 560px) {
		.comment-form .comment-form-author,
		.comment-form .comment-form-email {
			flex: 1 1 100%;
		}
	}

	/* core/comments-pagination reuses the .pagination look; ensure the numbers
	   block markup inherits it. */
	.wp-block-comments-pagination.pagination,
	.wp-block-comments-pagination-numbers .page-numbers {
		font-family: var(--font-mono);
	}
}
