/*
 * Base stylesheet — rules that can't be expressed as Tailwind utilities.
 * Tailwind v4 (compiled by Blockstudio) owns the reset and all utility styling.
 * See docs/styling.md for what lives here and why.
 */

/*
 * Declare Tailwind's cascade layer order up front so it doesn't depend on when
 * Blockstudio's injected `<style id="blockstudio-tailwind">` loads. Re-declaring
 * the order Blockstudio uses (7.3.3+) is a no-op if its style parses first.
 * Correct only while Blockstudio emits layered utilities — see the cascade
 * smoke-test in docs/styling.md.
 */
@layer theme, base, components, utilities;

/*
 * Register the translate axes that Tailwind v4's `translate-*` utilities depend
 * on. Blockstudio's TailwindPHP compiler doesn't emit `@property` for them, so
 * without these the `translate:` shorthand resolves to empty and the browser
 * drops the whole declaration — every translate utility silently does nothing.
 * Harmless once a future Blockstudio emits them (identical re-registration).
 */
@property --tw-translate-x {
	syntax: "*";
	inherits: false;
	initial-value: 0;
}

@property --tw-translate-y {
	syntax: "*";
	inherits: false;
	initial-value: 0;
}

@property --tw-translate-z {
	syntax: "*";
	inherits: false;
	initial-value: 0;
}

/*
 * Typography defaults. Layered in `@layer base` (rule block below) so any
 * Tailwind utility overrides them per-instance, while plain elements keep their
 * theme sizes. Must stay layered — an unlayered `body h2` would beat utilities
 * and invert the contract (see docs/styling.md → cascade smoke-test).
 *
 * Two rules below stay UNLAYERED on purpose (see their own notes):
 * `.wp-block-image.size-full` and bare `body { font-size; line-height }`.
 *
 * Loads on the frontend and, via add_editor_style(), inside the editor iframe
 * where WordPress auto-scopes every selector to `.editor-styles-wrapper`.
 * Lists are scoped to `.wp-block-list` so nav menus stay clean.
 */
body {
	font-size: var(--wp--preset--font-size--regular);
	line-height: 1.618;
}

/*
 * WP marks full-size images `size-full`; Tailwind v4 also ships a `size-full`
 * utility (width/height 100%) that would stretch the figure to its parent's
 * height. UNLAYERED so it beats that utility.
 */
.wp-block-image.size-full {
	height: auto;
}

@layer base {
	/*
	 * Default link colour. Kept out of theme.json's `styles.elements.link`: WP
	 * emits that unlayered, which would beat `text-ink` etc. on every anchor.
	 * In `@layer base` so Tailwind utilities can still override per link.
	 */
	body a { color: var(--wp--preset--color--blue); }
	body a:hover { color: var(--wp--preset--color--blue-deep); }

	body p { margin-block: 1.5rem; }
	body figure { margin-block: 3rem; }

	/* Headings: weight 800, negative tracking that loosens as size drops. */
	body :is(h1, h2, h3, h4, h5, h6) { font-weight: 800; }

	body h1 { font-size: var(--wp--preset--font-size--heading-1); line-height: 1.05; letter-spacing: -.03em;  margin-block: 3rem 1.5rem; }
	body h2 { font-size: var(--wp--preset--font-size--heading-2); line-height: 1.1;  letter-spacing: -.025em; margin-block: 3rem 1.5rem; }
	body h3 { font-size: var(--wp--preset--font-size--heading-3); line-height: 1.15; letter-spacing: -.025em; margin-block: 2rem 1.5rem; }
	body h4 { font-size: var(--wp--preset--font-size--heading-4); line-height: 1.2;  letter-spacing: -.02em;  margin-block: 2rem 1.5rem; }
	body h5 { font-size: var(--wp--preset--font-size--heading-5); line-height: 1.25; letter-spacing: -.02em;  margin-block: 1.5rem 1.5rem; }
	body h6 { font-size: var(--wp--preset--font-size--heading-6); line-height: 1.3;  letter-spacing: -.02em;  margin-block: 1.5rem 1.5rem; }

	/* Stacked headings: any heading directly following another collapses its top margin. */
	body :is(h1, h2, h3, h4, h5, h6) + :is(h1, h2, h3, h4, h5, h6) { margin-top: 0; }

	/* core/list block: restore bullets/numbers and indent that Tailwind preflight zeroes. */
	.wp-block-list { margin-block: 1.5rem; padding-inline-start: 1.5em; }
	.wp-block-list:where(ul) { list-style: disc; }
	.wp-block-list:where(ol) { list-style: decimal; }
	.wp-block-list :where(li > *) { margin-block: 0.5rem; }
	.wp-block-list :where(li > :first-child) { margin-top: 0; }
	.wp-block-list :where(li > :last-child)  { margin-bottom: 0; }

	/* First/last reset: heading at top of a section, paragraph at end, don't push the container. */
	body :is(h1, h2, h3, h4, h5, h6):first-child { margin-top: 0; }
	body p:last-child { margin-bottom: 0; }
}

/*
 * `core/group` prose width — cap reading-line length while media stays free to
 * fill the block. Descendant selector so prose in a child group is also capped.
 */
.wp-block-group :is(p, h1, h2, h3, h4, h5, h6, ul, ol),
.site-content > :is(p, h1, h2, h3, h4, h5, h6, ul, ol) {
	max-width: 72ch;
	/*
	 * Left-align prose to the contentSize (1440px) start edge whether the parent
	 * Group is constrained or alignfull: offset by half the parent's overshoot.
	 * RTL-safe; `!important` beats WP's `margin-inline: auto` on layout children.
	 * Second selector catches prose orphaned as a direct child of <main>.
	 */
	margin-inline-start: max(
		0px,
		calc((100% - var(--wp--style--global--content-size)) / 2)
	) !important;
}

/*
 * Auto-bleed for `core/group` blocks with a background color — extends the Group
 * edge-to-edge while its content stays at content-size, so editors get bleeding
 * sections without the (disabled) align toolbar. Scoped to direct children of
 * `.has-global-padding` (the page <main>). `!important` matches WP's auto-emitted
 * `margin-inline: auto` on layout children.
 */
.has-global-padding > .wp-block-group.has-background {
	max-width: none;
	margin-left: calc(var(--wp--style--root--padding-left) * -1) !important;
	margin-right: calc(var(--wp--style--root--padding-right) * -1) !important;
	padding-left: var(--wp--style--root--padding-left);
	padding-right: var(--wp--style--root--padding-right);
}

/*
 * Fluid block padding for bg-color Groups. Spacing controls are disabled in
 * theme.json, so this gives colored sections breathing room automatically.
 */
