/* Homepage Header - Background & padding set via Theme Options */
.homepage-header {
	/* position: fixed; */
	top: 0;
	left: 0;
	right: 0;
	z-index: 1000;
	transition: background-color 0.3s ease;
}

/* Solid black header (no transparency) - e.g. service individual page */
.homepage-header--solid,
.homepage-header--solid.is-scrolled {
	background-color: #000000 !important;
}

.homepage-template .homepage-header {
	position: fixed;
}

.homepage-header__inner {
	min-height: 100px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	position: relative; /* For absolutely-centered logo on desktop */
	/* padding set via Theme Options inline style */
}

.homepage-header__branding {
	flex-shrink: 0;
}

/* Mobile header: hamburger left, logo centered to the right, full black background */
@media (max-width: 1099px) {
	.homepage-header {
		background-color: #000000 !important;
	}

	.homepage-header__mobile-toggle {
		order: -1;
		flex-shrink: 0;
	}

	.homepage-header__branding {
		/* Center the logo even when the hamburger exists on the left */
		position: absolute;
		left: 50%;
		top: 0;
		bottom: 0;
		transform: translateX(-50%);
		display: flex;
		justify-content: center;
		align-items: center;
	}
}

/* Extra-small screens: center against the viewport (not the padded container). */
@media (max-width: 425px) {
	.homepage-header__inner {
		padding-left: 0 !important;
		padding-right: 0 !important;
	}

	.homepage-header__branding {
		left: 50vw; /* exact viewport center */
	}
}

.homepage-header__logo-link {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: var(--header-text-color, #fff);
	font-family: "Playfair Display", Georgia, serif;
}

.homepage-header__logo-text {
	font-size: 28px;
	font-weight: 700;
	line-height: 1;
}

.homepage-header__logo-sub {
	font-size: 12px;
	font-weight: 400;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	margin-top: 2px;
}

.homepage-header__nav {
	display: none;
}

@media (min-width: 1100px) {
	.homepage-header__mobile-toggle {
		order: unset;
	}

	.homepage-header__branding {
		/* Desktop: keep logo on the left side */
		position: static;
		left: auto;
		top: auto;
		bottom: auto;
		transform: none;
		display: flex;
		align-items: center;
		justify-content: flex-start;
	}

	.homepage-header__nav {
		display: block;
		flex: 1;
		text-align: center;
	}

	.homepage-header__menu {
		display: flex;
		justify-content: right;
		align-items: center;
		gap: 32px;
		list-style: none;
		margin-right: 30px;
		padding: 0;
	}

	/* Ensure the image/link content aligns left on desktop */
	.homepage-header .custom-logo-link,
	.homepage-header__logo-link--img {
		justify-content: flex-start;
	}

	.homepage-header__menu .menu-item {
		position: relative;
	}

	.homepage-header__menu .menu-item>a {
		display: block;
		padding: 12px 4px;
		color: #fff;
		text-decoration: none;
		font-size: 16px;
		transition: opacity 0.2s ease;
		font-family: Nunito;
		font-style: normal;
		font-weight: 400;
		line-height: normal;
	}

	.homepage-header__menu .menu-item>a:hover {
		opacity: 0.8;
	}

	/* Desktop submenu - black box, white text, sharp corners (Figma design) */
	.homepage-header__menu .sub-menu {
		position: absolute;
		top: 135%;
		left: 50%;
		transform: translateX(-50%);
		min-width: 240px;
		background-color: #000;
		list-style: none;
		margin: 0;
		padding: 10px 0;
		border-radius: 0;
		box-shadow: none;
		border: none;
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.2s ease, visibility 0.2s ease;
		z-index: 100;
	}

	/* Bridge: prevent hover gap between parent and submenu */
	.homepage-header__menu .menu-item-has-children::before {
		content: "";
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		height: 8px;
	}

	.homepage-header__menu .menu-item-has-children:hover>.sub-menu,
	.homepage-header__menu .menu-item-has-children:focus-within>.sub-menu {
		opacity: 1;
		visibility: visible;
	}

	.homepage-header__menu .sub-menu .menu-item {
		margin: 0;
	}

	.homepage-header__menu .sub-menu .menu-item a {
		display: block;
		padding: 10px 0px;
		font-family: Nunito;
		color: #fff;
		text-decoration: none;
		font-size: 14px;
		font-weight: 400;
		text-align: center;
		line-height: normal;
		transition: background-color 0.2s ease;
	}
}

.homepage-header__cta {
	display: none;
}

@media (min-width: 1100px) {
	.homepage-header__cta {
		display: block;
	}
}

.homepage-header__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px 24px;
	background-color:  rgba(142, 169, 162, 1);
	color: var(--header-cta-text, #fff);
	text-decoration: none;
	font-weight: 400;
	border-radius: 8px;
	transition: background-color 0.2s ease, transform 0.2s ease;
	text-align: center;
	font-family: Nunito !important;
	font-size: 16px;
	font-style: normal;
	line-height: normal;
	height: 45px;
}

.homepage-header__btn:hover {
	text-decoration: none;
}

.homepage-header__mobile-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 0;
	color: #fff;
}

