/**
 * Aureon frontend styles.
 *
 * Everything resolves to the runtime --aureon-* custom properties emitted by the
 * dynamic-CSS pipeline (M3), so a token change re-themes the chrome live.
 */

/**
 * Base. A system font stack means zero font requests (the fastest option) — so
 * there is no @font-face and nothing to preload. A web-font pipeline with
 * font-display:swap belongs to the Typography milestone if/when one ships.
 */
body {
	margin: 0;
	font-family: var(--aureon-font-body, system-ui, -apple-system, "Segoe UI", roboto, helvetica, arial, sans-serif);
	font-size: var(--aureon-font-size-body, var(--aureon-font-size-md, 1rem));
	font-weight: var(--aureon-font-weight-body, 400);
	line-height: var(--aureon-font-line-height-body, 1.6);
	letter-spacing: var(--aureon-font-letter-spacing-body, normal);
	color: var(--aureon-color-text);
	background: var(--aureon-color-background);
	text-transform: var(--aureon-font-transform-body, none);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizelegibility;
}

img {
	max-width: 100%;
	height: auto;
}

/* Preformatted text keeps its whitespace, so a long line scrolls inside the
   block instead of running out of the content column. */
pre {
	max-width: 100%;
	overflow-x: auto;
}

/* Typographic scale ------------------------------------------------------- */

h1,
h2,
h3,
h4,
h5,
h6 {
	margin-block: var(--aureon-space-lg) var(--aureon-space-md);
	font-family: var(--aureon-font-heading);
	font-weight: var(--aureon-font-weight-heading, 700);
	line-height: var(--aureon-font-line-height-heading, 1.25);
	letter-spacing: var(--aureon-font-letter-spacing-heading, -0.01em);
	color: var(--aureon-color-heading);
}

.aureon-site,
.aureon-site *,
.aureon-site *::before,
.aureon-site *::after {
	box-sizing: border-box;
}

::selection {
	background: var(--aureon-color-primary);
	color: var(--aureon-color-button-text);
}

h1 {
	font-size: var(--aureon-font-size-h1, var(--aureon-font-size-4xl));
}

h2 {
	font-size: var(--aureon-font-size-h2, var(--aureon-font-size-3xl));
}

h3 {
	font-size: var(--aureon-font-size-h3, var(--aureon-font-size-2xl));
}

h4 {
	font-size: var(--aureon-font-size-h4, var(--aureon-font-size-xl));
}

h5 {
	font-size: var(--aureon-font-size-h5, var(--aureon-font-size-lg));
}

h6 {
	font-size: var(--aureon-font-size-h6, var(--aureon-font-size-md));
}

p {
	margin-block: 0 var(--aureon-space-md);
}

a {
	color: var(--aureon-color-link);
	font-weight: var(--aureon-font-weight-link, 400);
	text-transform: var(--aureon-font-transform-link, none);
	text-decoration: var(--aureon-link-decoration, underline);
	letter-spacing: var(--aureon-link-letter-spacing, normal);
}

a:hover {
	color: var(--aureon-color-link-hover);
	text-decoration: var(--aureon-link-decoration-hover, underline);
}

/**
 * A linked heading (e.g. a post title wrapped in <a>) would otherwise lose
 * its heading weight/transform/letter-spacing: the `a` rule above targets
 * the anchor directly, which wins over what the anchor would have inherited
 * from the surrounding h1–h6. Re-assert inheritance here so heading
 * typography always wins inside a heading, regardless of link styling.
 */
h1 a,
h2 a,
h3 a,
h4 a,
h5 a,
h6 a {
	font-weight: inherit;
	text-transform: inherit;
	letter-spacing: inherit;
}

a:focus-visible,
button:focus-visible,
.aureon-button:focus-visible,
.aureon-header__toggle:focus-visible {
	outline: 2px solid var(--aureon-color-primary);
	outline-offset: 2px;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.screen-reader-text:focus,
.aureon-skip-link:focus {
	position: fixed;
	top: 8px;
	left: 8px;
	z-index: 100000;
	width: auto;
	height: auto;
	padding: 8px 16px;
	clip: auto;
	background: var(--aureon-color-background);
	color: var(--aureon-color-link);
}

/* The theme's layout container. The Aureon Blocks `aureon/section` block once
   shared this class and leaked CSS in both directions; it now renders as
   `.aureon-section` (with its own scoped width/padding), so this rule is free to
   target the theme wrapper alone again. */
.aureon-container {
	width: 100%;
	max-width: var(--aureon-content-width, 1200px);
	margin-inline: auto;
	padding-inline: var(--aureon-container-padding, var(--aureon-space-md));
}

/* Container types (body-class driven). */
.aureon-container-full .aureon-container {
	padding-inline: 0;
}

/* Full-width bleed: an `align:full` block inside the (boxed) content column
   spans the whole viewport, even though the column is capped. `overflow-x: clip`
   on the site wrapper absorbs the 100vw so it never adds a horizontal scrollbar
   (clip, unlike hidden, keeps position:sticky working). */
.aureon-site {
	overflow-x: clip;
}

/* Customizer header image, printed under the header. */
.aureon-header-image img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 1;
	max-height: 30rem;
	object-fit: cover;
}

.aureon-entry__content > .alignfull,
.aureon-entry > .alignfull {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
}

/* Content style is body-class driven: "Boxed" wraps the main column in a
   surface card (chrome shared with the boxed sidebar, below); "Unboxed" strips
   the per-entry card chrome AND the surrounding padding for flush, full-bleed
   content (a full-width first section should meet the header with no gap). */
.aureon-content-unboxed .aureon-entry,
.aureon-content-unboxed .aureon-entry:hover {
	padding: 0;
	border: 0;
	box-shadow: none;
	transform: none;
}

/* The hover lift is for cards in a post list. On a single post or page the
   entry is the whole page, so hovering it must not lift or shadow it. */
.aureon-singular .aureon-entry:hover {
	border-color: var(--aureon-color-border);
	box-shadow: none;
	transform: none;
}

.aureon-content-unboxed .aureon-main {
	padding-block: 0;
}

// Unboxed content runs edge to edge, usually ending in a full-width band, so
// the footer meets it directly rather than leaving a strip of background.
.aureon-content-unboxed .aureon-footer {
	margin-top: 0;
}

/* Zone rows (shared by the header + footer builders) ----------------------- */

// The Zone_Builder engine emits identical row/inner/column markup for both
// zones; these placeholders emit each shared declaration block once, as a
// grouped `.aureon-header__*, .aureon-footer__*` selector.
%zone-inner {
	display: flex;
	align-items: center;
	gap: var(--aureon-space-md);
}

%zone-inner-va-top {
	align-items: flex-start;
}

%zone-inner-va-center {
	align-items: center;
}

%zone-inner-va-bottom {
	align-items: flex-end;
}

// Full-width rows drop the .aureon-container max-width; keep edge gutters.
%zone-inner-full {
	max-width: none;
	width: 100%;
	padding-inline: var(--aureon-space-lg);
}

%zone-col {
	display: flex;
	align-items: center;
	gap: var(--aureon-space-md);
	flex: 1 1 0;
	min-width: 0;

	&.is-left {
		justify-content: flex-start;
	}

	&.is-center {
		justify-content: center;
	}

	&.is-right {
		justify-content: flex-end;
	}

	// Stacked: elements run top to bottom (a logo above a blurb), so the
	// alignment moves to the cross axis.
	&.is-stacked {
		flex-direction: column;
		justify-content: flex-start;
		gap: var(--aureon-space-sm);

		&.is-left {
			align-items: flex-start;
		}

		&.is-center {
			align-items: center;
			text-align: center;
		}

		&.is-right {
			align-items: flex-end;
			text-align: right;
		}
	}
}

/* Header ------------------------------------------------------------------ */

.aureon-header {
	background: var(--aureon-color-background);
	border-bottom: 1px solid var(--aureon-color-border);

	// Consecutive sticky rows are grouped into one `.aureon-header__sticky` unit.
	// It carries its own surface so it reads as solid, but the actual pinning is
	// done at the header level (see `&.is-sticky`) — a `position: sticky` element
	// is trapped inside its parent's box, and this wrapper's ancestors are only
	// as tall as the header itself, so it could never travel down the page.
	&__sticky {
		background: var(--aureon-color-background);

		// Shrink-on-scroll: compact the inner rows once scrolled past the top.
		&.is-scrolled .aureon-header__inner {
			min-height: 48px;
			transition: min-height 0.2s ease;
		}
	}

	// When any row is sticky, the whole header pins. Its tall `.aureon-site`
	// parent gives it the full page to travel, which the short inner wrappers
	// could not.
	&.is-sticky {
		position: sticky;
		top: 0;
		z-index: 100;
		transition: transform 0.25s ease, box-shadow 0.2s ease;

		// Shrink adds a lifted shadow; reveal hides the header on scroll-down.
		// Both are driven by the classes the sticky JS toggles on the inner unit.
		&:has(.aureon-header__sticky.is-scrolled) {
			box-shadow: var(--aureon-shadow-sm);
		}

		&:has(.aureon-header__sticky.is-hidden) {
			transform: translateY(-100%);
		}

		// The admin bar is fixed at the same viewport edge with a higher
		// z-index, so a sticky header pinned to `top: 0` scrolls under it.
		// Offset by its height (WP core's own responsive breakpoint) so the
		// header stays fully visible for logged-in users.
		.admin-bar & {
			top: 32px;

			@media (max-width: 782px) {
				top: 46px;
			}
		}
	}

	// Transparent (overlay) mode: any see-through row floats the whole header
	// over the page. The header surface goes transparent, and rows that aren't
	// flagged transparent get the surface back so only the chosen rows show
	// through. Declared after `&.is-sticky` so a sticky+transparent header still
	// pins (sticky wins the positioning) while keeping its see-through surface.
	&.is-transparent {
		position: absolute;
		inset-inline: 0;
		background: transparent;
		border-bottom-color: transparent;

		.aureon-header__row:not(.is-transparent-row) {
			background: var(--aureon-color-background);
		}

		.aureon-header__sticky {
			background: transparent;
		}
	}

	// A header that is both sticky and transparent keeps pinning — sticky
	// positioning takes precedence over the overlay's `position: absolute`.
	&.is-sticky.is-transparent {
		position: sticky;
	}

	&__row.is-transparent-row {
		background: transparent;
		border-bottom-color: transparent;
	}

	// Positioning context for the inline search bar, which spans the whole row.
	&__row {
		position: relative;
	}

	&__row--row-top {
		border-bottom: 1px solid var(--aureon-color-border);
		font-size: var(--aureon-font-size-sm);

		.aureon-header__inner {
			min-height: 36px;
		}
	}

	&__inner {

		@extend %zone-inner;

		min-height: 88px;
		transition: min-height 0.2s ease;

		&--va-top {

			@extend %zone-inner-va-top;
		}

		&--va-center {

			@extend %zone-inner-va-center;
		}

		&--va-bottom {

			@extend %zone-inner-va-bottom;
		}

		&--full {

			@extend %zone-inner-full;
		}
	}

	&__col {

		@extend %zone-col;
	}

	// A placed Toggle element lives inside a breakpoint-gated device wrapper
	// (.is-vis-tablet / .is-vis-mobile), so it shows wherever its layout shows.
	// The auto collapse toggle (--auto, on the desktop fallback) is gated to
	// small screens on its own.
	&__toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		padding: 0;
		border: 0;
		background: transparent;
		cursor: pointer;

		&--auto {
			display: none;
		}
	}

	// The toggle carries two icons — the "open" (hamburger) icon and the "close"
	// (×) icon. Only one shows at a time; the swap is driven by the
	// `.aureon-offcanvas-open` body class (see the Off-canvas block below), so
	// every toggle on the page flips in sync with the drawer.
	&__toggle-icon,
	&__toggle-close {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		color: var(--aureon-color-text);

		svg {
			display: block;
			width: 24px;
			height: 24px;
		}
	}

	&__toggle-close {
		display: none;
	}
}

.aureon-logo-wrap {
	display: inline-flex;
	align-items: center;
	gap: var(--aureon-space-xs);

	img {
		max-width: 100%;
		height: auto;
	}
}

// A logo with a dark-mode version carries both images; show the one that
// matches the scheme. The system-preference rule only applies where the logo
// says dark mode can follow the system (see Elements::render_logo()).
.aureon-logo__img--dark {
	display: none;
}

:root[data-theme="dark"] {

	.aureon-logo__img--light {
		display: none;
	}

	.aureon-logo__img--dark {
		display: inline;
	}
}

@media (prefers-color-scheme: dark) {

	:root:not([data-theme="light"]) .aureon-logo-wrap--auto-dark {

		.aureon-logo__img--light {
			display: none;
		}

		.aureon-logo__img--dark {
			display: inline;
		}
	}
}

.aureon-logo {
	font-size: var(--aureon-font-size-lg);
	font-weight: 700;
	letter-spacing: -0.01em;
	color: var(--aureon-color-heading);
	text-decoration: none;
}

.aureon-logo__tagline {
	font-size: var(--aureon-font-size-sm);
	color: var(--aureon-color-text);
	opacity: 0.7;
}

.aureon-menu {
	display: flex;
	gap: var(--aureon-space-md);
	margin: 0;
	padding: 0;
	list-style: none;
	font-weight: 500;

	/*
	 * wp_page_menu()'s fallback (no "primary" menu assigned in Appearance >
	 * Menus) puts menu_class on the <nav> itself, leaving a bare <ul> inside —
	 * unlike a real menu, where menu_class lands directly on the <ul>. Reset
	 * both shapes so the fallback isn't a bulleted, unstyled list.
	 */
	> ul {
		display: flex;
		gap: inherit;
		margin: 0;
		padding: 0;
		list-style: none;
	}

	a {
		position: relative;
		display: inline-block;
		padding-block: 0.25em;
		color: var(--aureon-menu-link, var(--aureon-color-text));
		text-decoration: none;
		transition: color 0.15s ease, background-color 0.15s ease;
	}

	a:hover {
		color: var(--aureon-menu-link-hover, var(--aureon-color-link));
	}

	/* Current (active) item takes the accent colour. */
	> li.current-menu-item > a,
	> li.current-menu-ancestor > a,
	> ul > li.current-menu-item > a,
	> ul > li.current-menu-ancestor > a {
		color: var(--aureon-menu-link-hover, var(--aureon-color-link));
	}

	/*
	 * A read-only item (Link type → "Read-only label") keeps its anchor element so
	 * the submenu still reveals on hover/click, but has no href — so it must not
	 * read as clickable. The hover colour is still allowed on a parent, whose
	 * anchor remains the panel's toggle.
	 */
	a.aureon-menu-readonly {
		cursor: default;
	}

	a.aureon-menu-readonly:not([role="button"]):hover {
		color: var(--aureon-menu-link, var(--aureon-color-text));
	}
}

