/*
 * core/navigation: the header menu (.ne-main-nav), its full-screen overlay on phones and
 * tablets (parts/menu-overlay.html) and the menu inside it (.ne-overlay-nav).
 * The overlay replaces the inline menu below 1024px (core switches at 600px).
 */

/* ---------- Header menu ---------- */
.ne-main-nav {
	flex: 1 1 auto;
	justify-content: center;
	font-family: var(--ne-sans);
	font-size: .95rem;
	font-weight: 500;
}
.ne-main-nav .wp-block-navigation__container { gap: clamp(18px, 2.3vw, 36px); }
.ne-main-nav .wp-block-navigation-item__content {
	position: relative;
	padding: 12px 0;
	color: inherit;
	text-decoration: none;
	opacity: .9;
	transition: opacity .2s;
}
.ne-main-nav .wp-block-navigation-item__content::after {
	content: "";
	position: absolute;
	right: 0;
	bottom: 6px;
	left: 0;
	height: 1.5px;
	border-radius: 2px;
	background: var(--wp--preset--color--sun);
	transform: scaleX(0);
	transform-origin: 100% 50%;
	transition: transform .4s var(--ne-ease);
}
.ne-main-nav .wp-block-navigation-item__content:hover,
.ne-main-nav .current-menu-item > .wp-block-navigation-item__content,
.ne-main-nav .current-menu-ancestor > .wp-block-navigation-item__content { opacity: 1; }
.ne-main-nav .wp-block-navigation-item__content:hover::after,
.ne-main-nav .current-menu-item > .wp-block-navigation-item__content::after,
.ne-main-nav .current-menu-ancestor > .wp-block-navigation-item__content::after { transform: scaleX(1); transform-origin: 0 50%; }

/* Submenu (Tours): dark glass panel */
.ne-main-nav .wp-block-navigation__submenu-icon { width: 10px; height: 10px; margin-left: 6px; }
.ne-main-nav .has-child .wp-block-navigation__submenu-container {
	min-width: 250px !important;
	padding: 10px !important;
	border: 1px solid rgba(255, 255, 255, .1) !important;
	border-radius: 18px;
	background: color-mix(in srgb, var(--wp--preset--color--night) 94%, transparent) !important;
	color: #fff !important;
	box-shadow: 0 30px 60px -20px rgba(4, 8, 14, .6);
	-webkit-backdrop-filter: blur(18px);
	backdrop-filter: blur(18px);
	transform: translateY(6px);
	transition: opacity .25s var(--ne-ease), transform .35s var(--ne-ease), visibility .25s !important;
}
.ne-main-nav .has-child:where(:hover, :focus-within) > .wp-block-navigation__submenu-container { transform: none; }
.ne-main-nav .has-child .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	display: block;
	width: 100%;
	padding: 11px 14px;
	border-radius: 10px;
	opacity: .86;
}
.ne-main-nav .has-child .wp-block-navigation__submenu-container .wp-block-navigation-item__content::after { content: none; }
.ne-main-nav .has-child .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover,
.ne-main-nav .has-child .wp-block-navigation__submenu-container .current-menu-item > .wp-block-navigation-item__content { background: rgba(255, 255, 255, .07); opacity: 1; }

/* Submenu buttons: a 24px target around the chevron, which turns when open. */
.ne-main-nav .wp-block-navigation__submenu-icon.wp-block-navigation-submenu__toggle { box-sizing: border-box; width: 24px; height: 24px; margin-left: 0; padding: 7px; }
.ne-main-nav .wp-block-navigation-submenu__toggle svg { width: 10px; height: 10px; transition: transform .35s var(--ne-ease); }
.ne-main-nav .wp-block-navigation-submenu__toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

