/* Screen Reader Text - visually hidden but accessible to screen readers */
.screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	position: absolute !important;
	height: 1px;
	width: 1px;
	overflow: hidden;
	word-wrap: normal !important;
}

/* animation / menu transitions */
@-webkit-keyframes slideInRight {
	0% {
		-webkit-transform: translate3d(-250px, 0, 0);
		transform: translate3d(-250px, 0, 0);
		visibility: visible;
	}

	100% {
		-webkit-transform: translate3d(0, 0, 0);
		transform: translate3d(0, 0, 0);
	}
}

@keyframes slideInRight {
	0% {
		-webkit-transform: translate3d(-250px, 0, 0);
		transform: translate3d(-250px, 0, 0);
		visibility: visible;
	}

	100% {
		-webkit-transform: translate3d(0, 0, 0);
		transform: translate3d(0, 0, 0);
	}
}

@-webkit-keyframes slideOutRight {
	0% {
		-webkit-transform: translate3d(0, 0, 0);
		transform: translate3d(0, 0, 0);
	}

	100% {
		-webkit-transform: translate3d(-250px, 0, 0);
		transform: translate3d(-250px, 0, 0);
		visibility: hidden;
	}
}

@keyframes slideOutRight {
	0% {
		-webkit-transform: translate3d(0, 0, 0);
		transform: translate3d(0, 0, 0);
	}

	100% {
		-webkit-transform: translate3d(-250px, 0, 0);
		transform: translate3d(-250px, 0, 0);
		visibility: hidden;
	}
}

/* Accessibility */
a.skip-main {
	left: -999px;
	position: absolute;
	top: auto;
	width: 1px;
	height: 1px;
	overflow: hidden;
	z-index: -999;
}

a.skip-main:focus,
a.skip-main:active {
	color: #fff;
	background-color: #004b66;
	left: 2%;
	top: 100px;
	width: auto;
	height: auto;
	overflow: auto;
	margin: 10px;
	padding: 5px;
	border-radius: 15px;
	border: 4px solid #ccc;
	text-align: center;
	font-size: 0.9rem;
	z-index: 999;
}

/* MAIN LOGO */
#mainlogo {
	padding: 0;
	display: block;
	margin: 24px 0 16px;
	height: 74px;
	transition: 0.5s ease all;
	min-width: 200px;
}

#mainlogo img {
	display: inline-block;
	width: auto;
	height: 100%;
	transition: 0.5s ease all;
}

/* TOP MENU / desktop / tablet */
#mainheader {
	background: white;
	position: relative;
	top: 0;
	left: 0;
	z-index: 5555;
	padding: 10px 0;
	margin: 0;
	width: 100%;
}

#mainheader.open {
	position: relative !important;
}

#scroll-to-top {
	z-index: 5000;
}

