/* =========================================================
   LOCATION NAVIGATION
========================================================= */

.manor-location-navigation {
	width: 100%;
}

.manor-location-menu,
.manor-location-menu .sub-menu {
	list-style: none;
	margin: 0;
	padding: 0;
}

.manor-location-menu {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: clamp(20px, 2vw, 38px);
}

.manor-location-menu li {
	position: relative;
	margin: 0;
}

.manor-location-menu a {
	display: block;
	color: inherit;
	font-family: "FK Grotesk", sans-serif;
	font-size: 14px;
	font-weight: 500;
	letter-spacing: 0.04em;
	line-height: 1.3;
	text-decoration: none;
	transition:
		color 0.25s ease,
		opacity 0.25s ease,
		transform 0.25s ease;
}

.manor-location-menu > li > a {
	padding: 20px 0;
}

.manor-location-menu a:hover,
.manor-location-menu .current-menu-item > a,
.manor-location-menu .current-menu-ancestor > a {
	color: #8c523b;
}

/* =========================================================
   DROPDOWN INDICATOR
========================================================= */

.manor-location-menu
	> .menu-item-has-children
	> a {
	display: flex;
	align-items: center;
	gap: 8px;
}

.manor-location-menu
	> .menu-item-has-children
	> a::after {
	content: "";
	width: 7px;
	height: 7px;
	margin-top: -4px;
	border-right: 1px solid currentColor;
	border-bottom: 1px solid currentColor;
	transform: rotate(45deg);
	transition: transform 0.25s ease;
}

.manor-location-menu
	> .menu-item-has-children:hover
	> a::after,
.manor-location-menu
	> .menu-item-has-children:focus-within
	> a::after,
.manor-location-menu
	> .menu-item-has-children.is-open
	> a::after {
	margin-top: 3px;
	transform: rotate(225deg);
}
/* .manor-location-menu
	> .menu-item-has-children.is-open
	> a::after {
	margin-top: 3px;
	transform: rotate(225deg);
} */

/* =========================================================
   STANDARD DROPDOWNS
========================================================= */

.manor-location-menu
	> li:not(.manor-mega-menu)
	> .sub-menu {
	position: absolute;
	z-index: 1000;
	top: 100%;
	left: 0;
	min-width: 240px;
	padding: 14px 0;
	background: #f1f1e7;
	box-shadow: 0 18px 40px rgba(0, 0, 0, 0.1);

	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(8px);

	transition:
		opacity 0.25s ease,
		visibility 0.25s ease,
		transform 0.25s ease;
}

/*
 * Creates visual spacing without introducing a hover gap.
 */
.manor-location-menu
	> li:not(.manor-mega-menu)
	> .sub-menu::before {
	content: "";
	position: absolute;
	right: 0;
	bottom: 100%;
	left: 0;
	height: 12px;
}

.manor-location-menu
	> li:not(.manor-mega-menu):hover
	> .sub-menu,
.manor-location-menu
	> li:not(.manor-mega-menu):focus-within
	> .sub-menu,
.manor-location-menu
	> li:not(.manor-mega-menu).is-open
	> .sub-menu {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateY(12px);
}

.manor-location-menu
	> li:not(.manor-mega-menu)
	> .sub-menu
	a {
	padding: 10px 22px;
	white-space: nowrap;
}

.manor-location-menu
	> li:not(.manor-mega-menu)
	> .sub-menu
	a:hover {
	background: rgba(140, 82, 59, 0.08);
}

/* =========================================================
   MEGA MENU
========================================================= */

/*
 * Add the CSS class "manor-mega-menu" to the top-level
 * Services menu item in Appearance > Menus.
 */
.manor-location-menu
	> .manor-mega-menu {
	position: static;
}

/*
 * First submenu becomes the mega-menu panel.
 */
.manor-location-menu
	> .manor-mega-menu
	> .sub-menu {
	position: fixed;
	z-index: 9999;
	/* top: var(--manor-header-bottom, 80px); */
	left: 0;

	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: clamp(40px, 5vw, 90px);

	width: 100vw;
	max-height: calc(100vh - var(--manor-header-bottom, 80px));
	overflow-y: auto;

	padding:
		clamp(48px, 5vw, 50px)
		clamp(40px, 6vw, 120px);

	background: #a66f45;
	box-shadow: 0 20px 45px rgba(0, 0, 0, 0.12);

	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(10px);

	transition:
		opacity 0.25s ease,
		visibility 0.25s ease,
		transform 0.25s ease;
}