/* Roomier spacing for the desktop header nav (off-canvas keeps the base gap).
   Elements sharing a header column use the same step, so a menu followed by
   the account or cart link reads as one evenly spaced row. */
.aureon-header__row .aureon-menu,
.aureon-header__row .aureon-header__col {
	gap: 1.75rem;
}

/*
 * Primary Menu element wrapper. Carries the per-element color custom
 * properties (set inline by Elements::render_primary_menu) and the hover /
 * submenu animation modifiers. The base .aureon-menu above stays layout-only;
 * the visible hover treatment is opt-in per modifier so "None" is truly none.
 */
.aureon-menu-el {

	/* Underline-on-hover (theme default). */
	&--hover-underline .aureon-menu > li > a,
	&--hover-underline .aureon-menu > ul > li > a {

		&::after {
			content: "";
			position: absolute;
			left: 0;
			right: 100%;
			bottom: 0;
			height: 2px;
			background: var(--aureon-menu-link-hover, var(--aureon-color-primary));
			transition: right 0.2s ease;
		}
	}

	&--hover-underline .aureon-menu > li > a:hover::after,
	&--hover-underline .aureon-menu > ul > li > a:hover::after,
	&--hover-underline .aureon-menu > li.current-menu-item > a::after,
	&--hover-underline .aureon-menu > li.current-menu-ancestor > a::after,
	&--hover-underline .aureon-menu > ul > li.current-menu-item > a::after,
	&--hover-underline .aureon-menu > ul > li.current-menu-ancestor > a::after {
		right: 0;
	}

	/* Highlight pill on hover. */
	&--hover-highlight .aureon-menu > li > a,
	&--hover-highlight .aureon-menu > ul > li > a {
		padding-inline: 0.6em;
		border-radius: var(--aureon-radius-sm);
	}

	&--hover-highlight .aureon-menu > li > a:hover,
	&--hover-highlight .aureon-menu > ul > li > a:hover {
		background: color-mix(in srgb, var(--aureon-menu-link-hover, var(--aureon-color-primary)) 12%, transparent);
	}

	/* Submenu flyout animation presets. */
	&--sub-none .aureon-nav .sub-menu,
	&--sub-none .aureon-nav .children {
		transition: none;
	}

	/* Slide keeps the horizontal centering offset (--aureon-sub-tx) intact. */
	&--sub-slide .aureon-nav .sub-menu,
	&--sub-slide .aureon-nav .children {
		transform: translate(var(--aureon-sub-tx, 0), 6px);
	}
}

/* Dropdown submenus (header context only — off-canvas overrides below). */
.aureon-header .aureon-nav {

	.menu-item-has-children,
	.page_item_has_children {
		position: relative;
	}

	/* Top-level labels never wrap. `.aureon-header__col` shrinks below its
	   content width on purpose (min-width: 0, so the row can tighten up
	   before anything breaks); without this, that squeeze lands on menu item
	   text and a multi-word title stacks itself across several lines instead
	   of the row just running tight or overflowing. Scoped to the header's
	   own `.aureon-menu` — the off-canvas drawer is a narrow column where
	   wrapping a long label is the better trade-off, so it keeps the default. */
	.aureon-menu > li > a,
	.aureon-menu > ul > li > a {
		white-space: nowrap;
	}

	/* Keep the label and its chevron on one row (top-level triggers only). */
	.aureon-menu > li.menu-item-has-children > a,
	.aureon-menu > li.page_item_has_children > a {
		display: inline-flex;
		align-items: center;
	}

	/* Chevron indicator on parent items (injected by append_menu_caret). */
	.aureon-menu__caret {
		width: 0.9em;
		height: 0.9em;
		margin-left: 0.15em;
		flex-shrink: 0;
		vertical-align: -0.12em;
		transition: transform 0.2s ease;
	}

	/*
	 * Nested items (depth > 0) open their submenu to the *side*, not below —
	 * the down-chevron that flips to "up" on the top level would misleadingly
	 * suggest a downward reveal here, so point it right instead. It stays
	 * pointing right in the open state too (see the --sub overrides below):
	 * unlike the top-level flip, there's no "up" that would make sense for a
	 * sideways flyout.
	 */
	.aureon-menu__caret--sub {
		transform: rotate(-90deg);
	}

	.sub-menu,
	.children {

		/* First-level flyouts center under their trigger; nested ones reset
		   this to 0 and open to the side instead. */
		--aureon-sub-tx: -50%;

		position: absolute;
		top: 100%;
		left: 50%;
		z-index: 100;
		min-width: var(--aureon-submenu-width, 14rem);
		margin: var(--aureon-space-sm) 0 0;
		padding: var(--aureon-space-xs) 0;
		transform: translateX(var(--aureon-sub-tx, 0));
		list-style: none;
		background: var(--aureon-submenu-bg, var(--aureon-color-background));
		border: 1px solid color-mix(in srgb, var(--aureon-color-border) 60%, transparent);

		/* Configurable via the Submenu corner radius control; moderate default. */
		border-radius: var(--aureon-submenu-radius, var(--aureon-radius-md));
		box-shadow: 0 16px 40px -8px rgba(15, 23, 42, 0.18);
		opacity: 0;
		visibility: hidden;
		transition:
			opacity 0.18s ease,
			transform 0.18s ease,
			visibility 0.18s ease;

		li {
			display: block;
		}

		a {
			display: flex;
			align-items: center;
			justify-content: space-between;
			gap: var(--aureon-space-sm);
			padding: 0.5em 1.25rem;
			color: var(--aureon-submenu-text, var(--aureon-color-text));
			font-size: var(--aureon-submenu-font-size, 0.9375rem);
			font-weight: 600;
			white-space: nowrap;
			transition: color 0.15s ease;
		}

		a:hover,
		a:focus-visible {
			color: var(--aureon-menu-link-hover, var(--aureon-color-link));
			background: var(--aureon-submenu-hover-bg, color-mix(in srgb, var(--aureon-submenu-text, var(--aureon-color-text)) 6%, transparent));
		}

		a::after {
			display: none;
		}

		/* Transparent bridge so the cursor can cross the gap without
		   dropping :hover and closing the flyout. */
		&::before {
			content: "";
			position: absolute;
			bottom: 100%;
			left: 0;
			width: 100%;
			height: var(--aureon-space-sm);
		}

		/* Nested submenus open to the side (no horizontal centering). */
		.sub-menu,
		.children {
			--aureon-sub-tx: 0;

			top: 0;
			left: 100%;
			margin: 0 0 0 var(--aureon-space-sm);

			/* Bridge sits on the left edge for side-opening flyouts. */
			&::before {
				top: 0;
				bottom: auto;
				left: auto;
				right: 100%;
				width: var(--aureon-space-sm);
				height: 100%;
			}

			/*
			 * Edge flip: submenu-flip.js adds this to a side flyout that would
			 * spill past the right viewport edge (deep cascades), so it opens to
			 * the left of its parent instead. The bridge moves to the flyout's
			 * right edge to match.
			 */
			&.aureon-flyout--left {
				left: auto;
				right: 100%;
				margin: 0 var(--aureon-space-sm) 0 0;

				&::before {
					left: 100%;
					right: auto;
				}
			}
		}
	}

}

/*
 * Open / active state for header dropdowns. A parent is "active" on hover or
 * keyboard focus for hover-triggered menus, or when JS adds `.is-open` for
 * click-triggered menus (submenu_trigger setting). Both resolve to the same
 * reveal, caret flip, highlighted trigger, and persistent underline.
 */

/* Hover-triggered menus (default). */
.aureon-header .aureon-menu-el--trigger-hover .aureon-nav {

	li:hover > .sub-menu,
	li:hover > .children,
	li:focus-within > .sub-menu,
	li:focus-within > .children {
		opacity: 1;
		visibility: visible;
		transform: translateX(var(--aureon-sub-tx, 0));
	}

	.menu-item-has-children:hover > a .aureon-menu__caret,
	.menu-item-has-children:focus-within > a .aureon-menu__caret,
	.page_item_has_children:hover > a .aureon-menu__caret,
	.page_item_has_children:focus-within > a .aureon-menu__caret {
		transform: rotate(180deg);
	}

	/* A --sub caret already points right at rest (see the base rule above) —
	   its submenu opens sideways, not below, so it has no "up" to flip to. */
	.menu-item-has-children:hover > a .aureon-menu__caret--sub,
	.menu-item-has-children:focus-within > a .aureon-menu__caret--sub,
	.page_item_has_children:hover > a .aureon-menu__caret--sub,
	.page_item_has_children:focus-within > a .aureon-menu__caret--sub {
		transform: rotate(-90deg);
	}

	.menu-item-has-children:hover > a,
	.menu-item-has-children:focus-within > a,
	.page_item_has_children:hover > a,
	.page_item_has_children:focus-within > a {
		color: var(--aureon-menu-link-hover, var(--aureon-color-link));
	}
}

.aureon-menu-el--trigger-hover.aureon-menu-el--hover-underline .aureon-menu {

	> li.menu-item-has-children:hover > a::after,
	> li.menu-item-has-children:focus-within > a::after,
	> ul > li.menu-item-has-children:hover > a::after,
	> ul > li.menu-item-has-children:focus-within > a::after {
		right: 0;
	}
}

/* Click-triggered menus — JS toggles `.is-open` on the parent <li>. */
/* stylelint-disable-next-line no-duplicate-selectors -- intentional feature-grouped block */
.aureon-header .aureon-nav {

	li.is-open > .sub-menu,
	li.is-open > .children {
		opacity: 1;
		visibility: visible;
		transform: translateX(var(--aureon-sub-tx, 0));
	}

	.menu-item-has-children.is-open > a .aureon-menu__caret,
	.page_item_has_children.is-open > a .aureon-menu__caret {
		transform: rotate(180deg);
	}

	.menu-item-has-children.is-open > a .aureon-menu__caret--sub,
	.page_item_has_children.is-open > a .aureon-menu__caret--sub {
		transform: rotate(-90deg);
	}

	.menu-item-has-children.is-open > a,
	.page_item_has_children.is-open > a {
		color: var(--aureon-menu-link-hover, var(--aureon-color-link));
	}
}

.aureon-menu-el--hover-underline .aureon-menu {

	> li.menu-item-has-children.is-open > a::after,
	> ul > li.menu-item-has-children.is-open > a::after {
		right: 0;
	}
}

/* ============================================================================
 * Drill-down & Columns submenu panels (the submenu_style setting).
 *
 * Both are built client-side by submenu-panels.js from the *same* nav markup
 * the Regular cascade uses, so they progressively enhance: with JS off, the
 * native flyouts still render. The wrapper only gets `.is-panelized` once the
 * script has built the panel, and the native `.sub-menu` / `.children` lists
 * are hidden only then — never leaving a menu with no submenus at all.
 * ==========================================================================*/
.aureon-menu-el--style-drilldown.is-panelized .aureon-nav .sub-menu,
.aureon-menu-el--style-drilldown.is-panelized .aureon-nav .children,
.aureon-menu-el--style-columns.is-panelized .aureon-nav .sub-menu,
.aureon-menu-el--style-columns.is-panelized .aureon-nav .children {
	display: none;
}

/* The panel mounts inside its trigger <li> (already position: relative). */
.aureon-submenu-panel {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 100;
	margin-top: var(--aureon-space-sm);
	opacity: 0;
	visibility: hidden;
	transform: translateY(4px);
	transition:
		opacity 0.18s ease,
		transform 0.18s ease,
		visibility 0.18s ease;
}

.aureon-panel-open > .aureon-submenu-panel {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {

	.aureon-submenu-panel {
		transition: none;
	}
}

/* Shared card chrome (honours the submenu colour / radius custom props). */
.aureon-panel,
.aureon-cols {
	background: var(--aureon-submenu-bg, var(--aureon-color-background));
	border: 1px solid color-mix(in srgb, var(--aureon-color-border) 60%, transparent);
	border-radius: var(--aureon-submenu-radius, var(--aureon-radius-md));
	box-shadow: 0 16px 40px -8px rgba(15, 23, 42, 0.18);
	overflow: hidden;
}

/* ---- Shared row: a "level" (opens deeper) vs a terminal "option". ---- */
.aureon-list {
	list-style: none;
	margin: 0;
	padding: 0.35rem;
}

/* Scoped to the panel so the grid layout beats `.aureon-menu-el a`
   (display: inline-block), which otherwise stacks the icon over the label. */
.aureon-submenu-panel .aureon-row__item {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	width: 100%;
	padding: 0.5rem 0.6rem;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--aureon-submenu-text, var(--aureon-color-text));
	font: inherit;
	font-size: var(--aureon-submenu-font-size, 0.9375rem);
	text-align: left;
	text-decoration: none;
	cursor: pointer;
}

.aureon-submenu-panel .aureon-row__item:hover,
.aureon-submenu-panel .aureon-row__item:focus-visible {
	background: var(--aureon-submenu-hover-bg, color-mix(in srgb, var(--aureon-submenu-text, var(--aureon-color-text)) 6%, transparent));
	color: var(--aureon-submenu-text, var(--aureon-color-text));
}

.aureon-row__ico {
	display: grid;
	place-items: center;
	width: 1.4rem;
	height: 1.4rem;
	border-radius: 6px;
}