/* DESKTOP MENU */
@media (min-width: 981px) {
	#mainheader {
		padding: 4px 0;
	}

	#mainlogo {
		margin-top: 0;
		padding-top: 8px;
	}

	/* Hide mobile nav footer on desktop */
	.b-nav-header,
	.b-nav-search {
		display: none;
	}

	.mainnav {
		color: #7e7471;
		position: relative;
		margin: 0 auto;
		width: 1440px;
		padding: 0;
		max-width: 100%;
		display: flex;
		flex-direction: row;
		flex-wrap: wrap;
		align-items: center;
	}

	body:not(.logged-in) .mainnav {
		padding-top: 0;
	}

	#topmenu {
		margin: 0 0 16px 2%;
		padding: 0;
	}

	#topmenu ul {
		margin: 3em 0 0;
		position: relative;
		padding: 0;
		white-space: nowrap;
		max-width: 76vw;
		width: 1000px;
	}

	#topmenu ul:not(.sub-menu) li {
		padding: 0;
		margin: 0 1.5vw 0 0;
		transition: 0.2s linear all;
		flex: 1 1 auto;
		text-align: left;
	}

	@supports (display: flex) {
		#topmenu ul:not(.sub-menu) {
			display: flex;
			margin: 1em 0 0 !important;
			align-items: baseline;
			justify-content: flex-start;
		}
	}

	#topmenu li a {
		color: #004b64;
		border-bottom: 2px solid white;
		display: inline;
		font-size: 0.9rem;
	}

	/* Level 2 submenu */
	#topmenu li ul.sub-menu {
		visibility: hidden;
		max-height: 0;
		overflow: visible; /* Changed from hidden to visible */
		background: white;
		width: 200px;
		box-shadow: 0 3px 5px rgba(0, 0, 0, 0.1);
		position: absolute;
		margin: 0;
		padding: 1em 0 0.5em;
		transform: scale(0);
		transition: 0.2s ease all; /* Increased duration */
		-webkit-transition: 0.2s ease all;
		opacity: 0;
		z-index: 1000;
		box-sizing: border-box;
	}

	/* Level 3 submenu */
	#topmenu li ul.sub-menu ul.sub-menu {
		left: 100%;
		right: auto; /* ensure it opens to the right */
		top: -0.8em; /* Compensate for parent padding */
		margin-left: 0;
		width: 220px;
		overflow-y: auto;
		z-index: 1001;
		border: 1px solid #e0e0e0;
		border-radius: 8px;
		box-shadow: 0 4px 12px rgba(24, 16, 16, 0.15);
		padding: 0.8em;
		display: flex;
		flex-direction: column;
		gap: 0.3em; /* Reduced gap between items */
	}

	/* Show second level on hover of first level */
	#topmenu li:hover > ul.sub-menu {
		visibility: visible;
		max-height: 50em;
		transform: scale(1);
		opacity: 1;
	}

	/* Show third level on hover of second level */
	#topmenu li ul.sub-menu li:hover > ul.sub-menu {
		visibility: visible;
		max-height: 50em;
		transform: scale(1);
		opacity: 1;
	}

	/* Keep parent menu visible when hovering child - ONLY direct children */
	#topmenu li:hover > ul.sub-menu,
	#topmenu li ul.sub-menu:hover {
		visibility: visible;
		max-height: 50em;
		transform: scale(1);
		opacity: 1;
	}

	/* Keep third level visible - ONLY when hovering second level items */
	#topmenu li ul.sub-menu li:hover > ul.sub-menu,
	#topmenu li ul.sub-menu li ul.sub-menu:hover {
		visibility: visible;
		max-height: 50em;
		transform: scale(1);
		opacity: 1;
	}

	#topmenu li.current-menu-item a,
	#topmenu li.current-menu-parent a,
	#topmenu li:hover a {
		border-bottom: 1px solid #0081af;
		text-decoration: none;
	}

	#topmenu li ul.sub-menu a {
		border-bottom: none !important;
	}

	#topmenu li .sub-menu li {
		display: block;
		padding: 0.5em 0;
		margin: 0;
		line-height: 1.4em;
		font-size: 0.85rem;
		border-bottom: 0 !important;
		flex: none;
		position: relative;
	}

	#topmenu li .sub-menu li a {
		padding: 0.3em 1.6em;
		display: block;
		width: 100%;
		font-size: 0.8rem;
	}

	#topmenu li .sub-menu li a:hover {
		text-decoration: underline;
	}

	/* Third level menu items in grid layout */
	#topmenu li .sub-menu .sub-menu li {
		margin: 0;
		padding: 0;
		break-inside: avoid; /* Prevent items from breaking across columns */
	}

	#topmenu li .sub-menu .sub-menu li a {
		padding: 0.5em 0.8em; /* Ensure padding is consistent */
		font-size: 0.75rem;
		display: block;
		border-radius: 4px;
		transition: all 0.2s ease;
		white-space: nowrap;
		overflow: hidden; /* Prevent background overflow */
		text-overflow: ellipsis;
		border: 1px solid transparent;
		line-height: 1.3; /* Tighter line height */
		box-sizing: border-box; /* Ensure padding and borders are included in width/height */
	}

	/* Ensure hover effects stay within bounds */
	#topmenu .sub-menu .sub-menu li a:hover {
		background: #004b66 100%;
		color: white;
		text-decoration: none;
		border-color: #0081af;
		transform: translateY(-1px);
		box-shadow: 0 2px 4px rgba(0, 129, 175, 0.3);
		overflow: hidden; /* Prevent hover background overflow */
	}

	/* Removed auto-flip-to-left media queries to always open to the right */

	/* Subtle visual indicators for items with children */

	#topmenu .sub-menu .menu-item-overview {
		border-bottom: 1px solid #004c6566 !important;
	}

	/* Caret indicator for submenu items with children */
	#topmenu .sub-menu li.menu-item-has-children > a::after {
		content: '';
		position: absolute;
		right: 0.5em;
		width: 10px;
		height: 10px;
		background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23004b66" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 18l6-6-6-6"/></svg>');
		background-size: contain;
		background-repeat: no-repeat;
		background-position: center;
		opacity: 0.8;
		transform: rotate(0deg);
		transition: transform 0.2s ease;
	}

	/* Rotate chevron on hover or when submenu is open */
	#topmenu .sub-menu li.menu-item-has-children:hover > a::after,
	#topmenu .sub-menu li.menu-item-has-children.open > a::after {
		transform: rotate(90deg);
	}

	/* Removed caret indicator for third level items with children */
	/* Only add extra padding to last item in level 2 menus, not level 3 */
	#topmenu li > .sub-menu > li:last-child {
		padding-bottom: 1em;
	}

	/* Explicitly remove padding from last third-level item */
	#topmenu li .sub-menu .sub-menu li:last-child {
		padding-bottom: 0;
	}

	.mainnav a.loginregister {
		margin: 0;
	}

	.mainnav .healcode-login-register-text-link {
		padding: 0.3em 1em !important;
		position: absolute;
		top: -0.3em;
		border-radius: 2px;
		border: 1px solid #ccc !important;
		overflow: hidden;
	}

	.mainnav a.loginregister:hover {
		opacity: 0.7;
	}

	.mainnav .menubutton {
		display: none;
	}

	.mainnav a {
		font-family: 'ScandiaLine', 'Scandia', sans-serif;
		text-decoration: none;
		font-size: 0.75rem;
		display: inline-block;
		color: #7e7471;
		transition: 0.5s ease all;
		font-weight: normal;
	}
}