/* ---------- Mega menu (Tours): full-width panel under the header (inc/mega-menu.php) ---------- */
@media (min-width: 1024px) {
	/* The panel takes the header as reference, not the menu item. */
	.ne-main-nav,
	.ne-main-nav .wp-block-navigation__responsive-container:not(.is-menu-open),
	.ne-main-nav .wp-block-navigation__responsive-close,
	.ne-main-nav .wp-block-navigation__responsive-dialog,
	.ne-main-nav .wp-block-navigation__responsive-container-content,
	.ne-main-nav .wp-block-navigation__responsive-container-content > .wp-block-navigation__container,
	.ne-main-nav .wp-block-navigation__responsive-container-content > .wp-block-navigation__container > li.is-style-mega { position: static; }

	/* Hover bridge from the link down to the panel. */
	.ne-main-nav li.is-style-mega > .wp-block-navigation-item__content::before { content: ""; position: absolute; top: 100%; right: -44px; left: -24px; height: calc(var(--ne-header-h) / 2); }

	.ne-main-nav li.is-style-mega > .wp-block-navigation__submenu-container {
		--ne-mega-text: #fff;
		--ne-mega-muted: rgba(238, 241, 245, .62);
		--ne-mega-line: rgba(238, 241, 245, .1);
		position: absolute !important;
		top: 100% !important;
		right: 0;
		left: 0 !important;
		display: grid !important;
		grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr) minmax(260px, .9fr);
		grid-template-rows: auto auto;
		gap: 0 clamp(28px, 3.6vw, 64px);
		width: auto !important;
		min-width: 0 !important;
		height: auto !important;
		padding: 36px max(var(--wp--custom--gutter), calc((100vw - 1360px) / 2)) 32px !important;
		border: 0 !important;
		border-top: 1px solid var(--ne-mega-line) !important;
		border-radius: 0 0 30px 30px;
		background: var(--wp--preset--color--night) !important;
		color: var(--ne-mega-text) !important;
		box-shadow: 0 50px 90px -40px rgba(4, 8, 14, .75);
		-webkit-backdrop-filter: none;
		backdrop-filter: none;
		opacity: 0;
		overflow: hidden !important;
		visibility: hidden;
		clip-path: inset(0 0 100% 0 round 0 0 30px 30px);
		transform: none;
		/* Closing waits a moment, so a diagonal move to the panel does not close it. */
		transition: clip-path .35s cubic-bezier(.4, 0, .2, 1) .12s, opacity .25s ease .12s, visibility 0s linear .47s !important;
	}
	.ne-main-nav li.is-style-mega:is(:hover, :has(> .wp-block-navigation-submenu__toggle[aria-expanded="true"])) > .wp-block-navigation__submenu-container {
		opacity: 1;
		visibility: visible;
		clip-path: inset(0 0 0 0 round 0 0 30px 30px);
		transition: clip-path .6s cubic-bezier(.16, 1, .3, 1) .05s, opacity .3s ease .05s, visibility 0s !important;
	}

	/* The page dims behind the open panel. */
	.ne-site-header::after { content: ""; position: absolute; top: 100%; right: 0; left: 0; z-index: -1; height: 100vh; background: rgba(5, 8, 14, .42); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .35s ease .1s, visibility 0s linear .45s; }
	.ne-site-header:has(li.is-style-mega:is(:hover, :has(> [aria-expanded="true"])))::after { opacity: 1; visibility: visible; transition: opacity .4s ease, visibility 0s; }

	/* Columns: the groups, then the tour card; single links at the bottom. */
	.ne-main-nav li.is-style-mega > .wp-block-navigation__submenu-container > li { min-width: 0; opacity: 0; translate: 0 12px; transition: opacity .2s ease, translate .3s ease; }
	.ne-main-nav li.is-style-mega:is(:hover, :has(> .wp-block-navigation-submenu__toggle[aria-expanded="true"])) > .wp-block-navigation__submenu-container > li { opacity: 1; translate: 0 0; transition: opacity .5s ease calc(.12s + var(--i, 0) * 60ms), translate .7s var(--ne-ease) calc(.12s + var(--i, 0) * 60ms); }
	.ne-main-nav li.is-style-mega > .wp-block-navigation__submenu-container > li:nth-child(2) { --i: 1; }
	.ne-main-nav li.is-style-mega > .wp-block-navigation__submenu-container > li:nth-child(n+3) { --i: 2; }
	.ne-main-nav li.is-style-mega > .wp-block-navigation__submenu-container > li:not(.has-child, .ne-mega__feature) { grid-row: 2; grid-column: 1 / 3; }
	.ne-main-nav li.is-style-mega > .wp-block-navigation__submenu-container > .ne-mega__feature { grid-row: 1 / 3; grid-column: -2 / -1; }

	/* A group is a column: its name as the heading, its links under it. */
	.ne-main-nav li.is-style-mega .has-child { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; }
	.ne-main-nav li.is-style-mega .has-child > * { flex: none; }
	.ne-main-nav li.is-style-mega > .wp-block-navigation__submenu-container > .has-child > .wp-block-navigation-item__content { flex: none; display: block !important; width: 100% !important; margin: 0 0 16px; white-space: nowrap; padding: 0 0 14px; border-bottom: 1px solid var(--ne-mega-line); border-radius: 0; background: none !important; font: 600 .7rem / 1.2 var(--ne-sans); letter-spacing: .18em; text-transform: uppercase; color: var(--ne-mega-muted); opacity: 1; cursor: default; }
	.ne-main-nav li.is-style-mega .has-child > .wp-block-navigation-submenu__toggle { display: none; }
	.ne-main-nav li.is-style-mega .has-child > .wp-block-navigation__submenu-container {
		position: static !important;
		display: grid !important;
		gap: 4px;
		width: auto !important;
		min-width: 0 !important;
		height: auto !important;
		padding: 0 !important;
		border: 0 !important;
		border-radius: 0;
		background: none !important;
		box-shadow: none;
		opacity: 1 !important;
		overflow: visible !important;
		visibility: inherit !important;
		transform: none;
		clip-path: none;
		transition: none !important;
	}
	.ne-main-nav li.is-style-mega .has-child:has(> ul > .ne-mega__tile) > .wp-block-navigation__submenu-container { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

	.ne-main-nav li.is-style-mega .wp-block-navigation__submenu-container .wp-block-navigation-item__content { opacity: 1; }
	.ne-mega__arrow { display: inline-grid; flex: none; place-items: center; }
	.ne-mega__arrow .ne-icon { width: 16px; height: 16px; }

	/* Photo tiles (pages with a featured image: the season pages). */
	.ne-main-nav li.is-style-mega .ne-mega__tile > .wp-block-navigation-item__content { position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 236px; padding: 18px !important; border-radius: 18px; background: var(--wp--preset--color--night-soft) !important; overflow: hidden; isolation: isolate; color: #fff; }
	.ne-mega__tile .ne-mega__media { position: absolute; inset: 0; z-index: -1; }
	.ne-mega__tile .ne-mega__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(9, 13, 20, 0) 35%, rgba(9, 13, 20, .82) 100%); }
	.ne-mega__tile .ne-mega__media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.02); transition: transform 1s var(--ne-ease); }
	.ne-mega__tile .wp-block-navigation-item__label { font: 600 1.12rem / 1.15 var(--ne-display); letter-spacing: -.02em; }
	.ne-mega__tile .ne-mega__meta { margin-top: 4px; font-size: .82rem; color: rgba(255, 255, 255, .78); }
	.ne-mega__tile .ne-mega__arrow { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, .14); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: background-color .3s, color .3s, rotate .45s var(--ne-ease); rotate: -45deg; }
	.ne-mega__tile > a:is(:hover, :focus-visible) .ne-mega__media img { transform: scale(1.08); }
	.ne-mega__tile > a:is(:hover, :focus-visible) .ne-mega__arrow { background: var(--wp--preset--color--sun); color: var(--wp--preset--color--ink); rotate: 0deg; }

	/* Rows (activities): illustration, name and number of tours. */
	.ne-main-nav li.is-style-mega .ne-mega__row > .wp-block-navigation-item__content { display: grid !important; grid-template-columns: 46px minmax(0, 1fr) auto; grid-template-rows: auto auto; align-items: center; column-gap: 14px; padding: 9px 10px !important; border-radius: 14px; transition: background-color .25s; }
	.ne-mega__row .ne-mega__media { grid-row: 1 / 3; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px; background: rgba(255, 255, 255, .06); overflow: hidden; transition: background-color .3s, transform .5s var(--ne-ease); }
	.ne-mega__row .ne-mega__media img { width: 38px; height: 38px; object-fit: contain; }
	.ne-mega__row .wp-block-navigation-item__label { align-self: end; font-size: .98rem; font-weight: 600; }
	.ne-mega__row .ne-mega__meta { grid-column: 2; align-self: start; font-size: .8rem; color: var(--ne-mega-muted); }
	.ne-mega__row .ne-mega__arrow { grid-column: 3; grid-row: 1 / 3; opacity: 0; translate: -6px 0; transition: opacity .25s, translate .35s var(--ne-ease); }
	.ne-main-nav li.is-style-mega .ne-mega__row > a:is(:hover, :focus-visible) { background: rgba(255, 255, 255, .06) !important; }
	.ne-mega__row > a:is(:hover, :focus-visible) .ne-mega__media { background: rgba(242, 166, 90, .16); transform: rotate(-4deg) scale(1.04); }
	.ne-mega__row > a:is(:hover, :focus-visible) .ne-mega__arrow { opacity: 1; translate: 0 0; }

	/* Single links (All tours & prices): the panel's footer. */
	.ne-main-nav li.is-style-mega > .wp-block-navigation__submenu-container > li:not(.has-child, .ne-mega__feature) { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--ne-mega-line); }
	.ne-main-nav li.is-style-mega > .wp-block-navigation__submenu-container > li:not(.has-child, .ne-mega__feature) > .wp-block-navigation-item__content { display: inline-flex !important; width: auto; align-items: center; gap: 10px; padding: 6px 0 !important; background: none !important; font-weight: 600; }
	.ne-main-nav li.is-style-mega > .wp-block-navigation__submenu-container > li:not(.has-child, .ne-mega__feature) > .wp-block-navigation-item__content::after { content: ""; position: static; width: 18px; height: 18px; border-radius: 0; background: var(--wp--preset--color--sun); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h15M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h15M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat; transform: none; transition: translate .35s var(--ne-ease); }
	.ne-main-nav li.is-style-mega > .wp-block-navigation__submenu-container > li:not(.has-child, .ne-mega__feature) > .wp-block-navigation-item__content:hover::after { translate: 4px 0; }

	/* Tour of the season. */
	.ne-mega__feature { display: flex; flex-direction: column; }
	.ne-mega__card { display: flex; flex: 1; flex-direction: column; gap: 16px; padding: 10px 10px 18px; border: 1px solid var(--ne-mega-line); border-radius: 22px; background: rgba(255, 255, 255, .035); color: #fff; text-decoration: none; transition: background-color .3s, border-color .3s; }
	.ne-mega__card:hover { border-color: rgba(238, 241, 245, .2); background: rgba(255, 255, 255, .06); }
	.ne-mega__card-media { position: relative; display: block; overflow: hidden; border-radius: 14px; aspect-ratio: 16 / 10; background: var(--wp--preset--color--night-soft); }
	.ne-mega__card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ne-ease); }
	.ne-mega__card:is(:hover, :focus-visible) .ne-mega__card-media img { transform: scale(1.06); }
	.ne-mega__card-body { display: flex; flex-direction: column; gap: 6px; padding: 0 8px; }
	.ne-mega__eyebrow { font: 600 .7rem / 1.2 var(--ne-sans); letter-spacing: .18em; text-transform: uppercase; color: var(--wp--preset--color--sun); }
	.ne-mega__card-title { font: 600 1.3rem / 1.15 var(--ne-display); letter-spacing: -.02em; }
	.ne-mega__card-meta { font-size: .86rem; color: var(--ne-mega-muted); }
	.ne-mega__card-cta { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; font-size: .9rem; font-weight: 600; }
	.ne-mega__card-cta .ne-icon { width: 16px; height: 16px; transition: translate .35s var(--ne-ease); }
	.ne-mega__card:hover .ne-mega__card-cta .ne-icon { translate: 4px 0; }
	.ne-main-nav li.is-style-mega :focus-visible { outline: 2px solid var(--wp--preset--color--sun); outline-offset: 2px; }
}
@media (min-width: 1024px) and (max-width: 1199px) {
	.ne-main-nav li.is-style-mega > .wp-block-navigation__submenu-container { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(220px, .8fr); }
	.ne-main-nav li.is-style-mega .ne-mega__tile > .wp-block-navigation-item__content { min-height: 200px; padding: 14px !important; }
	.ne-mega__tile .wp-block-navigation-item__label { font-size: 1rem; }
}
@media (min-width: 1024px) and (prefers-reduced-motion: reduce) {
	.ne-main-nav li.is-style-mega > .wp-block-navigation__submenu-container,
	.ne-main-nav li.is-style-mega > .wp-block-navigation__submenu-container > li { clip-path: none; translate: none; transition-duration: 0s !important; transition-delay: 0s !important; }
}

