/**
 * Desktop navigation, mobile trigger, and mobile overlay menu.
 */

/* Desktop nav */
.sh-nav--desktop {
	display: none;
}

.sh-nav__list {
	display: flex;
	align-items: center;
	gap: var(--sh-space-6);
}

.sh-nav__link {
	font-family: var(--sh-font-nav);
	font-size: 0.9375rem;
	font-weight: 500;
	color: var(--sh-text);
	padding: var(--sh-space-2) 0;
	position: relative;
}

.sh-nav__link::after {
	content: '';
	position: absolute;
	left: 0;
	right: 100%;
	bottom: -2px;
	height: 1px;
	background: var(--sh-accent);
	transition: right var(--sh-transition-base);
}

.sh-nav__link:hover::after,
.sh-nav__link:focus-visible::after {
	right: 0;
}

.sh-nav__link:hover,
.sh-nav__link:focus-visible {
	color: var(--sh-accent);
}

.current-menu-item > .sh-nav__link {
	color: var(--sh-accent);
}

/* Mobile trigger */
.sh-nav-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: var(--sh-radius-pill);
	color: var(--sh-heading);
	position: relative;
}

.sh-nav-toggle__icon {
	position: absolute;
	transition: opacity var(--sh-transition-fast), transform var(--sh-transition-fast);
}

.sh-nav-toggle__icon--close {
	opacity: 0;
	transform: rotate(-45deg);
}

.sh-nav-toggle[aria-expanded="true"] .sh-nav-toggle__icon--open {
	opacity: 0;
	transform: rotate(45deg);
}

.sh-nav-toggle[aria-expanded="true"] .sh-nav-toggle__icon--close {
	opacity: 1;
	transform: rotate(0);
}

/* Mobile dropdown menu — opens below the floating header pill rather
   than as a full-screen takeover. Tap-outside backdrop is a separate,
   transparent full-screen layer purely for click-to-close/scroll-lock;
   the visible panel itself sits just under the header. */
.sh-mobile-menu {
	position: fixed;
	inset: 0;
	z-index: 1000;
	pointer-events: none;
}

.sh-mobile-menu[hidden] {
	display: none;
}

.sh-mobile-menu.is-open {
	pointer-events: auto;
}

.sh-mobile-menu__overlay {
	position: absolute;
	inset: 0;
	background: transparent;
}

.sh-mobile-menu__panel {
	position: absolute;
	top: calc(20px + var(--sh-header-height-mobile) + 8px);
	left: 16px;
	right: 16px;
	z-index: 1;
	max-height: calc(100vh - 20px - var(--sh-header-height-mobile) - 28px);
	display: flex;
	flex-direction: column;
	align-items: stretch;
	background: var(--sh-header-bg);
	backdrop-filter: blur(var(--sh-header-blur));
	-webkit-backdrop-filter: blur(var(--sh-header-blur));
	border: 1px solid rgba(255, 255, 255, var(--sh-header-border-opacity));
	border-radius: var(--sh-radius-lg);
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
	opacity: 0;
	transform: translateY(-12px);
	transition: opacity var(--sh-transition-base), transform var(--sh-transition-base);
	overflow: hidden;
}

.sh-mobile-menu__panel-inner {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: var(--sh-space-6);
	padding: var(--sh-space-6) var(--sh-space-5);
	overflow-y: auto;
}

.sh-mobile-menu.is-open .sh-mobile-menu__panel {
	opacity: 1;
	transform: translateY(0);
}

.sh-nav__list--mobile {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: var(--sh-space-5);
}

.sh-nav__list--mobile .sh-nav__link {
	display: block;
	font-family: var(--sh-font-heading);
	font-size: 1.25rem;
	font-weight: 500;
}

.sh-mobile-menu .sh-header__cta {
	display: flex;
	width: 100%;
	justify-content: center;
	margin-top: var(--sh-space-2);
}

@media (prefers-reduced-motion: reduce) {
	.sh-mobile-menu__overlay,
	.sh-mobile-menu__panel {
		transition: none;
	}
}