.aureon-row__lbl {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.aureon-row__meta {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
}

/* Parent → drills deeper: accent tile, child count, forward chevron. */
.aureon-row--parent .aureon-row__ico {
	background: color-mix(in srgb, var(--aureon-color-primary) 12%, transparent);
	color: var(--aureon-menu-link-hover, var(--aureon-color-link));
}

.aureon-row--parent .aureon-row__ico svg {
	width: 0.9rem;
	height: 0.9rem;
}

.aureon-row--parent .aureon-row__lbl {
	font-weight: 650;
}

.aureon-row--parent .aureon-row__count {
	font-size: 0.72em;
	font-weight: 700;
	color: var(--aureon-color-text);
	opacity: 0.6;
	background: color-mix(in srgb, var(--aureon-color-border) 40%, transparent);
	border-radius: 999px;
	padding: 0.02rem 0.4rem;
}

.aureon-row--parent .aureon-row__go {
	width: 0.85rem;
	height: 0.85rem;
	opacity: 0.55;
}

.aureon-row--parent .aureon-row__item:hover .aureon-row__lbl,
.aureon-row--parent .aureon-row__item:hover .aureon-row__go {
	color: var(--aureon-menu-link-hover, var(--aureon-color-link));
	opacity: 1;
}

/* Leaf → a real destination: no icon (the empty cell keeps labels aligned with
   the parents' folder tiles), lighter weight so it reads as a menu item, not a
   bullet in a list. */
.aureon-row--leaf .aureon-row__lbl {
	font-weight: 500;
	opacity: 0.85;
}

.aureon-row--leaf .aureon-row__item:hover .aureon-row__lbl {
	opacity: 1;
}

/* ---- A) Drill-down ---- */
.aureon-panel {
	width: var(--aureon-submenu-width, 18.5rem);
}

.aureon-panel__head {
	padding: 0.6rem 0.6rem 0.55rem;
	border-bottom: 1px solid color-mix(in srgb, var(--aureon-color-border) 60%, transparent);
	background: color-mix(in srgb, var(--aureon-color-border) 18%, transparent);
}

.aureon-panel__top {
	display: flex;
	align-items: center;
	gap: 0.4rem;
}

.aureon-panel__back {
	display: inline-grid;
	place-items: center;
	width: 1.7rem;
	height: 1.7rem;
	flex: 0 0 auto;
	border: 1px solid color-mix(in srgb, var(--aureon-color-border) 70%, transparent);
	border-radius: 7px;
	background: var(--aureon-color-background);
	color: var(--aureon-color-text);
	cursor: pointer;
	transition:
		color 0.15s ease,
		border-color 0.15s ease;
}

.aureon-panel__back:hover {
	color: var(--aureon-menu-link-hover, var(--aureon-color-link));
	border-color: var(--aureon-menu-link-hover, var(--aureon-color-primary));
}

.aureon-panel__back[disabled] {
	opacity: 0.4;
	cursor: default;
}

.aureon-panel__title {
	flex: 1;
	min-width: 0;
	font-weight: 700;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.aureon-panel__pill {
	flex: 0 0 auto;
	font-size: 0.68em;
	font-weight: 700;
	color: var(--aureon-menu-link-hover, var(--aureon-color-link));
	background: color-mix(in srgb, var(--aureon-color-primary) 12%, transparent);
	border-radius: 999px;
	padding: 0.12rem 0.45rem;
}

.aureon-panel__trail {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.15rem;
	margin-top: 0.45rem;
	font-size: 0.8em;
}

.aureon-panel__crumb {
	max-width: 8rem;
	padding: 0.05rem 0.2rem;
	border: 0;
	border-radius: 4px;
	background: transparent;
	color: var(--aureon-color-text);
	opacity: 0.6;
	font: inherit;
	font-size: inherit;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	cursor: pointer;
}

.aureon-panel__crumb:hover {
	opacity: 1;
	color: var(--aureon-menu-link-hover, var(--aureon-color-link));
}

.aureon-panel__crumb[aria-current="true"] {
	opacity: 1;
	font-weight: 700;
	cursor: default;
}

.aureon-panel__sep {
	opacity: 0.4;
}

.aureon-panel__view {
	overflow: hidden;

	/* Height is set per active level by submenu-panels.js so the panel hugs the
	   current list instead of the tallest one — no dead space on short levels. */
	transition: height 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.aureon-panel__track {
	display: flex;

	/* Each page keeps its own height; without this, flex stretches every page to
	   the tallest, which is what the active view would then measure. */
	align-items: flex-start;
	transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.aureon-panel__page {
	flex: 0 0 100%;
	max-height: 60vh;
	overflow-y: auto;
	overscroll-behavior: contain;
}

@media (prefers-reduced-motion: reduce) {

	.aureon-panel__track {
		transition: none;
	}
}

/* ---- B) Columns (Miller) ---- */
.aureon-cols {
	display: flex;

	/* Columns size to their own content — no stretching a short column to match
	   a taller neighbour. */
	align-items: flex-start;
	max-width: min(90vw, 44rem);
	overflow-x: auto;
	overflow-y: hidden;
	scroll-behavior: smooth;
}

.aureon-col {
	flex: 0 0 var(--aureon-submenu-width, 14rem);
	max-height: 22rem;
	overflow-y: auto;
	border-right: 1px solid color-mix(in srgb, var(--aureon-color-border) 60%, transparent);
}

.aureon-col:last-child {
	border-right: 0;
}

.aureon-col__cap {
	position: sticky;
	top: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	padding: 0.5rem 0.7rem;
	border-bottom: 1px solid color-mix(in srgb, var(--aureon-color-border) 60%, transparent);
	background: color-mix(in srgb, var(--aureon-color-border) 18%, transparent);
}

.aureon-col__name {
	font-weight: 700;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.aureon-col__lv {
	flex: 0 0 auto;
	font-size: 0.66em;
	font-weight: 700;
	color: var(--aureon-menu-link-hover, var(--aureon-color-link));
	background: color-mix(in srgb, var(--aureon-color-primary) 12%, transparent);
	border-radius: 999px;
	padding: 0.05rem 0.4rem;
}

.aureon-col .aureon-row.is-active > .aureon-row__item {
	background: color-mix(in srgb, var(--aureon-color-primary) 10%, transparent);
	box-shadow: inset 3px 0 0 var(--aureon-menu-link-hover, var(--aureon-color-primary));
}

.aureon-col .aureon-row.is-active .aureon-row__lbl {
	color: var(--aureon-menu-link-hover, var(--aureon-color-link));
}

.aureon-social {
	display: flex;
	align-items: center;
	gap: var(--aureon-social-gap, var(--aureon-space-sm));
	margin: 0;
	padding: 0;
	list-style: none;

	&__item a {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		color: var(--aureon-social-color, var(--aureon-color-text));
		font-size: var(--aureon-font-size-sm);
		text-decoration: none;
		text-transform: capitalize;
		transition:
			background-color 0.15s ease,
			color 0.15s ease,
			opacity 0.15s ease;
	}

	// On hover the icon adopts its network brand colour (falling back to its
	// resting colour when no brand hex is known, e.g. custom colour style).
	&__item a:hover {
		opacity: 1;
		color: var(--aureon-social-brand, var(--aureon-social-color, var(--aureon-color-text)));
	}

	svg {
		display: block;
		width: var(--aureon-social-size, 25px);
		height: var(--aureon-social-size, 25px);
	}

	/* Shapes wrap the icon in a tinted chip. */
	&--shape-rounded &__item a,
	&--shape-square &__item a,
	&--shape-circle &__item a {
		padding: 0.5em;
		background: color-mix(in srgb, var(--aureon-social-color, var(--aureon-color-text)) 10%, transparent);
	}

	&--shape-rounded &__item a {
		border-radius: var(--aureon-radius-sm);
	}

	&--shape-square &__item a {
		border-radius: 0;
	}

	&--shape-circle &__item a {
		border-radius: 50%;
	}

	&--shape-rounded &__item a:hover,
	&--shape-square &__item a:hover,
	&--shape-circle &__item a:hover {
		opacity: 1;
		background: color-mix(in srgb, var(--aureon-social-brand, var(--aureon-social-color, var(--aureon-color-text))) 18%, transparent);
	}
}

.aureon-divider {
	display: inline-block;
	width: 1px;
	height: 1.5em;
	background: var(--aureon-color-border);

	&--horizontal {
		display: block;
		width: 100%;
		height: 1px;
	}
}

.aureon-spacer {
	display: block;
	width: 100%;
}

.aureon-copyright {
	color: var(--aureon-color-text-muted, var(--aureon-color-text));
	font-size: var(--aureon-font-size-sm);
}

.aureon-back-to-top {
	display: inline-flex;
	align-items: center;
	gap: var(--aureon-space-xs);
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	cursor: pointer;

	&:hover {
		color: var(--aureon-color-link);
	}
}

.aureon-link-list__title {
	margin-block: 0 var(--aureon-space-sm);
	font-size: var(--aureon-font-size-md);
}

// The menu markup differs by source: an assigned menu puts this class on the
// `<ul>`, while the page-list fallback (wp_page_menu) puts it on the wrapping
// `<nav>` and leaves the inner `<ul>` unclassed. Style both shapes so either
// lays out identically — no stray bullets, same flex flow.
.aureon-link-list__menu,
.aureon-link-list__menu ul {
	display: flex;
	flex-direction: column;
	gap: var(--aureon-space-xs);
	margin: 0;
	padding: 0;
	list-style: none;
}

.aureon-link-list--horizontal .aureon-link-list__menu,
.aureon-link-list--horizontal .aureon-link-list__menu ul {
	flex-direction: row;
	flex-wrap: wrap;
	gap: var(--aureon-space-md);
}

// Centered columns (e.g. the "Simple centered" footer) center the row of links
// so wrapped lines stay centered instead of going flush-left.
.is-center .aureon-link-list--horizontal .aureon-link-list__menu,
.is-center .aureon-link-list--horizontal .aureon-link-list__menu ul {
	justify-content: center;
}

.aureon-footer-widgets {
	width: 100%;

	.widget-title {
		margin-block: 0 var(--aureon-space-sm);
		font-size: var(--aureon-font-size-md);
	}
}

.aureon-newsletter {
	width: 100%;

	&__title {
		margin-bottom: var(--aureon-space-xs);
		font-weight: var(--aureon-font-weight-heading, 700);
	}

	&__text {
		margin-bottom: var(--aureon-space-sm);
		font-size: var(--aureon-font-size-sm);
	}

	&__form {
		display: flex;
		flex-wrap: wrap;
		gap: var(--aureon-space-xs);
	}

	&__input {
		flex: 1 1 12rem;
		min-width: 0;
		padding: var(--aureon-space-xs) var(--aureon-space-sm);
		border: 1px solid var(--aureon-color-border);
		border-radius: var(--aureon-radius-md, 8px);
		background: var(--aureon-color-background);
		color: var(--aureon-color-text);
	}

	&__submit {
		padding: var(--aureon-space-xs) var(--aureon-space-md);
		border: 0;
		border-radius: var(--aureon-radius-md, 8px);
		background: var(--aureon-color-primary);
		color: var(--aureon-color-button-text, #fff);
		cursor: pointer;
	}
}

.aureon-image__img {
	display: block;
	height: auto;
}

.aureon-payment {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--aureon-pay-gap, 8px);
	margin: 0;
	padding: 0;
	list-style: none;
}

.aureon-payment__svg {
	display: block;
	width: auto;
	height: var(--aureon-pay-h, 32px);
}

.aureon-language-switcher ul {
	display: flex;
	flex-wrap: wrap;
	gap: var(--aureon-space-sm);
	margin: 0;
	padding: 0;
	list-style: none;
}

.aureon-account {
	display: inline-flex;
	align-items: center;
	gap: var(--aureon-space-xs);
	color: var(--aureon-color-text);
	font-size: var(--aureon-font-size-sm);
	text-decoration: none;

	/* Same as the top-level menu labels: a squeezed header column shouldn't
	   stack "Log In" across two lines. */
	white-space: nowrap;

	img {
		border-radius: 50%;
	}
}

.aureon-account:hover {
	color: var(--aureon-color-link);
}

/* In the header these links sit in the same row as the menu, so they take
   the menu's type rather than the smaller utility size. */
.aureon-header .aureon-account,
.aureon-header .aureon-cart {
	font-size: inherit;
	font-weight: 500;
}

/* The button styles keep the button's own type and colours. */
.aureon-header .aureon-account--button {
	font-size: var(--aureon-btn-font-size, var(--aureon-font-size-sm));
	font-weight: var(--aureon-font-weight-button, 600);
}

.aureon-account.aureon-button--filled,
.aureon-account.aureon-button--filled:hover {
	color: var(--aureon-btn-text, var(--aureon-color-button-text));
}

.aureon-account.aureon-button--outline {
	color: var(--aureon-color-link);
}

.aureon-account.aureon-button--outline:hover {
	color: var(--aureon-color-button-text);
}

.aureon-cart {
	display: inline-flex;
	align-items: center;
	gap: var(--aureon-space-xs);
	color: var(--aureon-color-text);
	font-size: var(--aureon-font-size-sm);
	text-decoration: none;
	white-space: nowrap;
}

// The drawer variant is a <button> — strip the native chrome so it matches the
// link variant exactly.
button.aureon-cart {
	padding: 0;
	border: 0;
	background: none;
	font: inherit;
	cursor: pointer;
}

.aureon-cart:hover {
	color: var(--aureon-color-link);
}

.aureon-cart__icon,
.aureon-account__icon {
	display: inline-flex;
	align-items: center;

	svg {
		width: 1.25em;
		height: 1.25em;
	}
}

/* "On phones: icon only" — the icon a text-only link carries for phones stays
   out of the way on larger screens; on phones the label gives way to the icon,
   visually hidden rather than removed so the link keeps its accessible name. */
.aureon-account__icon--phone {
	display: none;
}

@media (max-width: 781px) {

	.aureon-account--icon-on-phone .aureon-account__icon--phone {
		display: inline-flex;
	}

	.aureon-account--icon-on-phone .aureon-account__label {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}
}

.aureon-cart__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.5em;
	height: 1.5em;
	padding-inline: 0.25em;
	border-radius: var(--aureon-radius-lg);
	background: var(--aureon-color-primary);
	color: var(--aureon-color-button-text);
	font-size: var(--aureon-font-size-sm);
}

.aureon-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--aureon-space-xs);
	padding: var(--aureon-btn-padding-top, 12px) var(--aureon-btn-padding-right, 24px) var(--aureon-btn-padding-bottom, 12px) var(--aureon-btn-padding-left, 24px);
	border: var(--aureon-btn-border-width, 2px) var(--aureon-btn-border-style, solid) var(--aureon-btn-border-color, transparent);
	border-radius: var(--aureon-btn-radius, var(--aureon-radius-md));
	background: var(--aureon-btn-bg, var(--aureon-color-primary));
	color: var(--aureon-btn-text, var(--aureon-color-button-text));
	font-size: var(--aureon-btn-font-size, var(--aureon-font-size-sm));
	font-weight: var(--aureon-font-weight-button, 600);
	line-height: 1.2;
	text-transform: var(--aureon-font-transform-button, none);
	letter-spacing: var(--aureon-button-letter-spacing, normal);
	text-decoration: none;
	cursor: pointer;
	transition:
		background-color 0.15s ease,
		color 0.15s ease,
		border-color 0.15s ease,
		box-shadow 0.15s ease,
		transform var(--aureon-btn-transition-speed, 0.15s) ease;
}

.aureon-button:hover {
	background: var(--aureon-btn-hover-bg, var(--aureon-color-primary-hover));
	color: var(--aureon-btn-hover-text, var(--aureon-btn-text, var(--aureon-color-button-text)));
	box-shadow: var(--aureon-shadow-sm);
	// PHP resolves the hover-style choice (none/lift/scale) straight to a
	// `transform` value, so this stays a single unconditional declaration.
	transform: var(--aureon-btn-hover-transform-value, none);
}

.aureon-button:active {
	transform: translateY(1px);
	box-shadow: none;
}

// The "Focus Style" toggle gates this via --aureon-btn-focus-ring (1/0): the
// spread multiplies out to 0 when the flag is off, collapsing the ring away
// without needing a second, conditional rule.
.aureon-button:focus-visible,
.wp-block-button__link:focus-visible,
.wp-element-button:focus-visible {
	box-shadow:
		0 0 0 calc(3px * var(--aureon-btn-focus-ring, 0))
		color-mix(in srgb, var(--aureon-btn-focus-ring-color, var(--aureon-color-primary)) 33%, transparent);
}

/* Core block buttons adopt the global button box (padding/border/radius) and
   hover from the Buttons section. A per-button color set on the block still
   wins on the resting state (block inline styles beat this stylesheet); the
   hover falls back to the theme button hover when no override is set. */
.wp-block-button__link,
.wp-element-button {
	padding: var(--aureon-btn-padding-top, 12px) var(--aureon-btn-padding-right, 24px) var(--aureon-btn-padding-bottom, 12px) var(--aureon-btn-padding-left, 24px);
	border-width: var(--aureon-btn-border-width, 2px);
	border-radius: var(--aureon-btn-radius, var(--aureon-radius-md));
	font-weight: var(--aureon-font-weight-button, 600);
}

.wp-block-button:not(.is-style-outline) > .wp-block-button__link:hover {
	background-color: var(--aureon-btn-hover-bg, var(--aureon-color-primary-hover));
	color: var(--aureon-btn-hover-text, var(--aureon-color-button-text));
	box-shadow: var(--aureon-shadow-sm);
}

.aureon-button--secondary {
	background: var(--aureon-color-secondary);
	color: var(--aureon-color-button-text);
}

.aureon-button--secondary:hover {
	background: var(--aureon-color-heading);
}

// An outline button is defined by its border — it must stay visible even
// when the Border section's own style is "None" (that setting is for the
// *optional* border on filled/text/link buttons, not this one's reason for
// existing), so border-style is hardcoded here rather than read from
// --aureon-btn-border-style. Width and color still come from the shared vars.
.aureon-button--outline {
	background: transparent;
	border-width: var(--aureon-btn-border-width, 2px);
	border-style: solid;
	border-color: var(--aureon-btn-border-color, var(--aureon-color-primary));
	color: var(--aureon-color-link);
}

.aureon-button--outline:hover {
	background: var(--aureon-color-primary);
	color: var(--aureon-color-button-text);
}

.aureon-button--ghost {
	background: transparent;
	color: var(--aureon-color-link);
}

.aureon-button--ghost:hover {
	background: var(--aureon-color-border);
}

/* Builder button styles: text variant + sizes ("filled"/"md" are the base) */
.aureon-button--text {
	padding-inline: 0.4em;
	border-color: transparent;
	background: transparent;
	color: var(--aureon-color-link);
}

.aureon-button--text:hover {
	background: transparent;
	color: var(--aureon-color-link-hover);
	box-shadow: none;
}

// Transparent, borderless, underlined — the 4th global style (Buttons ›
// Button Style › Link), filling the gap next to --outline/--text/--ghost.
.aureon-button--link {
	padding-inline: 0.2em;
	border-color: transparent;
	background: transparent;
	color: var(--aureon-color-link);
	text-decoration: underline;
}

.aureon-button--link:hover {
	background: transparent;
	color: var(--aureon-color-link-hover);
	box-shadow: none;
}

// Values here are the source of truth for Dynamic_CSS's `size_presets` map
// (Button box styling section) — duplicated intentionally since PHP can't
// read SCSS; keep both in sync by hand if these ever change.
.aureon-button--sm {
	padding: 0.45em 1em;
	font-size: var(--aureon-font-size-xs, 0.8rem);
}

.aureon-button--lg {
	padding: 0.85em 1.9em;
	font-size: var(--aureon-font-size-md, 1rem);
}

// Respect core's own per-block justification choice (`.is-content-justification-*`)
// over the theme-wide default from Buttons › Button Alignment.
.wp-block-buttons:not([class*="is-content-justification-"]) {
	justify-content: var(--aureon-btn-justify, flex-start);
}

/* Off-canvas -------------------------------------------------------------- */

.aureon-offcanvas {
	position: fixed;
	inset: 0;
	z-index: 1000;

	&__backdrop {
		position: absolute;
		inset: 0;
		z-index: 0;
		background: var(--aureon-offcanvas-overlay, rgba(0, 0, 0, 0.5));
		opacity: 0;
		transition: opacity 0.2s ease;
	}

	&__panel {
		position: absolute;
		z-index: 1;
		inset-block: 0;
		inset-inline-end: 0;
		width: min(var(--aureon-offcanvas-width, 320px), 85vw);
		padding: var(--aureon-space-lg);
		background: var(--aureon-offcanvas-bg, var(--aureon-color-background));
		box-shadow: var(--aureon-shadow-md);
		transform: translateX(100%);
		transition: transform 0.2s ease;
		overflow-y: auto;
	}

	.aureon-menu {
		flex-direction: column;
		gap: var(--aureon-space-sm);
	}

	/* Submenus expand inline inside the drawer — never flyouts. */
	.sub-menu,
	.children {
		position: static;
		min-width: 0;
		margin: 0;
		padding: var(--aureon-space-xs) 0 0 var(--aureon-space-md);
		border: 0;
		border-radius: 0;
		background: transparent;
		box-shadow: none;
		opacity: 1;
		visibility: visible;
		transform: none;
		list-style: none;
	}

	/* The drawer sits outside `.aureon-header`, so the header's caret sizing
	   doesn't reach it; without this the inline SVG renders at full width. */
	.aureon-menu__caret {
		width: 0.9em;
		height: 0.9em;
		margin-left: 0.15em;
		flex-shrink: 0;
		vertical-align: -0.12em;
	}
}

// Drawer options (Header › off-canvas card ⚙ — see
// Header_Builder::render_offcanvas()). Slide-in from the right is the base
// style above; these only override what differs.
.aureon-offcanvas--left .aureon-offcanvas__panel {
	inset-inline-start: 0;
	inset-inline-end: auto;
	transform: translateX(-100%);
}

.aureon-offcanvas--fullscreen .aureon-offcanvas__panel {
	inset: 0;
	width: auto;
	// Clear the header's toggle, which stays on top to close the panel.
	padding-block-start: calc(var(--aureon-space-lg) * 3);
	opacity: 0;
	transform: none;
	transition: opacity 0.2s ease;
}

.aureon-offcanvas--align-center .aureon-offcanvas__content,
.aureon-offcanvas--align-right .aureon-offcanvas__content {
	display: flex;
	flex-direction: column;
	gap: var(--aureon-space-md);
}

.aureon-offcanvas--align-center {

	.aureon-offcanvas__content,
	.aureon-menu,
	.aureon-menu > ul {
		align-items: center;
		text-align: center;
	}
}

.aureon-offcanvas--align-right {

	.aureon-offcanvas__content,
	.aureon-menu,
	.aureon-menu > ul {
		align-items: flex-end;
		text-align: end;
	}
}

.aureon-offcanvas .aureon-menu > ul {
	// Defensive: if the offcanvas location has no menu assigned, WP core's
	// wp_page_menu() fallback puts .aureon-menu on the <nav> wrapper and
	// leaves the actual <li> container as a class-less inner <ul>, which
	// inherits the desktop `.aureon-menu > ul { display: flex }` row layout.
	// flex-direction doesn't inherit from the outer column override, so pin
	// it here too.
	flex-direction: column;
}

.aureon-offcanvas-open {
	overflow: hidden;

	.aureon-offcanvas__backdrop {
		opacity: 1;
	}

	.aureon-offcanvas__panel {
		transform: translateX(0);
	}

	.aureon-offcanvas--fullscreen .aureon-offcanvas__panel {
		opacity: 1;
	}

	// While the drawer is open the backdrop (z-index 1000) covers the header, so
	// the toggle that opened it would be unclickable — a second tap couldn't
	// close it. Lift the toggle above the backdrop so it stays interactive and
	// toggles the drawer shut (backdrop click and Esc still close it too).
	.aureon-header__toggle {
		position: relative;
		z-index: 1001;
	}

	// Swap the toggle icon: hide the hamburger, reveal the × while the drawer
	// is open. Applies to every toggle on the page (tablet/mobile/auto).
	.aureon-header__toggle-icon {
		display: none;
	}

	.aureon-header__toggle-close {
		display: inline-flex;
	}
}

/* Mini-cart drawer ---------------------------------------------------------- *
 * A right-side slide-in panel mirroring .aureon-offcanvas above, but carrying
 * WooCommerce's mini-cart (see woocommerce/cart/mini-cart.php). It lives in the
 * always-loaded sheet — not woocommerce.css — because the header renders the
 * drawer shell on every page, so its styles must be present store-wide, not
 * only on shop pages. Layout follows the Tailwind UI shopping-cart pattern:
 * thumbnail-left line items with name/price and qty/remove rows, and a pinned
 * footer holding the subtotal, actions, and a continue-shopping link. */

.aureon-cart-drawer {
	position: fixed;
	inset: 0;
	z-index: 1000;

	&__backdrop {
		position: absolute;
		inset: 0;
		z-index: 0;
		background: rgba(0, 0, 0, 0.5);
		opacity: 0;
		transition: opacity 0.2s ease;
	}

	&__panel {
		position: absolute;
		z-index: 1;
		inset-block: 0;
		inset-inline-end: 0;
		display: flex;
		flex-direction: column;
		width: min(28rem, 100vw);
		background: var(--aureon-color-background);
		box-shadow: var(--aureon-shadow-md);
		transform: translateX(100%);
		transition: transform 0.2s ease;
	}

	&__head {
		display: flex;
		flex: none;
		align-items: center;
		justify-content: space-between;
		padding: var(--aureon-space-md) var(--aureon-space-lg);
		border-bottom: 1px solid var(--aureon-color-border);
	}

	&__title {
		color: var(--aureon-color-heading);
		font-size: var(--aureon-font-size-lg);
		font-weight: 600;
	}

	&__close {
		display: inline-flex;
		align-items: center;
		padding: 0;
		border: 0;
		background: none;
		color: var(--aureon-color-text);
		cursor: pointer;

		&:hover {
			color: var(--aureon-color-link);
		}
	}

	// Flex column so the item list scrolls while the footer stays pinned. After
	// an add-to-cart, WooCommerce core's own `div.widget_shopping_cart_content`
	// cart fragment replaces this wrapper and drops the `__content` class, so
	// match the core class too — otherwise the scroll container silently breaks
	// on the first fragment refresh.
	&__content,
	.widget_shopping_cart_content {
		display: flex;
		flex: 1 1 auto;
		flex-direction: column;
		min-height: 0;
		overflow: hidden;
	}
}

.aureon-cart-drawer-open {
	overflow: hidden;

	.aureon-cart-drawer__backdrop {
		opacity: 1;
	}

	.aureon-cart-drawer__panel {
		transform: translateX(0);
	}
}

// The WP admin bar is fixed at the viewport top with a higher z-index, so
// offset the (fixed) drawer panel below it or it covers the drawer header +
// close button. Core's admin-bar CSS has two breakpoints: above 782px it's
// 32px tall; from 601–782px it stays fixed but grows to 46px; at 600px and
// below it switches to `position: absolute` and scrolls away with the page,
// so a full-height panel is correct there (reserving space would leave a dead
// gap once scrolled).
.admin-bar .aureon-cart-drawer__panel {
	top: 32px;

	@media screen and (max-width: 782px) {
		top: 46px;
	}

	@media screen and (max-width: 600px) {
		top: 0;
	}
}

/* Mini-cart contents (the WooCommerce markup inside the drawer).
 *
 * Scoped under the drawer's `#aureon-cart-drawer` *id* (not its class) on
 * purpose: WooCommerce core's own mini-cart selectors are specific — e.g.
 * `.woocommerce ul.cart_list li img` (0,2,3) sizes the thumbnail and
 * `.woocommerce ul.cart_list` (0,2,2) strips the list padding. On a
 * `body.woocommerce` page (shop, cart, checkout, product, account) those beat
 * a class-only `.aureon-cart-drawer …` scope (0,2,x), so the drawer rendered
 * differently there than on non-Woo pages (blog, home). The id lifts every
 * rule below to (1,x,y), which reliably out-specifies core everywhere. */

#aureon-cart-drawer {

	// Scrollable list of line items.
	.woocommerce-mini-cart {
		flex: 1 1 auto;
		min-height: 0;
		margin: 0;
		padding: var(--aureon-space-sm) var(--aureon-space-lg);
		overflow-y: auto;
		list-style: none;
	}

	.woocommerce-mini-cart-item {
		display: flex;
		gap: var(--aureon-space-md);
		padding: var(--aureon-space-md) 0;

		// On `body.woocommerce` pages core adds a clearfix
		// (`.woocommerce ul.cart_list li::before/::after { content: " "; display: table }`).
		// This `li` is a flex container, so those pseudo-elements become phantom
		// flex items that inject an extra `gap` and shove the thumbnail right —
		// so the item indents 16px more on shop/cart/product pages than on blog
		// pages. Drop them so the layout is identical everywhere.
		&::before,
		&::after {
			content: none;
		}

		+ .woocommerce-mini-cart-item {
			border-top: 1px solid var(--aureon-color-border);
		}
	}
}

// Scoped under the `#aureon-cart-drawer` id (see the note above) so these
// out-specify WooCommerce core's own mini-cart selectors — e.g.
// `.woocommerce ul.cart_list li img` and `.woocommerce a.remove` — which
// otherwise win when the drawer sits inside a `body.woocommerce` shop page.
#aureon-cart-drawer .aureon-mini-cart {

	// Fixed-size thumbnail on the left.
	&__thumb {
		flex: none;
		width: 4rem;
		height: 4rem;
		overflow: hidden;
		border: 1px solid var(--aureon-color-border);
		border-radius: var(--aureon-radius-md, 6px);

		img {
			width: 100%;
			height: 100%;
			margin: 0;
			object-fit: cover;
			// Core floats mini-cart images right (`.woocommerce ul.cart_list li
			// img`); reset it so the thumbnail fills its box the same way on
			// shop pages as everywhere else.
			float: none;
		}
	}

	// Everything to the right of the thumbnail.
	&__body {
		display: flex;
		flex: 1 1 auto;
		flex-direction: column;
		gap: var(--aureon-space-xs);
		min-width: 0;
	}

	&__line {
		display: flex;
		align-items: flex-start;
		justify-content: space-between;
		gap: var(--aureon-space-sm);
	}

	&__name {
		color: var(--aureon-color-heading);
		font-weight: 600;
		text-decoration: none;

		&:hover {
			color: var(--aureon-color-link);
		}
	}

	&__price {
		flex: none;
		color: var(--aureon-color-heading);
		font-weight: 600;
	}

	&__variation {
		display: flex;
		flex-direction: column;
		gap: 2px;
		color: var(--aureon-color-text-muted, var(--aureon-color-text));
		font-size: var(--aureon-font-size-sm);

		dl,
		p {
			margin: 0;
		}
	}

	// Qty (left) and Remove (right), pushed to the bottom of the item.
	&__foot {
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin-top: auto;
		gap: var(--aureon-space-sm);

		.quantity {
			color: var(--aureon-color-text-muted, var(--aureon-color-text));
			font-size: var(--aureon-font-size-sm);
		}

		// Remove is a plain text link, not WooCommerce's default fixed-size "×".
		.remove {
			width: auto;
			height: auto;
			color: var(--aureon-color-link);
			font-size: var(--aureon-font-size-sm);
			font-weight: 500;
			line-height: 1.2;
			text-decoration: none;

			&:hover {
				color: var(--aureon-color-link-hover);
				background: none;
			}
		}
	}

	// Pinned footer: subtotal, tax note, actions, continue-shopping link.
	&__footer {
		flex: none;
		padding: var(--aureon-space-lg);
		border-top: 1px solid var(--aureon-color-border);
	}

	&__note {
		margin: var(--aureon-space-xs) 0 0;
		color: var(--aureon-color-text-muted, var(--aureon-color-text));
		font-size: var(--aureon-font-size-sm);
	}

	&__continue {
		margin: var(--aureon-space-md) 0 0;
		color: var(--aureon-color-text-muted, var(--aureon-color-text));
		font-size: var(--aureon-font-size-sm);
		text-align: center;

		a {
			color: var(--aureon-color-link);
			text-decoration: none;

			&:hover {
				color: var(--aureon-color-link-hover);
			}
		}
	}
}