.wp-block-group.has-background {
	padding-block: clamp(2rem, 6vw, 4rem);
}

/*
 * Foreground pairing for dark-background Groups — `color` cascades to all text
 * descendants. Add a sibling rule per dark swatch as the palette grows.
 */
.wp-block-group.has-ink-background-color {
	color: var(--wp--preset--color--paper);
}

/*
 * Duplo gap — top-margin between section-level blocks at the page root. Owl
 * selector, so the first section sits flush with the page top. Applies on the
 * frontend and in the editor (`.has-global-padding` is on both roots). Scoped to
 * `core/group`; extend the selector (or add an `.is-duplo` class) for composites.
 */
.has-global-padding > .wp-block-group + .wp-block-group {
	margin-top: clamp(2rem, 5vw, 75px);
}

/*
 * ROOT-LEVEL SPACING — read before adding a template or root block.
 * UNLAYERED on purpose. Vertical margins on a direct child of <main> are
 * unreliable: WP's unlayered layout rule overrides them and a last child's
 * bottom margin collapses out. So <main> owns the gap to the footer (one
 * padding-block-end, inherited by every template), root children carry no
 * vertical margins, and anything needing an outer margin declares it here, not
 * as a utility. Full rationale: docs/styling.md → Vertical spacing at the root.
 */
.site-content {
	display: flow-root;
	padding-block-end: 6rem;
}

/* No root section carries vertical margins — they would be unreliable anyway. */
.site-content > * {
	margin-block: 0;
}

/*
 * Exception: the Home closing panel wants 32px of air above it. The gap is outside
 * its Ink background, so it can only be a margin — declared here (unlayered).
 */
.site-content > .nomon-cta {
	margin-block-start: 2rem;
}

/*
 * Closing-CTA decoration — brand-blue dots fading in from the right edge. Pure
 * decoration (aria-hidden span). Here rather than utilities because the radial-
 * gradient dots + vendor-prefixed mask are unreadable as arbitrary values.
 * 1.5px dots on a 22px grid; the 105deg mask keeps the headline side clean.
 */
