/*
 * Block: core/navigation. Loads on every page with a Navigation block, i.e.
 * wherever the header renders, so keep it short. Generic fixes upstreamed
 * from client QA: 44px targets, a submenu panel on tokens, the phone overlay
 * on tokens with the heading face, 44px open/close buttons.
 */

/* ---------- items ---------- */

.wp-block-navigation .wp-block-navigation-item__content {
	display: flex;
	align-items: center;
	box-sizing: border-box;
	min-height: 44px;
	padding: 0.25rem 0;
}

/* Submenu toggle: 24px target, theme font. */
.wp-block-navigation .wp-block-navigation-submenu__toggle {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.5rem;
	height: 1.5rem;
	margin-left: 0;
	padding: 0.375rem;
	font-family: inherit;
}

.wp-block-navigation .wp-block-navigation-submenu__toggle svg {
	width: 0.75rem;
	height: 0.75rem;
}

/* ---------- submenu panel (desktop) ---------- */

.wp-block-navigation .has-child .wp-block-navigation__submenu-container {
	border: var(--wp--custom--border--width, 1px) solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--small, 0.375rem);
	background-color: var(--wp--preset--color--base-2);
	color: var(--wp--preset--color--contrast);
	padding: 0.5rem;
	box-shadow: var(--wp--preset--shadow--soft);
}

/* Items keep their width: the panel grows to its longest label. */
.wp-block-navigation .has-child .wp-block-navigation__submenu-container > .wp-block-navigation-item > .wp-block-navigation-item__content {
	padding: 0.5rem 0.75rem;
	border-radius: var(--wp--custom--radius--small, 0.375rem);
	white-space: nowrap;
}

/* ---------- overlay menu (phones) ---------- */

.wp-block-navigation:not(.has-background) .wp-block-navigation__responsive-container.is-menu-open:not(.disable-default-overlay) {
	--navigation-layout-justification-setting: flex-start;
	--navigation-layout-justify: flex-start;
	background-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	padding: var(--wp--preset--spacing--40);
	text-align: left;
}

.wp-block-navigation__responsive-container.is-menu-open:not(.disable-default-overlay) .wp-block-navigation__responsive-container-content .wp-block-navigation__container,
.wp-block-navigation__responsive-container.is-menu-open:not(.disable-default-overlay) .wp-block-navigation__responsive-container-content .wp-block-page-list {
	gap: var(--wp--preset--spacing--20);
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: var(--wp--custom--typography--font-weight--heading, 600);
	letter-spacing: var(--wp--custom--typography--letter-spacing--heading, 0);
	line-height: 1.15;
}

.wp-block-navigation__responsive-container.is-menu-open:not(.disable-default-overlay) .wp-block-navigation__responsive-container-content .wp-block-navigation-item__content {
	display: flex;
	align-items: center;
	min-height: 44px;
	padding: 0.375rem 0;
	white-space: normal;
}

/* Submenus are flat lists in the overlay, in the body face. */
.wp-block-navigation__responsive-container.is-menu-open:not(.disable-default-overlay) .wp-block-navigation__responsive-container-content .has-child .wp-block-navigation__submenu-container {
	border: 0;
	border-radius: 0;
	box-shadow: none;
	padding: 0.25rem 0 0.5rem 1rem;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--large);
	font-weight: var(--wp--custom--typography--font-weight--bold, 600);
	letter-spacing: 0;
}

/* ---------- open / close buttons: 44px, current colour ---------- */

.wp-block-navigation__responsive-container-open,
.wp-block-navigation__responsive-container-close {
	box-sizing: border-box;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 10px;
	color: inherit;
}

/* The burger keeps its visual size; the hit area grows outwards. */
.wp-block-navigation__responsive-container-open {
	margin: -10px;
}

.wp-block-navigation__responsive-container-close {
	display: flex;
	top: calc(var(--wp--preset--spacing--40) - 10px);
	right: calc(var(--wp--preset--spacing--40) - 10px);
}

/* ---------- header row (pattern revsults/header) ---------- */

/* One row at every width: the action's label never wraps (core lets button
   labels break anywhere), and the round controls beside it keep their 40 px. */
.revsults-header .wp-block-buttons.revsults-header-action,
.revsults-header .revsults-theme-toggle,
.revsults-header .revsults-burger {
	flex-shrink: 0;
}

.revsults-header-action .wp-block-button__link {
	white-space: nowrap;
}

/* The action leaves the row below 768 px on every template: a phone bar holds
   brand, menu and toggle. Up to 999 px it also gives way where the page
   carries the sticky CTA bar, which holds the call to action up to that
   width. A menu too long for the row from 768 px moves the burger breakpoint
   in the child (DESIGN-SYSTEM §4.6). */
@media (max-width: 767px) {
	:root .wp-block-buttons.revsults-header-action {
		display: none;
	}
}

@media (max-width: 999px) {
	:root:has(.revsults-sticky-cta) .wp-block-buttons.revsults-header-action {
		display: none;
	}
}