// Quantity stepper (− / input / +) in each line item's foot. Scoped under the
// drawer id so it out-specifies WooCommerce core's own `.quantity input` rules
// on shop pages.
#aureon-cart-drawer .aureon-qty {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--aureon-color-border);
	border-radius: var(--aureon-radius-md, 6px);

	// Set while a quantity update is in flight (cart-drawer.js); the refreshed
	// fragment replaces the control on success.
	&.is-loading {
		opacity: 0.6;
	}

	&__btn {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 1.75rem;
		height: 1.75rem;
		padding: 0;
		border: 0;
		background: none;
		color: var(--aureon-color-text);
		cursor: pointer;

		&:hover {
			color: var(--aureon-color-link);
		}
	}

	&__input {
		width: 2.5rem;
		height: 1.75rem;
		padding: 0;
		border: 0;
		border-inline: 1px solid var(--aureon-color-border);
		background: none;
		color: var(--aureon-color-heading);
		font-size: var(--aureon-font-size-sm);
		text-align: center;
		appearance: textfield;

		&::-webkit-inner-spin-button {
			margin: 0;
			-webkit-appearance: none;
		}
	}
}

/* stylelint-disable-next-line no-duplicate-selectors -- intentional feature-grouped block */
#aureon-cart-drawer {

	// Subtotal row: label left, amount right.
	.woocommerce-mini-cart__total {
		display: flex;
		align-items: baseline;
		justify-content: space-between;
		margin: 0;
		color: var(--aureon-color-heading);
		font-size: var(--aureon-font-size-md);
	}

	// Checkout and View cart share a row, each taking half the footer width.
	// The button chrome is defined here (not inherited from woocommerce.css)
	// so the drawer's CTAs look identical on non-shop pages, where that
	// stylesheet never loads.
	.woocommerce-mini-cart__buttons {
		display: flex;
		flex-direction: row;
		gap: var(--aureon-space-sm);
		margin: var(--aureon-space-md) 0 0;

		.button {
			display: block;
			flex: 1 1 0;
			min-width: 0;
			padding: var(--aureon-space-sm) var(--aureon-space-md);
			border: 1px solid var(--aureon-color-primary);
			border-radius: var(--aureon-radius-md, 6px);
			background: var(--aureon-color-primary);
			color: var(--aureon-color-button-text, #fff);
			font-weight: 600;
			line-height: 1.4;
			text-align: center;
			text-decoration: none;

			&:hover {
				background: var(--aureon-color-primary-hover, var(--aureon-color-primary));
				color: var(--aureon-color-button-text, #fff);
			}
		}

		// The checkout CTA is the primary action; order it first. View cart is
		// the secondary action — outlined rather than filled.
		.checkout {
			order: -1;
		}

		.button:not(.checkout) {
			background: transparent;
			color: var(--aureon-color-link);

			&:hover {
				background: var(--aureon-color-primary);
				color: var(--aureon-color-button-text, #fff);
			}
		}
	}

	.woocommerce-mini-cart__empty-message {
		margin: 0;
		padding: var(--aureon-space-xl) var(--aureon-space-lg);
		color: var(--aureon-color-text-muted, var(--aureon-color-text));
		text-align: center;
	}
}

/* Mini-cart dialog ---------------------------------------------------------- *
 * The `dialog` style reuses the modal shell (.aureon-cart-drawer — same dimmed
 * backdrop, scroll-lock, and focus-trap) but presents as a centered modal that
 * scales/fades in, rather than the drawer's edge slide-over. The `--dialog`
 * modifier re-centers the panel (clearing the drawer's edge insets) and stacks
 * its footer actions full-width with Checkout as the prominent primary. The
 * `#id.modifier` / open-state compounds out-specify the base drawer rules. */

.aureon-cart-drawer--dialog .aureon-cart-drawer__panel {
	inset: auto;
	top: 50%;
	left: 50%;
	width: min(32rem, calc(100vw - 2rem));
	max-height: calc(100vh - 4rem);
	border-radius: var(--aureon-radius-lg, 10px);
	opacity: 0;
	transform: translate(-50%, -50%) scale(0.96);
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.aureon-cart-drawer-open .aureon-cart-drawer--dialog .aureon-cart-drawer__panel {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1);
}

/* Mini-cart popover --------------------------------------------------------- *
 * A dropdown anchored under the cart trigger (position set by cart-drawer.js).
 * Non-modal: the shell doesn't cover or dim the page (pointer-events pass
 * through except on the panel), and page scroll is never locked — an outside
 * click closes it. The mini-cart body reuses the id-scoped `#aureon-cart-drawer`
 * contents styling shared with the drawer/dialog. */

.aureon-cart-popover {
	position: fixed;
	inset: 0;
	z-index: 1000;
	pointer-events: none;

	&__panel {
		position: fixed;
		z-index: 1;
		display: flex;
		flex-direction: column;
		width: min(28rem, calc(100vw - 2rem));
		max-height: min(36rem, calc(100vh - 5rem));
		overflow: hidden;
		background: var(--aureon-color-background);
		border: 1px solid var(--aureon-color-border);
		border-radius: var(--aureon-radius-lg, 10px);
		box-shadow: var(--aureon-shadow-lg, var(--aureon-shadow-md));
		opacity: 0;
		transform: translateY(-0.5rem);
		transition: opacity 0.15s ease, transform 0.15s ease;
		pointer-events: auto;
	}

	// Flex column so the item list scrolls while the footer stays pinned. The
	// drawer/dialog get this from the `.aureon-cart-drawer` block; the popover
	// uses its own block, so it needs the rule here. Matches the core class too
	// (`div.widget_shopping_cart_content`) since the cart fragment replaces this
	// wrapper and drops the theme's own class on refresh.
	&__panel .widget_shopping_cart_content {
		display: flex;
		flex: 1 1 auto;
		flex-direction: column;
		min-height: 0;
		overflow: hidden;
	}
}

.aureon-cart-popover-open .aureon-cart-popover__panel {
	opacity: 1;
	transform: translateY(0);
}

// The dialog and popover keep their footers compact: Checkout + View cart sit
// inline (the shared row default), and the continue-shopping link is dropped —
// closing the panel returns you to the page you were already on.
#aureon-cart-drawer.aureon-cart-popover .aureon-mini-cart__continue,
#aureon-cart-drawer.aureon-cart-drawer--dialog .aureon-mini-cart__continue {
	display: none;
}

/* Footer ------------------------------------------------------------------ */

.aureon-footer {
	margin-top: var(--aureon-space-xl);
	background: var(--aureon-color-background);
	border-top: 1px solid var(--aureon-color-border);
	color: var(--aureon-color-text);
	font-size: var(--aureon-font-size-sm);

	// Rows/inner/columns mirror the header engine's markup (Zone_Builder):
	// same modifiers (--va-*, --full, is-left/center/right), footer defaults.
	&__row {
		position: relative;
	}

	// The footer's breathing room sits on its outer rows rather than on the
	// footer itself, so a row with its own padding replaces it instead of
	// stacking on top of it.
	&__row:first-child {
		padding-top: var(--aureon-space-xl);
	}

	&__row:last-child {
		padding-bottom: var(--aureon-space-xl);
	}

	&__row + &__row .aureon-footer__inner {
		padding-top: var(--aureon-space-lg);
	}

	&__inner {

		@extend %zone-inner;

		gap: var(--aureon-space-lg);

		&--va-top {

			@extend %zone-inner-va-top;
		}

		&--va-center {

			@extend %zone-inner-va-center;
		}

		&--va-bottom {

			@extend %zone-inner-va-bottom;
		}

		&--full {

			@extend %zone-inner-full;
		}
	}

	&__col {

		@extend %zone-col;

		h2,
		h3,
		h4 {
			margin-block: 0 var(--aureon-space-sm);
			font-size: var(--aureon-font-size-sm);
			font-weight: 600;
			letter-spacing: 0.08em;
			text-transform: uppercase;
			color: var(--aureon-color-heading);
		}

		a {
			color: var(--aureon-color-text);
			text-decoration: none;
		}

		a:hover {
			color: var(--aureon-color-link);
		}
	}

	&__bottom {
		margin-top: var(--aureon-space-lg);
		font-size: var(--aureon-font-size-sm);
		color: var(--aureon-color-text-muted, var(--aureon-color-text));

		.aureon-container {
			display: flex;
			flex-wrap: wrap;
			align-items: center;
			justify-content: center;
			gap: var(--aureon-space-sm);
			text-align: center;
		}
	}
}

/* Content ----------------------------------------------------------------- */

.aureon-main {
	padding-block: var(--aureon-section-spacing, var(--aureon-space-lg));
}

/* Sidebar layout (grid on the content wrapper). */
.aureon-sidebar {
	min-width: 0;
	// Match .aureon-main's vertical rhythm so the sidebar's first item aligns
	// with the top of the main content column instead of sitting higher.
	padding-block: var(--aureon-section-spacing, var(--aureon-space-lg));
	color: var(--aureon-sidebar-text-color, inherit);
}

@media (min-width: 783px) {

	.aureon-sidebar-left .aureon-content,
	.aureon-sidebar-right .aureon-content,
	.aureon-sidebar-both .aureon-content {
		display: grid;
		gap: var(--aureon-space-lg);
		align-items: start;
	}

	.aureon-sidebar-left .aureon-content {
		grid-template-columns: var(--aureon-sidebar-width, 30%) minmax(0, 1fr);
	}

	.aureon-sidebar-right .aureon-content {
		grid-template-columns: minmax(0, 1fr) var(--aureon-sidebar-width, 30%);
	}

	// Both columns share the one width setting — a sidebar per side, content
	// in between. sidebar.php prints the left aside before the right one, and
	// `order` below places them either side of `.aureon-main` regardless.
	.aureon-sidebar-both .aureon-content {
		grid-template-columns: var(--aureon-sidebar-width, 30%) minmax(0, 1fr) var(--aureon-sidebar-width, 30%);
	}

	// `.alignfull`'s `calc(50% - 50vw)` breakout (above) assumes its column is
	// centered in the viewport, which is only true for the sidebar-less boxed
	// layout it was written for. Once a sidebar narrows and off-centers the
	// content column, that same calc drags the block toward the viewport
	// center instead of the column edge — visibly cropping it on one side.
	// There's no room to bleed full-width next to a sidebar anyway, so just
	// cap the block at the column's own width instead of the viewport's.
	.aureon-sidebar-left .aureon-entry__content > .alignfull,
	.aureon-sidebar-left .aureon-entry > .alignfull,
	.aureon-sidebar-right .aureon-entry__content > .alignfull,
	.aureon-sidebar-right .aureon-entry > .alignfull,
	.aureon-sidebar-both .aureon-entry__content > .alignfull,
	.aureon-sidebar-both .aureon-entry > .alignfull {
		width: 100%;
		max-width: 100%;
		margin-left: 0;
		margin-right: 0;
	}

	.aureon-sidebar-left .aureon-sidebar {
		order: -1;
	}

	// Two `.aureon-sidebar` asides render for "both" (see sidebar.php), in
	// left-then-right DOM order — place them either side of `.aureon-main`
	// (which keeps its default order: 0).
	.aureon-sidebar-both .aureon-sidebar:first-of-type {
		order: -1;
	}

	.aureon-sidebar-both .aureon-sidebar:last-of-type {
		order: 1;
	}

	/* Sticky sidebar — pins the column while the main content scrolls. Clears a
	   sticky header via the height sticky.js publishes so the gap below it stays
	   constant; the `0px` default is a no-op when no header is sticky. */
	.aureon-sidebar-sticky .aureon-sidebar {
		position: sticky;
		top: calc(var(--aureon-sticky-header-height, 0px) + var(--aureon-space-lg));
	}
}

// Sidebar responsive visibility — "Show on Mobile" / "Show on Tablet" in the
// Sidebar section's Layout tab. Mobile/tablet breakpoints match the other
// device-scoped rules in this file (e.g. the header's own). Collapses the
// grid back to a single column when the sidebar it would have shown is
// hidden, so main content reclaims the full row instead of leaving a gap.
@media (max-width: 781px) {

	.aureon-sidebar-hide-mobile .aureon-sidebar {
		display: none;
	}
}

@media (min-width: 782px) and (max-width: 1023px) {

	.aureon-sidebar-hide-tablet .aureon-sidebar {
		display: none;
	}

	.aureon-sidebar-hide-tablet.aureon-sidebar-left .aureon-content,
	.aureon-sidebar-hide-tablet.aureon-sidebar-right .aureon-content,
	.aureon-sidebar-hide-tablet.aureon-sidebar-both .aureon-content {
		display: block;
	}
}

/* Surface cards — the boxed sidebar and boxed content share the same base
   chrome; the sidebar then layers its own configurable border/radius/shadow
   on top (see Sidebar::print_vars() for the --aureon-sidebar-* custom
   properties). */
.aureon-sidebar-style-boxed .aureon-sidebar,
.aureon-content-boxed .aureon-main {
	background: var(--aureon-color-background);
	border: 1px solid var(--aureon-color-border);
}

.aureon-sidebar-style-boxed .aureon-sidebar {
	// The card supplies its own padding, so offset the top with a margin to keep
	// it level with the main content column (the base padding-block is reset by
	// this shorthand padding).
	margin-block-start: var(--aureon-section-spacing, var(--aureon-space-lg));
	background: var(--aureon-sidebar-bg, var(--aureon-color-background));
	border-color: var(--aureon-sidebar-border-color, var(--aureon-color-border));
	border-style: var(--aureon-sidebar-border-style, solid);
	border-width: var(--aureon-sidebar-border-width, 1px);
	padding: var(--aureon-sidebar-padding, var(--aureon-space-lg));
	border-radius: var(--aureon-sidebar-radius, var(--aureon-radius-md));
	box-shadow: var(--aureon-sidebar-shadow, none);
}

.aureon-content-boxed .aureon-main {
	padding: var(--aureon-space-xl);
	border-radius: var(--aureon-radius-lg);
}

/* Sidebar widgets: title matches the entry title (size + heading treatment)
   by default, styled further by Widget Styling's colors + title style choice.
   Covers classic (.widget-title) and block (.wp-block-heading) markup. */
.aureon-sidebar .widget {
	margin-bottom: var(--aureon-sidebar-widget-gap, var(--aureon-space-lg));
	padding-bottom: var(--aureon-sidebar-widget-gap, var(--aureon-space-lg));
	border-bottom: 1px solid var(--aureon-sidebar-divider, var(--aureon-color-border));
	border-bottom-style: var(--aureon-sidebar-divider-style, none);
}

.aureon-sidebar .widget:last-child {
	margin-bottom: 0;
	padding-bottom: 0;
	border-bottom: none;
}

.aureon-sidebar .widget-title,
.aureon-sidebar .wp-block-heading {
	margin-block: 0 var(--aureon-space-md);
	color: var(--aureon-sidebar-title-color, var(--aureon-color-heading));
	font-family: var(--aureon-font-heading);
	font-size: var(--aureon-font-size-xl);
	font-weight: var(--aureon-font-weight-heading, 600);
	line-height: var(--aureon-font-line-height-heading, 1.2);
}

.aureon-sidebar a {
	color: var(--aureon-sidebar-link-color, var(--aureon-color-link));
}

.aureon-sidebar a:hover {
	color: var(--aureon-sidebar-link-hover, var(--aureon-color-link-hover));
}

/* Widget title style — the structural choices (a plain color swap doesn't
   need a body class; these do). */
.aureon-sidebar-title-uppercase .aureon-sidebar .widget-title,
.aureon-sidebar-title-uppercase .aureon-sidebar .wp-block-heading {
	text-transform: uppercase;
	letter-spacing: 0.04em;
	font-size: var(--aureon-font-size-md);
}

.aureon-sidebar-title-bordered .aureon-sidebar .widget-title,
.aureon-sidebar-title-bordered .aureon-sidebar .wp-block-heading {
	display: inline-block;
	padding-bottom: var(--aureon-space-sm);
	border-bottom: 2px solid var(--aureon-sidebar-link-color, var(--aureon-color-primary));
}

.aureon-sidebar-title-underline .aureon-sidebar .widget-title,
.aureon-sidebar-title-underline .aureon-sidebar .wp-block-heading {
	text-decoration: underline;
	text-decoration-color: var(--aureon-sidebar-link-color, var(--aureon-color-primary));
	text-underline-offset: 4px;
}

/* Widget Hover Effect — applied to links inside sidebar widgets. */
.aureon-sidebar-hover-background .aureon-sidebar a:hover {
	background: color-mix(in srgb, var(--aureon-sidebar-link-color, var(--aureon-color-link)) 12%, transparent);
	border-radius: var(--aureon-radius-sm);
}

.aureon-sidebar-hover-lift .aureon-sidebar a {
	display: inline-block;
	transition: transform 0.15s ease;
}

.aureon-sidebar-hover-lift .aureon-sidebar a:hover {
	transform: translateX(3px);
}

.aureon-sidebar-hover-underline .aureon-sidebar a:hover {
	text-decoration: underline;
}

.aureon-entry {
	margin-bottom: var(--aureon-space-lg);
	padding: var(--aureon-space-lg);
	border: 1px solid var(--aureon-color-border);
	border-radius: var(--aureon-radius-md);
	transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;

	&:last-child {
		margin-bottom: 0;
	}

	&:hover {
		border-color: var(--aureon-card-border);
		box-shadow: var(--aureon-card-shadow);
		transform: translateY(var(--aureon-card-lift));
	}

	&__thumbnail {
		margin: 0 calc(var(--aureon-space-lg) * -1) var(--aureon-space-md);
		overflow: hidden;
		border-radius: 0;

		a {
			display: block;
		}

		img {
			display: block;
			width: 100%;
			border-radius: 0;
			transition: transform 0.3s ease;
		}
	}

	&__thumbnail:first-child {
		margin-top: calc(var(--aureon-space-lg) * -1);
		border-radius: var(--aureon-radius-md) var(--aureon-radius-md) 0 0;
	}

	&:hover &__thumbnail img {
		transform: scale(1.03);
	}

	&__header {
		margin-bottom: var(--aureon-space-md);
	}

	&__title {
		margin-block: 0 var(--aureon-space-xs);
		font-size: var(--aureon-font-size-xl);
		overflow-wrap: anywhere;

		a {
			color: var(--aureon-color-heading);
			text-decoration: none;
			transition: color 0.15s ease;
		}

		a:hover {
			color: var(--aureon-color-link-hover);
		}
	}

	&__meta {
		display: flex;
		flex-wrap: wrap;
		gap: var(--aureon-space-xs);
		align-items: center;
		margin-bottom: var(--aureon-space-sm);
		color: var(--aureon-misc-color, var(--aureon-color-text));
		font-size: var(--aureon-font-size-misc, var(--aureon-font-size-sm));
		font-weight: var(--aureon-font-weight-misc, 400);
		line-height: var(--aureon-font-line-height-misc, 1.6);

		a {
			color: inherit;
		}
	}

	&__meta-sep {
		opacity: 0.5;
	}

	&__content {
		color: var(--aureon-color-text);

		> :last-child {
			margin-bottom: 0;
		}
	}

	.aureon-read-more {
		display: inline-flex;
		align-items: center;
		margin-top: var(--aureon-space-md);
		color: var(--aureon-color-link, var(--aureon-color-primary));
		font-size: var(--aureon-font-size-sm);
		font-weight: 600;
		text-decoration: none;
		transition: color 0.15s ease;

		&::after {
			content: "\2192";
			margin-left: 0.4em;
			transition: transform 0.15s ease;
		}

		&:hover {
			color: var(--aureon-color-link-hover, var(--aureon-color-primary-hover));

			&::after {
				transform: translateX(3px);
			}
		}

		// Button style — adopts the theme button box (padding, radius, fill)
		// from the Buttons section instead of the inline arrow-link look.
		&--button {
			padding: var(--aureon-btn-padding-top, 0.55em) var(--aureon-btn-padding-right, 1.2em) var(--aureon-btn-padding-bottom, 0.55em) var(--aureon-btn-padding-left, 1.2em);
			border-radius: var(--aureon-btn-radius, var(--aureon-radius-md));
			background: var(--aureon-btn-bg, var(--aureon-color-primary));
			color: var(--aureon-btn-text, var(--aureon-color-button-text));
			font-weight: var(--aureon-font-weight-button, 600);
			transition:
				background-color 0.15s ease,
				color 0.15s ease,
				box-shadow 0.15s ease;

			&::after {
				content: none;
			}

			&:hover {
				background: var(--aureon-btn-hover-bg, var(--aureon-color-primary-hover));
				color: var(--aureon-btn-hover-text, var(--aureon-btn-text, var(--aureon-color-button-text)));
				box-shadow: var(--aureon-shadow-sm);
			}
		}
	}
}

/* Core compat classes — legacy [caption]/[gallery] shortcode output, classic-
   editor float alignment, and the sticky/bypostauthor markers WordPress adds
   automatically (post_class(), comment_class()). Content and third-party
   widgets still rely on these even though the theme's own markup doesn't. */
.wp-caption {
	max-width: 100%;
	margin-bottom: var(--aureon-space-md);
}

.wp-caption img[class*="wp-image-"] {
	display: block;
	width: 100%;
	height: auto;
}

.wp-caption-text,
.gallery-caption {
	margin-top: var(--aureon-space-xs);
	color: var(--aureon-color-text-muted, var(--aureon-color-text));
	font-size: var(--aureon-font-size-sm);
	text-align: center;
}

.alignleft {
	float: left;
	margin: 0.4em var(--aureon-space-md) var(--aureon-space-sm) 0;
}

.alignright {
	float: right;
	margin: 0.4em 0 var(--aureon-space-sm) var(--aureon-space-md);
}

.aligncenter {
	display: block;
	margin-left: auto;
	margin-right: auto;
}

.bypostauthor {

	> .comment-body {
		border-left: 3px solid var(--aureon-color-primary);
		padding-left: var(--aureon-space-sm);
	}
}

.aureon-entry.sticky {
	border-color: var(--aureon-color-primary);
}

/* Post loop — list (default) vs. multi-column grid --------------------------- */

.aureon-posts--grid {
	display: grid;
	grid-template-columns: repeat(var(--aureon-blog-columns, 3), minmax(0, 1fr));
	gap: var(--aureon-space-lg);

	// The grid gap owns the spacing, so cards drop their stacked margin.
	// Cards in a row should align to equal height rather than each sizing to
	// its own content, so the grid reads as a tidy matrix.
	.aureon-entry {
		margin-bottom: 0;
		display: flex;
		flex-direction: column;
	}

	.aureon-entry__content {
		flex: 1;
	}
}

// Collapse the column count as the viewport narrows so cards never crush.
@media (max-width: 900px) {

	.aureon-posts--grid.aureon-posts--cols-4,
	.aureon-posts--grid.aureon-posts--cols-3 {
		--aureon-blog-columns: 2;
	}
}

@media (max-width: 600px) {

	.aureon-posts--grid {
		--aureon-blog-columns: 1;
	}
}

.aureon-posts--cols-1 {
	--aureon-blog-columns: 1;
}

.aureon-posts--cols-2 {
	--aureon-blog-columns: 2;
}

.aureon-posts--cols-3 {
	--aureon-blog-columns: 3;
}

.aureon-posts--cols-4 {
	--aureon-blog-columns: 4;
}

/* Loop pagination — blog, archives, search, product loop ------------------- */

// Shared skeleton for all three styles (Layout → Pagination style): Previous on
// one end, Next on the other, numbers or a page count between them.
.aureon-pagination {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	margin-top: var(--aureon-space-lg);
	font-size: var(--aureon-font-size-sm);

	&__side {
		display: flex;

		// Zero-width flex tracks so the middle stays optically centred no matter
		// how the two labels differ in length.
		flex: 1 1 0;
		min-width: 0;

		&--next {
			justify-content: flex-end;
		}
	}

	&__numbers {
		display: flex;
	}

	.page-numbers {
		display: inline-flex;
		align-items: center;
		gap: 0.5em;
		color: var(--aureon-color-text-muted, var(--aureon-color-text));
		font-weight: 500;
		text-decoration: none;
		transition:
			border-color 0.15s ease,
			background-color 0.15s ease,
			color 0.15s ease;
	}

	.page-numbers.current {
		font-weight: 600;
	}

	&__arrow {
		flex: none;
		width: 1.15em;
		height: 1.15em;
	}

	&__label {
		white-space: nowrap;
	}

	&__count,
	&__summary {
		padding: var(--aureon-space-sm) 0;
		color: var(--aureon-color-text-muted, var(--aureon-color-text));
	}
}

// Numbered — a rule across the content with the numbers hanging off it; the
// current page is marked by an accent segment sitting on top of that rule.
.aureon-pagination--numbered {
	border-top: 1px solid var(--aureon-color-border);

	.page-numbers {
		// Pull the accent border up over the container rule rather than
		// stacking below it.
		margin-top: -1px;
		padding: var(--aureon-space-md) 1rem 0;
		border-top: 2px solid transparent;
	}

	a.page-numbers:hover {
		border-top-color: var(--aureon-color-border);
		color: var(--aureon-color-heading);
	}

	.page-numbers.current {
		border-top-color: var(--aureon-color-primary);
		color: var(--aureon-color-link);
	}

	.page-numbers.prev {
		padding-left: 0;
	}

	.page-numbers.next {
		padding-right: 0;
	}
}

// The group's outer corners. Placeholders because which cell is an end depends
// on whether an arrow is present, so several selectors share the treatment.
%aureon-pagination-end-left {
	margin-left: 0;
	border-radius: var(--aureon-radius-md) 0 0 var(--aureon-radius-md);
}

%aureon-pagination-end-right {
	border-radius: 0 var(--aureon-radius-md) var(--aureon-radius-md) 0;
}

// Button group — a footer bar: rule on top, the result summary at the far left,
// and one joined, bordered control pinned right. Sides stop flexing so prev,
// numbers and next sit shoulder to shoulder.
.aureon-pagination--buttons {
	--aureon-pagination-cell: 2.5rem;

	align-items: center;
	padding-top: var(--aureon-space-md);
	border-top: 1px solid var(--aureon-color-border);

	// Pushes everything after it to the right without spreading the group's own
	// three parts the way space-between would.
	.aureon-pagination__summary {
		margin-right: auto;
	}

	// No summary (item counts unavailable) leaves the group alone on the bar,
	// where centred reads better than shoved to one side.
	&:not(:has(.aureon-pagination__summary)) {
		justify-content: center;
	}

	.aureon-pagination__side {
		flex: 0 0 auto;
	}

	// Every cell is the same box whatever it holds — a number sizes off its text
	// line box and an arrow off its glyph, so the height is pinned here instead
	// or the group steps up and down across the seams.
	.page-numbers {
		justify-content: center;
		min-width: var(--aureon-pagination-cell);
		height: var(--aureon-pagination-cell);

		// Collapse the doubled border between neighbours.
		margin-left: -1px;
		padding: 0 0.75rem;
		border: 1px solid var(--aureon-color-border);
		background: var(--aureon-color-background);
		line-height: 1;
	}

	// Glyph-only ends: square cells, and the label stays for screen readers.
	.page-numbers.prev,
	.page-numbers.next {
		width: var(--aureon-pagination-cell);
		padding: 0;
	}

	.aureon-pagination__label {
		position: absolute;
		width: 1px;
		height: 1px;
		margin: -1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
	}

	a.page-numbers:hover {
		background: color-mix(in srgb, var(--aureon-color-primary) 8%, transparent);
		color: var(--aureon-color-heading);
	}

	.page-numbers.current {
		// Above its neighbours so the filled cell owns both its hairlines.
		z-index: 1;
		border-color: var(--aureon-color-primary);
		background: var(--aureon-color-primary);
		color: var(--aureon-color-button-text);
	}

	// Round the outer edges of the group. The arrows are the ends — except on
	// the first and last page, where paginate_links() omits one and the number
	// row supplies the end cell instead (hence the :empty / :has rules).
	.aureon-pagination__side--prev {

		.page-numbers {

			@extend %aureon-pagination-end-left;
		}

		&:empty + .aureon-pagination__numbers .page-numbers:first-child {

			@extend %aureon-pagination-end-left;
		}
	}

	.aureon-pagination__side--next .page-numbers {

		@extend %aureon-pagination-end-right;
	}

	.aureon-pagination__numbers:has(+ .aureon-pagination__side--next:empty) {

		.page-numbers:last-child {

			@extend %aureon-pagination-end-right;
		}
	}
}

// Previous / Next — two buttons at the far ends, no numbers at any width. Also
// a footer bar: with nothing but two end buttons there is no shape to the row,
// so the rule is what ties it to the loop above.
.aureon-pagination--simple {
	align-items: center;
	padding-top: var(--aureon-space-md);
	border-top: 1px solid var(--aureon-color-border);

	.page-numbers {
		padding: 0.55rem 1rem;
		border: 1px solid var(--aureon-color-border);
		border-radius: var(--aureon-radius-md);
		background: var(--aureon-color-background);
	}

	a.page-numbers:hover {
		border-color: var(--aureon-color-primary);
		color: var(--aureon-color-heading);
	}
}

// Narrow viewports keep only the two arrows — a full number row wraps badly and
// the arrows carry the same navigation. The `simple` style has none to hide.
@media (max-width: 782px) {

	.aureon-pagination__numbers {
		display: none;
	}

	// Nothing is left to join once the numbers go, and a pair of unlabelled
	// carets in the middle of the page says nothing — so the group becomes two
	// labelled buttons at the ends, like the `simple` style.
	.aureon-pagination--buttons {
		justify-content: space-between;

		// The summary competes with the buttons for a narrow row; the buttons win.
		.aureon-pagination__summary {
			display: none;
		}

		.aureon-pagination__side {
			flex: 1 1 0;
		}

		.aureon-pagination__side--prev .page-numbers,
		.aureon-pagination__side--next .page-numbers {
			width: auto;
			margin-left: 0;
			padding: 0 1rem;
			border-radius: var(--aureon-radius-md);
		}

		// Restore the label the joined group hides.
		.aureon-pagination__label {
			position: static;
			width: auto;
			height: auto;
			margin: 0;
			overflow: visible;
			clip: auto;
		}
	}
}

/* Title area — the banner above content (post/page/archive/search) --------- */

.aureon-title-area {
	display: flex;
	flex-direction: column;
	gap: var(--aureon-space-xs);
	margin-bottom: var(--aureon-space-lg);
	padding-bottom: var(--aureon-space-lg);
	border-bottom: 1px solid var(--aureon-color-border);

	&--no-border {
		padding-bottom: 0;
		border-bottom: 0;
	}

	&--align-center {
		text-align: center;
		align-items: center;
	}

	&--align-right {
		text-align: right;
		align-items: flex-end;
	}

	&__title {
		margin: 0;
		// Flex items default to `min-width: auto`, which lets a long unbroken
		// title (a long single word, URL, hashtag …) push the flex container
		// wider than the viewport instead of wrapping. Shrinking the item and
		// letting the text break is what actually prevents the overflow.
		min-width: 0;
		overflow-wrap: anywhere;

		span {
			color: var(--aureon-color-link);
		}
	}

	&__description,
	&__excerpt {
		max-width: 68ch;
		color: var(--aureon-color-text);
		opacity: 0.75;
	}

	&__meta {
		display: flex;
		flex-wrap: wrap;
		gap: var(--aureon-space-xs);
		align-items: center;
		color: var(--aureon-misc-color, var(--aureon-color-text));
		font-size: var(--aureon-font-size-misc, var(--aureon-font-size-sm));

		a {
			color: inherit;
		}
	}

	&__taxonomies {
		font-size: var(--aureon-font-size-sm);

		a {
			color: var(--aureon-color-link);
		}
	}

	&__image {
		width: 100%;
		margin-top: var(--aureon-space-xs);

		img {
			display: block;
			width: 100%;
			height: auto;
			border-radius: var(--aureon-radius-md);
		}
	}
}

/* Legacy archive header (kept for any template not yet on the title area). */
.aureon-archive__header {
	margin-bottom: var(--aureon-space-lg);
	padding-bottom: var(--aureon-space-lg);
	border-bottom: 1px solid var(--aureon-color-border);
}

.aureon-archive__title {
	margin-block: 0 var(--aureon-space-xs);
	overflow-wrap: anywhere;

	span {
		color: var(--aureon-color-link);
	}
}

.aureon-archive__description {
	max-width: 60ch;
	color: var(--aureon-color-text);
	opacity: 0.75;
}

/* Blog breadcrumbs / author box / post nav -------------------------------- */

.aureon-breadcrumbs {
	margin-bottom: var(--aureon-space-md);
	font-size: var(--aureon-font-size-sm);
	opacity: 0.8;

	&__sep {
		margin-inline: 0.25em;
		opacity: 0.5;
	}
}

.aureon-entry__author-box {
	display: flex;
	gap: var(--aureon-space-md);
	align-items: flex-start;
	margin-top: var(--aureon-space-lg);
	padding-top: var(--aureon-space-md);
	border-top: 1px solid var(--aureon-color-border);

	img {
		border-radius: var(--aureon-radius-md);
	}
}

.aureon-entry__author-name {
	font-weight: 600;
}

.aureon-post-nav {
	display: flex;
	justify-content: space-between;
	gap: var(--aureon-space-md);
	margin-bottom: var(--aureon-space-lg);

	.aureon-post-nav__label {
		display: block;
		font-size: var(--aureon-font-size-sm);
		opacity: 0.6;
	}
}

/* 404 ---------------------------------------------------------------------- */

.aureon-404 {
	max-width: 60ch;
	margin-inline: auto;
	padding-block: var(--aureon-space-2xl);
	text-align: center;

	&__title {
		font-size: var(--aureon-font-size-3xl);
	}
}

/* Page links (wp_link_pages) ----------------------------------------------- */

.aureon-page-links {
	clear: both;
	margin-top: var(--aureon-space-lg);
	padding-top: var(--aureon-space-md);
	border-top: 1px solid var(--aureon-color-border);
	font-size: var(--aureon-font-size-sm);

	a {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-width: 2em;
		padding: 0.25em 0.6em;
		margin-inline-end: var(--aureon-space-xs);
		border: 1px solid var(--aureon-color-border);
		border-radius: var(--aureon-radius-sm);
		color: var(--aureon-color-text);
		text-decoration: none;
	}

	a:hover {
		border-color: var(--aureon-color-primary);
		color: var(--aureon-color-link);
	}
}

/* Pagination (the_posts_navigation) ---------------------------------------- */

.nav-links {
	display: flex;
	justify-content: space-between;
	gap: var(--aureon-space-md);
	margin-top: var(--aureon-space-lg);
	padding-top: var(--aureon-space-lg);
	border-top: 1px solid var(--aureon-color-border);

	.nav-previous,
	.nav-next {

		/* Flex items default to min-width: auto, so one long unbroken title
		   would widen the row and push its sibling out of the column. */
		min-width: 0;
		font-size: var(--aureon-font-size-sm);
		font-weight: 600;
		overflow-wrap: anywhere;
	}

	.nav-next {
		margin-inline-start: auto;
	}

	a {
		color: var(--aureon-color-heading);
		text-decoration: none;
	}

	a:hover {
		color: var(--aureon-color-link);
	}
}

/* Search form -------------------------------------------------------------- */

.search-form {
	display: flex;
	gap: var(--aureon-space-sm);
	margin-block: var(--aureon-space-md);

	.search-field {
		flex: 1 1 auto;
		min-width: 0;
		padding: 0.65em 1em;
		border: 1px solid var(--aureon-color-border);
		border-radius: var(--aureon-radius-md);
		font-size: var(--aureon-font-size-md);
		color: var(--aureon-color-text);
		background: var(--aureon-color-background);
		transition: border-color 0.15s ease, box-shadow 0.15s ease;
	}

	.search-field:focus {
		border-color: var(--aureon-color-primary);
		outline: none;
		box-shadow:
			0 0 0 3px
			color-mix(in srgb, var(--aureon-color-primary) 15%, transparent);
	}

	.search-submit {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		padding: 0.65em 1.4em;
		border: 2px solid transparent;
		border-radius: var(--aureon-radius-md);
		background: var(--aureon-color-primary);
		color: var(--aureon-color-button-text);
		font-size: var(--aureon-font-size-sm);
		font-weight: 600;
		cursor: pointer;
		transition: background-color 0.15s ease;
	}

	.search-submit:hover {
		background: var(--aureon-color-primary-hover);
	}
}

/* Header search element (box / icon → inline | drawer) --------------------- */

.aureon-search {

	/* In the header the box form should sit flush, not carry article margins. */
	.search-form {
		position: relative;
		margin-block: 0;
	}

	&__toggle,
	&__close {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 40px;
		height: 40px;
		padding: 0;
		border: 0;
		background: transparent;
		color: var(--aureon-color-text);
		font-size: var(--aureon-font-size-xl);
		line-height: 1;
		cursor: pointer;
		transition: color 0.15s ease;
	}

	&__toggle:hover {
		color: var(--aureon-color-link);
	}

	/* The panel is shown/hidden via the `hidden` attribute (see search.js).
	   Scoped under the block (`.aureon-search …`) so it stays authoritative
	   over the reveal variants' `display`, which otherwise tie on specificity
	   and win on source order. */
	& &__panel[hidden],
	& &__results[hidden] {
		display: none;
	}
}

/* Box: always-visible inline form. Anchor the live-results dropdown to it. */
.aureon-search--box {
	position: relative;
}

/* Icon → drawer: a card dropped beneath the toggle. */
.aureon-search--offcanvas {
	position: relative;

	.aureon-search__panel {
		position: absolute;
		top: calc(100% + 8px);
		inset-inline-end: 0;
		z-index: 100;
		min-width: 280px;
		padding: var(--aureon-space-sm);
		background: var(--aureon-color-background);
		border: 1px solid var(--aureon-color-border);
		border-radius: var(--aureon-radius-md);
		box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
	}

	.aureon-search__close {
		display: none;
	}
}

/* Icon → inline: a bar spanning the whole header row, over the other elements.
   The widget stays a static box so the panel anchors to the (relative) row. */
.aureon-search--inline {
	position: static;

	.aureon-search__panel {
		position: absolute;
		inset-block: 0;
		inset-inline: 0;
		z-index: 30;
		display: flex;
		align-items: center;
		gap: var(--aureon-space-sm);
		padding-inline: var(--aureon-space-lg);
		background: var(--aureon-color-background);
	}

	.search-form {
		display: flex;
		flex: 1;
		gap: var(--aureon-space-sm);
	}

	.search-field {
		flex: 1;
	}

	.aureon-search__close {
		position: static;
		flex: 0 0 auto;
	}
}

/* Icon → full screen: a fixed overlay covering the viewport with the field
   centered. Escape, the close button, and a backdrop click all dismiss it
   (backdrop click is wired in search.js). */
.aureon-search--fullscreen {

	.aureon-search__panel {
		position: fixed;
		inset: 0;
		z-index: 1000;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: var(--aureon-space-lg);
		padding: var(--aureon-space-xl);
		background: color-mix(in srgb, var(--aureon-color-background) 97%, transparent);
	}

	.search-form {
		display: flex;
		gap: var(--aureon-space-sm);
		width: min(640px, 100%);
	}

	.search-field {
		flex: 1;
		font-size: var(--aureon-font-size-lg);
	}

	.aureon-search__close {
		position: absolute;
		inset-block-start: var(--aureon-space-lg);
		inset-inline-end: var(--aureon-space-lg);
	}

	/* Live results flow beneath the field rather than as an anchored dropdown. */
	.aureon-search__results {
		position: static;
		width: min(640px, 100%);
	}
}

/* Live-results dropdown (box + both icon reveal modes). */
.aureon-search__results {
	position: absolute;
	top: calc(100% + 6px);
	inset-inline: 0;
	z-index: 120;
	max-height: 340px;
	overflow-y: auto;
	background: var(--aureon-color-background);
	border: 1px solid var(--aureon-color-border);
	border-radius: var(--aureon-radius-md);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.aureon-search__result-list {
	margin: 0;
	padding: var(--aureon-space-xs);
	list-style: none;
}

.aureon-search__result a {
	display: block;
	padding: var(--aureon-space-xs) var(--aureon-space-sm);
	border-radius: var(--aureon-radius-sm);
	color: var(--aureon-color-text);
	text-decoration: none;
}

.aureon-search__result a:hover,
.aureon-search__result a:focus {
	background: color-mix(in srgb, var(--aureon-color-primary) 10%, transparent);
	color: var(--aureon-color-link);
}

.aureon-search__empty {
	margin: 0;
	padding: var(--aureon-space-sm);
	color: var(--aureon-color-text);
	font-size: var(--aureon-font-size-sm);
	opacity: 0.75;
}

/* The inline bar spans the row, so results align to the bar, not the field. */
.aureon-search--inline .aureon-search__results {
	inset-inline: var(--aureon-space-lg);
}

/* Comments ----------------------------------------------------------------- */

/**
 * The thread and the reply form share one visual language: a hairline-bordered
 * card on a faint tint of the text colour, so both read as "surfaces" no matter
 * which palette (or dark mode) the runtime tokens resolve to.
 */
.aureon-comments {
	--aureon-comments-surface: color-mix(in srgb, var(--aureon-color-text) 3%, var(--aureon-color-background));

	/**
	 * Accent for the action controls, pulled 35% toward the heading colour.
	 * The raw primary is picked for buttons — reversed white-on-colour — so at
	 * text size on a light ground it can land well under WCAG AA (the stock
	 * teal manages 2.65:1). Mixing toward the *heading* rather than toward
	 * black keeps this working in both directions: it darkens on a light
	 * palette and lightens on a dark one, instead of collapsing in dark mode.
	 */
	--aureon-comments-action: color-mix(in srgb, var(--aureon-color-primary) 65%, var(--aureon-color-heading));
	--aureon-comments-action-wash: color-mix(in srgb, var(--aureon-color-primary) 10%, transparent);

	margin-top: var(--aureon-space-xl);
	padding-top: var(--aureon-space-lg);
	border-top: 1px solid var(--aureon-color-border);
}

.aureon-comments__title {
	margin-block: 0 var(--aureon-space-lg);
	font-size: var(--aureon-font-size-lg);
}

.aureon-comments__list {
	margin: 0 0 var(--aureon-space-lg);
	padding: 0;
	list-style: none;

	.children {
		margin: var(--aureon-space-md) 0 0;
		padding-inline-start: var(--aureon-space-md);
		border-inline-start: 2px solid var(--aureon-color-border);
		list-style: none;
	}
}

.aureon-comments__list .comment-body {
	margin-bottom: var(--aureon-space-md);
	padding: var(--aureon-space-md);
	border: 1px solid var(--aureon-color-border);
	border-radius: var(--aureon-radius-lg);
	background: var(--aureon-comments-surface);
}

.aureon-comments__list .comment-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--aureon-space-sm);
	margin-bottom: var(--aureon-space-sm);
}