.nomon-cta__dots {
	background-image: radial-gradient(rgba(90, 102, 245, .5) 1.5px, transparent 1.5px);
	background-size: 22px 22px;
	-webkit-mask-image: linear-gradient(105deg, transparent 52%, #000 100%);
	        mask-image: linear-gradient(105deg, transparent 52%, #000 100%);
}

/*
 * PAGE-TOP GAP — one knob for the vertical gap above a framed page's header.
 * Framed templates read it via `pt-[var(--space-page-top)]` so top spacing moves
 * together. Home, the plugin page and 404 own their own top and don't read this.
 */
:root {
	--space-page-top: 4rem; /* 64px */
}

@layer base {
	html {
		scroll-behavior: smooth;
		scroll-padding-top: var(--scroll-offset, 2rem);
	}

	body {
		-webkit-font-smoothing: antialiased;
		-moz-osx-font-smoothing: grayscale;
	}

	/*
	 * Restore the click cursor on buttons (Tailwind v4 dropped Preflight's
	 * `button { cursor: pointer }`). In `@layer base` so a `cursor-*` utility
	 * can override; skips `:disabled` so inert controls keep the arrow.
	 */
	button:not( :disabled ),
	[role="button"]:not( [aria-disabled="true"] ) {
		cursor: pointer;
	}

	/*
	 * Neutralize bold/italic inside headings — heading typography is theme-
	 * controlled, not per-character (defense-in-depth with the editor.js hide).
	 */
	:where(h1, h2, h3, h4, h5, h6) :is(strong, b, em, i) {
		font-weight: inherit;
		font-style: inherit;
	}

	/*
	 * Neutralize text alignment on paragraphs and headings — cancels the editor's
	 * alignment toolbar visually (loaded in the iframe too, so preview matches).
	 */
	:is(p, h1, h2, h3, h4, h5, h6):is(
		.has-text-align-left,
		.has-text-align-center,
		.has-text-align-right
	) {
		text-align: inherit;
	}

	.screen-reader-text {
		border: 0;
		clip-path: inset(50%);
		height: 1px;
		margin: -1px;
		overflow: hidden;
		padding: 0;
		position: absolute;
		width: 1px;
		word-wrap: normal !important;
	}

	.skip-link:focus {
		clip-path: none;
		height: auto;
		margin: 0;
		overflow: auto;
		padding: 1rem;
		position: absolute;
		inset-block-start: 0;
		inset-inline-start: 0;
		width: auto;
		z-index: 100000;
		background: #000;
		color: #fff;
		text-decoration: underline;
	}

	/*
	 * External-link / new-window indicators (added by assets/js/main.js, WCAG
	 * 2.4.4). The visible icon is a signal; the screen-reader text is what counts
	 * for compliance and must not be hidden.
	 */
	a.is-external-link::after,
	a.is-new-window::after {
		content: " ↗";
		display: inline-block;
		font-size: 0.85em;
		vertical-align: super;
		line-height: 1;
	}
	a.is-new-window::after {
		content: " ⧉";
	}
	a.is-external-link.is-new-window::after {
		content: " ⧉";
	}

	/*
	 * Footer override: hide the visible external/new-window glyph in the theme
	 * footer and Nomon Helper's credit bar. The .screen-reader-text stays, so
	 * WCAG 2.4.4 still announces to AT. Higher specificity wins within @layer base.
	 */
	:is(.site-footer, .nomon_footer) a.is-external-link::after,
	:is(.site-footer, .nomon_footer) a.is-new-window::after,
	:is(.site-footer, .nomon_footer) a.is-external-link.is-new-window::after {
		content: none;
	}
}

/*
 * Critical Swiper layout — bridges the pre-init gap so `[data-swiper]` containers
 * don't flash as a vertical stack before the lazy vendor CSS lands. Hidden with
 * visibility (reserves layout space) until Swiper adds `.swiper-initialized`; the
 * flex rules pre-size slides so the reveal is shift-free.
 */
.swiper { overflow: hidden; }
.swiper:not(.swiper-initialized) { visibility: hidden; }
.swiper-wrapper { display: flex; }
.swiper-slide { flex-shrink: 0; width: 100%; }

/*
 * Editor-only: `display: contents` flattens the `.block-editor-inner-blocks` /
 * `.block-editor-block-list__layout` wrappers Gutenberg adds around InnerBlocks,
 * which otherwise break flex/grid on nomon/* blocks. Inert on the frontend
 * (`[data-type^="nomon/"]` is editor-only). Descendant combinators catch the
 * wrappers regardless of useBlockProps nesting depth.
 */
[data-type^="nomon/"] .block-editor-inner-blocks,
[data-type^="nomon/"] .block-editor-block-list__layout {
	display: contents;
}

/*
 * Editor-only: post title chrome. The title renders in the canvas as a sibling
 * of the content blocks; this wraps it in dark chrome with a "Page title" label
 * so editors read it as page metadata, not the first H1. Scoped through
 * `.edit-post-visual-editor__post-title-wrapper` to outweigh the `body h1`
 * defaults. Inert on the frontend (`.editor-*` classes only exist in the editor).
 */
/* Zero the iframe body's top padding so the title wrapper sits flush. */
body {
	padding-top: 0;
}

.edit-post-visual-editor__post-title-wrapper {
	background-color: #f0f0f0;
	color: #1e1e1e;
	margin-block-start: 0 !important;
	margin-block-end: 3rem;
	padding-inline: var(--wp--style--root--padding-left, clamp(1rem, 5vw, 5rem));
}

.edit-post-visual-editor__post-title-wrapper .editor-post-title {
	color: inherit;
	margin: 0 auto;
	max-width: var(--wp--style--global--content-size, 1440px);
	padding-block: 3rem;
}

.edit-post-visual-editor__post-title-wrapper .editor-post-title::before {
	content: "Page title";
	display: block;
	color: #666;
	font-size: 0.875rem;
	font-weight: 500;
	margin-block-end: 0.75rem;
}

.edit-post-visual-editor__post-title-wrapper .editor-post-title [data-rich-text-placeholder]::after {
	color: #666;
	opacity: 1;
}

/* =========================================================================
 * Navigation
 * -------------------------------------------------------------------------
 * Adapted from air-light (digitoimistodude/air-light) — same Nav_Walker, so
 * class names, ARIA wiring, and the hover-intent model carry over. Runtime:
 * assets/js/navigation.js. Per-site retheme = override the :root block below.
 *
 * Markup contract (see header.php + inc/includes/nav-walker.php):
 *   <nav id="nav" class="nav-primary">
 *     <button id="nav-toggle" class="nav-toggle">
 *       <span class="hamburger"></span>
 *     </button>
 *     <div id="menu-items-wrapper" class="menu-items-wrapper">
 *       <ul id="main-menu" class="menu-items">
 *         <li class="menu-item menu-item-has-children">
 *           <a>Parent</a>
 *           <button class="dropdown-toggle"><svg/></button>
 *           <ul class="sub-menu"><li class="menu-item"><a>Child</a></li></ul>
 *         </li>
 *       </ul>
 *     </div>
 *   </nav>
 * ========================================================================= */

:root {
	/* Mobile→desktop handoff breakpoint. JS reads it via getComputedStyle, so
	 * it must stay numeric (no `var()` inside). */
	--breakpoint-nav: 1029px;

	/*
	 * Burger + nav colors. Remapped to the Wepista palette — the starter's
	 * `light`/`dark` slugs no longer exist and a dangling var silently drops all
	 * nav color, so these must be remapped whenever the palette changes.
	 * Desktop bar sits on Paper; mobile drawer inverts to the Ink panel.
	 */
	/* Burger sits in a solid blue button (mobile only) with white stripes. */
	--hamburger-color: var(--wp--preset--color--paper);
	--hamburger-color-active: var(--wp--preset--color--paper);
	--hamburger-width: 1.5rem;
	--hamburger-layer-height: 2px;

	/* Desktop dropdowns */
	--color-main-level: var(--wp--preset--color--ink);
	--color-hover-main-level: var(--wp--preset--color--blue);
	--color-current: var(--wp--preset--color--blue);
	--typography-size-main-level: 19px;   /* design: header nav 19px/600 */
	--typography-weight-main-level: 600;
	--padding-main-level-vertical: 0.375rem;
	--gap-main-level-horizontal: 42px;    /* design: nav gap 42px */
	--gap-between-dropdown-toggle: 0.9375rem;
	--dropdown-toggle-size: 0.75rem;

	--color-sub-menu: var(--wp--preset--color--ink);
	--color-hover-sub-menu: var(--wp--preset--color--blue);
	--color-background-sub-menu: var(--wp--preset--color--card);
	--typography-size-sub-menu: 1rem;
	--typography-weight-sub-menu: 600;
	--padding-sub-menu-vertical: 0.625rem;
	--padding-sub-menu-link-vertical: 0.5rem;
	--padding-sub-menu-link-horizontal: 1.25rem;
	--width-sub-menu: 14rem;
	--gap-dropdown: 1.6rem;

	/* Mobile drawer — ~70%-width white panel (Paper), dark Ink text */
	--width-navigation: 70%;
	--color-background-menu-items: var(--wp--preset--color--paper);
	--color-main-level-menu-item-mobile: var(--wp--preset--color--ink);
	--color-main-level-menu-item-hover-focus-mobile: var(--wp--preset--color--blue);
	--color-sub-menu-mobile: var(--wp--preset--color--ink-muted);
	--color-current-menu-item: var(--wp--preset--color--blue);
	--color-dropdown-toggle-mobile: var(--wp--preset--color--ink);
	--typography-size-main-level-mobile: 1.375rem;
	--typography-weight-main-level-mobile: 600;
	--padding-main-level-vertical-mobile: 0.875rem;
	--typography-size-sub-menu-mobile: 1.0625rem;
	--typography-weight-sub-menu-mobile: 600;
	--margin-left-sub-menu: 0.625rem;
	--padding-sub-menu-vertical-mobile: 0.5rem;
	--padding-sub-menu-horizontal-mobile: var(--wp--style--root--padding-left, clamp(1rem, 5vw, 5rem));
}

/* ----- Burger button (hidden on desktop) -------------------------------- */
.hamburger {
	display: block;
	width: var(--hamburger-width);
	height: var(--hamburger-layer-height);
	background-color: var(--hamburger-color);
	position: relative;
	transition: all 0.2s ease 0s;
	flex-shrink: 0;
}
.hamburger::before,
.hamburger::after {
	content: "";
	display: block;
	width: var(--hamburger-width);
	height: var(--hamburger-layer-height);
	background-color: var(--hamburger-color);
	position: absolute;
	transition: all 0.2s ease 0s;
}
.hamburger::before { top: -0.5625rem; }
.hamburger::after  { bottom: -0.5625rem; }

body:not(.js-nav-active) .nav-toggle .hamburger::after,
body:not(.js-nav-active) .nav-toggle:focus .hamburger::after { width: 80%; }
body:not(.js-nav-active) .nav-toggle:hover .hamburger::after { width: 100%; }

.js-nav-active .hamburger { background-color: transparent; }
.js-nav-active .hamburger::before,
.js-nav-active .hamburger::after {
	background-color: var(--hamburger-color-active);
	left: 0;
	top: 0;
}
.js-nav-active .hamburger::before { transform: rotate(-45deg); }
.js-nav-active .hamburger::after  { transform: rotate(45deg); }

.nav-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	margin: 0;
	padding: 0;
	background: var(--wp--preset--color--blue);
	border: 0;
	border-radius: 0.625rem;
	cursor: pointer;
	position: relative;
	z-index: 99999;
	transition: background-color 0.2s ease;
}
.nav-toggle:hover,
.nav-toggle:focus-visible { background: var(--wp--preset--color--blue-deep); }
.nav-toggle:focus-visible {
	outline: 2px solid var(--wp--preset--color--blue);
	outline-offset: 2px;
}

/* Account CTA lives in the header pill on desktop; inside the mobile drawer it
 * reappears as a full-width blue pill (shown only within the mobile media query
 * below). Hidden everywhere else so it never leaks into the desktop menu row. */
.drawer-account { display: none; }

body.js-nav-active { overflow: hidden; }

/* ===== MOBILE (below --breakpoint-nav) ================================== */
@media (max-width: 1029.98px) {
	.nav-primary .menu-items ul { display: none; }
	.nav-primary ul .sub-menu.toggled-on { display: block; }

	.nav-primary { align-self: center; }

	.site-header ul,
	.site-header li,
	.site-header a { position: relative; }

	.nav-primary .menu-items-wrapper {
		position: fixed;
		top: 0;
		left: 0;
		width: var(--width-navigation);
		height: 100dvh; /* JS trims the height by the admin bar when present */
		background-color: var(--color-background-menu-items);
		box-shadow: 0 0 2.5rem rgba(14, 15, 19, 0.18); /* separate the ~70% panel from the live page beside it */
		transform: translate3d(-100%, 0, 0);
		transition: transform 220ms cubic-bezier(0.19, 1, 0.22, 1), opacity 180ms ease-in-out;
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
		overflow: auto;
		padding-top: 1.5rem; /* the panel now fills the full height; the logo sits under it, so links just need breathing room from the top edge */
		padding-bottom: 7.5rem;
		backface-visibility: hidden;
		z-index: 5;
	}

	.nav-primary .menu-items { margin: 0; padding: 0; list-style: none; }
	.nav-primary .menu-item  { margin: 0; }

	.nav-primary .menu-item a {
		display: block;
		padding-block: var(--padding-main-level-vertical-mobile);
		padding-inline: var(--padding-sub-menu-horizontal-mobile);
		color: var(--color-main-level-menu-item-mobile);
		font-size: var(--typography-size-main-level-mobile);
		font-weight: var(--typography-weight-main-level-mobile);
		text-decoration: none;
		position: relative;
		z-index: 0;
	}
	.nav-primary .menu-item a:hover,
	.nav-primary .menu-item a:focus { color: var(--color-main-level-menu-item-hover-focus-mobile); }
	.nav-primary .menu-item.current-menu-parent > a,
	.nav-primary .menu-item.current-menu-item > a { color: var(--color-current-menu-item); }

	.nav-primary .sub-menu { margin: 0; padding: 0; list-style: none; }
	.nav-primary .sub-menu a {
		color: var(--color-sub-menu-mobile);
		font-size: var(--typography-size-sub-menu-mobile);
		font-weight: var(--typography-weight-sub-menu-mobile);
		padding-block: var(--padding-sub-menu-vertical-mobile);
		padding-left: calc(var(--padding-sub-menu-horizontal-mobile) + var(--margin-left-sub-menu));
	}
	.nav-primary .sub-menu .sub-menu a {
		padding-left: calc(var(--padding-sub-menu-horizontal-mobile) + var(--margin-left-sub-menu) * 2);
	}

	.nav-primary .dropdown-toggle {
		position: absolute;
		top: 2px;
		right: 0;
		height: 100%;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		overflow: hidden;
		padding-block: var(--padding-sub-menu-vertical-mobile);
		padding-left: var(--padding-sub-menu-horizontal-mobile);
		padding-right: calc(var(--padding-sub-menu-horizontal-mobile) - calc(var(--dropdown-toggle-size) / 2));
		background: transparent;
		border: 0;
		color: var(--color-dropdown-toggle-mobile);
		cursor: pointer;
		z-index: 100;
	}
	.nav-primary .dropdown-toggle svg {
		width: var(--dropdown-toggle-size);
		height: var(--dropdown-toggle-size);
		transition: transform 150ms;
		pointer-events: none;
	}
	.nav-primary .dropdown-toggle.toggled-on svg { transform: rotate(180deg); }
	.nav-primary .sub-menu .dropdown-toggle { color: var(--color-sub-menu-mobile); }

	/* Account pill — full-width, pinned inset to match the menu-item padding. */
	.drawer-account {
		display: flex;
		align-items: center;
		justify-content: center;
		margin: 1.75rem var(--padding-sub-menu-horizontal-mobile) 0;
		padding: 0.875rem 1.5rem;
		border-radius: 9999px;
		background-color: var(--wp--preset--color--blue);
		color: var(--wp--preset--color--paper);
		font-size: 1.0625rem;
		font-weight: 600;
		line-height: 1.2;
		text-decoration: none;
		transition: background-color 0.2s ease;
	}
	.drawer-account:hover,
	.drawer-account:focus-visible { background-color: var(--wp--preset--color--blue-deep); }
	.drawer-account:focus-visible {
		outline: 2px solid var(--wp--preset--color--blue);
		outline-offset: 2px;
	}

	.js-nav-active .nav-primary .menu-items-wrapper {
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
		transform: translate3d(0, 0, 0);
	}

	/*
	 * Scrim that dims the page beside/behind the ~70% drawer. Lives in the root
	 * stacking context at z-index 4 — below the header (z-20, whose subtree holds
	 * the drawer) so the drawer and the header bar stay bright, above page content
	 * so everything else darkens. Clicks land on <body> (outside #nav), which the
	 * tap-to-close handler in navigation.js uses to close the drawer.
	 */
	body::after {
		content: "";
		position: fixed;
		inset: 0;
		background-color: rgba(14, 15, 19, 0.5);
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
		transition: opacity 180ms ease-in-out, visibility 180ms;
		z-index: 4;
	}
	body.js-nav-active::after {
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
	}
}

/* Admin-bar offset for the mobile drawer is handled at runtime in
 * navigation.js (calculateBurgerMenuPosition) — it sets top/height from the
 * live #wpadminbar height, so no static margin rule is needed here. */

/* ===== DESKTOP (at and above --breakpoint-nav) ========================== */
@media (min-width: 1030px) {
	.nav-toggle { display: none; }

	.nav-primary { line-height: 0; padding-block: 0; }

	.nav-primary .menu-items {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		justify-content: flex-end;
		column-gap: var(--gap-main-level-horizontal);
		row-gap: 0.625rem;
		margin: 0;
		padding: 0;
		list-style: none;
		position: relative;
	}

	.nav-primary .menu-item { margin: 0; position: relative; }

	.nav-primary .menu-item > a {
		display: inline-flex;
		align-items: center;
		color: var(--color-main-level);
		font-size: var(--typography-size-main-level);
		font-weight: var(--typography-weight-main-level);
		padding-block: var(--padding-main-level-vertical);
		white-space: nowrap;
		text-decoration: none;
	}
	.nav-primary .menu-item > a:hover,
	.nav-primary .menu-item > a:focus { color: var(--color-hover-main-level); }
	.nav-primary .menu-item.current-menu-parent > a,
	.nav-primary .menu-item.current-menu-item > a { color: var(--color-current); }

	/* Parents with a dropdown lay out link + toggle side by side */
	.nav-primary .menu-item.menu-item-has-children {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: var(--gap-between-dropdown-toggle);
	}

	/* "Safe area" bridges the gap between menu-item and submenu so hover
	 * doesn't break when traversing the empty space. Only visible while
	 * hovered (hover-intent), so it doesn't capture clicks at rest. */
	.nav-primary .menu-item.menu-item-has-children::after {
		content: "";
		display: block;
		position: absolute;
		top: 100%;
		width: 100%;
		max-width: var(--width-sub-menu);
		height: var(--gap-dropdown);
		visibility: hidden;
	}
	.nav-primary .menu-item.menu-item-has-children.hover-intent::after {
		visibility: visible;
		z-index: 100;
	}
	.nav-primary .sub-menu .menu-item-has-children::after { display: none; }

	.nav-primary .sub-menu {
		--color-current: var(--color-sub-menu);
		position: absolute;
		top: 100%;
		left: 0;
		width: var(--width-sub-menu);
		margin: 0;
		margin-top: var(--gap-dropdown);
		padding: 0;
		list-style: none;
		background-color: var(--color-background-sub-menu);
		opacity: 0;
		visibility: hidden;
		transition: all 0.2s cubic-bezier(0.19, 1, 0.22, 1);
		z-index: 9;
	}
	.nav-primary .sub-menu .sub-menu {
		top: 0;
		left: 100%;
		margin-top: calc(-1 * var(--padding-sub-menu-vertical));
	}

	/* Flip to the left when JS detects right-edge overflow */
	.nav-primary .sub-menu.is-out-of-viewport { left: auto; right: 0; }
	.nav-primary .sub-menu.is-out-of-viewport .sub-menu,
	.nav-primary .sub-menu .sub-menu.is-out-of-viewport { left: auto; right: 100%; }

	.nav-primary .menu-item .sub-menu a {
		display: inline-flex;
		align-items: center;
		width: 100%;
		color: var(--color-sub-menu);
		font-size: var(--typography-size-sub-menu);
		font-weight: var(--typography-weight-sub-menu);
		line-height: 1.5;
		padding-block: var(--padding-sub-menu-link-vertical);
		padding-inline: var(--padding-sub-menu-link-horizontal);
		text-decoration: none;
		white-space: normal;
	}
	.nav-primary .menu-item .sub-menu a:hover,
	.nav-primary .menu-item .sub-menu a:focus {
		color: var(--color-hover-sub-menu);
		text-decoration: underline;
		text-decoration-thickness: 2px;
	}
	.nav-primary .sub-menu .menu-item.current-menu-item > a {
		text-decoration: underline;
		text-decoration-thickness: 2px;
	}

	/* Open submenus: :hover for mouse, :focus-within for keyboard, and
	 * .hover-intent (added by JS) which keeps the menu open briefly after
	 * the cursor leaves to absorb stray movement. */
	.nav-primary .menu-item-has-children:hover > .sub-menu,
	.nav-primary .menu-item-has-children:focus-within > .sub-menu,
	.nav-primary .menu-item-has-children.hover-intent > .sub-menu {
		opacity: 1;
		visibility: visible;
		z-index: 12;
	}

	/* Dropdown toggle on desktop is decorative — pointer-events: none lets
	 * clicks fall through to the parent <a>. The svg is the visual cue. */
	.nav-primary .dropdown-toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		padding: 0;
		background: transparent;
		border: 0;
		pointer-events: none;
	}
	.nav-primary .dropdown-toggle svg {
		width: var(--dropdown-toggle-size);
		height: var(--dropdown-toggle-size);
		transition: all 0.35s cubic-bezier(0.19, 1, 0.22, 1);
	}
	.nav-primary .menu-item-has-children.hover-intent > .dropdown-toggle svg {
		transform: rotateX(180deg);
	}
	.nav-primary .sub-menu .dropdown-toggle svg { transform: rotate(-90deg); }
	.nav-primary .sub-menu .hover-intent > .dropdown-toggle svg {
		transform: rotate(-90deg) rotateX(180deg);
	}
}

