/*
 * The header menu (components/menu.php).
 */

/* Three lines, not WordPress's two, in the button's own colour. */
.qmd-header .wp-block-navigation__responsive-container-open svg {
	display: none;
}

.qmd-header .wp-block-navigation__responsive-container-open::before {
	background-image:
		linear-gradient(currentColor, currentColor),
		linear-gradient(currentColor, currentColor),
		linear-gradient(currentColor, currentColor);
	background-position: left top, left center, left bottom;
	background-repeat: no-repeat;
	background-size: 22px 2px;
	content: "";
	display: block;
	height: 16px;
	width: 22px;
}

/*
 * Collapsed (menu.js): above 600px, where WordPress would show the menu itself, the menu
 * would not fit, so the hamburger shows instead. Opened, WordPress's own overlay takes over,
 * since its wide-screen rules only touch a menu that is not open.
 */
@media (min-width: 600px) {
	.qmd-header.qmd-menu-collapsed .wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex;
	}

	.qmd-header.qmd-menu-collapsed .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
		display: none;
	}
}

/* Measuring (menu.js, for one moment, never painted): everything at its full size on one line. */
.qmd-header.qmd-menu-measuring * {
	flex-shrink: 0 !important;
}

.qmd-header.qmd-menu-measuring .wp-block-navigation__container {
	flex-wrap: nowrap !important;
}

.qmd-header.qmd-menu-measuring .wp-block-navigation-item__content {
	white-space: nowrap;
}

/*
 * Open, the menu floats on the page like a lightbox (Gillian, 2026-10-20): a panel over the
 * page, which goes dark and soft behind it, the links left-aligned. Tapping the page beside
 * the panel closes it (menu.js), as do the cross and the Escape key (WordPress's own).
 * The panel is the dark colour unless a site sets --qmd-menu-panel. The colour classes
 * WordPress puts on the overlay are !important, so these must be too. The rgba line is for
 * browsers without color-mix (Safari before 16.2, as on an iPhone 7).
 */
.qmd-header .wp-block-navigation__responsive-container.is-menu-open {
	align-items: center;
	background-color: rgba(0, 0, 0, 0.6) !important;
	background-color: color-mix(in srgb, var(--qmd-menu-panel, var(--wp--preset--color--dark)) 70%, transparent) !important;
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	padding: 72px 16px 16px !important;
}

.qmd-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-close {
	flex: none;
	width: 100%;
	max-width: 340px;
	margin: 0 auto;
	padding: 12px 32px 48px;
	border-radius: 6px;
	background-color: var(--qmd-menu-panel, var(--wp--preset--color--dark));
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.qmd-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-dialog {
	position: relative;
}

/*
The cross sits in the top corner and the links start just under it, with a little more room
under the last link than above the first, so the panel does not look top-heavy (Gillian,
2026-10-20). WordPress leaves 56px over the links for the cross; 40px is enough.
*/
.qmd-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	padding-top: 40px !important;
}

.qmd-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,
.qmd-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	align-items: flex-start !important;
	justify-content: flex-start !important;
	text-align: left;
}