/* ---------- Phones and tablets: Book now + menu button, side by side ---------- */
/* Burger drawn in CSS (three lines), so the close button can turn the same lines into an X. */
.ne-main-nav .wp-block-navigation__responsive-container-open,
.ne-menu-overlay__close {
	--ne-burger: var(--wp--preset--color--ink);
	position: relative;
	order: 3;
	place-items: center;
	box-sizing: border-box;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: linear-gradient(var(--ne-burger), var(--ne-burger)) center / 18px 2px no-repeat, #fff;
	color: var(--ne-burger);
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: transform .25s var(--ne-ease), background-color .3s;
}
.ne-main-nav .wp-block-navigation__responsive-container-open:active,
.ne-menu-overlay__close:active { transform: scale(.92); }
.ne-main-nav .wp-block-navigation__responsive-container-open svg,
.ne-menu-overlay__close svg,
.ne-menu-overlay__close .wp-block-navigation-overlay-close__text { display: none; }
.ne-main-nav .wp-block-navigation__responsive-container-open::before,
.ne-main-nav .wp-block-navigation__responsive-container-open::after,
.ne-menu-overlay__close::before,
.ne-menu-overlay__close::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 18px;
	height: 2px;
	margin: -1px 0 0 -9px;
	border-radius: 2px;
	background: currentColor;
	translate: 0 -6px;
	rotate: 0deg;
}
.ne-main-nav .wp-block-navigation__responsive-container-open::after,
.ne-menu-overlay__close::after { translate: 0 6px; }