/* =========================================================================
 * WooCommerce — buy card
 * -------------------------------------------------------------------------
 * The tier <select> is theme-rendered (woocommerce/single-product.php), so
 * Tailwind handles it. All that's left here is the one thing a utility can't
 * do: replace the native chevron. UNLAYERED, so it beats WP's global styles.
 * ========================================================================= */

.wepista-buy select {
	appearance: none;
	padding-right: 2.5rem;
	/* Decorative chevron. A data: URI keeps it request-free. */
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230E0F13' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.875rem center;
	background-size: 1.125rem;
}

/*
 * Account form selects (Country + the JS-swapped State dropdown). Same chevron
 * as the buy card, kept here (not utilities) so it survives the runtime rebuild
 * of the State <select>.
 */
.wepista-account select {
	appearance: none;
	padding-right: 2.5rem;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230E0F13' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.875rem center;
	background-size: 1.125rem;
}

/*
 * WooCommerce notices. Woo's own stylesheets are stripped, so without these the
 * notice renders as an unstyled <ul>. Colour isn't the only signal — the copy
 * and Woo's `role="alert"` carry it for screen readers.
 */
.wepista-notices .woocommerce-error,
.wepista-notices .woocommerce-message,
.wepista-notices .woocommerce-info {
	margin-block: 0 1.5rem;
	padding: 1rem 1.25rem;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 12px;
	background-color: var(--wp--preset--color--card);
	list-style: none;
	font-size: var(--wp--preset--font-size--small);
}

