/*
 * Nomon Theme — base stylesheet, loaded on the frontend and inside the editor iframe.
 *
 * Tailwind handles reset and utilities; this file owns only what utilities can't express.
 * Responsibilities and the cascade smoke-test: docs/styling.md.
 */

/* Up front so layer order doesn't depend on when Blockstudio's inline style loads. Holds
 * only while Blockstudio emits layered utilities — smoke-test in docs/styling.md. */
@layer theme, base, components, utilities;

/* Unlayered on purpose: wrapping this ties with preflight's `body { line-height: inherit }`. */
body {
	font-size: var(--wp--preset--font-size--regular);
	line-height: 1.45;
	--prose-cap: 72ch;
}

/* Registered so `ch` resolves against body's font here, not per heading at the point of use. */
@property --prose-cap { syntax: "<length>"; inherits: true; initial-value: 0px; }

/* WP's `size-full` marker collides with Tailwind's utility of that name; unlayered on
 * purpose so it beats the layered utility. See docs/styling.md. */
.wp-block-image.size-full {
	height: auto;
}

@layer base {
	body p { margin-block: 0 0.625rem; }
	body figure { margin-block: 3rem; }

	.nomon-buttons { margin-block: 2.5rem; }
	.nomon-buttons:first-child { margin-top: 0; }
	.nomon-buttons:last-child { margin-bottom: 0; }

	/* Preflight's `bolder` resolves to 400 against the 300 body weight. */
	body :is(b, strong) { font-weight: 700; }

	body :is(h1, h2, h3, h4, h5, h6) { line-height: 1.4; margin-block: 2.5rem; }
	body :is(h5, h6) { margin-block: 1.25rem 0.625rem; }

	body h1 { font-size: var(--wp--preset--font-size--heading-1); font-weight: 700; }
	body h2 { font-size: var(--wp--preset--font-size--heading-2); font-weight: 600; }
	body h3 { font-size: var(--wp--preset--font-size--heading-3); font-weight: 400; }
	body h4 { font-size: var(--wp--preset--font-size--heading-4); font-weight: 400; }
	body h5 { font-size: var(--wp--preset--font-size--heading-5); font-weight: 600; }
	body h6 { font-size: var(--wp--preset--font-size--heading-6); font-weight: 400; }

	/* Weight follows the size preset, not the tag; must stay below the tag rules above. */
	body .has-heading-1-font-size { font-weight: 700; }
	body .has-heading-2-font-size { font-weight: 600; }
	body .has-heading-3-font-size { font-weight: 400; }
	body .has-heading-4-font-size { font-weight: 400; }
	body .has-heading-5-font-size { font-weight: 600; }
	body .has-heading-6-font-size { font-weight: 400; }

	/* A sub-heading sized down by preset sits close to its own text, whatever its tag. */
	body :is(.has-heading-5-font-size, .has-heading-6-font-size) { margin-block: 2.5rem 0.9375rem; }

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

	/* core/list block: restore bullets/numbers and indent that Tailwind preflight zeroes. */
	.wp-block-list { margin-block: 0 0.625rem; padding-inline-start: 2.5rem; }
	.wp-block-list:where(ul) { list-style: disc; }
	.wp-block-list:where(ol) { list-style: decimal; }

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

	body .nomon-home-hero h1 { line-height: 1; }

	body .nomon-article__content h2 { font-size: var(--wp--preset--font-size--heading-5); font-weight: 600; }
	body .nomon-article__content :is(h3, h4) { font-size: var(--wp--preset--font-size--heading-6); font-weight: 400; }

	.pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.625rem 1.25rem; margin-top: 3.75rem; }
	.pagination .page-numbers { min-width: 1.5rem; text-align: center; }
	.pagination .page-numbers.current { color: var(--wp--preset--color--yellow); }

	body :is(h1, h2, h3, h4, h5, h6).is-style-dash { margin-bottom: 1.25rem; }
	:is(h1, h2, h3, h4, h5, h6).is-style-dash::after {
		content: "";
		display: block;
		width: 50px;
		margin-top: 1.25rem;
		border-top: 4px dashed var(--wp--preset--color--yellow);
	}
	.text-center :is(h1, h2, h3, h4, h5, h6).is-style-dash::after,
	:is(h1, h2, h3, h4, h5, h6).is-style-dash.has-text-align-center::after {
		margin-inline: auto;
	}

	/* `body a` outranks preflight's `a`, which lands later in this layer. */
	body a {
		color: inherit;
		text-decoration: underline;
		text-decoration-color: var(--wp--preset--color--yellow);
	}
	body a:is(:hover, :focus) { color: var(--wp--preset--color--yellow); }

	/* Editor blocks are focusable too and draw their own selection outline. */
	:focus-visible:not(.block-editor-block-list__block) {
		outline: 2px solid var(--wp--preset--color--yellow);
		outline-offset: 2px;
	}

	:is(.has-yellow-background-color, .bg-yellow, .has-white-background-color, .bg-white) {
		color: var(--wp--preset--color--black);
	}
	:is(.has-yellow-background-color, .bg-yellow) { font-weight: 400; }
	:is(.has-yellow-background-color, .bg-yellow, .has-white-background-color, .bg-white) a {
		color: var(--wp--preset--color--black);
		text-decoration-color: currentColor;
	}
	:is(.has-yellow-background-color, .bg-yellow, .has-white-background-color, .bg-white) a:is(:hover, :focus) {
		color: var(--wp--preset--color--black);
		text-decoration-thickness: 2px;
	}
	/* `.nomon-banner` / `.nomon-pm`: the cookie plugin's white dialogs, which inherit the ring above. */
	:is(.has-yellow-background-color, .bg-yellow, .has-white-background-color, .bg-white, .nomon-banner, .nomon-pm) :focus-visible {
		outline-color: var(--wp--preset--color--black);
	}
}

