/* ============================================================
   IKM HEADER REDESIGN v2 — light theme per owner mockups
   (images/ikm-1.jpeg, ikm-2.jpeg "01 HOME PAGE" panel)
   Loads AFTER site.css and must also out-specify the legacy
   header skin cached inside Divi's et-core-unified CSS
   (#main-header dark gradient, yellow #EDF000 underline,
   blue dropdown + mobile panels) which loads after this file —
   hence the deliberate specificity and !important usage.
   Concept: white bar ~80px, logo left (white PNG recolored to
   divine blue via CSS filter), blue Poppins nav, saffron-red
   underline for hover/active, blue WHNF pill + saffron Donate
   CTA, white card dropdowns, always-sticky slim scrolled state.
   ============================================================ */

/* ---------- 1. The bar: white, calm, always sticky ---------- */
#main-header,
#main-header.et-fixed-header {
	background: #ffffff !important;
	box-shadow: 0 1px 0 rgba(18, 60, 105, .08), 0 4px 18px rgba(18, 60, 105, .08) !important;
	transition: padding .25s ease, box-shadow .25s ease;
}
#main-header { padding: 16px 0 !important; }
/* owner requirement: header always visible while scrolling */
body.et_fixed_nav #main-header { position: fixed !important; }

/* Wider, airier container (beats legacy #main-header .container) */
#main-header .container.et_menu_container { width: 92% !important; max-width: 1280px !important; }

/* ---------- 2. Flex layout: static logo left, nav right ----------
   Divi absolutely-positions .logo_container and injects inline
   padding on #et-top-navigation via JS; flex replaces all of it. */
#main-header .container.et_menu_container {
	display: flex;
	align-items: center;
	justify-content: space-between;
}
#main-header .logo_container {
	position: static !important;
	width: auto !important;
	height: auto !important;
	flex: 0 0 auto;
}
#main-header .logo_helper { display: none; }
/* White-on-transparent logo, recolored to divine blue (~#123c69).
   Do not touch the file — pure CSS recolor. */
#main-header #logo {
	max-height: 48px !important;
	max-width: none !important;
	width: auto !important;
	margin: 0 !important;
	filter: brightness(0) saturate(100%) invert(19%) sepia(30%) saturate(1600%) hue-rotate(190deg) brightness(93%) contrast(94%);
	transition: max-height .25s ease;
}
#et-top-navigation,
.et_header_style_left #et-top-navigation {
	float: none;
	padding: 0 !important;   /* beats Divi's JS inline padding-top */
	margin: 0 0 0 28px !important;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	flex: 1 1 auto;
	min-width: 0;
}
#et_top_search { float: none; margin: 0 0 0 22px !important; }
#et_search_icon:before { color: #123c69 !important; }

/* ---------- 3. Nav typography: blue, quiet, evenly spaced ---------- */
@media (min-width: 981px) {
	#top-menu {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		justify-content: flex-end;
		gap: 6px 26px !important; /* beats legacy #top-menu{gap:30px} */
		padding: 0;
	}
	#top-menu > li { display: flex; align-items: center; padding-right: 0 !important; margin: 0; }
	#top-menu > li > a {
		font-family: 'Poppins', 'Open Sans', sans-serif !important;
		font-size: 14px !important;
		font-weight: 500 !important;
		letter-spacing: .02em;
		line-height: 1.4;
		color: #123c69 !important;
		text-shadow: none !important;
		padding: 6px 0 !important;
		position: relative;
	}

	/* Saffron underline slides in on hover / marks the active page.
	   ::before is redefined wholesale so the legacy yellow #EDF000
	   underline (same pseudo, lower specificity) can never render. */
	#top-menu > li > a::before {
		content: "";
		position: absolute;
		left: 0;
		bottom: -5px;
		width: 100%;
		height: 2px;
		border-radius: 2px;
		background: #f97316;
		transform: scaleX(0);
		transform-origin: left center;
		transition: transform .25s ease;
	}
	#top-menu > li > a:hover::before,
	#top-menu > li > a:focus-visible::before,
	#top-menu > li.current-menu-item > a::before,
	#top-menu > li.current-menu-ancestor > a::before { transform: scaleX(1); }

	#top-menu > li > a:hover { color: #c2410c !important; opacity: 1; }
	#top-menu > li.current-menu-item > a,
	#top-menu > li.current-menu-ancestor > a { color: #c2410c !important; }

	/* Dropdown caret on parent items (owner requirement) */
	#top-menu > li.menu-item-has-children > a::after {
		content: "";
		display: inline-block;
		width: 0;
		height: 0;
		border-left: 4px solid transparent;
		border-right: 4px solid transparent;
		border-top: 5px solid currentColor;
		opacity: .55;
		margin-left: 7px;
		vertical-align: 2px;
		transition: transform .2s ease;
	}
	#top-menu > li.menu-item-has-children:hover > a::after,
	#top-menu > li.menu-item-has-children:focus-within > a::after { transform: rotate(180deg); }

	/* Group dividers (before Kirtan Standards and before Donate) */
	#top-menu > li.menu-item-5358,
	#top-menu > li.menu-item-1386 { padding-left: 26px; }
	#top-menu > li.menu-item-5358::before,
	#top-menu > li.menu-item-1386::before {
		left: 0;
		width: 1px;
		height: 20px;
		background: rgba(18, 60, 105, .15);
	}
}