.aureon-comments__list .avatar {
	flex: none;
	border-radius: 50%;
}

.aureon-comments__list .comment-author {
	display: flex;
	align-items: center;
	gap: var(--aureon-space-sm);
}

.aureon-comments__list .comment-author .fn {
	font-style: normal;
	font-weight: 600;
	color: var(--aureon-color-heading);
}

.aureon-comments__list .comment-author .says {
	display: none;
}

.aureon-comments__list .comment-metadata {
	font-size: var(--aureon-font-size-sm);
	opacity: 0.7;

	a {
		color: inherit;
		text-decoration: none;
	}

	a:hover,
	a:focus-visible {
		text-decoration: underline;
	}
}

.aureon-comments__list .comment-content > :first-child {
	margin-top: 0;
}

.aureon-comments__list .comment-content > :last-child {
	margin-bottom: 0;
}

/* Awaiting-moderation notice reads as a badge, not body copy. */
.aureon-comments__list .comment-awaiting-moderation {
	display: inline-block;
	margin-bottom: var(--aureon-space-sm);
	padding: 0.15em 0.6em;
	border-radius: 999px;
	background: color-mix(in srgb, var(--aureon-color-accent) 20%, transparent);
	font-size: var(--aureon-font-size-sm);
}

.aureon-comments__list .reply {
	margin-top: var(--aureon-space-sm);
}