/* Prose cap; descendant selector so prose inside a nested group is capped too. */
.wp-block-group :is(p, h1, h2, h3, h4, h5, h6, ul, ol),
.site-content > :is(p, h1, h2, h3, h4, h5, h6, ul, ol) {
	max-width: var(--prose-cap);
	/* Pins prose to the contentSize start edge however wide the parent is;
	 * `!important` beats WP's `.is-layout-constrained > * { margin-inline: auto !important }`. */
	margin-inline-start: max(
		0px,
		calc((100% - var(--wp--style--global--content-size)) / 2)
	) !important;
}

/* Auto-bleed, mirroring native `.alignfull`; `!important` matches WP's own margin rule. */
.has-global-padding > .wp-block-group.has-background {
	max-width: none;
	margin-left: calc(var(--wp--style--root--padding-left) * -1) !important;
	margin-right: calc(var(--wp--style--root--padding-right) * -1) !important;
	padding-left: var(--wp--style--root--padding-left);
	padding-right: var(--wp--style--root--padding-right);
}

/* A root-level Group is a section; composite blocks set their own padding from the tokens. */
.has-global-padding > .wp-block-group {
	padding-block: var(--wp--preset--spacing--section-md);
}

/* Two plain sections sit one step apart, not two. */
.has-global-padding > .wp-block-group:not(.has-background) + .wp-block-group:not(.has-background) {
	padding-top: 0;
}

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

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

	/* Gutenberg can't hide these toolbar buttons, so cancel the effect instead. */
	body :where(h1, h2, h3, h4, h5, h6) :is(strong, b, em, i) {
		font-weight: inherit;
		font-style: inherit;
	}

	/* Same reason as above; the editor iframe loads this file too, so preview matches. */
	:is(p, h1, h2, h3, h4, h5, h6):is(
		.has-text-align-left,
		.has-text-align-center,
		.has-text-align-right
	) {
		text-align: inherit;
	}

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

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

	/* WCAG 2.4.4: per-site CSS may restyle or hide the glyph, never the screen-reader text. */
	a.is-external-link::after,
	a.is-new-window::after {
		content: " ↗";
		display: inline-block;
		font-size: 0.85em;
		vertical-align: super;
		line-height: 1;
	}
	a.is-new-window::after {
		content: " ⧉";
	}
	a.is-external-link.is-new-window::after {
		content: " ⧉";
	}

	/* Hides the glyph in the footer, credit bar and social icons only; the screen-reader text stays. */
	:is(.site-footer, .nomon_footer, .nomon-social) a.is-external-link::after,
	:is(.site-footer, .nomon_footer, .nomon-social) a.is-new-window::after,
	:is(.site-footer, .nomon_footer, .nomon-social) a.is-external-link.is-new-window::after {
		content: none;
	}
}