/* ---------- 4. CTAs: blue WHNF pill + saffron Donate (mockup) ---------- */
#top-menu > li.menu-item-6000 > a {
	background: #123c69 !important;
	color: #ffffff !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	letter-spacing: .03em;
	padding: 8px 18px !important;
	border-radius: 999px;
	line-height: 1.2;
	box-shadow: 0 2px 8px rgba(18, 60, 105, .25);
	transition: background .2s ease, box-shadow .2s ease, transform .2s ease;
}
#top-menu > li.menu-item-6000 > a::before { content: none !important; } /* no underline; caret stays (white via currentColor) */
#top-menu > li.menu-item-6000 > a:hover {
	background: #0b2a4d !important;
	color: #ffffff !important;
	box-shadow: 0 4px 14px rgba(11, 42, 77, .35);
	transform: translateY(-1px);
}
#top-menu > li.menu-item-1386 > a {
	background: #c2410c !important;      /* AA with white text */
	border: 0;
	color: #ffffff !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	letter-spacing: .03em;
	padding: 8px 20px !important;
	border-radius: 999px;
	line-height: 1.2;
	box-shadow: 0 2px 8px rgba(194, 65, 12, .30);
	transition: background .2s ease, box-shadow .2s ease, transform .2s ease;
}
#top-menu > li.menu-item-1386 > a::before,
#top-menu > li.menu-item-1386 > a::after { content: none !important; }
#top-menu > li.menu-item-1386 > a:hover {
	background: #9a3412 !important;
	color: #ffffff !important;
	box-shadow: 0 4px 14px rgba(154, 52, 18, .40);
	transform: translateY(-1px);
}

/* ---------- 5. Dropdowns: white cards, soft shadow, saffron accent ---------- */
#top-menu li { position: relative; }
#main-header .nav li ul,
#main-header.et-fixed-header .nav li ul {
	background: #ffffff !important;
	border: 0 !important;
	border-top: 3px solid #f97316 !important;
	border-radius: 0 0 12px 12px !important;
	width: 250px !important;
	padding: 8px 8px 10px !important;
	box-shadow: 0 18px 40px rgba(18, 60, 105, .16), 0 2px 8px rgba(18, 60, 105, .10) !important;
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
}
/* first-level panel sits just below the bar, with an invisible hover
   bridge across the gap so the menu never flickers shut */
#top-menu > li > ul.sub-menu { top: calc(100% + 17px); left: -12px; margin-top: 0; }
#top-menu > li > ul.sub-menu::before {
	content: "" !important;
	position: absolute;
	left: 0;
	right: 0;
	top: -20px;
	height: 20px;
	width: auto;
	background: transparent;
	transform: none;
}
/* fly-outs sit flush beside their parent card */
#top-menu li li > ul.sub-menu { top: -8px; left: 100%; }

#main-header .nav li:hover > ul,
#main-header .nav li.et-hover > ul,
#main-header .nav li:focus-within > ul.sub-menu {
	opacity: 1 !important;
	visibility: visible !important;
	transform: translateY(0);
}

