/**
 * NewMetro
 * Max Mega Menu overrides, used when Mega Menu is enabled on the Primary location.
 * Without Mega Menu these rules match nothing.
 */

.fascia #mega-menu-wrap-primary,
.fascia #mega-menu-wrap-primary #mega-menu-primary {
	background: transparent;
}

.fascia #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item {
	margin: 0;
}

.fascia #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > a.mega-menu-link {
	height: auto;
	min-height: 44px;
	padding: 0 10px;
	background: transparent;
	border-radius: 4px;
	color: var(--on-fascia);
	font-family: var(--sans);
	font-size: 0.9375rem;
	font-weight: 500;
	line-height: 44px;
	letter-spacing: 0;
	text-transform: none;
	transition: background-color 160ms ease;
}

.fascia #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > a.mega-menu-link:hover,
.fascia #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item.mega-toggle-on > a.mega-menu-link {
	background: var(--fascia-line);
	color: var(--on-fascia);
}

.fascia #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item.mega-current-menu-item > a.mega-menu-link,
.fascia #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item.mega-current-menu-ancestor > a.mega-menu-link,
.fascia #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item.current-menu-ancestor > a.mega-menu-link {
	background: transparent;
	color: var(--on-fascia);
	text-decoration: underline;
	text-decoration-color: var(--gold);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.22em;
}

.fascia #mega-menu-wrap-primary .mega-indicator {
	margin-left: 8px;
	color: var(--on-fascia-soft);
}

/* Drawn chevron: Dashicons (Mega Menu's default arrow font) aren't loaded for
   visitors. The indicator box is the link's full height; centre the chevron in it. */
.fascia #mega-menu-wrap-primary #mega-menu-primary li.mega-menu-item > a.mega-menu-link > span.mega-indicator {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 1em;
	vertical-align: middle;
}

.fascia #mega-menu-wrap-primary #mega-menu-primary li.mega-menu-item > a.mega-menu-link > span.mega-indicator::after {
	content: "";
	display: block;
	position: static;
	width: 7px;
	height: 7px;
	margin: 0;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: translateY(-2px) rotate(45deg);
	transition: transform 200ms var(--ease-out);
}

.fascia #mega-menu-wrap-primary #mega-menu-primary li.mega-menu-item.mega-toggle-on > a.mega-menu-link > span.mega-indicator::after {
	transform: translateY(2px) rotate(-135deg);
}

/* Keyboard focus: the theme's gold ring, as everywhere else on the fascia. */
.fascia #mega-menu-wrap-primary #mega-menu-primary a.mega-menu-link:focus-visible,
.fascia #mega-menu-wrap-primary.mega-keyboard-navigation #mega-menu-primary a.mega-menu-link:focus,
.fascia #mega-menu-wrap-primary .mega-menu-toggle:focus-visible {
	outline: 2px solid var(--gold);
	outline-offset: 2px;
	box-shadow: none;
}

/* ==========================
   Flyout dropdown
========================== */

.fascia #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-flyout ul.mega-sub-menu {
	min-width: 260px;
	padding: 8px;
	background: var(--fascia);
	border: 1px solid var(--fascia-line);
	border-radius: 8px;
	box-shadow: 0 18px 30px -12px rgba(12, 39, 31, 0.45);
}

.fascia #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-flyout ul.mega-sub-menu li.mega-menu-item > a.mega-menu-link {
	height: auto;
	min-height: 44px;
	padding: 10px 12px;
	background: transparent;
	border-radius: 4px;
	color: var(--on-fascia-soft);
	font-family: var(--sans);
	font-size: 0.9375rem;
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: 0;
	text-transform: none;
	transition: background-color 160ms ease, color 160ms ease;
}

.fascia #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-flyout ul.mega-sub-menu li.mega-menu-item > a.mega-menu-link:hover,
.fascia #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-flyout ul.mega-sub-menu li.mega-current-menu-item > a.mega-menu-link {
	background: var(--fascia-line);
	color: var(--on-fascia);
}