/**
 * The four comment actions — Reply, Cancel reply, Edit profile, Log out —
 * share one outlined-button treatment. They rest in the body colour with a
 * hairline border and only take the accent on hover, so a thread full of them
 * stays calm and none of them competes with the solid Post button.
 */
.aureon-comments__list .comment-reply-link,
#cancel-comment-reply-link,
.aureon-comments__identity-link {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	padding: 0.4em 0.8em;
	border: 1px solid var(--aureon-color-border);
	border-radius: var(--aureon-radius-md);
	background: var(--aureon-color-background);

	/* Cancel sits inside the reply <h2>, so the heading face is overridden. */
	font-family: var(--aureon-font-body);
	font-size: var(--aureon-font-size-sm);
	font-weight: 600;
	line-height: 1.4;
	color: var(--aureon-color-text);
	text-decoration: none;
	white-space: nowrap;
	transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.aureon-comments__list .comment-reply-link:hover,
#cancel-comment-reply-link:hover,
.aureon-comments__identity-link:hover {
	border-color: var(--aureon-comments-action);
	color: var(--aureon-comments-action);
	background: var(--aureon-comments-action-wash);
}

.aureon-comments__list .comment-reply-link:focus-visible,
#cancel-comment-reply-link:focus-visible,
.aureon-comments__identity-link:focus-visible {
	outline: 2px solid var(--aureon-comments-action);
	outline-offset: 2px;
}

/* Decorative — the sibling label span carries the accessible name. */
.aureon-comments__action-icon {
	flex: none;
	width: 1.05em;
	height: 1.05em;
}

.aureon-comments__closed {
	margin-bottom: var(--aureon-space-lg);
	font-size: var(--aureon-font-size-sm);
	opacity: 0.75;
}

/* Reply form --------------------------------------------------------------- */

.aureon-comments__respond {
	padding: var(--aureon-space-md);
	border: 1px solid var(--aureon-color-border);
	border-radius: var(--aureon-radius-lg);
	background: var(--aureon-comments-surface);
}

/* A nested reply form sits inside a comment card: drop the extra frame. */
.aureon-comments__list .comment-respond {
	margin-bottom: var(--aureon-space-md);
	background: var(--aureon-color-background);
}

.comment-reply-title {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--aureon-space-sm);
	margin-block: 0 var(--aureon-space-xs);
	font-size: var(--aureon-font-size-lg);
	line-height: 1.3;
}