.wepista-notices .woocommerce-error {
	border-color: var(--wp--preset--color--warning);
	background-color: var(--wp--preset--color--warning-bg);
	color: var(--wp--preset--color--warning);
}

.wepista-notices .woocommerce-message {
	border-color: var(--wp--preset--color--success);
	background-color: var(--wp--preset--color--success-bg);
	color: var(--wp--preset--color--success);
}

.wepista-notices .button {
	margin-left: 0.75rem;
	font-weight: 600;
	text-decoration: underline;
}


/* =========================================================================
 * Docs — article body
 * -------------------------------------------------------------------------
 * `the_content()` output, styled from the `.docs-article` scope (not utilities —
 * the theme doesn't touch this markup). UNLAYERED so a plain `.docs-article p`
 * beats theme.json's unlayered `:root :where(p)`. Sizes come from the tokens.
 * ========================================================================= */

.docs-article > *:first-child {
	margin-block-start: 0;
}

.docs-article p {
	margin-block: 0 1.25rem;
	color: var(--wp--preset--color--ink-body);
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.75;
}

/* The opening paragraph is the lede — larger, lighter. Derived from position. */
.docs-article > p:first-of-type {
	color: var(--wp--preset--color--ink-soft);
	font-size: var(--wp--preset--font-size--lede);
	line-height: 1.65;
}