/* Group headings inside the dropdown (menu items with the CSS class "menu-group"):
   the services sit beneath them, so the dropdown stays one simple list. */
.fascia #mega-menu-wrap-primary #mega-menu-primary li.mega-menu-flyout ul.mega-sub-menu li:is(.menu-group, .mega-menu-group) > a.mega-menu-link {
	/* Small label look, full 44px target. */
	display: flex;
	align-items: flex-end;
	min-height: 44px;
	padding: 14px 12px 6px;
	color: var(--on-fascia-soft);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	opacity: 0.85;
}

.fascia #mega-menu-wrap-primary #mega-menu-primary li.mega-menu-flyout ul.mega-sub-menu li:is(.menu-group, .mega-menu-group) > a.mega-menu-link:hover {
	background: transparent;
	color: var(--on-fascia);
	opacity: 1;
}

.fascia #mega-menu-wrap-primary #mega-menu-primary li.mega-menu-flyout ul.mega-sub-menu li:is(.menu-group, .mega-menu-group):not(:first-child) {
	margin-top: 6px;
	border-top: 1px solid var(--fascia-line);
}

/* "All services" closes the list. */
.fascia #mega-menu-wrap-primary #mega-menu-primary li.mega-menu-flyout ul.mega-sub-menu li:is(.menu-all, .mega-menu-all) {
	margin-top: 6px;
	border-top: 1px solid var(--fascia-line);
}

.fascia #mega-menu-wrap-primary #mega-menu-primary li.mega-menu-flyout ul.mega-sub-menu li:is(.menu-all, .mega-menu-all) > a.mega-menu-link {
	color: var(--on-fascia);
	font-weight: 600;
}


/* ==========================
   Mobile toggle and drawer
========================== */

.fascia #mega-menu-wrap-primary .mega-menu-toggle {
	background: transparent;
}

.fascia #mega-menu-wrap-primary .mega-toggle-animated-inner,
.fascia #mega-menu-wrap-primary .mega-toggle-animated-inner::before,
.fascia #mega-menu-wrap-primary .mega-toggle-animated-inner::after {
	background-color: var(--on-fascia);
}

/* Matches the theme's 1240px collapse point: set Mega Menu's
   Responsive Breakpoint (Menu Themes > Mobile Menu) to 1240px. */
@media (max-width: 1240px) {

	/* The drawer spans the whole fascia, not Mega Menu's toggle-sized wrapper. */
	.fascia #mega-menu-wrap-primary {
		position: static;
	}

	/* In the drawer the indicator floats right: give it the full row height. */
	.fascia #mega-menu-wrap-primary #mega-menu-primary li.mega-menu-item > a.mega-menu-link > span.mega-indicator {
		height: 52px;
		width: 44px;
	}

	/* Phone number first, then the menu toggle at the far right. */
	.fascia--mega #mega-menu-wrap-primary {
		order: 2;
	}

	.fascia--mega .nav {
		gap: 12px;
	}

	.fascia #mega-menu-wrap-primary #mega-menu-primary {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		padding: 8px var(--gutter) 24px;
		background: var(--fascia);
		border-bottom: 1px solid var(--fascia-deep);
		box-shadow: 0 18px 30px -12px rgba(12, 39, 31, 0.45);
	}

	.fascia #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item {
		width: 100%;
	}

	.fascia #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > a.mega-menu-link {
		width: 100%;
		min-height: 52px;
		padding: 0;
		border-bottom: 1px solid var(--fascia-line);
		border-radius: 0;
		font-size: 1.125rem;
		line-height: 52px;
		text-align: left;
	}

	.fascia #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-flyout ul.mega-sub-menu {
		position: static;
		width: 100%;
		min-width: 0;
		padding: 0 0 8px 16px;
		background: transparent;
		border: 0;
		box-shadow: none;
	}

	/* The fascia keeps its phone link; the gold CTA moves into the page on small screens. */
	.fascia--mega .nav__actions .btn {
		display: none;
	}
}