@media (max-width: 1200px) {
	.mainnav a {
		font-size: 0.7rem;
	}

	#topmenu {
		margin: 0 0 16px 1.5%;
	}
}

/* STANDARD IPAD SIZE */
@media (max-width: 1024px) {
	#mainheader a {
		font-size: 0.7rem;
	}
}

/* CSS Custom Properties for Mobile Menu Theme */
:root {
	/* Light theme (default) */
	--mobile-menu-bg: #ffffff;
	--mobile-menu-text: #004b65;
	--mobile-menu-text-hover: #0081af;
	--mobile-menu-hover-bg: #ffffff;
	--mobile-menu-border: #e9ecef;
	--mobile-menu-accent: #0081af;
	--mobile-menu-accent-bg: #ffffff;
	--mobile-menu-submenu-bg: #ffffff;
	--mobile-menu-burger: #444;
	--mobile-menu-burger-hover: #2196f3;

	/* Typography */
	--mobile-menu-font-size: 0.9rem !important;
	--mobile-menu-font-weight: 500;
	--mobile-menu-line-height: 1.4;
}

/* Mobile Menu Base Styles */

/* USE MOBILE-STYLE MENU */
@media (max-width: 980px) {
	/* Ensure mobile menu variables are available within this scope */
	:root {
		--mobile-menu-font-size: 1rem;
		--mobile-menu-font-weight: 500;
		--mobile-menu-line-height: 1.4;
	}

	.mainnav,
	#menu-primary.hidedesktop,
	#menu-virtual-primary.hidedesktop {
		display: block !important;
	}

	/* Reset #topmenu margin for mobile */
	#topmenu {
		margin: 0;
		padding: 0;
	}

	/* MOBILE "BURGER" MENU */
	.b-container * {
		box-sizing: border-box;
	}

	.b-nav,
	body:after {
		position: absolute;
	}

	.b-nav .menu-primary-container {
		margin-top: 0;
		padding-top: 0;
	}

	.b-brand,
	.b-nav a {
		color: var(--mobile-menu-text) !important;
		font-weight: var(--mobile-menu-font-weight, 500);
		text-decoration: none;
		line-height: var(--mobile-menu-line-height);
	}

	.b-brand button {
		display: none;
	}

	.b-nav {
		margin: 0;
		padding: 0;
		background: var(--mobile-menu-bg);
		z-index: 4444;
		width: 100%;
		position: fixed;
		top: 0;
		left: -99%;
		max-width: 480px;
		max-height: 100dvh;
		box-sizing: border-box;
		display: block; /* Always display but positioned off-screen */
		transition: all 0.3s ease; /* Smooth slide animation */
		border-radius: 0 0 12px 0;
		overflow: hidden;
		overflow-y: auto;
		box-shadow: -4px 0 12px rgba(0, 0, 0, 0.1); /* Subtle shadow on left edge */
		/** remove scrollbar **/
		&::-webkit-scrollbar {
			display: none;
		}
	}

	.b-nav ul {
		margin: 0;
		padding: 0.5rem 0 0;
	}

	.b-nav:not(.open) {
		left: -100%; /* Keep hidden off-screen when closed */
	}

	.b-nav.open {
		left: 0; /* Slide into view when open */
	}

	/* Mobile nav header with logo and close button */
	.b-nav-header {
		background: var(--mobile-menu-bg);
		padding: 1rem;
		border-bottom: 1px solid rgba(255, 255, 255, 0.1);
		display: flex;
		justify-content: space-between;
		align-items: center;
		position: sticky;
		top: 0;
		z-index: 1;
	}

	.b-nav-logo-link {
		display: flex;
		align-items: center;
	}

	.b-nav-logo {
		height: 60px;
		width: auto;
	}

	.b-nav-close {
		background: none;
		border: none !important;
		color: var(--color-white);
		font-size: 1.5rem;
		cursor: pointer;
		padding: 0.5rem;
		border-radius: 4px;
		transition: all 0.3s ease;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 40px;
		height: 40px;
		font-weight: 300;
	}

	.b-nav-close:hover {
		background: rgba(255, 255, 255, 0.1);
		color: var(--color-white);
	}

	/* Mobile nav content wrapper */
	.b-nav-content {
		flex: 1;
		display: flex;
		flex-direction: column;
		overflow-y: auto;
	}

	/* Adjust main navigation list to account for header */
	.b-nav ul {
		margin: 0;
		padding: 0; /* Remove top padding to eliminate space */
	}

	.b-nav li {
		background: white;
		color: var(--mobile-menu-text);
		list-style-type: none;
		margin: 0;
		line-height: var(--mobile-menu-line-height);
		text-align: left;
		opacity: 0;
		transform: translateX(30px); /* Start slightly offset */
		border-bottom: 1px solid var(--mobile-menu-border);
		transition: all 0.3s ease;
	}
	.b-nav .sub-menu li:first-child {
		border-top: 1px solid var(--mobile-menu-border);
	}

	.b-nav li:last-child {
		border-bottom: none;
	}

	.b-nav li:hover {
		background: var(--mobile-menu-accent-bg);
	}

	.b-nav li:not(.open) {
		opacity: 0;
		transform: translateX(30px);
	}

	.b-nav li:not(.open),
	.b-nav.open li {
		transition: all 0.3s ease;
	}

	.b-nav li a {
		display: block;
		padding: 0.5rem 1.5rem;
		font-size: var(
			--mobile-menu-font-size,
			1rem
		) !important; /* Use CSS variable with fallback */
		font-weight: var(--mobile-menu-font-weight, 500);
		color: var(--mobile-menu-text);
		text-decoration: none;
		transition: all 0.3s ease;
		position: relative;
		min-height: 44px; /* Improved touch target */
		display: flex;
		align-items: center;
	}

	.b-nav li a:hover {
		color: var(--mobile-menu-text-hover);
		background: var(--mobile-menu-hover-bg);
	}

	.b-nav li a::before {
		content: '';
		position: absolute;
		left: 0;
		top: 0;
		bottom: 0;
		width: 0;
		background: var(--mobile-menu-accent);
		transition: width 0.3s ease;
	}

	.b-nav li a:hover::before {
		width: 4px;
	}

	/* Focus styles for accessibility */
	.b-nav li a:focus {
		outline: 2px solid var(--mobile-menu-text-hover);
		outline-offset: 2px;
		background: var(--mobile-menu-hover-bg);
	}

	.b-nav.open {
		visibility: visible;
	}

	.b-nav.open li {
		opacity: 1;
		transform: translateX(0);
		transition-delay: calc(var(--item-index, 0) * 0.05s); /* Stagger animation */
	}

	.b-menu {
		transition: all 0.4s ease;
	}

	.b-menu {
		cursor: pointer;
		display: inline-block;
		height: 60px;
		padding-left: 15.5px;
		padding-top: 17.5px;
		position: relative;
		transition: all 0.4s ease;
		-webkit-user-select: none;
		-moz-user-select: none;
		-ms-user-select: none;
		user-select: none;
		width: 60px;
		z-index: 12;
	}

	.b-bun--bottom,
	.b-bun--mid,
	.b-bun--top {
		height: 2px;
		width: 25px;
	}

	.b-container.open .b-main,
	.b-bun {
		background: var(--mobile-menu-burger);
		transition: all 0.4s ease;
		color: var(--mobile-menu-burger);
	}

	.b-brand,
	.b-bun {
		position: relative;
		transition: all 0.4s ease;
	}

	.b-bun--top {
		top: 0;
	}

	.b-bun--mid {
		top: 8px;
	}

	.b-bun--bottom {
		top: 16px;
	}

	.b-brand {
		color: var(--mobile-menu-burger-hover);
		top: -21.43px;
		transition: all 0.4s ease;
		z-index: 13;
	}

	.b-container {
		height: 60px;
		overflow: hidden;
	}

	.b-container:hover:not(.open) .bun-bottom,
	.b-container:hover:not(.open) .bun-mid,
	.b-container:hover:not(.open) .bun-top {
		background: var(--mobile-menu-burger-hover);
	}

	.b-container.open .b-bun--top {
		background: var(--mobile-menu-burger);
		top: 9px;
		-webkit-transform: rotate(45deg);
		-ms-transform: rotate(45deg);
		transform: rotate(45deg);
	}

	.b-container.open .b-bun--mid {
		opacity: 0;
	}

	.b-container.open .b-bun--bottom {
		background: var(--mobile-menu-burger);
		top: 5px;
		-webkit-transform: rotate(-45deg);
		-ms-transform: rotate(-45deg);
		transform: rotate(-45deg);
	}

	.b-container.open .b-brand {
		color: var(--mobile-menu-burger);
	}

	.b-nav .sub-menu {
		padding: 0;
		margin: 0;
		display: none; /* Hidden by default */
		max-height: 0;
		overflow: hidden;
		transition:
			max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
			opacity 0.3s ease;
		opacity: 0;
		background-color: var(--mobile-menu-submenu-bg);
		margin-left: 1rem;
		border-left: 2px solid var(--mobile-menu-border);
	}

	.b-nav .sub-menu.open {
		display: block; /* Show when open class is added */
		max-height: 1000px; /* Large enough to accommodate content */
		opacity: 1;
	}

	.b-nav .sub-menu.close {
		display: none;
		max-height: 0;
		opacity: 0;
	}

	/* Submenu items styling - smaller font size */
	.b-nav .sub-menu li a {
		padding: 0.5rem 1.5rem 0.5rem 2rem;
		font-size: 0.85rem !important; /* Slightly smaller font */
		color: var(--mobile-menu-text);
		opacity: 0.8;
		transition: all 0.2s ease; /* Base transition for smooth effects */
	}

	.b-nav .sub-menu li a:hover {
		opacity: 1;
		color: var(--mobile-menu-text-hover);
		background: var(--mobile-menu-hover-bg);
	}

	/* Ensure third-level submenus follow the same behavior */
	.b-nav .sub-menu .sub-menu {
		padding: 0;
		margin: 0;
		display: none; /* Hidden by default */
		max-height: 0;
		overflow: hidden;
		transition:
			max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
			opacity 0.3s ease;
		opacity: 0;
		margin-left: 1rem;
		background: #ffffff;
	}

	.b-nav .sub-menu .sub-menu.open {
		display: block; /* Show when open class is added */
		max-height: 1000px; /* Large enough to accommodate content */
		opacity: 1;
	}

	.b-nav .sub-menu .sub-menu.close {
		display: none;
		max-height: 0;
		opacity: 0;
	}

	/* Level 2 submenu styling */
	.b-nav .sub-menu li {
		border-bottom: 1px solid var(--mobile-menu-border);
		margin: 0;
		background: transparent;
	}

	.b-nav .sub-menu li:last-child {
		border-bottom: none;
	}

	.b-nav .sub-menu li:hover {
		background: var(--mobile-menu-accent-bg);
	}

	/* Remove duplicate submenu link styling - keeping the one above with proper indentation */

	/* Level 3 submenu styling - even smaller font */
	.b-nav .sub-menu .sub-menu li {
		border-bottom: 1px solid var(--mobile-menu-border);
	}

	.b-nav .sub-menu .sub-menu li a {
		padding: 0.7rem 1.5rem 0.7rem 2.5rem;
		font-size: 0.75rem !important; /* Smaller for level 3 */
		color: var(--mobile-menu-text);
		opacity: 0.8;
		transition: all 0.2s ease; /* Base transition for smooth effects */
	}

	.b-nav .sub-menu .sub-menu li a:hover {
		color: var(--mobile-menu-text-hover);
		opacity: 1;
		transform: translateX(4px); /* Consistent hover effect */
		transition: all 0.2s ease;
	}

	/* Modern mobile menu indicators */
	.b-nav.open li.menu-item-has-children > a::after {
		content: '';
		position: absolute;
		right: 1.5rem;
		top: 50%;
		transform: translateY(-50%);
		width: 8px;
		height: 8px;
		border-right: 2px solid var(--mobile-menu-text-hover);
		border-bottom: 2px solid var(--mobile-menu-text-hover);
		transform: translateY(-50%) rotate(45deg);
		transition: transform 0.3s ease;
		opacity: 0.8;
	}

	.b-nav.open li.menu-item-has-children.open > a::after {
		transform: translateY(-50%) rotate(225deg);
	}

	/* Style indicators for submenu items with children */
	.b-nav.open .sub-menu li.menu-item-has-children > a::after {
		right: 1.5rem;
		border-color: var(--mobile-menu-text);
		width: 6px;
		height: 6px;
		opacity: 0.6;
	}

	.b-nav.open .sub-menu li.menu-item-has-children.open > a::after {
		transform: translateY(-50%) rotate(225deg);
		opacity: 0.8;
	}

	#mainlogo {
		min-width: 180px;
		width: 180px;
		margin: 16px 0 24px;
	}

	.mainnav .menubutton {
		position: absolute;
		display: block;
		top: 36px !important;
		right: 2px !important;
		z-index: 9999;
	}

	.loginregister {
		display: none;
	}

	/* Backdrop overlay for drawer menu */
	.menu-backdrop {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		background: rgba(0, 75, 101, 0.6); /* Navy color with transparency */
		backdrop-filter: blur(3px); /* Stronger blur */
		-webkit-backdrop-filter: blur(3px);
		z-index: 4443;
		opacity: 0;
		visibility: hidden;
		transition: all 0.3s ease;
	}

	.menu-backdrop.open {
		opacity: 1;
		visibility: visible;
	}

	/* Add subtle backdrop blur effect when menu is open */
	#bodyblock.open::before {
		content: '';
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		background: rgba(0, 75, 101, 0.3); /* Navy color for consistency */
		backdrop-filter: blur(2px);
		-webkit-backdrop-filter: blur(2px);
		z-index: 4443;
		opacity: 0;
		animation: fadeIn 0.3s ease forwards;
	}

	/* Ensure menu appears above backdrop */
	.b-nav {
		position: fixed;
		z-index: 4445; /* Higher than backdrop */
	}

	/* Add micro-interactions for better UX */
	.b-nav li a {
		transform: translateX(0);
		transition: all 0.2s ease;
	}

	.b-nav li a:active {
		transform: none;
	}

	/* Improve touch targets for mobile */
	@media (max-width: 480px) {
		.b-nav li a {
			padding: 0.3rem 1.5rem;
			font-size: var(--mobile-menu-font-size);
		}
	}

	/* Extra small screens */
	@media (max-width: 360px) {
		:root {
			--mobile-menu-font-size: 1rem;
		}

		.b-nav {
			max-width: 280px; /* Smaller width on very small screens */
		}

		.b-nav:not(.open) {
			right: -280px;
		}

		.b-nav li a {
			padding: 1.2rem 1rem;
		}

		.b-nav .sub-menu li a {
			padding: 1rem 1rem 1rem 1.5rem;
		}

		.b-nav .sub-menu .sub-menu li a {
			padding: 0.8rem 1rem 0.8rem 2rem;
		}
	}

	/* Add loading animation for theme transitions */
	* {
		transition:
			background-color 0.3s ease,
			color 0.3s ease,
			border-color 0.3s ease;
	}

	/* Prevent body scroll when mobile menu is open */
	body.menu-open {
		overflow: hidden;
		position: fixed;
		width: 100%;
		height: 100%;
		/* Maintain scrollbar space to prevent layout shift */
		padding-right: var(--scrollbar-width, 0px);
	}

	/* Prevent scroll on html as well for some browsers */
	html.menu-open {
		overflow: hidden;
	}

	/* Calculate scrollbar width to prevent layout shift */
	@supports (scrollbar-gutter: stable) {
		body.menu-open {
			scrollbar-gutter: stable;
			padding-right: 0;
		}
	}

	/* Mobile Navigation Search */
	.b-nav-search {
		background: #ffffff; /* White background */
		margin: 0 !important;
		padding: 0 1rem 0;
	}

	.b-nav-search .search-container {
		position: relative;
		width: 100%;
	}

	.b-nav-search .mobile-search-form {
		position: relative;
		width: 100%;
		display: flex;
		align-items: center;
	}

	.b-nav-search input[type='search'] {
		width: 100%;
		padding: 1rem 3rem 1rem 1rem; /* Extra right padding for centered icon */
		background: #f8f9fa;
		border: 2px solid #e9ecef;
		border-radius: 50%;
		color: #333333;
		font-size: 16px; /* Minimum 16px to prevent iOS zoom */
		font-weight: 400;
		outline: none;
		appearance: none;
		box-sizing: border-box;
		transition: all 0.3s ease;
	}

	.b-nav-search input[type='search']:focus {
		border-color: #004b65;
		background: #ffffff;
		box-shadow: 0 0 0 3px rgba(0, 75, 101, 0.1);
	}

	.b-nav-search input[type='search']::placeholder {
		color: #6c757d;
	}

	.b-nav-search input[type='search']::-webkit-search-cancel-button {
		-webkit-appearance: none;
	}

	.b-nav-search button {
		position: absolute;
		right: 12px;
		top: 50%;
		transform: translateY(-50%);
		padding: 0.4rem;
		background: transparent;
		border: none;
		color: #8e9297;
		cursor: pointer;
		display: flex;
		align-items: center;
		justify-content: center;
		transition: color 0.3s ease;
		z-index: 2;
	}

	.b-nav-search button:hover {
		color: #004b65;
	}

	.b-nav-search button svg {
		width: 20px;
		height: 20px;
	}

	/* Hide main header logo when mobile nav is open */
	.menu-open #mainlogo {
		opacity: 0;
		pointer-events: none;
		transition: opacity 0.3s ease;
	}
}

