/*
Fuel6 Theme: Fuel6 Walker Menu
Version: 6.4.0
*/

/*--------------------------------------------------------------
>>> TABLE OF CONTENTS:
----------------------------------------------------------------
# Shared Menu Styles
# Mobile Menu
# Desktop Menu
# Notifications Menu
# Open/Close Sub-Menus
--------------------------------------------------------------*/

/*--------------------------------------------------------------
# Shared Menu Styles
--------------------------------------------------------------*/
.fuel6-walker-menu {
	--menu-height: 5.5rem;
	/* Change the height of the top level menu */
	position: static;
	background: var(--wp--preset--color--menu-background);

	& .synced-pattern-menu-cta-about {
		& .menu-cta {
			width: 18rem;
		}

		& .accent-img-small {
			position: relative;

			& img {
				position: relative;
				display: block;
				margin-left: auto;
			}
		}

		& .accent-img-large {
			position: relative;

			& img {
				position: relative;
				display: block;
				margin-right: auto;
				margin-top: -5.5rem;
			}
		}
	}

	& .menu-link {
		display: block;
		page-break-inside: avoid;
		cursor: pointer;
	}

	& .menu-link[aria-expanded]::after {
		content: '';
		display: inline-block;
		background: currentColor;
		clip-path: url(#menu_chevron);
		margin-left: 0.5rem;
		margin-top: 0.2rem;
		width: 0.6rem;
		height: 0.4rem;
		transition: transform 0.3s;
	}

	/* Top level styling */
	&>.lvl-1 {
		display: flex;

		&>li {
			flex: 1 1 auto;

			&>.menu-link {
				display: flex;
				position: relative;
				justify-content: center;
				align-items: center;
				height: var(--menu-height);
				color: var(--wp--preset--color--menu-color);
				z-index: 0;

				&:is(:hover, :focus-visible, [aria-expanded="true"]) {
					color: var(--wp--preset--color--menu-color);
				}

				&::before {
					content: '';
					display: block;
					position: absolute;
					inset: 0;
					z-index: -1;
					background: var(--wp--preset--color--menu-hover-bg);
					transition: transform 500ms;
					transform: scale(0);
				}

				&:is(:hover, :focus-visible, [aria-expanded="true"])::before {
					transform: scale(1);
				}
			}
		}
	}

	& .sub-menu.lvl-2 {
		display: grid;
		position: absolute;
		inset: var(--sub-menu-lvl-2-inset, auto 0);
		z-index: 1;
		visibility: hidden;
		clip-path: rect(0 100% 0 0);
		transition: clip-path 0.5s ease, visibility 0.5s ease;
		overflow: auto;
		overflow-x: hidden;
		max-height: var(--sub-menu-max-height, calc(100vh - 12rem));
		background: var(--wp--preset--color--sub-menu-background);

		& .menu-link {
			display: flex;
			justify-content: space-between;
			align-items: center;
			border-radius: 8px;
		}

		& .menu-label-text {
			flex: 1 1 auto;
		}
	}

	& .sub-menu-content {
		grid-area: 1 / 1;
		position: relative;
		padding: 2rem 1rem;
		color: var(--wp--preset--color--sub-menu-color);
		background: var(--wp--preset--color--sub-menu-background);

		& .menu-link {
			margin-left: -0.4rem;
		}

		& a:not(.notice, .wp-element-button) {
			color: var(--wp--preset--color--sub-menu-color);
		}

		& a:is(.menu-link, .back-link) {
			padding: 0.3rem 0.8rem;
		}

		& a:is(.menu-link, .back-link):is(:hover, :focus-visible) {
			/* color: var(--wp--preset--color--sub-menu-hover-color); */
			background: var(--wp--preset--color--sub-menu-hover-bg);
		}
	}

	& .sub-menu-content.lvl-2 {
		z-index: 3;
	}

	& .menu-title {
		margin: 0.5rem 0 1rem 0.2rem;
		padding-bottom: 0.6rem;
		font-weight: bold;
		font-family: var(--content-font);
		color: var(--wp--preset--color--sub-menu-color);
		font-size: var(--wp--preset--font-size--content);
		border-bottom: 1px solid;
	}

	& .sub-menu-content.lvl-2,
	& .sub-menu-content.lvl-3 .sub-menu {
		display: grid;
		grid-auto-flow: column;
		align-content: flex-start;
		justify-content: center;
		gap: 0 clamp(1rem, -21rem + 40vw, 3rem);
		transition: height 0.5s, visibility 0.5s;
	}

	& .sub-menu-content:not(:has(.menu-item:nth-child(2))) .synced-pattern {
		width: 59rem;
		max-width: calc(100vw - 3rem);
	}

	& .sub-menu-content.lvl-3 .sub-menu {
		height: 0;
		overflow: hidden;
		visibility: hidden;
		opacity: 0;
		transform: translateX(var(--distance, 1.5rem));
		transition: visibility 0s ease .6s, opacity .3s ease-in-out, transform .6s ease-in-out;
		/* padding-left: var(--contain-padding);
		padding-right: var(--contain-padding); */
	}

	& .sub-menu-content.lvl-3 .sub-menu>*:not(.back-link) {
		grid-area: 2 / auto
	}

	/* Hide empty lists - when sub menu only has sycned blocks, also hide SVGs inside back link */
	& .sub-menu-content-column:has(> li:nth-child(2):empty) {
		display: none;
	}
}


/*--------------------------------------------------------------
# Mobile Menu
--------------------------------------------------------------*/
@media (max-width: 68.49em) {

	body {
		/* Reverses menu colors from desktop */
		--wp--preset--color--menu-background: var(--primary-color);
		--wp--preset--color--sub-menu-background: var(--blue-gradient);
		--wp--preset--color--sub-menu-color: var(--white);
	}

	.primary-menu {
		padding-bottom: env(safe-area-inset-bottom) !important;
	}

	.wp-block-group:has(> .fuel6-walker-menu) {
		position: fixed;
		inset: auto 0 0;
		z-index: 20;
		/* box-shadow: 0 0 0.5rem rgba(0, 0, 0, 0.2); */
	}

	.fuel6-walker-menu {
		/* Mobile App Bar */
		--sub-menu-lvl-2-inset: auto 0 calc(var(--menu-height) + 0.05rem) 0;
		--menu-height: 2.75rem;
		--wp--preset--color--menu-hover-bg: var(--accent-color);
		border: none !important;

		& .depth-0>.menu-link {
			min-width: 3.5rem;
			flex-direction: column;

			&>.menu-label-text {
				display: block;
				font-size: .6rem;
			}

			&[aria-expanded]::after {
				display: none;
			}
		}

		/* Submenu */
		& .sub-menu-content.lvl-2::before,
		& .sub-menu-content.lvl-3 .sub-menu::before {
			content: '';
			display: block;
			width: 2.4rem;
			height: 2rem;
			background: url('../images/logo-menu-mobile.svg');
			background-repeat: no-repeat;
			background-size: cover;
			margin: 0.5rem auto 0.5rem;
			position: relative;
			z-index: 1;
		}

		/* Submenu button styling */
		& .sub-menu-content .wp-block-group .wp-element-button {
			color: var(--accent-color);
			background: var(--wp--preset--color--sub-menu-color);
			border: 1px solid var(--wp--preset--color--sub-menu-color);
		}

		/* Submenu button hover styling */
		& .sub-menu-content .wp-block-group .wp-element-button:is(:hover, :focus-visible) {
			color: var(--wp--preset--color--sub-menu-color);
			background: var(--wp--preset--color--sub-menu-background);
			border-color: var(--wp--preset--color--sub-menu-color)
		}

		& .sub-menu.lvl-2 {
			clip-path: rect(100% 100% 100% 0);
			--sub-menu-max-height: calc(100dvh - var(--menu-height));

			& .menu-title {
				margin: 1rem 0 0;
				padding: 0.5rem 1rem;
				background: rgba(255, 255, 255, 0.1);
				border: none;
			}

			& .menu-link {
				padding: 0.3rem 1rem 0.3rem 1.5rem;
				display: flex;
				justify-content: space-between;
				align-items: center;

				.menu-label-text {
					flex: 1 1 auto;
				}

				&[aria-expanded]::after {
					transform: rotate(270deg);
					background: currentColor;
				}
			}

			& a:not(.wp-element-button):is(:hover, :focus-visible) {
				background: var(--wp--preset--color--sub-menu-hover-bg);
				color: var(--wp--preset--color--sub-menu-hover-color);
			}
		}

		& .sub-menu-content:not(:has(.menu-item:nth-child(2))) .synced-pattern {
			max-width: 100vw;
		}

		& .sub-menu-content:is(.lvl-2, .lvl-3),
		& .sub-menu-content.lvl-3 .sub-menu {
			display: flex;
			flex-direction: column;
			padding: 0;
			overflow: hidden;
		}

		/* Add line above sycned pattern group block */
		& .sub-menu-content.lvl-3 .wp-block-group::before {
			content: '';
			display: block;
			height: 1px;
			background-color: rgba(255, 255, 255, 1);
			margin-bottom: 1rem;
			width: calc(100% - 1rem);
		}
	}

	.mobile-menu-buttons>div {
		max-height: 2.4rem;
	}

	.mobile-menu-buttons a {
		border-radius: 0;
	}

	.mobile-menu-buttons svg {
		margin-top: -0.2rem;
		margin-right: 0.2rem;
	}

	.sub-menu .wp-block-search__button {
		font-size: 0.8rem;
		min-width: fit-content;
		border-radius: 0;
	}

	.menu-cta {
		max-width: 67% !important;
		min-width: 12.2rem;
		margin: auto;
		margin-bottom: 2rem;
	}

	.menu-cta figure img {
		width: 55% !important;
	}

	.menu-cta figure:last-of-type img {
		width: 70% !important;
	}

	.sub-menu .bio-name {
		padding-bottom: 0;
		margin-bottom: 0.3rem;
		font-size: 0.8rem;
	}

	.sub-menu .bio-name::before {
		display: none;
	}

	.sub-menu .bio-cred {
		font-size: 0.55rem;
	}

	.sub-menu .bio-image {
		width: 2.4rem;
		aspect-ratio: 24/56;
		border-top-left-radius: 12px;
	}

	.depth-2 .has-h-5-font-size {
		text-align: center;
	}

	.depth-2 .wp-block-button {
		margin: auto;
	}
}

.menu-item .map-nav-item::before {
	display: none;
}

/*--------------------------------------------------------------
# Desktop Menu
--------------------------------------------------------------*/
@media (min-width: 68.5em) {
	.fuel6-walker-menu {
		padding-left: clamp(0rem, 6.7vw, 6.5rem);

		/* Submenu single column positioning */
		& .menu-single .sub-menu {
			min-width: 12rem;
			width: calc(100% - 0.9rem);
			max-width: 25rem;
		}

		& .menu-single .sub-menu-content.lvl-2 {
			display: block;
		}

		& .synced-pattern-location-section {
    	width: 100vw !important;
    	max-width: unset !important;
		}

		& .lvl-2:has(.synced-pattern-location-section) {
			padding: 0 !important;
		}

		/* Position sub-menu based on new position-anchor property */
		@supports (anchor-name: --notices) {
			& .menu-single .sub-menu.depth-0 {
				position-anchor: var(--name);
				position-area: bottom span-right;
			}
		}

		/* Fallback sub-menu positioning if position-anchor not supported */
		@supports not (anchor-name: --notices) {
			& .menu-single .sub-menu.depth-0 {
				--sub-menu-lvl-2-inset: auto;
				transform: translateX(-18.7rem);
			}
		}

		/* Sub-menu chevron */
		& .depth-0 .menu-link[aria-expanded=true]::after {
			transform: rotate(-180deg);
		}

		& .depth-0>.menu-link>.menu-label-svg svg {
			font-size: 1.4rem;
			max-width: none;
		}

		& .sub-menu.lvl-2 {
			border-radius: 0 0 0 4rem;
		}

		& .sub-menu.lvl-2 .menu-link[aria-expanded]::after {
			background: var(--wp--preset--color--sub-menu-color);
			transform: rotate(270deg);
		}

		& .sub-menu.lvl-2 .menu-link[aria-expanded]:hover::after {
			transform: translateX(0.3rem) rotate(270deg);
		}

		& .back-link {
			width: fit-content;
			margin-bottom: 1rem;
			margin-left: -0.8rem;
		}

		& .sub-menu-content.lvl-3 .sub-menu .sub-menu-content-column {
			column-count: 3;
			column-gap: 2rem;
		}

		& .sub-menu-content.lvl-3 .sub-menu .menu-title {
			column-span: all;
		}

		& .hide-label .menu-link::after,
		& .hide-label .menu-link .menu-label-text,
		& .menu-item:not(.hide-label) .menu-label-svg {
			display: none;
		}

		& .menu-phone .menu-link {
			font-size: 1.1rem;
			font-weight: bold;
		}

		& .menu-phone .menu-label-text svg {
			margin-right: .5rem;
		}
	}

	#submenu-3 {
		/* padding: 0; */
	}

	#submenu-3 .synced-pattern {
		/* width: 100vw; */
		max-width: 100%;
	}

	.sub-menu .wp-block-button__link::before {
		background-color: var(--accent-color);
	}

	.sub-menu .wp-block-button__link:hover {
		color: var(--white) !important;
	}
}