.docs-article h2 {
	margin-block: 2.25rem 1rem;
	font-size: var(--wp--preset--font-size--heading-6);
	font-weight: 800;
	letter-spacing: -0.02em;
	line-height: 1.15;
}

.docs-article h3 {
	margin-block: 1.75rem 0.75rem;
	font-size: var(--wp--preset--font-size--title);
	font-weight: 700;
	letter-spacing: -0.01em;
	line-height: 1.3;
}

.docs-article :where(h2, h3) + * {
	margin-block-start: 0;
}

.docs-article li {
	color: var(--wp--preset--color--ink-body);
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.7;
}

/* Bold lead-ins inside prose ("**One-page checkout.** …") sit at full Ink. */
.docs-article strong {
	color: var(--wp--preset--color--ink);
	font-weight: 700;
}

/* -------------------------------------------------------------------------
 * Code
 * -------------------------------------------------------------------------
 * `core/code` — the design's dark panel. No syntax highlighting (no highlighter
 * in the stack, and one would mean a JS runtime for decoration): one legible
 * foreground on Ink.
 * ------------------------------------------------------------------------- */

.docs-article .wp-block-code {
	margin-block: 0 2.5rem;
	padding: 22px 24px;
	border-radius: var(--radius-well, 14px);
	background-color: var(--wp--preset--color--ink);
	overflow-x: auto;
}

.docs-article .wp-block-code code {
	color: var(--wp--preset--color--code-text);
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--code);
	line-height: 1.7;
	white-space: pre;
	tab-size: 4;
}

/* Inline code — the light chip. Scoped so it can't reach into the dark panel. */
.docs-article :not(pre) > code {
	padding: 2px 7px;
	border: 1px solid var(--wp--preset--color--well-border);
	border-radius: var(--radius-chip, 6px);
	background-color: var(--wp--preset--color--well);
	color: var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--wp--preset--font-size--code);
}

/* -------------------------------------------------------------------------
 * Checklist — the `core/list` block style (inc/integrations/core-blocks.php).
 * The tick is a MASK, not a background-image, so it takes its color from the
 * `success` token instead of baking a hex into the data URI.
 * ------------------------------------------------------------------------- */

.wp-block-list.is-style-checklist {
	padding-inline-start: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.wp-block-list.is-style-checklist > li {
	position: relative;
	padding-inline-start: 1.9375rem; /* icon (19px) + 12px gutter */
}

.wp-block-list.is-style-checklist > li::before {
	content: "";
	position: absolute;
	inset-block-start: 0.4em;
	inset-inline-start: 0;
	width: 19px;
	height: 19px;
	background-color: var(--wp--preset--color--success);
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M20 6 9 17l-5-5' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	mask-repeat: no-repeat;
	mask-size: contain;
}

/* -------------------------------------------------------------------------
 * Callout (`nomon/callout`) — the InnerBlocks paragraph inherits the note's
 * type rather than the article's, so a callout never renders as 18px body copy.
 * ------------------------------------------------------------------------- */

.nomon-callout__body :where(p, li) {
	margin-block: 0;
	color: inherit;
	font-size: inherit;
	line-height: inherit;
}

.nomon-callout__body :where(p) + :where(p) {
	margin-block-start: 0.75rem;
}

.nomon-callout__body strong {
	color: var(--wp--preset--color--blue);
	font-weight: 700;
}

/* Editor-only: an empty callout would otherwise be an invisible drop zone. */
[data-type="nomon/callout"]:not(:has(.wp-block)) .nomon-callout__body::before {
	content: "";
	display: block;
	min-height: 1.5rem;
}

/* =========================================================================
 * Sub-page prose (page.php `.is-prose-page`)
 * -------------------------------------------------------------------------
 * Generic sub-pages (About, Support, License…) reuse the `.docs-article` scale
 * for the softer/larger docs feel. Scoped to `.is-prose-page` (set on <main> in
 * page.php only) so it can't touch landing sections or the Account dashboard;
 * the h1 stays the page title. UNLAYERED and selector-scoped like `.docs-article`
 * — reaches only atoms inside a `.wp-block-group` wrapper plus the orphan case,
 * so custom blocks that own their type are untouched. No lede rule (the lead
 * lives in the header frame).
 * ========================================================================= */

.is-prose-page .wp-block-group :is(p, li),
.is-prose-page > :is(p, li) {
	color: var(--wp--preset--color--ink-body);
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.75;
}

.is-prose-page .wp-block-group h2,
.is-prose-page > h2 {
	font-size: var(--wp--preset--font-size--heading-6);
	letter-spacing: -0.02em;
	line-height: 1.15;
}

.is-prose-page .wp-block-group h3,
.is-prose-page > h3 {
	font-size: var(--wp--preset--font-size--title);
	font-weight: 700;
	letter-spacing: -0.01em;
	line-height: 1.3;
}

/* Bold lead-ins inside prose sit at full Ink, like the docs article. */
.is-prose-page .wp-block-group :is(p, li) strong {
	color: var(--wp--preset--color--ink);
}

/* =========================================================================
 * Search — results pagination
 * -------------------------------------------------------------------------
 * `the_posts_pagination()` prints WP's own `.page-numbers` markup, styled here
 * rather than with utilities. Restrained on purpose (the search screen has no
 * design): reuses the chip tokens rather than inventing a pagination style.
 * ========================================================================= */

.pagination {
	margin-block-start: 2.5rem;
}

.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
}

