/**
 * Main theme styles
 * Normalized and cleaned up
 */

*,
*::before,
*::after {
	box-sizing: border-box;
}

body {
	font-family: 'Bricolage Grotesque', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	background-color: var(--color-bg-teal);
	color: var(--color-primary-text);
	margin: 0;
	padding: 0;
	min-height: 100vh;
	overflow-x: hidden;
}

a {
	color: inherit;
	text-decoration: none;
}

a:hover,
a:focus {
	color: var(--color-link-hover);
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

/* Home page layout */
.home-page {
	display: flex;
	flex-direction: column;
	gap: 0;
	padding-bottom: 4rem;
}

/* Section base styles */
section {
	padding: 0;
	margin: 0;
	width: 100%;
}

/* Header styles - Header 1 */
.site-header {
	background: var(--color-bg-white);
	padding: 46px;
	position: relative;
	width: 100%;
	overflow: visible;
}

.header-inner {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 0;
	max-width: 1280px;
	margin: 0 auto;
	width: 100%;
	position: relative;
	overflow: visible;
	box-sizing: border-box;
	min-height: fit-content;
}

.site-branding {
	display: flex;
	align-items: flex-start;
	flex-shrink: 0;
	margin-right: 46px;
	padding-top: 0;
}

.site-logo {
	display: inline-block;
	text-decoration: none;
	line-height: 0;
}

.logo-image {
	width: 70px;
	height: 70px;
	display: block;
	object-fit: contain;
}

.menu-toggle {
	background: transparent;
	border: none;
	padding: 0;
	cursor: pointer;
	display: none;
	width: 33.93px;
	height: 24.71px;
	min-height: 24.71px;
	flex-direction: column;
	justify-content: space-between;
	gap: 0;
}

.menu-icon {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	width: 100%;
	height: 100%;
}

.menu-line {
	width: 100%;
	height: 3.57px;
	background: var(--color-teal);
	border-radius: 1px;
	transition: all 0.3s ease;
}

.primary-navigation {
	display: flex;
	align-items: flex-start;
	flex: 0 1 auto;
	justify-content: flex-start;
	min-width: 0;
	overflow: visible;
	align-self: stretch;
	min-height: fit-content;
	margin-left: 0;
}

.nav-menu {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0;
	position: relative;
	overflow: visible;
	list-style: none;
	margin: 0;
	padding: 0;
}

.nav-group {
	position: relative;
	overflow: visible;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: flex-start;
	min-height: fit-content;
	width: auto;
}

.nav-label {
	/* Typography handled by .text-nav-label */
	display: inline-block;
	margin: 0 0 0 0;
	cursor: default;
	white-space: nowrap;
	align-self: flex-start;
	position: relative;
}

/* Current page indicator for nav groups with submenus */
.nav-group.current-menu-ancestor > .nav-label::after,
.nav-group.current-menu-parent > .nav-label::after,
.nav-group.current-menu-item > .nav-label::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: -6px; /* 2px gap + 4px border height */
	height: 4px;
	background-color: #AAE8E8; /* Teal */
}

.nav-submenu {
	display: flex;
	flex-direction: column;
	gap: 0;
	position: relative;
	top: 4px;
	left: 0;
	white-space: nowrap;
	z-index: 10;
	background: transparent;
	width: max-content;
	margin-top: 0;
}

.nav-link {
	/* Typography handled by .text-nav-link */
	text-decoration: none;
	display: block;
	margin-bottom: 0;
	transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link:focus {
	color: var(--color-teal); /* Teal color on hover */
}

.nav-submenu .nav-link.current-menu-item,
.nav-submenu .nav-link.current_page_item {
	color: var(--color-teal);
}

.nav-link-direct {
	/* Typography handled by .text-nav-link-direct */
	margin-left: 0;
	margin-top: 0;
	margin-bottom: 0;
	padding-top: 0;
	white-space: nowrap;
	flex-shrink: 0;
	align-self: flex-start;
	transition: color 0.2s ease;
	position: relative;
	display: inline-block;
}

.nav-link-direct:hover,
.nav-link-direct:focus {
	color: var(--color-teal); /* Teal color on hover */
}

/* Current page indicator for direct links */
.nav-item.current-menu-item > .nav-link-direct::after,
.nav-item.current_page_parent > .nav-link-direct::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: -6px; /* 2px gap + 4px border height */
	height: 4px;
	background-color: #AAE8E8; /* Teal */
}

.header-social {
	display: flex;
	align-items: center;
	gap: 17.07px;
	flex-shrink: 0;
	margin-left: auto;
	padding-top: 25px; /* Align with menu items */
	box-sizing: border-box;
}