/* PAGE SUBNAV */
#ptnav {
	background: #23282d;
	border-bottom: 1px solid #ccc;
	z-index: 999;
	padding: 0;
	position: -webkit-sticky;
	position: sticky;
	left: 0 !important;
	top: 0;
	margin: 0;
	text-transform: uppercase;
	width: 100%;
	max-width: none;
}

#ptnav.open {
	position: -webkit-sticky;
	position: sticky;
	top: 0;
	z-index: 999;
}

#ptnav ul {
	list-style: none;
	text-align: center;
	max-width: 1080px;
	margin: 0 auto;
	padding: 0;
}

#ptnav ul li {
	display: inline-block;
	padding: 0.5rem 1.5rem;
	margin: 0;
	font-size: 0.75rem;
	font-family: 'ScandiaLine', sans-serif;
	line-height: 2em;
}

#ptnav ul li a {
	color: white;
	text-decoration: none;
}

#ptnav ul li a.sel,
#ptnav ul li.sel a,
#ptnav ul li a[aria-current] {
	border-bottom: 1px solid white !important;
}

.chf-anchor-nav {
	background: #23282d !important;
	border-bottom-color: rgba(255, 255, 255, 0.2) !important;
}

.chf-anchor-nav .chf-anchor-nav__link {
	color: #ffffff !important;
}