/* Critical Swiper layout before the lazy vendor CSS lands. No pre-init `visibility: hidden`
 * — that hid the hero from FlyingPress's above-the-fold pass, costing the LCP preload. */
.swiper { overflow: hidden; }
.swiper-wrapper { display: flex; }
.swiper-slide { flex-shrink: 0; width: 100%; }
/* Overrides FlyingPress Lazy Render's inline style — see docs/runtimes.md. */
.swiper-slide,
.swiper-slide * { content-visibility: visible !important; }

/* Editor-only: flattens Gutenberg's InnerBlocks wrapper chain, which breaks parent flex/grid.
 * Unlayered to outrank editor styles; descendant combinators because `useBlockProps` shifts a level. */
[data-type^="nomon/"] .block-editor-inner-blocks,
[data-type^="nomon/"] .block-editor-block-list__layout:not([data-type]) {
	display: contents;
}

[data-type="nomon/text-sidebox"]:not(:has(.wp-block)),
[data-type="nomon/sidebox"]:not(:has(.wp-block)),
[data-type="nomon/service-cards"]:not(:has(.wp-block)),
[data-type="nomon/news-cards"]:not(:has(.wp-block)),
[data-type="nomon/social"]:not(:has(.wp-block)),
[data-type="nomon/cta-band"]:not(:has(.wp-block)),
[data-type="nomon/home-hero"]:not(:has(.wp-block)) {
	min-height: 3rem;
	outline: 1px dashed currentColor;
}

/* Editor-only: a drag saves the box's computed `aspectRatio`, which the ratio dropdown
 * cannot display or clear (`docs/integrations.md`). Selector length beats the components
 * stylesheet's own `.has-show-handle` rule at (0,3,0). */
[data-type="core/image"] .components-resizable-box__container.has-show-handle .components-resizable-box__handle {
	display: none;
}

/* Editor-only: makes the post title read as page metadata, not the first H1. No negative
 * inline margin needed — `useRootPaddingAwareAlignments` leaves body itself unpadded. */
/* WP core's editor styles add a top padding to the iframe body; zero it. */
body {
	padding-top: 0;
}

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

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

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

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

:root {
	/* Must stay numeric: JS reads it via getComputedStyle for matchMedia. */
	--breakpoint-nav: 1199px;

	--hamburger-color: var(--wp--preset--color--white);
	--hamburger-color-active: var(--wp--preset--color--white);
	--hamburger-width: 2rem;
	--hamburger-layer-height: 2px;

	/* Desktop dropdowns */
	--color-main-level: var(--wp--preset--color--white);
	--color-hover-main-level: var(--wp--preset--color--white);
	--color-current: var(--wp--preset--color--white);
	--typography-size-main-level: 1.375rem;
	--typography-weight-main-level: 400;
	--padding-main-level-vertical: 0.875rem;
	--gap-main-level-horizontal: 1.75rem;
	--gap-between-dropdown-toggle: 0.125rem;
	--dropdown-toggle-size: 1.5rem;

	--color-sub-menu: var(--wp--preset--color--white);
	--color-hover-sub-menu: var(--wp--preset--color--white);
	--color-background-sub-menu: var(--wp--preset--color--black);
	--typography-size-sub-menu: 1rem;
	--typography-weight-sub-menu: 400;
	--padding-sub-menu-vertical: 0;
	--padding-sub-menu-link-vertical: 0.875rem;
	--padding-sub-menu-link-horizontal: 2.125rem;
	--width-sub-menu: 13.75rem;
	--gap-dropdown: 0px;

	/* Mobile drawer */
	--width-navigation: 100vw;
	--color-background-menu-items: var(--wp--preset--color--black);
	--color-separator-nav-mobile: transparent;
	--color-main-level-menu-item-mobile: var(--wp--preset--color--white);
	--color-main-level-menu-item-hover-focus-mobile: var(--wp--preset--color--white);
	--color-sub-menu-mobile: var(--wp--preset--color--white);
	--color-current-menu-item: var(--wp--preset--color--white);
	--color-dropdown-toggle-mobile: var(--wp--preset--color--white);
	--typography-size-main-level-mobile: 1.375rem;
	--typography-weight-main-level-mobile: 400;
	--padding-main-level-vertical-mobile: 0.875rem;
	--typography-size-sub-menu-mobile: 1rem;
	--typography-weight-sub-menu-mobile: 400;
	--margin-left-sub-menu: 0.9375rem;
	--padding-sub-menu-vertical-mobile: 0.875rem;
	--padding-sub-menu-horizontal-mobile: var(--wp--style--root--padding-left, clamp(1rem, 5vw, 5rem));
}

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

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

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