#top-menu li li a {
	display: block;
	width: auto !important;
	padding: 10px 16px !important;
	border-radius: 8px;
	font-family: 'Poppins', 'Open Sans', sans-serif;
	font-size: 13.5px !important;
	font-weight: 500;
	line-height: 1.45;
	color: #1f3a5c !important;
	text-shadow: none !important;
	position: relative;
	transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
#top-menu li li a::before { content: none !important; } /* no legacy underline in panels */
#top-menu li li a:hover,
#top-menu li li a:focus-visible {
	background: #fff4ec !important;
	color: #c2410c !important;
	box-shadow: inset 3px 0 0 #f97316;
	padding-left: 16px !important; /* beats legacy hover padding-left:25px */
}
#top-menu li li.current-menu-item > a { color: #c2410c !important; font-weight: 600; }

/* caret for fly-out parents inside a panel */
#top-menu li li.menu-item-has-children > a::after {
	content: "";
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	width: 0;
	height: 0;
	border-top: 4px solid transparent;
	border-bottom: 4px solid transparent;
	border-left: 5px solid currentColor;
	opacity: .55;
}

/* ---------- 6. Scrolled state: slimmer, still white, lifted ---------- */
#main-header.et-fixed-header { padding: 9px 0 !important; }
#main-header.et-fixed-header #logo { max-height: 40px !important; }

/* ---------- 7. Accessibility ---------- */
#main-header a:focus-visible,
#main-header button:focus-visible {
	outline: 2px solid #c2410c;
	outline-offset: 4px;
	border-radius: 4px;
}
#top-menu > li.menu-item-6000 > a:focus-visible,
#top-menu > li.menu-item-1386 > a:focus-visible { outline-offset: 3px; border-radius: 999px; }
@media (prefers-reduced-motion: reduce) {
	#main-header, #main-header.et-fixed-header, #main-header #logo,
	#main-header .nav li ul,
	#top-menu > li > a::before,
	#top-menu > li.menu-item-has-children > a::after,
	#top-menu > li.menu-item-6000 > a,
	#top-menu > li.menu-item-1386 > a { transition: none; }
}

/* ---------- 8. Mid-width desktops: compress gracefully ---------- */
@media (min-width: 981px) and (max-width: 1350px) {
	#top-menu { gap: 6px 16px !important; }
	#top-menu > li > a { font-size: 13px !important; }
	#main-header #logo { max-height: 42px !important; }
	.et_header_style_left #et-top-navigation { margin-left: 18px !important; }
	#top-menu > li.menu-item-6000 > a,
	#top-menu > li.menu-item-1386 > a { padding: 7px 14px !important; font-size: 12.5px !important; }
	#top-menu > li.menu-item-5358,
	#top-menu > li.menu-item-1386 { padding-left: 16px; }
}

/* ---------- 9. Mobile (<981px): light panel, generous tap targets ---------- */
@media (max-width: 980px) {
	#main-header { padding: 10px 0 !important; }
	#main-header #logo { max-height: 40px !important; }
	#et-top-navigation { margin-left: 16px !important; }
	.mobile_nav .select_page { display: none !important; } /* hamburger alone is cleaner */
	.mobile_menu_bar { padding: 6px; }
	.mobile_menu_bar:before,
	.mobile_menu_bar:after { color: #123c69 !important; font-size: 30px; }

	/* #main-header prefix out-specifies the legacy blue panel skin */
	#main-header .et_mobile_menu {
		background: #ffffff !important;
		border: 0 !important;
		border-top: 3px solid #f97316 !important;
		border-radius: 0 0 14px 14px;
		box-shadow: 0 20px 44px rgba(18, 60, 105, .18) !important;
		padding: 8px 10px 14px !important;
	}
	#main-header .et_mobile_menu li { padding: 0 !important; }
	#main-header .et_mobile_menu li a {
		font-family: 'Poppins', 'Open Sans', sans-serif;
		font-size: 15px;
		font-weight: 500;
		color: #123c69 !important;
		padding: 13px 14px !important;
		border-bottom: 1px solid rgba(18, 60, 105, .08) !important;
		border-radius: 8px;
		position: relative;
	}
	#main-header .et_mobile_menu li a:hover,
	#main-header .et_mobile_menu li a:focus-visible { background: #fff4ec !important; color: #c2410c !important; }
	#main-header .et_mobile_menu li li a { font-size: 14px; font-weight: 400; }

	/* dropdown hint on parents (owner requirement) */
	#main-header .et_mobile_menu li.menu-item-has-children > a::after {
		content: "";
		position: absolute;
		right: 14px;
		top: 50%;
		transform: translateY(-50%);
		width: 0;
		height: 0;
		border-left: 5px solid transparent;
		border-right: 5px solid transparent;
		border-top: 6px solid currentColor;
		opacity: .5;
	}

	/* brand CTAs keep their identity inside the panel */
	#main-header .et_mobile_menu li.menu-item-6000 > a {
		background: #123c69 !important;
		color: #ffffff !important;
		font-weight: 600;
		border-radius: 10px;
		border-bottom: 0 !important;
		margin: 6px 2px;
		text-align: center;
	}
	#main-header .et_mobile_menu li.menu-item-1386 > a {
		background: #c2410c !important;
		color: #ffffff !important;
		font-weight: 600;
		border-radius: 10px;
		border-bottom: 0 !important;
		margin: 6px 2px;
		text-align: center;
	}
}