@media (max-width: 1023px) {
	.ne-site-header__row { gap: 8px; }
	.ne-site-header__row > .wp-block-northern-explorer-logo { margin-right: auto !important; }
	.ne-main-nav { flex: 0 0 auto; order: 3; }
	.ne-site-header__cta { order: 2; }
	.ne-site-header__cta .wp-block-button__link { min-height: 44px; padding-inline: 18px; font-size: .93rem; }
	.ne-main-nav .wp-block-navigation__responsive-container-open:not(.always-shown) { display: grid; }
	.ne-main-nav .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none; }
}
@media (min-width: 1024px) {
	.ne-main-nav .wp-block-navigation__responsive-container-open:not(.always-shown) { display: none; }
	.ne-site-header__row > .wp-block-northern-explorer-logo,
	.ne-site-header__cta { flex: 0 0 auto; }
}
@media (max-width: 360px) {
	.ne-site-header__cta .wp-block-button__link { padding-inline: 14px; }
	.ne-site-header__cta .ne-btn__icon, .ne-site-header__cta .wp-block-button__link svg { display: none; }
}

/* ---------- Mobile menu: Morph ----------
 * The menu button opens into a floating card. assets/js/frontend.js measures the button and
 * sets --ne-card-top / --ne-card-side (the card wraps the button at an even gap, with a
 * concentric corner) and --ne-tx/--ne-ty (the close button sits exactly on the menu button),
 * then grows the card's clip-path from the button and folds it back on close. */
