/*
 * Header bar (core/group, the header-bar template part's root inside every site header part): the row's look, the
 * same in every header. Its constrained layout keeps the theme's sizes, and the row's alignment (toolbar) picks its
 * width site-wide: Full (default), Wide or none (the content width); colours come from the header around it (Site
 * header style and the look parts' settings).
 * - Full stops at the site frame (theme.json custom layout.frame, 1680px), like the footer and the title bands;
 * - logo: without a site logo, the theme's mark in an accent circle before the site title;
 * - lines (core/separator in the row): 1px in the header's text colour;
 * - main menu (the row's navigation without an overlay, with the Dropdown style for its submenus): label type, caps,
 *   hover and current item colour (--rt-header-hover, set by the Site header style);
 * - mini cart, search and the menu button: icon sizes, the cart count, the menu panel from the right;
 * - under 64rem the main menu and the lines hide: the menu button opens the menu.
 * Selectors go through `.is-style-header-bar > .wp-block-group > …` (the row), so the offcanvas navigation inside the
 * menu button is not hit. Loaded only on pages where a group uses the style (inc/rt-block-styles.php).
 */
/* Full stops at the site frame; core's constrained layout gives a full row max-width none (0,2,0, printed later) */
.is-style-header-bar.is-layout-constrained > .alignfull {
	max-width: var(--wp--custom--layout--frame);
	margin-inline: auto;
}

/* Logo and site title: the mark stands in for a missing site logo; a long title ends with an ellipsis */
.is-style-header-bar > .wp-block-group > .wp-block-group:has(> .wp-block-site-title) {
	min-width: 0;
}

.is-style-header-bar > .wp-block-group > .wp-block-group:has(> .wp-block-site-title):not(:has(img))::before {
	content: "";
	flex: none;
	width: 3rem;
	height: 3rem;
	border-radius: 50%;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cpath d='M25.4765714,18.7693625 L18.2655714,22.3796623 C17.9931429,22.5159836 17.8155714,22.7890556 17.801,23.0935973 L17.7525714,24.1135044 C17.7218571,24.7572046 18.3945714,25.1959221 18.9702857,24.9078305 L30.7812857,18.9945145 C31.3411429,18.7141473 32,19.1218241 32,19.7486451 L32,24.6763845 C32,25.1075206 31.6907143,25.4931685 31.2632857,25.5452367 C30.7511429,25.607461 30.3157143,25.2089391 30.3157143,24.7084265 L30.3157143,22.5800676 C30.3157143,21.9482401 29.6474286,21.5408494 29.087,21.8309436 L18.2665714,27.4308491 C17.9938571,27.572034 17.8194286,27.8505416 17.8114286,28.1576581 L17.7057143,32.1790677 C17.6937143,32.6358087 17.3204286,33 16.8638571,33 L16.842,33 C16.377,33 16,32.6225056 16,32.1567528 L16,21.9908673 C16,21.674739 16.1764286,21.38536 16.4571429,21.2408851 L24.4754286,17.11491 C24.9837143,16.8534247 25.6075714,17.0532578 25.8697143,17.5616379 C26.0978571,18.0035023 25.9208571,18.5469283 25.4765714,18.7693625'/%3E%3C/svg%3E") 50% 50% / contain no-repeat, var(--wp--preset--color--accent);
}

.is-style-header-bar .wp-block-site-logo {
	flex: none;
}