/* Hamburger icon - self-contained white 3-line (matches .hamburger .hamburger-box .hamburger-inner) */
.homepage-header__mobile-toggle .hamburger {
	display: inline-block;
	padding: 0;
	background: transparent !important;
	border: none;
	cursor: pointer;
	vertical-align: middle;
}

.homepage-header__mobile-toggle .hamburger-box {
	width: 24px;
	height: 18px;
	display: inline-block;
	position: relative;
}

.homepage-header__mobile-toggle .hamburger-inner {
	display: block;
	width: 30px;
	height: 2px;
	background-color: #fff !important;
	border-radius: 30px;
	position: absolute;
	top: 50%;
	left: 0;
	transition: transform 0.075s ease;
}

.homepage-header__mobile-toggle .hamburger-inner::before,
.homepage-header__mobile-toggle .hamburger-inner::after {
	content: "";
	display: block;
	width: 30px;
	height: 2px;
	background-color: #fff !important;
	border-radius: 30px;
	position: absolute;
	transition: transform 0.075s ease, top 0.075s ease;
}

.homepage-header__mobile-toggle .hamburger-inner::before {
	top: -4px;
	margin-top: -4px;
}

.homepage-header__mobile-toggle .hamburger-inner::after {
	top: 4px;
	margin-top: 4px;
}

.homepage-header__mobile-toggle.is-active .hamburger-inner {
	transform: rotate(45deg);
}

.homepage-header__mobile-toggle.is-active .hamburger-inner::before {
	top: 0;
	opacity: 0;
}

.homepage-header__mobile-toggle.is-active .hamburger-inner::after {
	top: 0;
	transform: rotate(-90deg);
}

@media (min-width: 1100px) {
	.homepage-header__mobile-toggle {
		display: none;
	}
}

/* Mobile menu overlay (backdrop) */
.homepage-header__mobile-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.4);
	z-index: 998;
	opacity: 0;
	transition: opacity 0.3s ease;
	pointer-events: none;
}

body.menu-active .homepage-header__mobile-overlay {
	display: block;
	opacity: 1;
	pointer-events: auto;
}

@media (min-width: 1100px) {
	.homepage-header__mobile-overlay {
		display: none !important;
	}
}

.homepage-header__mobile-menu {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	bottom: 0;
	background-color: #fff;
	padding: 0;
	transform: translateX(-100%);
	transition: transform 0.3s ease;
	z-index: 999;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
}

.homepage-header__mobile-menu.is-open {
	transform: translateX(0);
}

.homepage-header__mobile-menu-head {
	display: flex;
	align-items: flex-start;
	justify-content: right;
	margin: 25px 0 0 0;
}

.homepage-header__mobile-menu-head .homepage-header__mobile-menu-logo {
	padding: 0;
	text-align: left;
	margin: auto;
}