.ne-main-nav .wp-block-navigation__responsive-container.is-menu-open {
	--ne-gap: 10px;
	padding: 0;
	background: transparent;
	color: var(--wp--preset--color--ink);
}
.ne-main-nav .wp-block-navigation__responsive-container.is-menu-open::before {
	content: "";
	position: fixed;
	/* The area really on screen (--ne-vv-*, assets/js/frontend.js): on iPhones, with the browser's
	   bars hidden, a plain inset: 0 leaves the page uncovered under it. */
	inset: var(--ne-vv-top, 0px) 0 var(--ne-vv-bottom, 0px);
	background: color-mix(in srgb, var(--wp--preset--color--night) 48%, transparent);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	opacity: 0;
	transition: opacity .45s ease;
}
.ne-main-nav .wp-block-navigation__responsive-container.is-menu-open.is-morphed::before { opacity: 1; }
.ne-main-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content { padding: 0; }
.ne-main-nav .is-menu-open .wp-block-navigation__responsive-close,
.ne-main-nav .is-menu-open .wp-block-navigation__responsive-dialog { max-width: none; min-height: 100%; margin: 0; }
/* The floating buttons would sit on top of the open menu: they slip away as it opens and come
   back once it has folded into its button (their return is eased in floating-actions/style.scss). */