/* ============================================================
   GLASS HEADER — owner-requested frosted transparent look.
   Appended last: overrides the solid white bar above.
   ============================================================ */
#main-header,
body.et_fixed_nav #main-header {
	background: rgba(255, 255, 255, 0.72) !important;
	-webkit-backdrop-filter: blur(16px) saturate(170%);
	backdrop-filter: blur(16px) saturate(170%);
	box-shadow: 0 1px 0 rgba(18, 60, 105, 0.06), 0 10px 34px rgba(18, 60, 105, 0.10) !important;
	border-bottom: 1px solid rgba(255, 255, 255, 0.45);
}
/* Slightly denser glass once scrolled, for legibility over busy content */
body.et_fixed_nav #main-header.et-fixed-header {
	background: rgba(255, 255, 255, 0.82) !important;
	-webkit-backdrop-filter: blur(18px) saturate(180%);
	backdrop-filter: blur(18px) saturate(180%);
}
/* Browsers without backdrop-filter get a near-solid bar (text stays readable) */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	#main-header, body.et_fixed_nav #main-header, body.et_fixed_nav #main-header.et-fixed-header {
		background: rgba(255, 255, 255, 0.96) !important;
	}
}
/* Glassy dropdown panels */
#main-header .nav li ul {
	background: rgba(255, 255, 255, 0.88) !important;
	-webkit-backdrop-filter: blur(14px) saturate(160%);
	backdrop-filter: blur(14px) saturate(160%);
}
/* Glassy mobile panel */
.et_mobile_menu {
	background: rgba(255, 255, 255, 0.92) !important;
	-webkit-backdrop-filter: blur(14px) saturate(160%);
	backdrop-filter: blur(14px) saturate(160%);
}

/* ============================================================
   Cascade self-sufficiency — declarations migrated from site.css
   before its legacy-skin cleanup (B1-B4 of css-cleanup patch).
   ============================================================ */
@media (min-width: 981px) {
	#top-menu > li.menu-item-5358,
	#top-menu > li.menu-item-1386 { position: relative; padding-left: 18px; }
	#top-menu > li.menu-item-5358::before,
	#top-menu > li.menu-item-1386::before {
		content: "";
		position: absolute;
		top: 50%;
		transform: translateY(-50%);
		left: 0;
		width: 1px;
		height: 20px;
		background: rgba(18, 60, 105, .15);
	}
	#top-menu > li > a { white-space: nowrap; }
}
#main-header #logo { height: auto !important; }
#top-menu-nav { flex: 1 1 auto; min-width: 0; }

/* ============================================================
   Fixed-header offset: reserve the header's height in CSS so the
   page top (hero poster) is never hidden under the glass bar —
   independent of Divi's deferred JS that normally sets this.
   ============================================================ */
body.et_fixed_nav #page-container { padding-top: 80px !important; }
@media (max-width: 980px) {
	body.et_fixed_nav #page-container { padding-top: 66px !important; }
}