.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.5rem;
	padding: 0.5rem 0.75rem;
	border-radius: 9999px;
	color: var(--wp--preset--color--ink-soft);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	text-decoration: none;
	transition: background-color 150ms ease, color 150ms ease;
}

.pagination a.page-numbers:hover {
	background-color: var(--wp--preset--color--chip);
	color: var(--wp--preset--color--ink);
}

.pagination .page-numbers.current {
	background-color: var(--wp--preset--color--blue-wash);
	color: var(--wp--preset--color--blue);
}

.pagination .page-numbers:focus-visible {
	outline: 2px solid var(--wp--preset--color--blue);
	outline-offset: 2px;
}

/* =========================================================================
 * Buy card — licence tier select (select2 / selectWoo)
 * -------------------------------------------------------------------------
 * buy-card.js enhances the tier <select> with select2 so the closed control
 * shows only the name while the open list shows name + price. select2 emits its
 * own markup, so it's styled here, not with utilities. Scoped via the
 * `wepista-tier` / `wepista-tier-dropdown` classes (set by container/dropdown
 * CssClass) so Woo's other select2 controls are untouched. Matches the native
 * control it replaces: 12px radius, outline border, bg-card, px-4 py-3.
 * ========================================================================= */

.select2-container--default .select2-selection--single.wepista-tier {
	display: flex;
	align-items: center;
	height: auto;
	padding: 0.75rem 1rem;
	border: 1px solid var(--wp--preset--color--outline);
	border-radius: 12px;
	background-color: var(--wp--preset--color--card);
}

.select2-container--default .select2-selection--single.wepista-tier .select2-selection__rendered {
	padding: 0;
	color: var(--wp--preset--color--ink);
	font-size: var(--wp--preset--font-size--regular);
	line-height: 1.4;
}

.select2-container--default .select2-selection--single.wepista-tier .select2-selection__arrow {
	height: 100%;
	top: 0;
	right: 0.5rem;
}

/* Focus ring — mirror the native `focus-visible:outline-blue` treatment. */
.select2-container--default.select2-container--focus .select2-selection--single.wepista-tier,
.select2-container--default.select2-container--open .select2-selection--single.wepista-tier {
	outline: 2px solid var(--wp--preset--color--blue);
	outline-offset: 2px;
}

/* Open panel. */
.select2-dropdown.wepista-tier-dropdown {
	overflow: hidden;
	margin-top: 6px;
	border: 1px solid var(--wp--preset--color--outline);
	border-radius: 12px;
	background-color: var(--wp--preset--color--card);
	box-shadow: 0 1px 2px rgba( 14, 15, 19, 0.04 ), 0 16px 40px rgba( 14, 15, 19, 0.07 );
}

.select2-dropdown.wepista-tier-dropdown .select2-results__option {
	padding: 0.625rem 1rem;
	color: var(--wp--preset--color--ink);
	font-size: var(--wp--preset--font-size--regular);
}

/* Row: name left, price muted on the right. */
.wepista-tier-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
}

.wepista-tier-row__price {
	color: var(--wp--preset--color--ink-muted);
	font-size: var(--wp--preset--font-size--small);
}

/* Neutralize select2's own grey fill — the closed control already shows the
   current tier, so no "selected option" highlight is needed. */
.select2-dropdown.wepista-tier-dropdown .select2-results__option[aria-selected] {
	background-color: transparent;
}

/* Hover + keyboard highlight — a single soft fill. Declared last so it wins over
   the reset above. */
.select2-dropdown.wepista-tier-dropdown .select2-results__option--highlighted[aria-selected] {
	background-color: var(--wp--preset--color--panel);
	color: var(--wp--preset--color--ink);
}

/* =========================================================================
 * Pricing — Yearly / Lifetime billing toggle
 * -------------------------------------------------------------------------
 * A segmented slider from two native radios (real radiogroup + keyboard), with a
 * thumb sliding under the active label. A `:has()` rule swaps which tier grid
 * shows — no JS. Yearly is `checked` by default. Equal-width inline-grid columns
 * keep the thumb aligned regardless of label length (incl. translations).
 * ========================================================================= */

.wepista-billing-toggle {
	position: relative;
	display: inline-grid;
	grid-template-columns: 1fr 1fr;
	padding: 4px;
	border-radius: 9999px;
	background-color: var(--wp--preset--color--chip);
}

/* Radios drive state but are not drawn; kept in flow & focusable for a11y. */
.wepista-billing-toggle__input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
	pointer-events: none;
}

.wepista-billing-toggle__label {
	position: relative;
	z-index: 1;
	padding: 0.5rem 1.5rem;
	border-radius: 9999px;
	color: var(--wp--preset--color--blue);
	font-size: var(--wp--preset--font-size--regular);
	font-weight: 700;
	text-align: center;
	white-space: nowrap;
	cursor: pointer;
	transition: color 200ms ease;
}

/* The sliding thumb — a solid brand-blue pill behind the active label, half the
   track minus padding. */
.wepista-billing-toggle__thumb {
	position: absolute;
	top: 4px;
	bottom: 4px;
	left: 4px;
	width: calc( 50% - 4px );
	border-radius: 9999px;
	background-color: var(--wp--preset--color--blue);
	box-shadow: 0 2px 8px rgba( 14, 15, 19, 0.18 );
	transition: transform 200ms ease;
}

.wepista-billing-toggle:has( #wepista-bp-lifetime:checked ) .wepista-billing-toggle__thumb {
	transform: translateX( 100% );
}

/* Active label sits on the blue thumb — white; the other stays brand blue. */
.wepista-billing-toggle:has( #wepista-bp-yearly:checked ) .wepista-billing-toggle__label[for="wepista-bp-yearly"],
.wepista-billing-toggle:has( #wepista-bp-lifetime:checked ) .wepista-billing-toggle__label[for="wepista-bp-lifetime"] {
	color: #fff;
}

/* Keyboard focus ring on whichever radio is focused. */
.wepista-billing-toggle__input:focus-visible + .wepista-billing-toggle__label {
	outline: 2px solid var(--wp--preset--color--blue);
	outline-offset: 2px;
}

/* Swap which tier grid shows. Yearly checked by default → lifetime hidden. */
#pricing:has( #wepista-bp-lifetime:checked ) .wepista-tiers--yearly,
#pricing:has( #wepista-bp-yearly:checked ) .wepista-tiers--lifetime {
	display: none;
}