body:has(.ne-main-nav .is-menu-open) .wp-block-northern-explorer-floating-actions .ne-fab {
	opacity: 0;
	transform: translateY(14px) scale(.96);
	pointer-events: none;
	transition-duration: .25s;
	transition-delay: 0s;
}
/* A fixed card inside a blurred or moved header would be clipped by it. */
.ne-site-header:has(.is-menu-open) { transform: none !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }

.ne-menu-overlay {
	position: fixed;
	top: var(--ne-card-top, var(--ne-gap));
	right: var(--ne-card-side, var(--ne-gap));
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	width: min(calc(100vw - var(--ne-card-side, 10px) - var(--ne-gap)), 440px);
	/* 100% is the menu layer (fixed, the size of the screen); --ne-vv-bottom stretches it to the
	   real bottom on iPhones once the browser's bars hide. */
	max-height: calc(100% - var(--ne-vv-bottom, 0px) - var(--ne-card-top, 10px) - var(--ne-gap));
	padding: var(--ne-gap) 20px 0;
	border-radius: 32px;
	background: var(--wp--preset--color--paper);
	color: var(--wp--preset--color--ink);
	box-shadow: 0 40px 100px -30px rgba(4, 8, 14, .6);
	overflow: hidden auto;
	overscroll-behavior: contain;
	scrollbar-width: none;
	--ne-line: var(--wp--custom--line);
	--ne-line-2: var(--wp--custom--line-strong);
	--ne-muted: var(--wp--preset--color--muted);
	--ne-text: var(--wp--preset--color--ink-soft);
}
.ne-menu-overlay > * { margin: 0 !important; }
.ne-menu-overlay__top { flex: none; align-items: center; min-height: 44px; padding-right: 54px; }
.ne-menu-overlay .ne-logo { color: var(--wp--preset--color--ink); }

/* The close button sits exactly on the menu button and morphs its lines into an X:
 * opening, they meet in the middle, then turn with a little spring; closing plays it back. */
.ne-menu-overlay__close {
	position: fixed;
	top: var(--ne-ty, 16px);
	left: var(--ne-tx, auto);
	right: auto;
	z-index: 3;
	display: grid;
	transition: transform .25s var(--ne-ease), background-color .35s ease .1s, color .35s ease .1s, background-size .16s linear .2s;
}
.ne-menu-overlay__close::before,
.ne-menu-overlay__close::after {
	transition: rotate .3s cubic-bezier(.65, 0, .35, 1), translate .26s cubic-bezier(.65, 0, .35, 1) .2s;
}
.is-morphed .ne-menu-overlay__close {
	--ne-burger: #fff;
	background: linear-gradient(var(--ne-burger), var(--ne-burger)) center / 0 2px no-repeat, var(--wp--preset--color--ink);
	transition: transform .25s var(--ne-ease), background-color .35s ease, color .35s ease, background-size .12s linear .06s;
}
.is-morphed .ne-menu-overlay__close::before,
.is-morphed .ne-menu-overlay__close::after {
	translate: 0 0;
	transition: translate .26s cubic-bezier(.65, 0, .35, 1) .06s, rotate .5s cubic-bezier(.34, 1.56, .64, 1) .26s;
}
.is-morphed .ne-menu-overlay__close::before { rotate: 45deg; }
.is-morphed .ne-menu-overlay__close::after { rotate: -45deg; }
.ne-menu-overlay__close:focus-visible { outline: 2px solid var(--wp--preset--color--sun); outline-offset: 3px; }

