/* =============================================================
   header.css — Sticky navigation bar
   All values reference CSS custom properties from style.css.
   ============================================================= */

/* ── Header shell ── */

.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background-color: var(--color-white);
	box-shadow: var(--shadow-nav);
	height: var(--nav-height);
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	max-width: var(--container-nav);
	margin: 0 auto;
	padding: var(--nav-padding-y) 1.5rem;
	height: 100%;
}

/* ── WP admin bar offset ── */

body.admin-bar .site-header {
	top: 32px;
}

@media (max-width: 782px) {
	body.admin-bar .site-header {
		top: 46px;
	}
}

/* ── Logo ── */

.site-logo {
	display: flex;
	align-items: center;
	text-decoration: none;
	flex-shrink: 0;
}

.site-logo img,
.site-logo .custom-logo {
	height: 48px;
	width: auto;
	display: block;
}

.site-logo .custom-logo-link {
	display: flex;
	align-items: center;
}

.site-logo__name {
	font-family: var(--font-primary);
	font-size: var(--text-body-sm);
	font-weight: var(--weight-medium);
	color: var(--color-primary);
	line-height: 1.2;
	margin-left: 0.5rem;
	white-space: nowrap;
}

/* Hide text when a logo image is present */
.site-logo--has-image .site-logo__name {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ── Nav menu ── */

.main-navigation {
	display: flex;
	align-items: center;
	gap: var(--nav-link-gap);
}

.nav-menu {
	display: flex;
	align-items: center;
	gap: var(--nav-link-gap);
	list-style: none;
}

.nav-menu a {
	font-family: var(--font-primary);
	font-size: var(--text-body-sm);
	font-weight: var(--weight-regular);
	color: var(--color-text-secondary);
	line-height: var(--lh-nav);
	text-decoration: none;
	transition: color 0.2s;
}

.nav-menu a:hover,
.nav-menu .current-menu-item > a,
.nav-menu .current_page_item > a {
	color: var(--color-primary);
}

/* ── CTA button in nav ── */

.nav-cta {
	display: inline-flex;
	align-items: center;
	gap: var(--btn-cta-icon-gap);
	padding: 0.5rem 1.25rem;
	background-color: var(--color-primary);
	color: var(--color-white);
	font-family: var(--font-primary);
	font-size: var(--text-body-sm);
	font-weight: var(--weight-regular);
	line-height: var(--lh-nav);
	text-decoration: none;
	border-radius: var(--radius-none);
	white-space: nowrap;
	flex-shrink: 0;
	transition: background-color 0.2s;
}

.nav-cta:hover {
	background-color: var(--color-primary-hover);
	color: var(--color-white);
}

.nav-cta svg {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
}

/* ── Hamburger toggle (hidden on desktop) ── */

.menu-toggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 36px;
	height: 36px;
	padding: 4px;
	z-index: 101;
}

.menu-toggle-bar {
	display: block;
	width: 100%;
	height: 2px;
	background-color: var(--color-primary);
	transition: transform 0.3s, opacity 0.3s;
}

/* X animation when toggled */
.main-navigation.toggled .menu-toggle-bar:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}

.main-navigation.toggled .menu-toggle-bar:nth-child(2) {
	opacity: 0;
}

.main-navigation.toggled .menu-toggle-bar:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

/* ── Responsive — mobile nav ── */

@media (max-width: 768px) {
	.menu-toggle {
		display: flex;
	}

	.main-navigation {
		position: relative;
	}

	.nav-menu {
		display: none;
		position: absolute;
		top: calc(100% + 0.75rem);
		right: 0;
		background-color: var(--color-white);
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		min-width: 220px;
		box-shadow: var(--shadow-image);
		z-index: 200;
	}

	.nav-menu li {
		width: 100%;
		border-bottom: 1px solid var(--color-border);
	}

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

	.nav-menu a {
		display: block;
		padding: 0.75rem 1.25rem;
	}

	.main-navigation.toggled .nav-menu {
		display: flex;
	}

	.nav-cta {
		padding: 0.5rem;
		gap: 0;
	}

	.nav-cta__label {
		display: none;
	}

}