.chf-anchor-nav .chf-anchor-nav__link:hover,
.chf-anchor-nav .chf-anchor-nav__link:focus-visible {
	color: #f9c03c !important;
}

.mindbody-logo {
	height: 16px;
	width: auto;
	vertical-align: middle;
}

.search-icon-link {
	display: inline-block;
	position: relative;
	vertical-align: top;
	top: 3px;
	height: 24px;
	width: 30px;
}

.mainnav-utilities {
	display: none;
}

@media (min-width: 1440px) {
	.mainnav-utilities {
		align-items: center;
		display: flex;
		flex: 0 0 auto;
		gap: 1.25rem;
		margin: 0 1.5rem 0 auto;
	}

	.mainnav-utility-link {
		align-items: center;
		color: #004b64;
		display: inline-flex;
		font-family: 'ScandiaLine', 'Scandia', sans-serif;
		font-size: 0.68rem;
		gap: 0.45rem;
		letter-spacing: 0.04em;
		text-decoration: none;
		white-space: nowrap;
	}

	.mainnav-utility-link .mindbody-logo {
		height: 16px;
		width: auto;
	}

	a.mainnav-utility-link.search-icon-link {
		height: 32px;
		top: 0;
		width: 32px;
	}

	#mainheader.chf-header--overlay:not(.is-stuck) .mainnav-utility-link {
		color: #ffffff;
	}

	#mainheader.chf-header--overlay:not(.is-stuck) .mindbody-logo {
		filter: brightness(0) invert(1);
	}
}