/*--------------------------------------------------------------
# Notifications Menu
--------------------------------------------------------------*/
#notification_content {
	display: block;
}

.menu-notifications li {
	margin-bottom: 0.4rem;
}

.menu-notifications .notice {
	background: var(--white);
	color: var(--content-color);
	padding: 0.3rem 0.5rem 0.3rem 2.6rem;
}

.menu-notifications #notices {
	padding: 0;
}

.menu-notifications li::before {
	aspect-ratio: 1/1;
	width: 0.6rem;
	height: unset;
}

.menu-notifications .notice {
	padding-left: 2.2rem;
}

/* Notifications Mobile Menu */
@media (max-width: 68.49em) {
	.menu-notifications .menu-title {
		display: none;
	}

	.menu-notifications #notices {
		padding: 0.2rem 0.4rem 1.2rem;
		position: relative;
	}

	.linkIcon {
		background: var(--accent-color);
		color: var(--white);
	}

	.menu-notifications .notice {
		font-size: clamp(0.9rem, 2vw, 1rem);
		padding-left: 1.2rem;
	}

	.menu-notifications li::before {
		aspect-ratio: 1;
		width: 0.4rem;
		top: 1.1rem;
		left: 0.4rem;
	}

}

/* Notification Desktop Menu */
@media (min-width: 68.5em) {
	#notification_content {
		padding: 2rem;
	}

	.menu-notifications li {
		background-color: var(--wp--preset--color--sub-menu-color);
		color: var(--white);
	}

	.menu-notifications li::before {
		left: 0.9rem;
		z-index: 2;
	}

	.linkIcon {
		background: var(--accent-color);
		color: var(--white);
	}

	.menu-notifications a {
		overflow: hidden;
	}

	.menu-notifications a::after {
		content: '';
		width: 100%;
		height: 100%;
		background-color: var(--accent-color);
		position: absolute;
		top: 0;
		left: calc(100% - 1rem);
		z-index: -1;
		transition: left 300ms;
	}

	.menu-notifications a:is(:hover, :focus-visible)::after {
		left: 0;
	}

	#notices a {
		z-index: 1;
		position: relative;
	}

	#notices li {
		line-height: 1.3;
	}

	#notices a:hover {
		color: var(--wp--preset--color--sub-menu-background);
		background-color: var(--wp--preset--color--sub-menu-color);
	}

	.menu-notifications .notice {
		color: var(--primary-color);
	}
}