.homepage-header__mobile-menu-close {
	display: flex;
	align-items: flex-start;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	background: transparent;
	border: none;
	cursor: pointer;
	color: #000;
	transition: color 0.2s;
}

.homepage-header__mobile-menu-close:hover {
	color: #333;
}

.homepage-header__close-icon {
	width: 24px;
	height: 24px;
	flex-shrink: 0;
}

.homepage-header__mobile-menu-logo img {
	height: 43px;
	width: auto;
	max-width: 113px;
}

.homepage-header__mobile-menu-logo .homepage-header__mobile-logo-text {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: #000;
	font-family: "Playfair Display", Georgia, serif;
}

.homepage-header__mobile-menu-logo .homepage-header__logo-text {
	font-size: 24px;
	font-weight: 700;
	line-height: 1;
}

.homepage-header__mobile-menu-logo .homepage-header__logo-sub {
	font-size: 11px;
	font-weight: 400;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	margin-top: 2px;
}

.homepage-header__mobile-menu-nav {
	flex: 1;
	padding: 16px 20px;
	overflow-y: auto;
}

.homepage-header__mobile-menu-logo-link {
	display: flex;
	align-items: center;
	text-decoration: none;
	color: #000;
}

.homepage-header__mobile-menu-logo-link img {
	height: 43px;
	width: auto;
	max-width: 113px;
}

.homepage-header__mobile-menu-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.homepage-header__mobile-menu-list .menu-item {
	margin: 20px 0;
}

.homepage-header__mobile-menu-list .sub-menu .menu-item,
.sub-menu .menu-item a {
	margin: 0px 0;
	color: #000;
	font-family: Nunito, Georgia, serif !important;
	font-size: 14px;
	font-style: normal;
	font-weight: 400;
	line-height: normal;
}

.homepage-header__mobile-menu-list .menu-item>a {
	color: #000;
	text-decoration: none;
	font-family: "Playfair Display", Georgia, serif;
	display: flex;
	align-items: center;
	padding: 12px 0;
	font-size: 16px;
	font-style: normal;
	font-weight: 400;
	line-height: normal;
}

/* Items with children: flex row so link + toggle button sit side by side */
.homepage-header__mobile-menu-list .menu-item-has-children {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 5px;
}

/* Submenu toggle button */
.homepage-header__submenu-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	flex-shrink: 0;
	padding: 0;
	background: none;
	border-radius: 6px;
	cursor: pointer;
	color: inherit;
}

.homepage-header__submenu-toggle svg {
	transition: transform 0.2s ease;
}

.menu-item-has-children.is-expanded > .homepage-header__submenu-toggle svg {
	transform: rotate(180deg);
}

/* Sub-menu spans the full row width */
.homepage-header__mobile-menu-list .sub-menu {
	list-style: none;
	flex-basis: 100%;
	margin: 0;
	padding: 8px 16px 0;
	display: none;
}

.homepage-header__mobile-menu-list .menu-item-has-children.is-expanded > .sub-menu {
	display: block;
}

.homepage-header__mobile-menu-list .sub-menu .menu-item a {
	color: #000;
	text-decoration: none;
	font-family: "Playfair Display", Georgia, serif;
	font-size: 16px;
	padding: 8px 0;
	display: block;
}

.homepage-header__btn--mobile {
	font-family: Playfair Display, Georgia, serif !important;
	display: flex;
	align-items: center;
	justify-content: center;
	width: calc(100% - 40px);
	margin: 30px auto;
	background-color: #8EA9A2;
	color: #fff !important;
	text-decoration: none;
	font-weight: 400;
	font-size: 16px;
	border-radius: 8px;
	border: none;
	transition: opacity 0.2s ease;
}

.homepage-header__btn--mobile:hover {
	opacity: 0.9;
}

/* Custom logo and ACF logo sizing */
.homepage-header .custom-logo-link,
.homepage-header__logo-link--img {
	width: 300px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.homepage-header .custom-logo-link img,
.homepage-header__logo-img {
	height: 50px;
	width: auto;
	max-height: 50px;
}