@media (max-width: 850px) {
	.search-icon-link {
		display: none !important;
	}
	#ptnav {
		position: -webkit-sticky;
		position: sticky;
		top: 0;
	}

	#ptnav ul {
		overflow-x: auto;

		-ms-overflow-style: none; /* IE and Edge */
		white-space: nowrap;
		padding: 0 1em;
	}

	#ptnav ul li {
		font-size: 0.7rem;
		padding: 0.7rem 2rem 0.7rem 1rem;
		display: inline-block;
		float: none; /* Ensure items stay inline */
	}

	#ptnav::after {
		content: '';
		position: absolute;
		top: 0;
		right: 0;
		height: 100%;
		width: 30px;
		background: linear-gradient(to left, #23282d, transparent);
		pointer-events: none;
	}
}

@media (max-width: 360px) {
	#ptnav ul li {
		font-size: 0.55rem;
	}
}

/* ============================================================================
   MOBILE NAVIGATION SEARCH
   ============================================================================ */

.b-nav-search {
	margin-bottom: 1.5rem;
	background: #ffffff;
	padding: 1rem;
	border-radius: 8px;
	border-bottom: 1px solid #e9ecef;
}

.b-nav-search .search-container {
	position: relative;
}

.mobile-search-form {
	position: relative;
	width: 100%;
	display: flex;
	align-items: center;
}