.social-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: opacity 0.2s ease;
}

.social-link:hover {
	opacity: 0.7;
}

.social-link img {
	display: block;
	width: auto;
	height: auto;
}

/* Footer styles - Footer 1 */
.site-footer {
	background: transparent;
	padding: 0 clamp(1.5rem, 4vw, 4rem) 120px;
}

.footer-container {
	max-width: 1280px;
	margin: 0 auto;
	padding: 80px 0;
	display: flex;
	flex-direction: row;
	gap: 120px;
}

.footer-content {
	display: flex;
	flex-direction: column;
	gap: 56px;
	flex: 1;
}

.footer-text {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.footer-branding {
	display: flex;
	align-items: center;
	gap: 8px;
}

.footer-logo {
	/* Typography handled by .text-heading-serif */
	margin: 0;
}

.footer-tagline {
	/* Typography handled by .text-body */
	margin: 0;
}

.footer-social {
	display: flex;
	align-items: center;
	gap: 26.8px;
}

.footer-navigation {
	display: flex;
	gap: 40px;
	flex-shrink: 0;
	width: 607px;
}

.footer-nav-column {
	display: flex;
	flex-direction: column;
	gap: 8px;
	width: 178px;
}

.footer-nav-header {
	/* Typography handled by .text-subtitle-bold */
	margin: 0 0 16px 0;
	padding: 0;
}

.footer-nav-link {
	/* Typography handled by .text-body */
	text-decoration: none;
	transition: color 0.2s ease;
}

.footer-nav-link:hover,
.footer-nav-link:focus {
	color: var(--color-link-hover);
}

/* Desktop Navigation (1024px+) */
@media (min-width: 1024px) {
	/* Header: fixed height from 46px padding above/below logo; submenus extend beyond */
	.site-header {
		padding-top: 46px;
		padding-bottom: 46px;
	}

	/* Hide mobile-only elements on desktop */
	.mobile-menu-header {
		display: none !important;
	}

	.mobile-menu-close {
		display: none !important;
	}

	.nav-menu {
		display: flex;
		flex-direction: row;
		flex-wrap: nowrap;
		align-items: flex-start;
		gap: 28px;
		width: auto;
		min-width: 0;
	}

	.nav-label {
		padding-top: 22px; /* 35px (logo center) - 13px (half of 26px label height) */
	}

	/* Invisible hover bridge so mouse doesn't leave nav-group in the gap above submenu */
	.nav-group::before {
		content: '';
		position: absolute;
		left: -23px;
		right: -23px;
		top: 100%;
		height: 11px;
		z-index: 99;
	}

	/* Submenu: absolute, extends below header; starts 1px below teal active border (6px gap + 4px bar + 1px) */
	.nav-submenu {
		position: absolute;
		left: -23px;
		top: calc(100% + 11px);
		display: flex;
		flex-direction: column;
		gap: 6px;
		padding: 6px 23px 22px 23px;
		width: max-content;
		min-width: calc(100% + 46px);
		background: #FFF;
		border-radius: 0 0 10px 10px;
		box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
		z-index: 100;
		max-height: 0;
		overflow: hidden;
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
		transition: max-height 0.3s ease, opacity 0.2s ease, visibility 0s linear 0.3s;
	}

	.nav-group:hover .nav-submenu,
	.nav-group .nav-label[aria-expanded="true"] ~ .nav-submenu {
		max-height: 400px;
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
		transition: max-height 0.3s ease, opacity 0.2s ease, visibility 0s linear 0s;
	}

	.nav-link-direct {
		margin-top: 22px; /* 35px (logo center) - 13px (half of 26px label height) */
	}
}

/* Hide social buttons at medium widths to prevent overlap with menu */
@media (max-width: 1110px) and (min-width: 1024px) {
	.header-social {
		display: none;
	}
}

/* Responsive - Mobile */
@media (max-width: 1023px) {
	body {
		font-size: 16px;
	}

	/* Header Mobile */
	.site-header {
		padding: 16px 24px;
	}

	.logo-image {
		width: 60px;
		height: 60px;
	}

	.header-inner {
		gap: 0;
		justify-content: space-between;
	}

	.menu-toggle {
		display: flex;
		order: 3;
		margin-top: 17.645px; /* Center with logo: (60px - 24.71px) / 2 = 17.645px */
		box-sizing: border-box;
		position: relative;
		z-index: 1001;
		width: 33.93px;
		height: 24.71px;
		min-height: 24.71px;
		padding: 0;
	}

	.primary-navigation {
		position: fixed;
		top: 0;
		right: 0;
		width: 100%;
		height: 100vh;
		max-height: 100dvh;
		/* Base rule uses min-height: fit-content; without this override the panel
		   grows to full content height so overflow-y never scrolls while body is locked. */
		min-height: 0;
		background: var(--color-bg-white);
		border-bottom: 1px solid var(--color-border-light);
		padding: 15.5px 24px 24px 24px;
		z-index: 1000;
		box-shadow: 0 4px 6px var(--color-shadow-strong);
		transform: translateX(100%);
		transition: transform 0.3s ease-in-out;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		visibility: hidden;
		display: flex;
		flex-direction: column;
		align-items: flex-start;
	}

	.primary-navigation.is-active {
		visibility: visible;
	}

	.primary-navigation.is-active {
		transform: translateX(0);
		visibility: visible;
	}

	/* Mobile menu header and close button - hidden on desktop */
	.mobile-menu-header {
		display: none !important;
	}

	.mobile-menu-close {
		display: none !important;
	}

	/* Mobile menu header with logo - only visible on mobile */
	@media (max-width: 1023px) {
		.mobile-menu-header {
			display: block !important;
			margin-bottom: 61.5px; /* Spacing below logo to first menu item */
			width: 100%;
		}

		.mobile-menu-logo {
			display: block;
		}

		.mobile-logo-image {
			width: 60px;
			height: 60px;
			object-fit: contain;
			display: block;
		}

		.mobile-menu-close {
			display: none !important;
			position: fixed;
			top: 30px;
			right: 24px;
			width: 32px;
			height: 32px;
			padding: 0;
			background: transparent;
			border: none;
			align-items: center;
			justify-content: center;
			cursor: pointer;
			color: var(--color-teal);
			z-index: 1001;
		}

		.mobile-menu-close svg {
			width: 27px;
			height: 27px;
			display: block;
		}

		/* Hide hamburger when menu is open */
		.menu-toggle.menu-is-active {
			display: none;
		}

		/* Show close button when menu is open */
		.mobile-menu-close.menu-is-active {
			display: flex !important;
		}
	}

	.nav-menu {
		flex-direction: column;
		align-items: flex-start;
		gap: 32px;
		width: 100%;
		margin-top: 0;
	}

	.nav-group {
		margin-right: 0;
		width: 100%;
	}

	.nav-group:last-of-type {
		margin-right: 0;
	}

	.nav-label {
		font-family: 'Bricolage Grotesque', sans-serif;
		font-weight: 500;
		font-size: 18px;
		line-height: 1.45;
		letter-spacing: -0.005em;
		margin-bottom: 6px;
	}

	.nav-submenu {
		position: static;
		gap: 3px;
		margin-left: 0;
	}

	.nav-link {
		font-family: 'Bricolage Grotesque', sans-serif;
		font-weight: 400;
		font-size: 18px;
		line-height: 1.45;
		letter-spacing: -0.005em;
	}

	.nav-link-direct {
		font-family: 'Bricolage Grotesque', sans-serif;
		font-weight: 500;
		font-size: 18px;
		line-height: 1.45;
		letter-spacing: -0.005em;
		margin-left: 0;
		margin-top: 0;
		padding-top: 0;
	}

	.nav-link-direct:first-of-type {
		margin-left: 0;
	}

	.nav-link-direct + .nav-link-direct {
		margin-left: 0;
	}

	/* Mobile active indicator positioning */
	.nav-group.current-menu-ancestor > .nav-label::after,
	.nav-group.current-menu-parent > .nav-label::after,
	.nav-group.current-menu-item > .nav-label::after,
	.nav-item.current-menu-item > .nav-link-direct::after,
	.nav-item.current_page_parent > .nav-link-direct::after {
		bottom: -4px; /* Closer to text on mobile */
	}

	.header-social {
		display: none;
	}

	/* Footer Mobile */
	.site-footer {
		padding: 0 24px;
	}

	.footer-container {
		flex-direction: column;
		gap: 64px;
		padding: 64px 0;
	}

	.footer-content {
		gap: 32px;
	}

	.footer-navigation {
		width: 100%;
	}

	.footer-logo {
		font-size: 27px;
	}

	.footer-tagline {
		font-size: 14px;
		line-height: 1.54;
	}

	.footer-social {
		gap: 16px;
	}

	.footer-navigation {
		flex-direction: column;
		gap: 40px;
	}

	.footer-nav-column {
		width: 100%;
	}

	.footer-nav-header {
		font-size: 16px;
		line-height: 1.45;
		margin-bottom: 8px;
	}
}
