/* =========================================================
   Journey — nav.css
   Uses only variables from global.css. No hardcoded colors.
   ========================================================= */

/* ---------- Fixed header ---------- */
header.site-header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: var(--nav-height);
	z-index: 1000;
	border-bottom: 1px solid transparent;
	background: rgba(252, 251, 249, 0.92);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
	transition: border-color 0.2s ease;
}

/* Opaque fallback where blur is unsupported. */
@supports not ((backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px))) {
	header.site-header {
		background: var(--bg);
	}
}

/* Hairline appears after scrolling 60px (class added by nav.js). */
header.site-header.scrolled {
	border-bottom: 1px solid var(--line);
}

.nav-inner {
	height: var(--nav-height);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	width: 100%;
	padding: 0 40px;
}

/* ---------- Logo ---------- */
.site-logo {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
}
.site-logo img {
	height: 96px;
	width: auto;
	display: block;
}

/* ---------- Nav group (right-aligned) ---------- */
.nav-collapse {
	margin-left: auto;
	display: flex;
	align-items: center;
}
.nav-menu {
	list-style: none;
	display: flex;
	align-items: center;
	gap: 36px;
	margin: 0;
	padding: 0;
}
.nav-menu > li {
	position: relative;
	margin: 0;
}

.nav-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-family: var(--sans);
	font-size: 16px;
	font-weight: 500;
	color: var(--taupe);
	background: none;
	border: none;
	padding: 0;
	margin: 0;
	cursor: pointer;
	transition: color 0.15s ease, opacity 0.15s ease;
}
a.nav-link {
	text-decoration: none;
}
span.nav-label {
	cursor: default;
}
span.nav-label:hover {
	opacity: 1;
}
/* No hover highlight: GeneratePress gives every <button> a hover background,
   so force the dropdown-parent buttons transparent in all states and just
   lighten the text slightly on hover. */
.nav-link:hover,
.nav-link:focus,
.nav-link:active {
	background: none;
	color: var(--taupe);
}
.nav-link:hover {
	opacity: 0.6;
}

/* ---------- Dropdown caret ---------- */
.caret {
	display: inline-block;
	width: 7px;
	height: 7px;
	border-right: 1.6px solid currentColor;
	border-bottom: 1.6px solid currentColor;
	transform: rotate(45deg) translate(-1px, -2px);
	transition: transform 0.2s ease;
}
.has-dropdown:hover .caret {
	transform: rotate(225deg) translate(-1px, -1px);
}

/* ---------- Dropdown panel ---------- */
.dropdown {
	list-style: none;
	margin: 0;
	padding: 8px;
	position: absolute;
	top: calc(100% + 18px);
	left: 50%;
	transform: translateX(-50%) translateY(6px);
	min-width: 210px;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 14px;
	box-shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.25);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.18s ease, transform 0.18s ease;
}
.has-dropdown:hover .dropdown {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateX(-50%) translateY(0);
}
/* Invisible bridge so the dropdown doesn't close when the cursor crosses the gap. */
.has-dropdown::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	height: 20px;
}
.dropdown li {
	margin: 0;
}
.dropdown a {
	display: block;
	padding: 9px 12px;
	border-radius: 8px;
	font-family: var(--sans);
	font-size: 14px;
	color: var(--ink-mute);
	white-space: nowrap;
	transition: opacity 0.12s ease;
}
.dropdown a:hover {
	opacity: 0.6;
}

/* ---------- Hamburger (mobile only) ---------- */
.nav-toggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 44px;
	height: 44px;
	padding: 0;
	background: none;
	border: none;
	cursor: pointer;
}
.nav-toggle-bar {
	display: block;
	width: 24px;
	height: 2px;
	margin: 0 auto;
	background: var(--ink);
	transition: transform 0.2s ease, opacity 0.2s ease;
}
body.nav-open .nav-toggle-bar:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}
body.nav-open .nav-toggle-bar:nth-child(2) {
	opacity: 0;
}
body.nav-open .nav-toggle-bar:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}
/* Kill GeneratePress's default gray button highlight on the toggle (it gives
   every <button> a hover/focus/active background). Replace it with a subtle,
   on-brand warming of the bars; keyboard users still get a clean focus ring. */
.nav-toggle:hover,
.nav-toggle:focus,
.nav-toggle:active {
	background: none;
	box-shadow: none;
	outline: none;
}
.nav-toggle:hover .nav-toggle-bar {
	background: var(--gold-cta-deep);
}
.nav-toggle:focus-visible {
	outline: 2px solid var(--gold-cta);
	outline-offset: 3px;
	border-radius: 6px;
}

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
	/* Smaller header + logo on phones so it doesn't dominate the screen. */
	:root {
		--nav-height: 76px;
	}
	.site-logo img {
		height: 56px;
	}
	.nav-inner {
		padding: 0 24px;
	}

	.nav-toggle {
		display: flex;
	}

	.nav-collapse {
		position: fixed;
		top: var(--nav-height);
		left: 0;
		right: 0;
		margin-left: 0;
		flex-direction: column;
		align-items: stretch;
		max-height: calc(100vh - var(--nav-height));
		overflow-y: auto;
		padding: 8px 32px 28px;
		background: var(--bg);
		border-bottom: 1px solid var(--line);
		box-shadow: 0 12px 24px rgba(15, 15, 15, 0.06);
		transform: translateY(-115%);
		opacity: 0;
		pointer-events: none;
		transition: transform 0.25s ease, opacity 0.25s ease;
	}
	body.nav-open .nav-collapse {
		transform: translateY(0);
		opacity: 1;
		pointer-events: auto;
	}

	.nav-menu {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		width: 100%;
	}
	.nav-menu > li {
		width: 100%;
		border-bottom: 1px solid var(--line);
		padding: 6px 0;
	}
	.nav-link {
		width: 100%;
		justify-content: space-between;
		padding: 10px 0;
		font-size: 17px;
	}

	/* Submenus shown expanded and indented on mobile. */
	.dropdown {
		position: static;
		transform: none;
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
		min-width: 0;
		padding: 0 0 8px;
		background: transparent;
		border: none;
		border-radius: 0;
		box-shadow: none;
	}
	.has-dropdown::after {
		display: none;
	}
	.dropdown a {
		padding: 8px 0 8px 14px;
		color: var(--ink-soft);
		white-space: normal;
	}

	body.nav-open {
		overflow: hidden;
	}
}