/* Core prints the "Cancel reply" link inside a <small> in the heading. */
.comment-reply-title small {
	font-size: var(--aureon-font-size-sm);
	font-weight: 400;
}

/* Cancel sits in the heading row, so it stays on one line. */
#cancel-comment-reply-link {
	white-space: nowrap;
}

.comment-notes {
	margin-block: 0 var(--aureon-space-md);
	font-size: var(--aureon-font-size-sm);
	opacity: 0.75;
}

/* Signed-in identity row --------------------------------------------------- */

/**
 * Identity is its own bordered strip above the field, so the account actions
 * read as chrome instead of dissolving into the intro copy the way core's
 * "Logged in as … Log out?" sentence does.
 */
.aureon-comments__identity {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--aureon-space-sm);
	margin-block: 0 var(--aureon-space-md);
	padding: var(--aureon-space-sm);
	border: 1px solid var(--aureon-color-border);
	border-radius: var(--aureon-radius-md);
	background: var(--aureon-color-background);
	font-size: var(--aureon-font-size-sm);
}

.aureon-comments__identity-user {
	display: flex;
	align-items: center;
	gap: var(--aureon-space-sm);
	min-width: 0;
}

.aureon-comments__identity-avatar {
	flex: none;
	border-radius: 50%;
}

.aureon-comments__identity-name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.aureon-comments__identity-name strong {
	color: var(--aureon-color-heading);
}

