/* =========================================================
   Legacy Financial — Site Header
   Full-width, transparent background, 1440px content area
   Font: Quicksand (Google Fonts)
   ========================================================= */

.lf-header {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	z-index: 1000;
	background: transparent;
	font-family: 'Quicksand', sans-serif;
	transition: height 0.3s ease;
}

/* ::before — backdrop blur only, fades out at ~60% */
.lf-header::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: -1;
	background: transparent;
	backdrop-filter: blur( 8px );
	height: 100px;
	-webkit-backdrop-filter: blur( 8px );
	-webkit-mask-image: linear-gradient( to bottom, black 0%, transparent 100% );
	mask-image: linear-gradient( to bottom, black 0%, transparent 100% );
	opacity: 0.5;
	transition: opacity 0.3s ease;
	pointer-events: none;
}

/* ::after — background colour only, more gradual fade starts earlier */
.lf-header::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: -2;
	height: 100px;
	background: rgba( 0, 0, 0, 0.5 );
	-webkit-mask-image: linear-gradient( to bottom, black 0%, transparent 100% );
	mask-image: linear-gradient( to bottom, black 0%, transparent 100% );
	opacity: 0.5;
	transition: opacity 0.3s ease;
	pointer-events: none;
}

.lf-header.is-scrolled {
	background-color: transparent !important;
}

.lf-header.is-scrolled::before,
.lf-header.is-scrolled::after {
	opacity: 1;
}

.lf-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	max-width: 1440px;
	margin: 0 auto;
	padding: 0 20px;
	height: 80px;
	transition: height 0.3s ease;
}

/* ---- Logo ---- */
.lf-header__logo,
.lf-header__logo a {
	display: flex;
	align-items: center;
	text-decoration: none;
	flex-shrink: 0;
}

.lf-header__logo img,
.lf-header__logo .custom-logo {
	width: 322px;
	height: 59px;
	object-fit: contain;
	display: block;
}

/* ---- Primary Nav ---- */
.lf-header__nav {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	margin-left: auto;
	padding-right: 25px;
}

.lf-header__menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 25px;
}

.lf-header__menu li {
	margin: 0;
	padding: 0;
}

.lf-header__menu a {
	font-family: 'Quicksand', sans-serif;
	font-size: 18px;
	font-weight: 600;
	color: #ffffff;
	text-decoration: none;
}

.lf-header__menu a:hover {
	color: #ffffff;
}

.lf-header__menu > li > a {
	position: relative;
}

.lf-header__menu > li > a::before {
	content: '';
	position: absolute;
	bottom: -3px;
	left: 25%;
	width: 50%;
	height: 2px;
	background: rgba(255, 255, 255, 0.8);
	border-radius: 9999px;
	transform: scaleX(0);
	transform-origin: center;
	transition: transform 0.25s ease;
}

.lf-header__menu > li > a:hover::before,
.lf-header__menu > li.current-menu-item > a::before {
	transform: scaleX(1);
}

/* ---- Dropdown sub-menus ---- */

/* Parent item must establish a stacking context for the absolute sub-menu */
.lf-header__menu li.menu-item-has-children {
	position: relative;
}

/* Chevron indicator */
.lf-header__menu li.menu-item-has-children > a::after {
	content: '';
	display: inline-block;
	margin-left: 6px;
	width: 8px;
	height: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg) translateY(-2px);
	vertical-align: middle;
	transition: transform 0.2s ease;
}

.lf-header__menu li.menu-item-has-children:hover > a::after {
	transform: rotate(-135deg) translateY(-2px);
}

/* Sub-menu panel — hidden until parent is hovered */
.lf-header__menu .sub-menu {
	position: absolute;
	top: calc(100% + 12px);
	left: 50%;
	transform: translateX(-50%);
	min-width: 200px;
	list-style: none;
	margin: 0;
	padding: 8px 0;
	background: #ffffff;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 7px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
	z-index: 1010;

	/* Hidden state */
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
	transform: translateX(-50%) translateY(-4px);
}

/* Invisible bridge so the menu doesn't close when moving cursor from link to panel */
.lf-header__menu li.menu-item-has-children::before {
	content: '';
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	height: 14px;
}

/* Show on hover */
.lf-header__menu li.menu-item-has-children:hover > .sub-menu {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateX(-50%) translateY(0);
}

/* Sub-menu items */
.lf-header__menu .sub-menu li {
	margin: 0;
	padding: 0;
	white-space: nowrap;
}

.lf-header__menu .sub-menu a {
	display: block;
	padding: 10px 20px;
	font-size: 16px;
	font-weight: 600;
	color: #1d1d1d;
	text-decoration: none;
	transition: background-color 0.2s ease, padding-left 0.2s ease;
}

.lf-header__menu .sub-menu a:hover,
.lf-header__menu .sub-menu .current-menu-item > a {
	background-color: #f5f5f5;
	padding-left: 24px;
}

/* Third-level sub-menus: open to the right */
.lf-header__menu .sub-menu .menu-item-has-children > a::after {
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(-45deg) translateY(0);
	margin-left: auto;
	float: right;
	margin-top: 4px;
}

.lf-header__menu .sub-menu .sub-menu {
	top: 0;
	left: 100%;
	transform: translateX(4px);
}

.lf-header__menu .sub-menu .menu-item-has-children:hover > .sub-menu {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateX(0);
}

/* ---- CTA Button ---- */
.lf-header__cta {
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

.lf-header__cta-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 140px;
	height: 44px;
	background-color: #009D44;
	color: #ffffff;
	font-family: 'Quicksand', sans-serif;
	font-size: 18px;
	font-weight: 700;
	text-decoration: none;
	border: 2px solid #30FE89;
	border-radius: 999px;
	white-space: nowrap;
	box-sizing: border-box;
	transition: background-color 0.2s ease, transform 0.15s ease;
}

.lf-header__cta-btn:hover {
	background-color: #007d36;
	color: #ffffff;
	transform: translateY(-1px);
}

/* ---- Scrolled state — slightly smaller ---- */
.lf-header.is-scrolled .lf-header__inner {
	height: 64px;
	transition: height 0.3s ease;
}

.lf-header.is-scrolled .lf-header__logo img,
.lf-header.is-scrolled .lf-header__logo .custom-logo {
	height: 46px;
	width: auto;
	transition: height 0.3s ease;
}

/* ---- Offset page content so fixed header doesn't overlap ---- */
.elementor-page .elementor-section:first-child,
body.page .entry-content > *:first-child {
	padding-top: 80px;
}

/* =========================================================
   Responsive — collapse nav on smaller screens
   ========================================================= */

@media (max-width: 1024px) {
	.lf-header__nav {
		display: none;
	}

	.lf-header__cta {
		margin-left: auto;
	}
}

@media (max-width: 768px) {
	.lf-header__inner {
		height: 64px;
	}

	.lf-header__logo img,
	.lf-header__logo .custom-logo {
		width: auto;
		max-width: 200px;
		height: 40px;
	}
}