.mobile-search-form input[type='search'] {
	width: 100%;
	padding: 0.8rem 3rem 0.8rem 1rem;
	background: #f8f9fa;
	border: 2px solid #e9ecef;
	border-radius: 30px;
	color: #333333;
	font-size: 16px; /* Minimum 16px to prevent iOS zoom */
	font-weight: 400;
	outline: none;
	appearance: none;
	box-sizing: border-box;
	transition: all 0.3s ease;
}

.mobile-search-form input[type='search']:focus {
	border-color: #004b65;
	background: #ffffff;
	box-shadow: 0 0 0 3px rgba(0, 75, 101, 0.1);
}

.mobile-search-form input[type='search']::placeholder {
	color: #6c757d;
}

.mobile-search-form .search-button {
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	background: transparent !important;
	border: none !important;
	padding: 0.4rem;
	color: #8e9297;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.3s ease;
	z-index: 2;
}

.mobile-search-form .search-button:hover {
	color: #004b65;
}

.mobile-search-form .search-button svg {
	width: 20px;
	height: 20px;
}

/* ============================================================================
   OVERLAY HEADER
   Applied by navigation.ts only when a .chf-hero exists to sit behind it.
   ============================================================================ */

#mainheader.chf-header--overlay {
	position: absolute;
	background: transparent;
	transition:
		background-color 0.35s ease,
		box-shadow 0.35s ease,
		padding 0.35s ease;
}

/* Scrim keeps nav legible over bright areas of the hero image. */
#mainheader.chf-header--overlay::before {
	content: '';
	position: absolute;
	inset: 0 0 auto;
	height: 220px;
	background: linear-gradient(to bottom, rgba(1, 26, 36, 0.55), rgba(1, 26, 36, 0));
	pointer-events: none;
	opacity: 1;
	transition: opacity 0.35s ease;
	z-index: -1;
}

#mainheader.chf-header--overlay.is-stuck::before {
	opacity: 0;
}

/* --- Transparent state --- */

#mainheader.chf-header--overlay:not(.is-stuck) {
	--mobile-menu-burger: #ffffff;
	--mobile-menu-burger-hover: #f9c03c;
}