.aureon-comments__identity-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--aureon-space-sm);
}


.comment-form {
	display: flex;
	flex-direction: column;
	gap: var(--aureon-space-md);
	margin: 0;
}

.aureon-comments .comment-form {
	display: grid;
	grid-template-columns: 1fr;
	max-width: none;
}

/* Every direct child is a full-width row until the 2-up breakpoint pairs
   Name and Email; the gap owns the rhythm, so per-row margins are dropped. */
.aureon-comments .comment-form > * {
	grid-column: 1 / -1;
	margin: 0;
}

.comment-form label {
	display: block;
	margin-bottom: var(--aureon-space-xs);
	font-size: var(--aureon-font-size-sm);
	font-weight: 600;
	color: var(--aureon-color-heading);
}

.comment-form .required {
	color: var(--aureon-color-accent);
	font-weight: 700;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	display: block;
	width: 100%;
	max-width: 100%;
	padding: 0.7em 0.9em;
	border: 1px solid var(--aureon-color-border);
	border-radius: var(--aureon-radius-md);
	font: inherit;
	line-height: 1.5;
	color: var(--aureon-color-text);
	background: var(--aureon-color-background);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* The WooCommerce review form ships a <select> for the star rating fallback. */
.comment-form select {
	width: 100%;
	padding: 0.7em 2.5em 0.7em 0.9em;
	border: 1px solid var(--aureon-color-border);
	border-radius: var(--aureon-radius-md);
	font: inherit;
	color: var(--aureon-color-text);
	background-color: var(--aureon-color-background);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%231f2937' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 1em center;
	appearance: none;
	cursor: pointer;
}

.comment-form select:focus {
	border-color: var(--aureon-color-primary);
	outline: none;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--aureon-color-primary) 18%, transparent);
}

.comment-form input::placeholder,
.comment-form textarea::placeholder {
	color: var(--aureon-color-text);
	opacity: 0.45;
}

.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus,
.comment-form input[type="url"]:focus,
.comment-form textarea:focus {
	border-color: var(--aureon-color-primary);
	outline: none;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--aureon-color-primary) 18%, transparent);
}

.comment-form textarea {
	min-height: 9rem;
	resize: vertical;
}

/* Consent checkbox is a row, not a stacked label. */
.comment-form-cookies-consent {
	display: flex;
	align-items: flex-start;
	gap: var(--aureon-space-sm);
}

.comment-form-cookies-consent input[type="checkbox"] {
	flex: none;
	width: 1rem;
	height: 1rem;
	margin: 0.2rem 0 0;
	accent-color: var(--aureon-color-primary);
}

.comment-form-cookies-consent label {
	margin: 0;
	font-size: var(--aureon-font-size-sm);
	font-weight: 400;
	color: var(--aureon-color-text);
}

.comment-form .form-submit {
	margin: 0;
}

.comment-form .submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.75em 1.75em;
	border: 1px solid transparent;
	border-radius: var(--aureon-radius-md);
	background: var(--aureon-color-primary);
	color: var(--aureon-color-button-text);
	font: inherit;
	font-size: var(--aureon-font-size-sm);
	font-weight: 600;
	line-height: 1.4;
	cursor: pointer;
	transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.comment-form .submit:hover {
	background: var(--aureon-color-primary-hover);
}

.comment-form .submit:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--aureon-color-primary) 35%, transparent);
}

/* Name + email pair up once there is room for two comfortable columns. */
@media (min-width: 600px) {

	.aureon-comments__respond {
		padding: var(--aureon-space-lg);
	}

	.aureon-comments .comment-form {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.aureon-comments .comment-form > p.comment-form-author,
	.aureon-comments .comment-form > p.comment-form-email {
		grid-column: span 1;
	}
}

/* Responsive -------------------------------------------------------------- */

// Per-device header layouts. Each wrapper is hidden by default and shown only
// at the tiers it declares (is-vis-*). Desktop declares the tiers that aren't
// independently customized, so it also covers tablet/mobile as a fallback.
.aureon-header__device,
.aureon-footer__device {
	display: none;
}

@media (min-width: 1024px) {

	.aureon-header__device.is-vis-desktop,
	.aureon-footer__device.is-vis-desktop {
		display: block;
	}
}

@media (min-width: 782px) and (max-width: 1023px) {

	.aureon-header__device.is-vis-tablet,
	.aureon-footer__device.is-vis-tablet {
		display: block;
	}
}

@media (max-width: 781px) {

	.aureon-header__device.is-vis-mobile,
	.aureon-footer__device.is-vis-mobile {
		display: block;
	}
}

@media (max-width: 782px) {

	// Only the desktop layout is auto-simplified when it falls back onto small
	// screens (hide the inline nav / centered column, expose the toggle). A
	// custom mobile layout renders exactly as the user built it.
	.aureon-header__device--desktop .aureon-header__col .aureon-nav,
	.aureon-header__device--desktop .aureon-header__col.is-center {
		display: none;
	}

	.aureon-header__toggle--auto {
		display: inline-flex;
	}

	// The desktop footer layout stacks its columns when it falls back onto
	// small screens; custom tablet/mobile layouts render exactly as built.
	.aureon-footer__device--desktop .aureon-footer__inner {
		flex-direction: column;
		align-items: stretch;
	}

	.aureon-footer__device--desktop .aureon-footer__col {
		justify-content: flex-start;
	}
}

// The off-canvas panel is available on tablet and mobile (both can carry a
// Toggle); only the desktop tier hides it outright.
@media (min-width: 1024px) {

	.aureon-offcanvas {
		display: none;
	}
}