/*--------------------------------------------------------------
# Open/Close Sub-Menus
--------------------------------------------------------------*/

/* Main sub menu opener (opens wrapper that contains all sub-menus) */
body.js-active .fuel6-walker-menu .menu-link[aria-expanded=true]+.sub-menu,
/* JS */
body:not(.js-active) .fuel6-walker-menu ul.lvl-1>li:has(:target)>.sub-menu

/* NO JS*/
	{
	visibility: visible;
	clip-path: rect(0 100% 110% 0);
}

/* Close sub menus inside main sub menu wrapper */
body:not(.js-active) .fuel6-walker-menu .sub-menu-content:not(:target, :has(.sub-menu:target))

/* NO JS*/
	{
	visibility: hidden;
	z-index: -1;
}

/* Pre-Animate lvl-2 sub-menu on open - fade down*/
body.js-active .fuel6-walker-menu .sub-menu-content.lvl-2 {
	opacity: 0;
	transform: translateY(var(--fadein-direction, -1.5rem));
	transition: opacity .6s ease 0s, transform .6s ease 0s
}

/* Animate lvl-2 sub-menu on open - fade down*/
body.js-active .fuel6-walker-menu .sub-menu-content.lvl-2.active {
	opacity: 1;
	transform: translateY(0);
	transition: opacity .6s ease .3s, transform .6s ease .3s
}

