/*
 * Azeroth Mobile Menu
 * Mobile/tablet only. Desktop GeneratePress header/navigation remains untouched.
 */

:root {
	--azmm-accent: #00aeff;
	--azmm-ink: #20222b;
	--azmm-muted: #68717d;
	--azmm-line: #e9edf1;
	--azmm-bg: #ffffff;
	--azmm-ease: cubic-bezier(.22, .61, .36, 1);
	--azmm-duration: 300ms;
}

.azmm-header,
.azmm-shell {
	display: none;
}

@media (max-width: 1023px) {
	html.azmm-open,
	body.azmm-open {
		overflow: hidden !important;
		overscroll-behavior: none;
	}

	/*
	 * Replace GeneratePress' mobile header/navigation only.
	 * Desktop is unaffected because every selector lives in this media query.
	 */
	.site-header,
	#site-navigation,
	.main-navigation,
	.menu-toggle,
	#mobile-header,
	.navigation-branding,
	.mobile-header-navigation {
		display: none !important;
	}

	.azmm-header {
		display: block;
		position: relative;
		z-index: 900;
		width: 100%;
		background: #fff;
		border-bottom: 1px solid #eef1f4;
	}

	.azmm-header__inner {
		position: relative;
		display: flex;
		align-items: center;
		justify-content: center;
		min-height: 64px;
		width: 100%;
		padding: 8px 62px;
	}

	.azmm-brand {
		position: absolute;
		left: 50%;
		top: 50%;
		transform: translate(-50%, -50%);
		display: inline-flex;
		align-items: center;
		justify-content: center;
		max-width: min(58vw, 230px);
		line-height: 1;
		text-decoration: none;
		white-space: nowrap;
	}

	.azmm-brand img {
		display: block;
		width: auto;
		height: auto;
		max-width: 100%;
		max-height: 42px;
		object-fit: contain;
	}

	.azmm-brand--text {
		color: var(--azmm-ink);
		font-size: clamp(20px, 5.7vw, 28px);
		font-weight: 800;
		letter-spacing: -.035em;
	}

	.azmm-toggle {
		position: absolute;
		right: 12px;
		top: 50%;
		transform: translateY(-50%);
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 48px;
		height: 48px;
		margin: 0;
		padding: 0;
		border: 0;
		border-radius: 8px;
		background: #f8f9fa;
		color: var(--azmm-ink);
		cursor: pointer;
		-webkit-tap-highlight-color: transparent;
	}

	.azmm-toggle:hover,
	.azmm-toggle:focus-visible {
		background: #f1f4f6;
	}

	.azmm-toggle:focus-visible,
	.azmm-close:focus-visible,
	.azmm-subtoggle:focus-visible,
	.azmm-menu a:focus-visible {
		outline: 2px solid var(--azmm-accent);
		outline-offset: 2px;
	}

	.azmm-toggle__box {
		position: relative;
		display: block;
		width: 21px;
		height: 16px;
	}

	.azmm-toggle__line {
		position: absolute;
		left: 0;
		width: 21px;
		height: 2px;
		border-radius: 2px;
		background: currentColor;
		transform-origin: center;
		transition:
			transform var(--azmm-duration) var(--azmm-ease),
			top var(--azmm-duration) var(--azmm-ease),
			opacity 180ms ease;
	}

	.azmm-toggle__line--1 { top: 0; }
	.azmm-toggle__line--2 { top: 7px; }
	.azmm-toggle__line--3 { top: 14px; }

	body.azmm-open .azmm-toggle__line--1 {
		top: 7px;
		transform: rotate(45deg);
	}

	body.azmm-open .azmm-toggle__line--2 {
		opacity: 0;
		transform: scaleX(.45);
	}

	body.azmm-open .azmm-toggle__line--3 {
		top: 7px;
		transform: rotate(-45deg);
	}

	.azmm-shell {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 99999;
		pointer-events: none;
		visibility: hidden;
	}

	.azmm-shell.is-open {
		pointer-events: auto;
		visibility: visible;
	}

	.azmm-overlay {
		position: absolute;
		inset: 0;
		background: rgba(18, 21, 28, .52);
		opacity: 0;
		transition: opacity var(--azmm-duration) ease;
	}

	.azmm-shell.is-open .azmm-overlay {
		opacity: 1;
	}

	.azmm-panel {
		position: absolute;
		top: 0;
		right: 0;
		width: min(78vw, 380px);
		height: 100vh;
		height: 100dvh;
		overflow-x: hidden;
		overflow-y: auto;
		background: var(--azmm-bg);
		color: var(--azmm-ink);
		box-shadow: -18px 0 45px rgba(16, 20, 26, .18);
		transform: translate3d(100%, 0, 0);
		transition: transform var(--azmm-duration) var(--azmm-ease);
		overscroll-behavior: contain;
		-webkit-overflow-scrolling: touch;
	}

	.azmm-shell.is-open .azmm-panel {
		transform: translate3d(0, 0, 0);
	}

	.azmm-panel__top {
		position: sticky;
		top: 0;
		z-index: 2;
		display: flex;
		align-items: center;
		justify-content: space-between;
		min-height: 64px;
		padding: 8px 10px 8px 20px;
		background: rgba(255,255,255,.96);
		border-bottom: 1px solid var(--azmm-line);
		backdrop-filter: blur(8px);
	}

	.azmm-panel__title {
		overflow: hidden;
		color: var(--azmm-ink);
		font-size: 16px;
		font-weight: 800;
		letter-spacing: -.015em;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.azmm-close {
		position: relative;
		flex: 0 0 48px;
		width: 48px;
		height: 48px;
		margin: 0;
		padding: 0;
		border: 0;
		border-radius: 8px;
		background: transparent;
		cursor: pointer;
	}

	.azmm-close:hover {
		background: #f6f8f9;
	}

	.azmm-close span {
		position: absolute;
		left: 14px;
		top: 23px;
		width: 20px;
		height: 2px;
		background: var(--azmm-ink);
		border-radius: 2px;
	}

	.azmm-close span:first-child { transform: rotate(45deg); }
	.azmm-close span:last-child { transform: rotate(-45deg); }

	.azmm-nav {
		padding: 8px 0 28px;
	}

	.azmm-menu,
	.azmm-menu ul {
		list-style: none;
		margin: 0;
		padding: 0;
	}

	.azmm-menu > li {
		position: relative;
		border-bottom: 1px solid var(--azmm-line);
		opacity: 0;
		transform: translateX(12px);
		transition:
			opacity 240ms ease,
			transform 280ms var(--azmm-ease);
	}

	.azmm-shell.is-open .azmm-menu > li {
		opacity: 1;
		transform: none;
	}

	.azmm-shell.is-open .azmm-menu > li:nth-child(1) { transition-delay: 35ms; }
	.azmm-shell.is-open .azmm-menu > li:nth-child(2) { transition-delay: 60ms; }
	.azmm-shell.is-open .azmm-menu > li:nth-child(3) { transition-delay: 85ms; }
	.azmm-shell.is-open .azmm-menu > li:nth-child(4) { transition-delay: 110ms; }
	.azmm-shell.is-open .azmm-menu > li:nth-child(5) { transition-delay: 135ms; }
	.azmm-shell.is-open .azmm-menu > li:nth-child(6) { transition-delay: 160ms; }
	.azmm-shell.is-open .azmm-menu > li:nth-child(n+7) { transition-delay: 175ms; }

	.azmm-menu li {
		position: relative;
	}

	.azmm-menu a {
		display: flex;
		align-items: center;
		min-height: 52px;
		padding: 12px 58px 12px 20px;
		color: var(--azmm-ink);
		font-size: 16px;
		font-weight: 400;
		line-height: 1.35;
		text-decoration: none;
		transition: color 160ms ease, background 160ms ease;
	}

	.azmm-menu a:hover {
		background: #f8fafb;
		color: var(--azmm-accent);
	}

	.azmm-menu .current-menu-item > a,
	.azmm-menu .current-menu-ancestor > a,
	.azmm-menu .current_page_item > a,
	.azmm-menu .current_page_ancestor > a {
		color: var(--azmm-accent);
	}

	.azmm-menu .current-menu-item > a::before,
	.azmm-menu .current_page_item > a::before {
		content: "";
		position: absolute;
		left: 0;
		top: 14px;
		bottom: 14px;
		width: 3px;
		border-radius: 0 3px 3px 0;
		background: var(--azmm-accent);
	}

	.azmm-subtoggle {
		position: absolute;
		top: 2px;
		right: 8px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 48px;
		height: 48px;
		margin: 0;
		padding: 0;
		border: 0;
		border-radius: 8px;
		background: transparent;
		color: #4b5560;
		cursor: pointer;
	}

	.azmm-subtoggle::before {
		content: "";
		width: 8px;
		height: 8px;
		border-right: 2px solid currentColor;
		border-bottom: 2px solid currentColor;
		transform: translateY(-2px) rotate(45deg);
		transition: transform 220ms var(--azmm-ease);
	}

	.azmm-subtoggle[aria-expanded="true"]::before {
		transform: translateY(2px) rotate(225deg);
	}

	.azmm-menu .sub-menu {
		display: block !important;
		position: static !important;
		width: auto !important;
		max-height: 0;
		overflow: hidden;
		visibility: visible !important;
		opacity: 1 !important;
		background: #fafbfc;
		box-shadow: inset 0 1px 0 var(--azmm-line);
		transform: none !important;
		transition: max-height 300ms var(--azmm-ease);
	}

	.azmm-menu .sub-menu.is-open {
		max-height: var(--azmm-submenu-height, 1000px);
	}

	.azmm-menu .sub-menu a {
		min-height: 48px;
		padding-left: 34px;
		font-size: 15px;
		font-weight: 400;
	}

	.azmm-menu .sub-menu .sub-menu a {
		padding-left: 48px;
	}

	.azmm-empty {
		margin: 18px 20px;
		color: var(--azmm-muted);
		font-size: 14px;
	}

	@media (prefers-reduced-motion: reduce) {
		.azmm-toggle__line,
		.azmm-overlay,
		.azmm-panel,
		.azmm-menu > li,
		.azmm-menu .sub-menu,
		.azmm-subtoggle::before {
			transition-duration: 1ms !important;
			transition-delay: 0ms !important;
		}
	}
}

@media (max-width: 390px) {
	.azmm-header__inner {
		min-height: 62px;
		padding-left: 56px;
		padding-right: 56px;
	}

	.azmm-brand {
		max-width: min(60vw, 205px);
	}

	.azmm-brand img {
		max-height: 38px;
	}

	.azmm-toggle {
		right: 8px;
	}

	.azmm-panel {
		width: min(78vw, 380px);
	}

	.azmm-menu a {
		font-size: 15.5px;
	}
}


/* 1.0.1 — typography: only the active menu path is bold */
@media (max-width: 1023px) {
	.azmm-menu a {
		font-weight: 400;
	}

	.azmm-menu .current-menu-item > a,
	.azmm-menu .current-menu-ancestor > a,
	.azmm-menu .current_page_item > a,
	.azmm-menu .current_page_ancestor > a {
		font-weight: 700;
	}
}


/* 1.0.2 — unified lighter gray mobile menu controls */
@media (max-width: 1023px) {
	.azmm-toggle,
	.azmm-close {
		background: #e9ebee;
		color: var(--azmm-ink);
	}

	.azmm-toggle:hover,
	.azmm-toggle:focus-visible,
	.azmm-close:hover,
	.azmm-close:focus-visible {
		background: #dde0e4;
	}

	body.azmm-open .azmm-toggle {
		background: #e9ebee;
	}
}


/* 1.0.3 — keep hamburger and X button identical in every interaction state */
@media (max-width: 1023px) {
	.azmm-toggle,
	.azmm-toggle:hover,
	.azmm-toggle:focus,
	.azmm-toggle:focus-visible,
	.azmm-toggle:active,
	body.azmm-open .azmm-toggle,
	body.azmm-open .azmm-toggle:hover,
	body.azmm-open .azmm-toggle:focus,
	.azmm-close,
	.azmm-close:hover,
	.azmm-close:focus,
	.azmm-close:focus-visible,
	.azmm-close:active {
		background-color: #e9ebee !important;
		color: var(--azmm-ink) !important;
	}

	.azmm-close span {
		background-color: var(--azmm-ink) !important;
	}
}


/* 1.0.4 — smaller, permanently gray submenu toggle */
@media (max-width: 1023px) {
	.azmm-subtoggle,
	.azmm-subtoggle:hover,
	.azmm-subtoggle:focus,
	.azmm-subtoggle:focus-visible,
	.azmm-subtoggle:active,
	.azmm-subtoggle[aria-expanded="true"] {
		width: 34px;
		height: 34px;
		top: 9px;
		right: 14px;
		min-width: 34px;
		min-height: 34px;
		padding: 0;
		border: 0;
		border-radius: 7px;
		background: #e9ebee !important;
		color: var(--azmm-ink) !important;
	}

	.azmm-subtoggle::before {
		width: 7px;
		height: 7px;
		border-right-width: 2px;
		border-bottom-width: 2px;
	}
}