.nav-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 4rem;
	height: 4rem;
	margin: 0;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 0;
	cursor: pointer;
	position: relative;
	z-index: 99999;
}

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

@media (max-width: 1199.98px) {
	.nav-primary .menu-items ul { display: none; }
	.nav-primary ul .sub-menu.toggled-on { display: block; }

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

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

	.nav-primary .menu-items-wrapper {
		position: fixed;
		top: 0;
		right: 0;
		width: var(--width-navigation);
		height: calc(100dvh - 7.2rem); /* JS recalculates from actual header height */
		background-color: var(--color-background-menu-items);
		transform: translate3d(100%, 0, 0);
		transition: transform 220ms cubic-bezier(0.19, 1, 0.22, 1), opacity 180ms ease-in-out;
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
		overflow: auto;
		padding-bottom: 7.5rem;
		backface-visibility: hidden;
		z-index: 5;
	}

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

	.nav-primary .menu-item a {
		display: block;
		padding-block: var(--padding-main-level-vertical-mobile);
		padding-inline: var(--padding-sub-menu-horizontal-mobile);
		border-top: 1px solid var(--color-separator-nav-mobile);
		color: var(--color-main-level-menu-item-mobile);
		font-size: var(--typography-size-main-level-mobile);
		font-weight: var(--typography-weight-main-level-mobile);
		text-decoration: none;
		position: relative;
		z-index: 0;
	}
	.nav-primary .menu-item a:hover,
	.nav-primary .menu-item a:focus { color: var(--color-main-level-menu-item-hover-focus-mobile); }
	/* Full-width rows: an outset ring would be clipped at both screen edges. */
	.nav-primary .menu-item :focus-visible { outline-offset: -2px; }
	.nav-primary .menu-item.current-menu-parent > a,
	.nav-primary .menu-item.current-menu-item > a { color: var(--color-current-menu-item); }

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

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

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

@media (max-width: 782px) {
	.logged-in.admin-bar .nav-primary .menu-items-wrapper { margin-top: 46px; }
}

@media (min-width: 1200px) {
	.nav-toggle { display: none; }

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

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

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

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

	.nav-primary .menu-item.menu-item-has-children {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: var(--gap-between-dropdown-toggle);
	}

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

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

	.nav-primary .sub-menu.is-out-of-viewport { left: auto; right: 0; }
	.nav-primary .sub-menu.is-out-of-viewport .sub-menu,
	.nav-primary .sub-menu .sub-menu.is-out-of-viewport { left: auto; right: 100%; }

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

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

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

/* Live has only the hover underline; the current state borrows it (capture README item 22). */
.nav-primary .menu-item a:is(:hover, :focus-visible),
.nav-primary .menu-item:is(.current-menu-item, .current-menu-parent, .current-menu-ancestor, .current_page_parent) > a {
	text-decoration: underline;
	text-decoration-color: var(--wp--preset--color--yellow);
}

/* WordPress flags the posts page as `current_page_parent` on every non-page view. */
:is(.search, .error404) .nav-primary .menu-item.current_page_parent > a:not(:hover, :focus-visible) {
	text-decoration: none;
}

/* Decorative top-edge shade; `--shade-height` per use (footer 130px, #15 170px). */
.has-top-shade {
	position: relative;
	isolation: isolate;
}
.has-top-shade::before {
	content: "";
	position: absolute;
	inset: 0 0 auto 0;
	z-index: -1;
	height: var(--shade-height, 130px);
	background: linear-gradient(to bottom, rgb(0 0 0 / 0.39), var(--wp--preset--color--dark) 89%);
	pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.hamburger,
	.hamburger::before,
	.hamburger::after,
	.nav-primary .menu-items-wrapper,
	.nav-primary .sub-menu,
	.nav-primary .dropdown-toggle svg { transition: none; }
}
