/*
 * Branded mobile navigation overlay. The brand title and info panel are
 * injected by twentytwentyfive_child_brand_mobile_menu() in functions.php.
 */

/* Only shown inside the open overlay, never in the inline (desktop) menu.
   The info panel's template-part wrapper is hidden too: left visible, the
   empty wrapper is still a flex item and adds a block gap to the right of
   the desktop menu. */
.wp-block-navigation__responsive-container:not(.is-menu-open) :is(.mobile-menu-brand, .mobile-menu-info, .wp-block-template-part:has(> .mobile-menu-info)) {
	display: none;
}

/* Stretch the overlay's inner wrappers so the info panel sits at the bottom. */
.wp-block-navigation__responsive-container.is-menu-open {
	display: flex;
	flex-direction: column;
}

.wp-block-navigation__responsive-container.is-menu-open :is(.wp-block-navigation__responsive-close, .wp-block-navigation__responsive-dialog) {
	display: flex;
	flex-direction: column;
	flex-grow: 1;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	flex-grow: 1;
}

/* The brand row replaces core's top spacing for the close button. */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-dialog .wp-block-navigation__responsive-container-content {
	align-items: stretch;
	padding-top: 0;
}

/*
 * Keep the brand and close button exactly where the header's title and
 * menu button are, so nothing shifts when the overlay opens: match the
 * header row's top padding, and center the 24px close button on the
 * title's line box (body line-height 1.4) the way the header centers
 * its menu button.
 */
.wp-block-navigation .wp-block-navigation__responsive-container.is-menu-open {
	padding-top: var(--wp--preset--spacing--30);
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close {
	top: calc((var(--wp--preset--font-size--large) * 1.4 - 24px) / 2);
}

/* Core slides the overlay up 0.5em as it fades in, which moves the brand; fade only. */
@keyframes mobile-menu-fade-in {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

@media not (prefers-reduced-motion) {
	.wp-block-navigation__responsive-container.is-menu-open {
		animation-name: mobile-menu-fade-in;
	}
}

/* Brand: site title in the same spot as the header, beside the close button. */
.wp-block-navigation__responsive-container.is-menu-open .mobile-menu-brand {
	align-self: stretch;
	padding-right: 3rem;
	margin-bottom: var(--wp--preset--spacing--60);
}

/* The site title has no size of its own; match the body size it inherits in the header. */
.wp-block-navigation__responsive-container.is-menu-open .mobile-menu-brand .wp-block-site-title {
	margin: 0;
	font-size: var(--wp--preset--font-size--large);
}

.wp-block-navigation__responsive-container.is-menu-open .mobile-menu-brand a {
	color: inherit;
	text-decoration: none;
}

/* Links: large, left-aligned, easy to tap. */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__container {
	align-items: flex-start;
	gap: var(--wp--preset--spacing--20);
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item:not(.nav-contact-button) > .wp-block-navigation-item__content {
	font-size: var(--wp--preset--font-size--xx-large);
	font-weight: 400;
	letter-spacing: -0.04em;
	line-height: 1.15;
	text-decoration: none;
}

/* Current page: the brand yellow as a marker underline. */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item:not(.nav-contact-button) > .wp-block-navigation-item__content[aria-current="page"] .wp-block-navigation-item__label {
	box-shadow: inset 0 -0.3em 0 var(--wp--preset--color--accent-1);
}

/* Contact: a full pill button as the menu's call to action. */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item.nav-contact-button {
	margin-top: var(--wp--preset--spacing--30);
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item.nav-contact-button > .wp-block-navigation-item__content {
	font-size: var(--wp--preset--font-size--medium);
	padding: 0.9em 2em;
}

/* Info panel, pinned to the bottom (the template part wraps it in its own div). */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-template-part:has(> .mobile-menu-info) {
	margin-top: auto;
	padding-top: var(--wp--preset--spacing--60);
}

.wp-block-navigation__responsive-container.is-menu-open .mobile-menu-info {
	padding-top: var(--wp--preset--spacing--50);
	border-top: 1px solid color-mix(in srgb, var(--wp--preset--color--contrast) 15%, transparent);
	text-align: left;
}

.wp-block-navigation__responsive-container.is-menu-open .mobile-menu-info > * {
	margin-block: 0;
}

.mobile-menu-info__tagline {
	max-width: 24ch;
	margin-bottom: var(--wp--preset--spacing--30) !important;
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 400;
	line-height: 1.35;
}

.mobile-menu-info__detail {
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.8;
}

.mobile-menu-info__label {
	display: inline-block;
	min-width: 8.5em;
	font-family: var(--wp--preset--font-family--fira-code);
	font-size: 0.75em;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent-4);
}

.wp-block-navigation__responsive-container.is-menu-open .mobile-menu-info__social {
	margin-top: var(--wp--preset--spacing--30) !important;
	font-size: var(--wp--preset--font-size--small);
}

.mobile-menu-info__social .wp-block-social-link-anchor {
	gap: 0.6em;
}

.mobile-menu-info__social .wp-block-social-link-anchor svg {
	width: 1.5em;
	height: 1.5em;
}

.mobile-menu-info__social .wp-social-link .wp-block-social-link-label:not(.screen-reader-text) {
	font-size: var(--wp--preset--font-size--small);
}

/* Short phones (e.g. iPhone SE): tighten the spacing so the whole menu fits without scrolling. */
@media (max-height: 640px) {
	.wp-block-navigation__responsive-container.is-menu-open .mobile-menu-brand {
		margin-bottom: var(--wp--preset--spacing--40);
	}

	.wp-block-navigation__responsive-container.is-menu-open .wp-block-template-part:has(> .mobile-menu-info) {
		padding-top: var(--wp--preset--spacing--40);
	}

	.wp-block-navigation__responsive-container.is-menu-open .mobile-menu-info {
		padding-top: var(--wp--preset--spacing--30);
	}

	.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item:not(.nav-contact-button) > .wp-block-navigation-item__content {
		font-size: var(--wp--preset--font-size--x-large);
	}
}

/*
 * Breakpoint: core swaps the overlay for inline links at 600px, where the
 * links squeeze the site title onto two lines. Keep the overlay up to
 * WordPress's 782px tablet breakpoint (also where the footer columns stack)
 * by reversing core's two 600px rules in between.
 */
@media (min-width: 600px) and (max-width: 781px) {
	.wp-block-navigation .wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex;
	}

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