/* CONMMEP Navigation — mobile-first, consumes --conmmep-* tokens from conmmep-core (falls back gracefully if absent) */

/* ---------- Top bar (desktop nav / mobile compact brand strip) ---------- */

.conmmep-topbar {
	position: sticky;
	top: 0;
	z-index: 999;
	background: var( --conmmep-white, #ffffff );
	border-bottom: 1px solid var( --conmmep-grey, #ced2d5 );
}

.conmmep-topbar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.65rem 1rem;
	max-width: 1280px;
	margin: 0 auto;
}

.conmmep-topbar__brand {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	text-decoration: none;
	color: var( --conmmep-ink, #1a1a1a );
	font-weight: 700;
}

.conmmep-topbar__logo {
	height: 60px;
	width: 60px;
	object-fit: contain;
}

/* Mobile: nav is hidden, so the logo is the only child — center it
   instead of leaving it pinned to the left from justify-content: space-between. */
.conmmep-topbar__nav {
	display: none;
}

@media ( max-width: 767px ) {
	.conmmep-topbar__inner {
		justify-content: center;
	}
}

/* ---------- Bottom app-style icon tab bar (mobile) ---------- */

.conmmep-bottomnav {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 1000;
	background: var( --conmmep-white, #ffffff );
	border-top: 1px solid var( --conmmep-grey, #ced2d5 );
	box-shadow: 0 -2px 12px rgba( 0, 0, 0, 0.08 );
	padding-bottom: env( safe-area-inset-bottom, 0 );
}

/* "More items this way" hint — a fading gradient plus a chevron pinned to
   the right edge of the bar, shown only while there's unscrolled content
   to the right. Purely visual, so it's aria-hidden and ignores clicks. */
.conmmep-bottomnav__more-hint {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: 44px;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	padding-right: 2px;
	background: linear-gradient( to right, rgba( 255, 255, 255, 0 ), rgba( 255, 255, 255, 0.95 ) 55% );
	color: var( --conmmep-blue, #00aff0 );
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.conmmep-bottomnav__more-hint.is-visible {
	opacity: 1;
	animation: conmmep-hint-nudge 1.4s ease-in-out infinite;
}

@keyframes conmmep-hint-nudge {
	0%,
	100% {
		transform: translateX( 0 );
	}
	50% {
		transform: translateX( 3px );
	}
}

.conmmep-bottomnav__scroller {
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x proximity;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.conmmep-bottomnav__scroller::-webkit-scrollbar {
	display: none;
}

.conmmep-bottomnav__item {
	flex: 0 0 auto;
	scroll-snap-align: start;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.2rem;
	min-width: 72px;
	padding: 0.55rem 0.5rem 0.5rem;
	text-decoration: none;
	color: var( --conmmep-ink, #1a1a1a );
	opacity: 0.65;
	transition: opacity 0.15s ease, color 0.15s ease;
}

.conmmep-bottomnav__item .conmmep-icon {
	color: inherit;
}

.conmmep-bottomnav__item.is-active {
	opacity: 1;
	color: var( --conmmep-green, #007c46 );
}

.conmmep-bottomnav__label {
	font-size: 0.68rem;
	font-weight: 600;
	white-space: nowrap;
	line-height: 1;
}

/* Reserve space at the bottom of the page so fixed-position tab bar never
   covers footer content on mobile. */
body {
	padding-bottom: 64px;
}

/* ---------- Desktop / tablet layout from md breakpoint up ---------- */

@media ( min-width: 768px ) {
	.conmmep-topbar__nav {
		display: flex;
		align-items: center;
		gap: 1.5rem;
	}

	.conmmep-topbar__list {
		list-style: none;
		display: flex;
		align-items: center;
		gap: 1.1rem;
		margin: 0;
		padding: 0;
	}

	/* Entrance animation: each item fades/slides up into place, staggered
	   by the inline transition-delay set in menu.js. */
	.conmmep-topbar__item {
		opacity: 0;
		transform: translateY( -6px );
		transition: opacity 0.35s ease, transform 0.35s ease;
	}

	.conmmep-topbar__item.is-visible {
		opacity: 1;
		transform: translateY( 0 );
	}

	.conmmep-topbar__link {
		position: relative;
		display: inline-block;
		text-decoration: none;
		color: var( --conmmep-ink, #1a1a1a );
		font-weight: 600;
		font-size: 0.92rem;
		padding: 0.35rem 0;
	}

	/* Animated underline that grows in from the left on hover/focus,
	   rather than an instant border-bottom flip. */
	.conmmep-topbar__link::after {
		content: '';
		position: absolute;
		left: 0;
		bottom: 0;
		height: 2px;
		width: 100%;
		background: var( --conmmep-green, #007c46 );
		transform: scaleX( 0 );
		transform-origin: left;
		transition: transform 0.25s ease;
	}

	.conmmep-topbar__link:hover,
	.conmmep-topbar__link:focus {
		color: var( --conmmep-green, #007c46 );
	}

	.conmmep-topbar__link:hover::after,
	.conmmep-topbar__link:focus::after {
		transform: scaleX( 1 );
	}

	.conmmep-topbar__link.is-active {
		color: var( --conmmep-green, #007c46 );
	}

	.conmmep-topbar__link.is-active::after {
		transform: scaleX( 1 );
	}

	/* Membership stands out as a filled button rather than a plain text
	   link — it's the one nav item meant to read as a call to action. */
	.conmmep-topbar__button {
		display: inline-block;
		background: var( --conmmep-blue, #00aff0 );
		color: var( --conmmep-white, #ffffff );
		font-weight: 700;
		font-size: 0.9rem;
		padding: 0.5rem 1.1rem;
		border-radius: 6px;
		text-decoration: none;
		white-space: nowrap;
		transition: background-color 0.2s ease;
	}

	.conmmep-topbar__button:hover,
	.conmmep-topbar__button:focus {
		background: var( --conmmep-gold, #c9a227 );
		color: var( --conmmep-ink, #1a1a1a );
	}

	/* The app-style bottom tab bar is a mobile pattern only — hide it once
	   there's room for the full inline nav above. */
	.conmmep-bottomnav {
		display: none;
	}

	body {
		padding-bottom: 0;
	}
}
