/* =================================================================
   Emerald header + mega menu + mobile nav
   ================================================================= */

.emerald-header {
	--emerald-header-accent: var(--emerald-primary-color, #41a48f);
	--emerald-header-ink: #1D5F51;
	--emerald-header-muted: #8a9490;
	--emerald-admin-bar: 0px;
	position: relative;
	z-index: 100;
	padding: 16px 20px 0;
	background: transparent;
	pointer-events: none;
}

.admin-bar .emerald-header {
	--emerald-admin-bar: 32px;
}

@media screen and (max-width: 782px) {
	.admin-bar .emerald-header {
		--emerald-admin-bar: 46px;
	}
}

@media screen and (max-width: 600px) {
	.admin-bar .emerald-header {
		--emerald-admin-bar: 46px;
	}
}


.emerald-header__shell {
	--emerald-header-border-color: #05050533;
	--emerald-header-bg: var(--BG, #f8f8f8);
	--emerald-header-radius: 40px;
	--emerald-bar-h: 72px;
	pointer-events: auto;
	position: relative;
	z-index: 5;
	box-sizing: border-box;
	width: 100%;
	max-width: 1280px;
	margin: 0 auto;
	overflow: visible;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
}

/* Pill bar — border never changes on mega open/close */
.emerald-header__bar {
	position: relative;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	min-height: var(--emerald-bar-h);
	padding: 8px 12px;
	border: 1px solid var(--emerald-header-border-color);
	border-radius: 999px;
	background: var(--emerald-header-bg);
	box-shadow: 0 10px 40px rgba(31, 45, 42, 0.12);
}

.emerald-header__shell.is-mega-open .emerald-header__bar,
.emerald-header__shell.is-mega-closing .emerald-header__bar {
	/* Same border/radius/bg as closed — only drop outer shadow (mega has its own) */
	box-shadow: none;
}

.emerald-header__brand {
	display: flex;
	align-items: center;
	flex: 0 0 auto;
}

.emerald-brand img,
.emerald-header .custom-logo {
	display: block;
	width: 150px;
	max-width: 100%;
	height: auto;
}

.emerald-brand--text {
	color: var(--emerald-header-ink);
	font-family: 'Manrope', sans-serif;
	font-weight: 700;
	font-size: 16px;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.emerald-header__end {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 0 0 auto;
}

/* —— Desktop nav —— */
.emerald-nav {
	display: flex;
	flex: 1 1 auto;
	justify-content: center;
	min-width: 0;
}

.emerald-menu {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 4px 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.emerald-menu__item {
	margin: 0;
	padding: 0;
}

.emerald-menu__link,
.emerald-menu__trigger {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 10px 12px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--emerald-header-ink);
	font-family: 'Manrope', sans-serif;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	text-decoration: none;
	cursor: pointer;
	transition: color 0.15s ease;
}

.emerald-menu__link:hover,
.emerald-menu__trigger:hover,
.emerald-menu__item.is-current > .emerald-menu__link,
.emerald-menu__item.is-open > .emerald-menu__trigger {
	color: var(--emerald-header-accent);
	text-decoration: none;
}

.emerald-menu__trigger .emerald-icon-chevron {
	transition: transform 0.2s ease;
}

.emerald-menu__item.is-open > .emerald-menu__trigger .emerald-icon-chevron {
	transform: rotate(180deg);
}

.emerald-menu__trigger:focus,
.emerald-menu__link:focus {
	outline: 0;
}

.emerald-menu__trigger:focus-visible,
.emerald-menu__link:focus-visible {
	outline: 2px solid var(--emerald-header-accent);
	outline-offset: 2px;
}

/* —— Header CTA —— */
.emerald-cta--header,
.emerald-cta--mnav {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 14px 22px;
	border: 0;
	border-radius: 999px;
	background: var(--emerald-header-accent);
	color: #ffffff !important;
	font-family: 'Manrope', sans-serif;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	transition: filter 0.15s ease;
}

.emerald-cta--header{
	padding: 16px 36px;
	font-size: 16px;
}

.emerald-cta--header:hover,
.emerald-cta--mnav:hover {
	filter: brightness(0.95);
	color: #ffffff !important;
}

/* —— Mega panels (absolute overlay — does not grow header space) —— */
.emerald-mega {
	position: absolute;
	left: 0;
	right: 0;
	/* Sit behind the pill; white fills gaps under the curves */
	top: 0;
	z-index: 1;
	display: grid;
	grid-template-rows: 0fr;
	margin: 0;
	padding: 0;
	/* No real border — it leaves a 1px hairline under the pill when height → 0 */
	border: 0;
	border-radius: var(--emerald-header-radius);
	background: transparent;
	box-shadow: none;
	opacity: 1;
	pointer-events: none;
	transition: grid-template-rows 0.45s cubic-bezier(0.33, 1, 0.68, 1);
}

/* Fully idle — no leftover sliver under the pill */
.emerald-header__shell:not(.is-mega-open):not(.is-mega-closing) .emerald-mega {
	visibility: hidden;
	height: 0;
	overflow: hidden;
	opacity: 0;
	pointer-events: none;
	transition: none;
}

.emerald-header__shell.is-mega-open .emerald-mega,
.emerald-header__shell.is-mega-closing .emerald-mega {
	visibility: visible;
	height: auto;
	overflow: hidden;
	background: var(--emerald-header-bg);
}

.emerald-header__shell.is-mega-open .emerald-mega {
	grid-template-rows: 1fr;
	pointer-events: auto;
	opacity: 1;
	/* Outline via shadow so it doesn't add layout height */
	box-shadow:
		0 0 0 1px var(--emerald-header-border-color),
		0 16px 50px rgba(31, 45, 42, 0.16);
	transition:
		grid-template-rows 0.45s cubic-bezier(0.33, 1, 0.68, 1),
		opacity 0s,
		box-shadow 0.2s ease;
}

.emerald-header__shell.is-mega-closing .emerald-mega {
	grid-template-rows: 0fr;
	pointer-events: none;
	box-shadow: none;
	opacity: 0;
	transition:
		grid-template-rows 0.45s cubic-bezier(0.33, 1, 0.68, 1),
		opacity 0.35s ease,
		box-shadow 0.2s ease;
}

.emerald-mega__clip {
	display: grid;
	overflow: hidden;
	min-height: 0;
	background: transparent;
}

.emerald-header__shell.is-mega-open .emerald-mega__panel,
.emerald-header__shell.is-mega-closing .emerald-mega__panel {
	padding-top: var(--emerald-bar-h);
}

.emerald-mega__panel {
	grid-area: 1 / 1;
	width: 100%;
	background: transparent;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(8px);
	transition:
		opacity 0.32s ease,
		visibility 0.32s ease,
		transform 0.32s ease;
	z-index: 0;
}

.emerald-mega__panel.is-active {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateY(0);
	z-index: 1;
}

.emerald-mega__inner {
	display: grid;
	gap: 28px;
	padding: 28px 32px 32px;
}

.emerald-mega__inner--columns {
	grid-template-columns: minmax(0, 1fr) minmax(240px, 280px);
	align-items: stretch;
}

.emerald-mega__inner--grid {
	grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
	align-items: stretch;
}

.emerald-mega__cols {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
}

.emerald-mega__grid-wrap {
	min-width: 0;
}

.emerald-mega__label {
	margin: 0 0 16px;
	color: var(--emerald-header-muted);
	font-family: 'Manrope', sans-serif;
	font-size: 12px;
	font-weight: 500;
	line-height: 1.3;
}

.emerald-mega__list,
.emerald-mega__grid {
	margin: 0;
	padding: 0;
	list-style: none;
}

.emerald-mega__list {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.emerald-mega__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 22px 28px;
}

.emerald-mega__link {
	display: flex;
	flex-direction: column;
	gap: 4px;
	color: var(--emerald-header-ink);
	text-decoration: none;
}

.emerald-mega__link:hover,
.emerald-mega__link:focus {
	color: var(--emerald-header-accent);
	text-decoration: none;
}

.emerald-mega__link-title {
	display: inline-flex;
	align-items: center;
	color: #1F2D2A;
	gap: 10px;
	font-family: 'Manrope', sans-serif;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
}

.emerald-mega__link-title:hover {
	color: var(--emerald-header-ink);
}

.emerald-mega__link-desc {
	color: var(--emerald-header-muted);
	font-family: 'Source Sans 3', sans-serif;
	font-size: 13px;
	font-weight: 400;
	line-height: 1.4;
}

.emerald-mega__link:hover .emerald-mega__link-desc {
	color: var(--emerald-header-muted);
}

.emerald-mega__feature {
	position: relative;
	display: block;
	overflow: hidden;
	min-height: 280px;
	border-radius: 20px;
	color: #ffffff;
	text-decoration: none;
	isolation: isolate;
}

.emerald-mega__feature:hover,
.emerald-mega__feature:focus {
	color: #ffffff;
	text-decoration: none;
}

.emerald-mega__feature-img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100% !important;
	height: 100% !important;
	object-fit: cover;
}

.emerald-mega__feature-img--placeholder {
	background: linear-gradient(160deg, #1d5f51 0%, #41a48f 100%);
}

.emerald-mega__feature-overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(180deg, rgba(31, 45, 42, 0.15) 20%, rgba(31, 45, 42, 0.72) 100%);
	pointer-events: none;
}

.emerald-mega__feature-copy {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 2;
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 24px;
}

.emerald-mega__feature-title {
	font-family: 'Manrope', sans-serif;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -0.02em;
}

.emerald-mega__feature-text {
	font-family: 'Source Sans 3', sans-serif;
	font-size: 13px;
	font-weight: 400;
	line-height: 1.45;
	opacity: 0.92;
}

/* —— Sticky —— */
.emerald-header.is-sticky {
	position: fixed;
	top: var(--emerald-admin-bar);
	left: 0;
	right: 0;
	padding-top: 12px;
	transform: translateY(-120%);
	will-change: transform;
}

.emerald-header.is-sticky.is-animated {
	transition: transform 0.3s ease;
}

.emerald-header.is-sticky.is-visible {
	transform: translateY(0);
}

body.emerald-header-stuck {
	padding-top: var(--emerald-header-h, 0px);
}

/* —— Hamburger —— */
.emerald-hamburger {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
}

.emerald-hamburger__bar {
	display: block;
	width: 20px;
	height: 2px;
	margin: 0 auto;
	border-radius: 2px;
	background: var(--emerald-header-ink);
}

/* —— Mobile drawer —— */
.emerald-mnav {
	--emerald-header-accent: var(--emerald-primary-color, #41a48f);
	--emerald-header-ink: #1D5F51;
	--emerald-header-muted: #8a9490;
	position: fixed;
	inset: 0;
	z-index: 200;
	display: flex;
	flex-direction: column;
	background: var(--BG, #f8f8f8);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.25s ease, visibility 0.25s ease;
}

body.mobile-nav-open .emerald-mnav {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

body.mobile-nav-open {
	overflow: hidden;
}

.emerald-mnav__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex: 0 0 auto;
	gap: 16px;
	padding: 16px 18px;
	background: var(--BG, #f8f8f8);
}

.emerald-mnav__brand .emerald-brand img {
	max-height: 48px;
}

.emerald-mnav__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--emerald-header-ink);
	cursor: pointer;
}

.emerald-mnav__scroll {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
	overflow-x: hidden;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
}

.emerald-mnav__nav {
	flex: 1 0 auto;
	padding: 0 0 24px;
}

.emerald-mnav__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.emerald-mnav__item {
	border-bottom: 1px solid rgba(31, 45, 42, 0.1);
}

.emerald-mnav__row {
	display: flex;
	align-items: stretch;
	width: 100%;
}

.emerald-mnav__link,
.emerald-mnav__trigger {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	width: 100%;
	margin: 0;
	padding: 20px 22px;
	border: 0;
	background: transparent;
	color: var(--emerald-header-ink);
	font-family: 'Manrope', sans-serif;
	font-size: 20px;
	font-weight: 600;
	line-height: 1.2;
	text-align: left;
	text-decoration: none;
	cursor: pointer;
}

.emerald-mnav__row .emerald-mnav__link {
	flex: 1 1 auto;
	justify-content: flex-start;
	padding-right: 8px;
}

.emerald-mnav__chevron-btn {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 56px;
	margin: 0;
	padding: 0;
	border: 0;
	border-left: 1px solid rgba(31, 45, 42, 0.08);
	background: transparent;
	color: var(--emerald-header-ink);
	cursor: pointer;
}

.emerald-mnav__link:hover,
.emerald-mnav__link:focus,
.emerald-mnav__trigger:hover,
.emerald-mnav__trigger:focus,
.emerald-mnav__chevron-btn:hover,
.emerald-mnav__chevron-btn:focus {
	color: var(--emerald-header-accent);
	text-decoration: none;
}

.emerald-mnav__chevron {
	display: inline-flex;
	color: inherit;
	transition: transform 0.2s ease;
}

.emerald-mnav__item.is-open > .emerald-mnav__row .emerald-mnav__chevron,
.emerald-mnav__item.is-open > .emerald-mnav__trigger .emerald-mnav__chevron {
	transform: rotate(90deg);
}

.emerald-mnav__item.is-open > .emerald-mnav__row .emerald-icon-chevron--right,
.emerald-mnav__item.is-open > .emerald-mnav__trigger .emerald-icon-chevron--right {
	/* rotate parent handles orientation to "down" feel */
}

.emerald-mnav__panel {
	background: #ffffff;
	padding: 20px 24px;
}

.emerald-mnav__panel[hidden] {
	display: none !important;
}

.emerald-mnav__group + .emerald-mnav__group {
	margin-top: 18px;
}

.emerald-mnav__label {
	margin: 0 0 10px;
	color: var(--emerald-header-muted);
	font-family: 'Manrope', sans-serif;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.3;
}

.emerald-mnav__sublist {
	margin: 0;
	padding: 0;
	list-style: none;
}

.emerald-mnav__sublink {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 0 10px 8px;
	color: var(--emerald-header-ink);
	font-family: 'Manrope', sans-serif;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
}

.emerald-mnav__sublink:hover,
.emerald-mnav__sublink:focus {
	color: var(--emerald-header-accent);
	text-decoration: none;
}

.emerald-mnav__cta-wrap {
	flex: 0 0 auto;
	padding: 8px 22px 28px;
	margin-top: auto;
}

.emerald-cta--mnav {
	display: flex;
	width: 100%;
	padding: 18px 22px;
	font-size: 16px;
}

.admin-bar .emerald-mnav__top {
	padding-top: calc(16px + 32px);
}

@media screen and (max-width: 782px) {
	.admin-bar .emerald-mnav__top {
		padding-top: calc(16px + 46px);
	}
}

@media screen and (max-width: 600px) {
	.admin-bar .emerald-mnav__top {
		padding-top: 16px;
	}
}

/* —— Breakpoints —— */
@media (max-width: 1100px) {
	.emerald-menu__link,
	.emerald-menu__trigger {
		padding: 8px 8px;
		font-size: 13px;
	}

	.emerald-mega__inner--columns,
	.emerald-mega__inner--grid {
		grid-template-columns: 1fr;
	}

	.emerald-mega__feature {
		min-height: 220px;
	}
}

@media (max-width: 960px) {
	.emerald-nav,
	.emerald-cta--header {
		display: none;
	}

	.emerald-hamburger {
		display: flex;
	}

	.emerald-header__shell {
		border: 0;
		border-radius: 0;
		background: transparent;
		box-shadow: none;
		overflow: visible;
	}

	.emerald-header__shell.is-mega-open,
	.emerald-header__shell.is-mega-closing {
		border: 0;
		border-radius: 0;
		background: transparent;
		box-shadow: none;
		overflow: visible;
	}

	.emerald-header__bar {
		min-height: 64px;
		padding: 8px 10px 8px 16px;
		border: 1px solid var(--emerald-header-border-color);
		border-radius: 99px;
		background: var(--emerald-header-bg);
		box-shadow: 0 10px 40px rgba(31, 45, 42, 0.12);
	}

	.emerald-header__shell.is-mega-open .emerald-header__bar,
	.emerald-header__shell.is-mega-closing .emerald-header__bar {
		border: 1px solid var(--emerald-header-border-color);
		border-radius: 99px;
		background: var(--emerald-header-bg);
		box-shadow: 0 10px 40px rgba(31, 45, 42, 0.12);
	}

	.emerald-mega {
		display: none !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.emerald-header.is-sticky.is-animated,
	.emerald-header__shell,
	.emerald-mega,
	.emerald-mega__panel.is-active,
	.emerald-mnav {
		transition: none !important;
		animation: none !important;
	}
}