.is-style-header-bar .wp-block-site-title {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* Lines: 1px in the text colour (a colour setting on the line still wins: core's colour classes are !important) */
.is-style-header-bar > .wp-block-group > .wp-block-separator {
	height: 0;
	margin: 0;
	border: 0;
	border-top: 1px solid currentColor;
	background: none;
	color: inherit;
	opacity: 1;
}

/* Main menu: its Typography settings win (the defaults sit in :where()) */
:where(.is-style-header-bar > .wp-block-group > .wp-block-navigation:not(.is-responsive)) {
	font-family: var(--wp--preset--font-family--label);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	text-transform: uppercase;
}

.is-style-header-bar > .wp-block-group > .wp-block-navigation:not(.is-responsive) .wp-block-navigation-item {
	flex-wrap: nowrap;
	white-space: nowrap;
}

.is-style-header-bar > .wp-block-group > .wp-block-navigation:not(.is-responsive) a {
	text-decoration: none;
	transition: color 0.2s ease;
}

/* First-level items only: submenu links keep their panel's look (Dropdown style), so the accent header's white hover
   does not reach a white panel. The submenu chevron and its label are one target: hovering or focusing either one, or
   the current page, colours both, with the label's transition. */
.is-style-header-bar > .wp-block-group > .wp-block-navigation:not(.is-responsive) .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation__submenu-icon {
	transition: color 0.2s ease;
}

.is-style-header-bar > .wp-block-group > .wp-block-navigation:not(.is-responsive) .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content:hover,
.is-style-header-bar > .wp-block-group > .wp-block-navigation:not(.is-responsive) .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content:focus-visible,
.is-style-header-bar > .wp-block-group > .wp-block-navigation:not(.is-responsive) .wp-block-navigation__container > .wp-block-navigation-item > [aria-current="page"],
.is-style-header-bar > .wp-block-group > .wp-block-navigation:not(.is-responsive) .wp-block-navigation__container > .wp-block-navigation-item:has(> .wp-block-navigation__submenu-icon:is(:hover, :focus-visible)) > .wp-block-navigation-item__content,
.is-style-header-bar > .wp-block-group > .wp-block-navigation:not(.is-responsive) .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content:is(:hover, :focus-visible, [aria-current="page"]) ~ .wp-block-navigation__submenu-icon,
.is-style-header-bar > .wp-block-group > .wp-block-navigation:not(.is-responsive) .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation__submenu-icon:is(:hover, :focus-visible) {
	color: var(--rt-header-hover);
}

@media (prefers-reduced-motion: reduce) {
	.is-style-header-bar > .wp-block-group > .wp-block-navigation:not(.is-responsive) .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation__submenu-icon {
		transition: none;
	}
}

/* Mini cart: bag icon, count badge on the accent fill (WooCommerce writes its colours inline) */
.is-style-header-bar .wc-block-mini-cart .wc-block-mini-cart__button {
	padding: 0;
	color: inherit;
	font-style: inherit;
	font-weight: inherit;
	letter-spacing: inherit;
	text-transform: inherit;
}

:where(.is-style-header-bar .wc-block-mini-cart) {
	font-weight: 500;
}

.is-style-header-bar .wc-block-mini-cart .wc-block-mini-cart__icon {
	width: 1.75rem;
	height: 1.75rem;
}

.is-style-header-bar .wc-block-mini-cart .wc-block-mini-cart__badge {
	top: auto;
	bottom: -0.5rem;
	color: var(--wp--preset--color--on-accent) !important;
	transform: none;
}

/* Search open: the main menu and the short line make room for the field */
.is-style-header-bar:has(.wp-block-search:not(.wp-block-search__searchfield-hidden)) > .wp-block-group > .wp-block-navigation:not(.is-responsive),
.is-style-header-bar:has(.wp-block-search:not(.wp-block-search__searchfield-hidden)) > .wp-block-group > .wp-block-separator:first-of-type {
	display: none;
}

/* Menu button: the open panel comes in from the right (26rem) over a dark backdrop, below the admin bar */
.is-style-header-bar .wp-block-navigation.is-responsive .wp-block-navigation__responsive-container-open {
	padding: 0;
	color: inherit;
}

.is-style-header-bar .wp-block-navigation.is-responsive .wp-block-navigation__responsive-container-open svg {
	width: 1.625rem;
	height: 1.625rem;
}

.is-style-header-bar .wp-block-navigation.is-responsive .wp-block-navigation__responsive-container.is-menu-open {
	inset: 0 0 0 auto;
	width: min(26rem, 100vw);
	padding: 0;
	box-shadow: 0 0 0 100vmax rgb(0 0 0 / 45%);
}

/* The overlay's content (a group with its own background) fills the panel's height: core's wrappers between the panel
   and it have no height, so a Minimum height of 100% on the group finds nothing to resolve against */
.is-style-header-bar .wp-block-navigation.is-responsive .wp-block-navigation__responsive-container.is-menu-open :is(.wp-block-navigation__responsive-close, .wp-block-navigation__responsive-dialog, .wp-block-navigation__responsive-container-content, .wp-block-navigation__overlay-container) {
	display: flex;
	flex: 1 0 auto;
	flex-direction: column;
}

.is-style-header-bar .wp-block-navigation.is-responsive .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__overlay-container > * {
	flex: 1 0 auto;
}

/* A sticky header passes core's offset down (0 on phones, where the admin bar scrolls away) */
.admin-bar .is-style-header-bar .wp-block-navigation.is-responsive .wp-block-navigation__responsive-container.is-menu-open {
	top: var(--wp-admin--admin-bar--position-offset, var(--wp-admin--admin-bar--height, 0px));
}

/* Tablets and phones: the menu button opens the menu */
@media (max-width: 64rem) {
	.is-style-header-bar > .wp-block-group > .wp-block-navigation:not(.is-responsive),
	.is-style-header-bar > .wp-block-group > .wp-block-separator {
		display: none;
	}
}