.ne-menu-overlay__label {
	padding: 26px 4px 4px;
	font: 600 .72rem / 1.2 var(--ne-sans);
	letter-spacing: .18em;
	text-transform: uppercase;
	color: var(--ne-muted);
}

/* Menu rows */
.ne-overlay-nav { width: 100%; }
.ne-overlay-nav .wp-block-navigation__container { flex-direction: column; align-items: stretch !important; gap: 0; width: 100%; }
.ne-overlay-nav .wp-block-navigation-item { display: block; }
.ne-overlay-nav > .wp-block-navigation__container > .wp-block-navigation-item { border-bottom: 1px solid var(--ne-line); }
.ne-overlay-nav > .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 15px 4px;
	font-family: var(--ne-display);
	font-size: clamp(1.4rem, 5.6vw, 1.7rem);
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: -.025em;
	color: var(--wp--preset--color--ink);
	text-decoration: none;
	opacity: 1;
}
.ne-overlay-nav > .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content::after {
	content: "";
	position: static;
	flex: none;
	width: 18px;
	height: 18px;
	border-radius: 0;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h15M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h15M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
	opacity: .35;
	transform: none;
	transition: opacity .25s, translate .3s var(--ne-ease);
}
.ne-overlay-nav > .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content:hover::after { opacity: 1; translate: 3px 0; }
.ne-overlay-nav .current-menu-item > .wp-block-navigation-item__content,
.ne-overlay-nav .current-menu-ancestor > .wp-block-navigation-item__content { color: var(--wp--preset--color--brand) !important; }
.ne-overlay-nav .wp-block-navigation__submenu-icon { display: none; }

/* Tours: its links always open, in two columns under the row */
.ne-overlay-nav .has-child .wp-block-navigation__submenu-container {
	position: static !important;
	display: grid !important;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0 16px;
	width: auto !important;
	min-width: 0 !important;
	height: auto !important;
	margin: -4px 0 0;
	padding: 0 4px 14px !important;
	border: 0 !important;
	border-radius: 0;
	background: none !important;
	color: inherit !important;
	opacity: 1 !important;
	visibility: visible !important;
	overflow: visible !important;
	box-shadow: none;
	transform: none;
	-webkit-backdrop-filter: none;
	backdrop-filter: none;
}
.ne-overlay-nav .has-child .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	display: block;
	width: auto;
	padding: 8px 0;
	border: 0;
	border-radius: 0;
	background: none !important;
	font-family: var(--ne-sans);
	font-size: .97rem;
	font-weight: 500;
	line-height: 1.3;
	color: var(--ne-text);
	text-decoration: none;
	opacity: 1;
}
.ne-overlay-nav .has-child .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover { color: var(--wp--preset--color--ink); text-decoration: underline; text-underline-offset: .25em; }

/* Groups of a mega menu (Tours): their name as a small heading over their links. */
.ne-overlay-nav .has-child .has-child { display: block; }
.ne-overlay-nav .has-child .has-child > .wp-block-navigation-item__content { padding: 10px 0 2px !important; font-size: .7rem !important; font-weight: 600 !important; letter-spacing: .16em; text-transform: uppercase; color: var(--ne-muted) !important; text-decoration: none !important; }
.ne-overlay-nav .has-child .has-child > .wp-block-navigation__submenu-container { display: block !important; margin: 0; padding: 0 !important; }
.ne-overlay-nav .has-child .has-child .wp-block-navigation__submenu-container > .wp-block-navigation-item > .wp-block-navigation-item__content { padding: 8px 0 !important; }
.ne-overlay-nav .is-style-mega > .wp-block-navigation__submenu-container > li:not(.has-child) { grid-column: 1 / -1; }
.ne-overlay-nav .is-style-mega > .wp-block-navigation__submenu-container > li:not(.has-child) > .wp-block-navigation-item__content { font-weight: 600; color: var(--wp--preset--color--ink); }