@media ( prefers-reduced-motion: reduce ) {
	.wepista-billing-toggle__thumb,
	.wepista-billing-toggle__label {
		transition: none;
	}
}

/* =========================================================================
 * WS Form — the Support form (/support/)
 * -------------------------------------------------------------------------
 * Layers the site tokens over WS Form's own skin, scoped to `.wsf-form`. The
 * "How can we help?" radio renders as selectable cards using the same native-
 * radio pattern as the pricing toggle above (real radios kept focusable,
 * `:has(:checked)` for state, `input:focus-visible + label` for the ring), so
 * keyboard and screen-reader behaviour is untouched.
 * ========================================================================= */

/* ---- Field rhythm, labels, help text ---- */
.wsf-form .wsf-label {
	display: inline-block;
	margin-bottom: 0.4rem;
	color: var(--wp--preset--color--ink);
	font-weight: 600;
}

.wsf-form .wsf-help {
	margin-top: 0.4rem;
	color: var(--wp--preset--color--ink-muted);
	font-size: var(--wp--preset--font-size--small);
}

/* Vertical rhythm between fields. Gap goes on WS Form's flex containers (which
   ship with none) rather than wrapper margins, so conditionally-hidden fields
   (display:none) leave no phantom gap. */
.wsf-form .wsf-sections,
.wsf-form .wsf-fields {
	gap: 1.5rem;
}

/* ---- Text inputs, textarea, select ---- */
.wsf-form input.wsf-field[type="text"],
.wsf-form input.wsf-field[type="email"],
.wsf-form textarea.wsf-field,
.wsf-form select.wsf-field {
	width: 100%;
	padding: 0.7rem 0.9rem;
	border: 1.5px solid var(--wp--preset--color--outline);
	border-radius: var(--radius-well, 14px);
	background-color: var(--wp--preset--color--card);
	color: var(--wp--preset--color--ink);
	transition: border-color 150ms ease, box-shadow 150ms ease;
}

.wsf-form textarea.wsf-field {
	min-height: 8rem;
	resize: vertical;
}

.wsf-form .wsf-field::placeholder {
	color: var(--wp--preset--color--ink-muted);
}

.wsf-form input.wsf-field:focus,
.wsf-form textarea.wsf-field:focus,
.wsf-form select.wsf-field:focus {
	border-color: var(--wp--preset--color--blue);
	box-shadow: 0 0 0 3px var(--wp--preset--color--blue-wash);
	outline: none;
}

/* Native <select> chevron replacement — mirrors `.wepista-buy select` so every
   custom select carries the same chevron. */
.wsf-form select.wsf-field {
	appearance: none;
	padding-right: 2.5rem;
	/* Decorative chevron. A data: URI keeps it request-free. */
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230E0F13' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.875rem center;
	background-size: 1.125rem;
}

/* ---- "How can we help?" as selectable cards ----
   Theme-owned CSS grid (2-up ≥ 34rem, 1-up on phones); WS Form's own Grid radio
   orientation needs a CSS framework and renders nothing in this frameworkless fork. */
.wsf-form .wsf-field-wrapper[data-type="radio"] [role="radiogroup"] {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.625rem;
}

@media ( max-width: 34rem ) {
	.wsf-form .wsf-field-wrapper[data-type="radio"] [role="radiogroup"] {
		grid-template-columns: 1fr;
	}
}

.wsf-form [data-row-radio] {
	position: relative;
	margin: 0;
}

/* Real radio: kept focusable but not drawn, so native single-select and arrow-key
   nav survive. `!important` overrides WS Form's own visible-circle skin. */
.wsf-form [data-row-radio] input[type="radio"] {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	margin: 0;
	border: 0 !important;
	opacity: 0 !important;
	pointer-events: none;
}

/* The card is the row label. */
.wsf-form [data-row-radio] > label.wsf-label {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	width: 100%;
	margin: 0;
	padding: 0.9rem 1rem;
	border: 1.5px solid var(--wp--preset--color--outline);
	border-radius: var(--radius-well, 14px);
	background-color: var(--wp--preset--color--card);
	color: var(--wp--preset--color--ink-body);
	font-weight: 500;
	cursor: pointer;
	transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

/* The visible radio circle — the label's first flex child. The real <input>
   drives the checked state via `:has()`; this ::before is the dot only. */
.wsf-form [data-row-radio] > label.wsf-label::before {
	content: "";
	flex: 0 0 auto;
	width: 1.15rem;
	height: 1.15rem;
	border: 1.5px solid var(--wp--preset--color--outline);
	border-radius: 50%;
	background-color: #fff;
	transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.wsf-form [data-row-radio]:hover > label.wsf-label {
	border-color: var(--wp--preset--color--blue-soft);
}

/* Selected card — blue border + wash fill; the circle fills in below. */
.wsf-form [data-row-radio]:has( input:checked ) > label.wsf-label {
	border-color: var(--wp--preset--color--blue);
	background-color: var(--wp--preset--color--blue-wash);
	color: var(--wp--preset--color--ink);
	box-shadow: inset 0 0 0 1px var(--wp--preset--color--blue);
}

.wsf-form [data-row-radio]:has( input:checked ) > label.wsf-label::before {
	border-color: var(--wp--preset--color--blue);
	background-color: var(--wp--preset--color--blue);
	box-shadow: inset 0 0 0 3px #fff;
}

/* Keyboard focus ring on the card whose radio is focused. */
.wsf-form [data-row-radio] input[type="radio"]:focus-visible + label.wsf-label {
	outline: 2px solid var(--wp--preset--color--blue);
	outline-offset: 2px;
}

/* ---- Submit button ---- Matches the site's `.nomon-button` (pill, bg-blue →
   hover bg-blue-deep). Plain CSS because WS Form owns the button markup. */
.wsf-form .wsf-button-primary {
	padding: 1rem 1.875rem;
	border: none;
	border-radius: 9999px;
	background-color: var(--wp--preset--color--blue);
	color: #fff;
	font-size: 17px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 150ms ease;
}

.wsf-form .wsf-button-primary:hover {
	background-color: var(--wp--preset--color--blue-deep);
}

.wsf-form .wsf-button-primary:focus-visible {
	outline: 2px solid var(--wp--preset--color--blue);
	outline-offset: 2px;
}

@media ( prefers-reduced-motion: reduce ) {
	.wsf-form .wsf-field,
	.wsf-form [data-row-radio] > label.wsf-label,
	.wsf-form .wsf-button-primary {
		transition: none;
	}
}