/* Open sub menus inside main sub menu wrapper */
body.js-active .fuel6-walker-menu .active,
/* JS */
body.js-active .fuel6-walker-menu.lvl-2 .sub-menu-content:has(.active),
/* JS */
body:not(.js-active) .fuel6-walker-menu .sub-menu-content:has(:target, .sub-menu:target)

/* NO JS */
	{
	visibility: visible;
}

/* 3rd level fade-in-right animation when 3rd level opened */
body.js-active .fuel6-walker-menu .sub-menu-content.lvl-3 .sub-menu.active,
/* JS */
body:not(.js-active) .fuel6-walker-menu .sub-menu-content.lvl-3 :target

/* NO JS */
	{
	opacity: 1;
	height: 100%;
	transform: translateX(0);
	visibility: visible;
	transition: visibility 0s ease 0s, opacity .3s ease-in-out, transform .6s ease-in-out;
	position: relative;
	z-index: 3;
	background: var(--wp--preset--color--sub-menu-background);
}

/* 2nd level fade-in-left animation when 3rd level closed */
body.js-active .fuel6-walker-menu .sub-menu.lvl-2 .sub-menu-content.lvl-2>* {
	opacity: 1;
	transform: translateX(0);
	transition: visibility 0s ease 0s, opacity .3s ease-in-out, transform .6s ease-in-out;
}

/* When 3rd level open, make 2nd level content hidden and setup for fade-in-left animation when 3rd level closed */
body.js-active .fuel6-walker-menu .sub-menu.lvl-2:has(.sub-menu-content.lvl-3 .active) .sub-menu-content.lvl-2>* {
	opacity: 0;
	height: 0;
	overflow: hidden;
	visibility: hidden;
	transform: translateX(var(--distance, -1.5rem));
	transition: visibility 0s ease .6s, opacity .3s ease-in-out, transform .6s ease-in-out;
}


/* Blanket when menu open */
.entry-wrapper .entry-content:first-child:before,
main>.entry-content:first-child:before {
	content: '';
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: auto;
	background: rgba(0, 0, 0, 0);
	transition: background-color 0.3s;
	pointer-events: none;
	z-index: 19;
}

body:has(.fuel6-walker-menu .menu-link[aria-expanded=true]) .entry-content:before {
	background: rgba(0, 0, 0, 0.5);
	pointer-events: unset;
}