/* Booking and social */
/* Pinned to the bottom of the card: when the menu is taller than the screen, its rows scroll
   under these (fading out over the top of the band) instead of pushing them out of sight. */
.ne-menu-overlay__foot {
	position: sticky;
	bottom: 0;
	z-index: 1;
	flex: none;
	gap: 18px;
	padding: 26px 0 calc(20px + env(safe-area-inset-bottom));
	background: linear-gradient(transparent, var(--wp--preset--color--paper) 20px);
}
.ne-menu-overlay__foot .wp-block-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.ne-menu-overlay__foot .wp-block-button { width: auto; }
.ne-menu-overlay__foot .wp-block-button__link { width: 100%; min-height: 50px; padding-inline: 12px; font-size: .95rem; }
.ne-menu-overlay__foot .wp-block-northern-explorer-social-icons { justify-content: flex-start; }
.ne-menu-overlay__foot .wp-block-northern-explorer-social-icons a { border-color: var(--ne-line-2); color: var(--wp--preset--color--ink); }

/* Phone screens: tighter rows, so the whole menu fits without scrolling on most of them. */
@media (max-height: 820px) {
	.ne-menu-overlay__label { padding-top: 16px; }
	.ne-overlay-nav > .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content { padding-block: 12px; }
	.ne-overlay-nav .has-child .wp-block-navigation__submenu-container .wp-block-navigation-item__content { padding-block: 6px; }
	.ne-overlay-nav .has-child .has-child .wp-block-navigation__submenu-container > .wp-block-navigation-item > .wp-block-navigation-item__content { padding-block: 6px !important; }
	.ne-menu-overlay__foot { gap: 14px; padding-top: 18px; }
}

/* Rows arrive one after the other once the card is open */
.ne-menu-overlay > :not(.ne-menu-overlay__top) { opacity: 0; translate: 0 14px; }
.is-morphed .ne-menu-overlay > :not(.ne-menu-overlay__top) { opacity: 1; translate: 0 0; transition: opacity .45s ease, translate .6s var(--ne-ease); }
.is-morphed .ne-menu-overlay > :nth-child(2) { transition-delay: .14s; }
.is-morphed .ne-menu-overlay > :nth-child(3) { transition-delay: .18s; }
.is-morphed .ne-menu-overlay > :nth-child(4) { transition-delay: .26s; }
.ne-overlay-nav > .wp-block-navigation__container > .wp-block-navigation-item { opacity: 0; translate: 0 10px; }
.is-morphed .ne-overlay-nav > .wp-block-navigation__container > .wp-block-navigation-item { opacity: 1; translate: 0 0; transition: opacity .4s ease calc(.16s + var(--i, 0) * 35ms), translate .55s var(--ne-ease) calc(.16s + var(--i, 0) * 35ms); }
.ne-overlay-nav > .wp-block-navigation__container > .wp-block-navigation-item:nth-child(2) { --i: 1; }
.ne-overlay-nav > .wp-block-navigation__container > .wp-block-navigation-item:nth-child(3) { --i: 2; }
.ne-overlay-nav > .wp-block-navigation__container > .wp-block-navigation-item:nth-child(4) { --i: 3; }
.ne-overlay-nav > .wp-block-navigation__container > .wp-block-navigation-item:nth-child(5) { --i: 4; }
.ne-overlay-nav > .wp-block-navigation__container > .wp-block-navigation-item:nth-child(n+6) { --i: 5; }

@media (prefers-reduced-motion: reduce) {
	.ne-menu-overlay > :not(.ne-menu-overlay__top),
	.ne-overlay-nav > .wp-block-navigation__container > .wp-block-navigation-item { opacity: 1; translate: 0 0; }
}

/* Inside the editor the overlay part is shown in the page flow. */
.editor-styles-wrapper .ne-menu-overlay { position: relative; inset: auto; width: min(100%, 440px); margin-inline: auto; }
.editor-styles-wrapper .ne-menu-overlay > * { opacity: 1; translate: none; }
.editor-styles-wrapper .ne-menu-overlay__close { position: relative; top: auto; left: auto; }