.manor-location-menu
	> .manor-mega-menu:hover
	> .sub-menu,
.manor-location-menu
	> .manor-mega-menu:focus-within
	> .sub-menu,
.manor-location-menu
	> .manor-mega-menu.is-open
	> .sub-menu {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateY(0);
}

/* Each immediate child becomes a column. */

.manor-location-menu
	> .manor-mega-menu
	> .sub-menu
	> li {
	position: static;
	min-width: 0;
}

/* Column headings */

.manor-location-menu
	> .manor-mega-menu
	> .sub-menu
	> li
	> a {
	display: block;
	margin: 0 0 24px;
	padding: 0;

	color: #f1f1e7;
	font-family: "Items Text", "FK Grotesk", sans-serif;
	font-size: clamp(20px, 1.5vw, 29px);
	font-weight: 400;
	letter-spacing: 0.08em;
	line-height: 1.25;
	text-transform: uppercase;
}

/*
 * Remove dropdown positioning from the third-level lists.
 *
 * Do not reset opacity, visibility or pointer-events here. The panel
 * hides itself with visibility/pointer-events, both of which inherit,
 * so these lists must stay hidden along with it. Overriding them left
 * an invisible but still hit-testable panel covering the hero, which
 * opened the mega menu on hover.
 */
.manor-location-menu
	> .manor-mega-menu
	> .sub-menu
	> li
	> .sub-menu {
	position: static;
	display: flex;
	flex-direction: column;
	gap: 6px;

	min-width: 0;
	padding: 0;
	background: transparent;
	box-shadow: none;

	transform: none;
}

/* Service links */

.manor-location-menu
	> .manor-mega-menu
	> .sub-menu
	> li
	> .sub-menu
	a {
	display: inline-block;
	padding: 0;

	color: #f1f1e7;
	font-size: clamp(16px, 1vw, 20px);
	font-weight: 400;
	letter-spacing: 0;
	line-height: 1.45;
	text-transform: none;
	white-space: normal;
}

.manor-location-menu
	> .manor-mega-menu
	> .sub-menu
	> li
	> .sub-menu
	a:hover,
.manor-location-menu
	> .manor-mega-menu
	> .sub-menu
	> li
	> .sub-menu
	a:focus-visible {
	color: #f1f1e7;
	opacity: 0.7;
	transform: translateX(3px);
}

/* Current page inside the mega menu */

.manor-location-menu
	> .manor-mega-menu
	.current-menu-item
	> a {
	color: #f1f1e7;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 5px;
}

/* Prevent heading links from receiving the top-level arrow */

.manor-location-menu
	> .manor-mega-menu
	> .sub-menu
	> .menu-item-has-children
	> a::after {
	display: none;
}

/* =========================================================
   RESPONSIVE COLUMN ADJUSTMENTS
========================================================= */

@media (max-width: 1200px) {
	.manor-location-menu
		> .manor-mega-menu
		> .sub-menu {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 50px 70px;
	}
}

@media (max-width: 1024px) {
	/*
	 * The mobile navigation should be opened by your menu toggle.
	 * The mega-menu itself becomes an accordion-style panel.
	 */

	.manor-location-menu {
		display: block;
		width: 100%;
	}

	.manor-location-menu > li {
		border-bottom: 1px solid rgba(36, 36, 36, 0.12);
	}

	.manor-location-menu > li > a {
		justify-content: space-between;
		padding: 16px 0;
	}

	.manor-location-menu
		> li:not(.manor-mega-menu)
		> .sub-menu,
	.manor-location-menu
		> .manor-mega-menu
		> .sub-menu {
		position: static;
		display: none;
		width: 100%;
		min-width: 0;
		max-height: none;
		overflow: visible;
		padding: 20px 24px;

		background: #f1f1e7;
		box-shadow: none;

		opacity: 1;
		visibility: visible;
		pointer-events: auto;
		transform: none;
	}

	.manor-location-menu
		> .manor-mega-menu
		> .sub-menu {
		grid-template-columns: 1fr;
		gap: 30px;
		background: #a66f45;
	}

	.manor-location-menu
		> li.is-open
		> .sub-menu {
		display: block;
	}

	.manor-location-menu
		> .manor-mega-menu.is-open
		> .sub-menu {
		display: grid;
	}

	.manor-location-menu
		> .manor-mega-menu
		> .sub-menu
		> li
		> a {
		margin-bottom: 12px;
		font-size: 19px;
	}

	.manor-location-menu
		> .manor-mega-menu
		> .sub-menu
		> li
		> .sub-menu {
		gap: 10px;
	}
}