#mainheader.chf-header--overlay:not(.is-stuck) #mainlogo img {
	filter: brightness(0) invert(1);
}

/* Below this width the same <ul> is the light mobile drawer, not the inline menu. */
@media (min-width: 981px) {
	#mainheader.chf-header--overlay:not(.is-stuck) #topmenu ul:not(.sub-menu) > li > a {
		color: #ffffff;
		border-bottom-color: transparent;
	}

	#mainheader.chf-header--overlay:not(.is-stuck)
		#topmenu
		ul:not(.sub-menu)
		> li.current-menu-item
		> a,
	#mainheader.chf-header--overlay:not(.is-stuck)
		#topmenu
		ul:not(.sub-menu)
		> li.current-menu-parent
		> a,
	#mainheader.chf-header--overlay:not(.is-stuck) #topmenu ul:not(.sub-menu) > li:hover > a {
		border-bottom-color: #ffffff;
	}

	/* Dropdown panels stay light, so their links keep the default ink. */
	#mainheader.chf-header--overlay:not(.is-stuck) #topmenu .sub-menu a {
		color: #004b64;
	}

	#mainheader.chf-header--overlay:not(.is-stuck) .healcode-login-register-text-link {
		border-color: rgba(255, 255, 255, 0.75) !important;
		color: #ffffff !important;
	}

	#mainheader.chf-header--overlay:not(.is-stuck) .healcode-login-register-text-link:hover {
		background: #ffffff;
		color: #013147 !important;
	}
}

#mainheader.chf-header--overlay:not(.is-stuck) .searchelement {
	border-color: #ffffff;
}

#mainheader.chf-header--overlay:not(.is-stuck) .searchelement.one {
	background: transparent;
}

#mainheader.chf-header--overlay:not(.is-stuck) a:focus-visible {
	outline: 2px solid #f9c03c;
	outline-offset: 3px;
}

/* --- Scrolled state --- */

#mainheader.chf-header--overlay.is-stuck {
	position: fixed;
	background: #ffffff;
	box-shadow: 0 1px 12px rgba(1, 49, 71, 0.12);
	padding-top: 0;
	padding-bottom: 0;
}

#mainheader.chf-header--overlay.is-stuck #mainlogo {
	height: 56px;
	margin: 8px 0;
}

body.chf-header-is-stuck #ptnav,
body.chf-header-is-stuck .chf-anchor-nav--sticky {
	top: var(--chf-sticky-header-offset, 0px) !important;
}

.admin-bar #mainheader.chf-header--overlay.is-stuck {
	top: 32px;
}

@media screen and (max-width: 782px) {
	.admin-bar #mainheader.chf-header--overlay.is-stuck {
		top: 46px;
	}
}

@media (min-width: 981px) {
	#mainheader.chf-header--overlay.is-stuck #topmenu ul {
		margin-top: 0.5em !important;
	}

	#mainheader.chf-header--overlay.is-stuck #topmenu {
		margin-bottom: 8px;
	}
}

/* Drawer keeps its own light theme regardless of header state. */
#mainheader.chf-header--overlay.open,
#mainheader.chf-header--overlay.open::before {
	background: #ffffff;
}

#mainheader.chf-header--overlay.open {
	--mobile-menu-burger: #444;
	--mobile-menu-burger-hover: #2196f3;
}

#mainheader.chf-header--overlay.open #mainlogo img {
	filter: none;
}

@media (prefers-reduced-motion: reduce) {
	#mainheader.chf-header--overlay,
	#mainheader.chf-header--overlay::before,
	#mainheader.chf-header--overlay #mainlogo {
		transition: none;
	}
}

/* ============================================================================
   Utility bar: slim dark strip across the top (member sign-in / account menu).
   Overlays the top of the page like the WordPress admin bar so the hero keeps
   running behind it; the header is padded down to make room.
   ============================================================================ */

:root {
	--chf-utilbar-height: 36px;
}

.chf-utilbar {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 5600;
	height: var(--chf-utilbar-height);
	background: rgba(1, 26, 36, 0.88);
	color: #ffffff;
}

.chf-utilbar__inner {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	height: 100%;
	max-width: 1440px;
	margin: 0 auto;
	padding: 0 1rem;
}

body.chf-has-utilbar #mainheader {
	padding-top: calc(var(--chf-utilbar-height) + 4px);
}

body.chf-has-utilbar #mainheader.chf-header--overlay.is-stuck {
	padding-top: 0;
}

/* Staff see the real WordPress admin bar too; sit below it. */
body.admin-bar .chf-utilbar {
	top: 30px;
}

body.admin-bar.chf-has-utilbar #mainheader {
	padding-top: calc(var(--chf-utilbar-height) + 54px);
}

@media screen and (max-width: 980px) {
	body.chf-has-utilbar #mainheader {
		padding-top: calc(var(--chf-utilbar-height) + 10px);
	}
}
