/*
 * Jersey Bulls FC — Underlay navigation
 *
 * The menu panel is fixed to the right at z-index:1, sitting BEHIND the page
 * shell (.body_wrap[data-main], z-index:2). Opening the toggle slides the shell
 * (+ the overlay) left to reveal the menu underneath. Animation driven by GSAP
 * (js/underlay-nav.js); this sheet is the static layout + the no-JS / reduced-
 * motion baseline.
 *
 * Themed from a Webflow "underlay" reference to Bulls tokens (Evogria display,
 * brand red, dark canvas). Class names kept so the reference GSAP timeline binds
 * with minimal changes. The toggle lives inside the existing .bulls-bar.
 */

:root {
	--underlay-menu-width: 30rem;
}

/* The sliding shell — must be opaque so the menu never shows through except in
   the revealed gap. .body_wrap already carries the dark canvas via body.bulls-dark. */
.body_wrap[data-main] {
	position: relative;
	z-index: 2;
	min-height: 100vh;
	background: var(--t-canvas, #141414);
	/* will-change set by JS only while animating */
}

/* ---- Menu panel (fixed right, behind the shell) ---- */
.underlay-nav__menu {
	z-index: 1;
	width: var(--underlay-menu-width);
	color: var(--c-white, #fff);
	position: fixed;
	inset: 0 auto 0 0; /* LEFT-anchored — shell slides right to reveal it */
	background: var(--c-ink-900, #0e0e0e);
}

.underlay-nav__inner {
	display: flex;
	flex-flow: column;
	justify-content: flex-start;   /* flow top-down so Follow/socials stay in view (not pinned to the cut-off bottom) */
	gap: var(--space-7, 1.75rem);
	box-sizing: border-box;        /* keep padding INSIDE the panel width (else the right-aligned arrows fall off the edge) */
	width: 100%;
	height: 100%;
	padding: 4.5rem var(--space-6, 1.5rem) var(--space-6, 1.5rem);
	overflow: auto;
	position: relative;
}
.underlay-nav__close {
	position: absolute;
	top: var(--space-4, 1rem);
	right: var(--space-4, 1rem);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 44px;
	height: 44px;
	padding: 0;
	background: none !important;   /* override the FC United parent <button> red skin */
	border: 0;
	box-shadow: none;
	color: var(--c-white, #fff);
	opacity: 0.85;
	cursor: pointer;
	z-index: 3;
	transition: opacity 0.2s ease;
}
.underlay-nav__close:hover,
.underlay-nav__close:focus-visible { opacity: 1; }

.underlay-nav__list {
	display: flex;
	flex-flow: column;
	width: 100%;
	margin: 0;
	padding: 0;
	list-style: none;
}
.underlay-nav__list.is--small {
	gap: var(--space-3, 0.75rem);
}

.underlay-nav__link-large {
	display: inline-block;
	padding: 0.2rem 0.5rem;
	margin-left: -0.5rem;
	border-radius: var(--radius-sm, 0.25rem);
	color: var(--c-white, #fff);
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}
.underlay-nav__link-large:hover { background: rgba(255, 255, 255, 0.06); }
.underlay-nav__link-large.is--current {
	color: var(--c-white, #fff);
	background: var(--c-bulls-red-500, #dc0f17);
}

.underlay-nav__link-label {
	font-family: var(--ff-display, "Evogria", sans-serif);
	font-size: clamp(1.6rem, 4.5vw, 2.5rem);
	line-height: 0.95;
	letter-spacing: var(--ls-tight, -0.02em);
	text-transform: uppercase;
}

.underlay-nav__list > li { margin-bottom: var(--space-3, 0.75rem); }

/* --- Drill-down sub-nav: section rows carry a › arrow; tapping reveals the
   section's child pages with a ‹ Back link (the menu carries every link). --- */
.underlay-nav__nav { position: relative; }
/* The root list has display:flex, which would override the [hidden] attribute —
   force hidden to win so drilling actually swaps root ↔ sub-panel. */
.underlay-nav__list[hidden],
.underlay-nav__sub[hidden] { display: none !important; }
.underlay-nav__list[data-underlay-level="root"] > li {
	display: flex;
	align-items: center;
	gap: var(--space-2, 0.5rem);
}
.underlay-nav__drill {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 44px;
	height: 44px;
	padding: 0;            /* the FC United parent skins <button> with side padding */
	margin-left: auto;
	background: none;
	border: 0;
	color: var(--c-white, #fff);
	opacity: 0.85;
	cursor: pointer;
	transition: opacity 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.underlay-nav__drill:hover,
.underlay-nav__drill:focus-visible { opacity: 1; color: var(--c-bulls-red-300, #f4646a); transform: translateX(2px); }
/* size the inline SVGs explicitly (the parent reset can collapse them to 0 width) */
.underlay-nav__drill svg { width: 22px; height: 22px; flex: none; }
.underlay-nav__close svg { width: 26px; height: 26px; flex: none; }
.underlay-nav__back svg { width: 18px; height: 18px; flex: none; }

.underlay-nav__back {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	margin-bottom: var(--space-3, 0.75rem);
	padding: 0.5rem 0.5rem 0.5rem 0;
	background: none;
	border: 0;
	color: var(--c-white, #fff);
	opacity: 0.65;
	cursor: pointer;
	font-family: var(--ff-mono, monospace);
	font-size: var(--fs-50, 0.75rem);
	letter-spacing: var(--ls-wider, 0.08em);
	text-transform: uppercase;
}
.underlay-nav__back:hover,
.underlay-nav__back:focus-visible { opacity: 1; }
.underlay-nav__sub-title {
	display: block;
	margin-bottom: var(--space-3, 0.75rem);
	font-family: var(--ff-display, "Evogria", sans-serif);
	font-size: clamp(1.6rem, 4.5vw, 2.5rem);
	line-height: 0.95;
	letter-spacing: var(--ls-tight, -0.02em);
	text-transform: uppercase;
	color: var(--c-bulls-red-300, #f4646a);
}
.underlay-nav__sublist-v {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-flow: column;
}
.underlay-nav__sublink-v {
	display: block;
	padding: 0.45rem 0;
	color: var(--c-white, #fff);
	opacity: 0.82;
	text-decoration: none;
	font-family: var(--ff-display, sans-serif);
	font-size: clamp(1.1rem, 2.5vw, 1.5rem);
	text-transform: uppercase;
	letter-spacing: var(--ls-tight, -0.01em);
	transition: opacity 0.2s ease, color 0.2s ease;
}
.underlay-nav__sublink-v:hover,
.underlay-nav__sublink-v:focus-visible { opacity: 1; color: var(--c-bulls-red-300, #f4646a); }

.underlay-nav__bottom {
	display: flex;
	justify-content: flex-start;
	align-items: flex-start;
	gap: var(--space-6, 1.5rem);
	width: 100%;
	padding-top: var(--space-5, 1.25rem);
	position: relative;
}
.underlay-nav__bottom-col {
	display: flex;
	flex-flow: column;
	flex: 1;
	gap: var(--space-3, 0.75rem);
}
.underlay-nav__link-small {
	font-family: var(--ff-body, sans-serif);
	font-size: var(--fs-100, 1rem);
	line-height: 1.1;
	color: var(--c-white, #fff);
	text-decoration: none;
}
.underlay-nav__link-small:hover { color: var(--c-bulls-red-300, #f4646a); }
.underlay-nav__link-small.is--faded {
	font-family: var(--ff-mono, monospace);
	font-size: var(--fs-50, 0.75rem);
	letter-spacing: var(--ls-wider, 0.08em);
	text-transform: uppercase;
	opacity: 0.5;
}
/* socials as an inline row of marks */
.underlay-nav__socials {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-3, 0.75rem);
}
.underlay-nav__socials a {
	display: inline-flex;
	color: var(--c-white, #fff);
	opacity: 0.7;
	transition: opacity 0.2s ease, color 0.2s ease;
}
.underlay-nav__socials a:hover { opacity: 1; color: var(--c-bulls-red-300, #f4646a); }
.underlay-nav__socials svg { width: 22px; height: 22px; }

.underlay-nav__bottom-border {
	position: absolute;
	inset: 0 0 auto;
	width: 100%;
	height: 1px;
	background: currentColor;
	opacity: 0.15;
	transform-origin: 0%;
}

/* ---- Overlay (on top of the shell; dims + frames + click-to-close) ---- */
.underlay-nav__overlay {
	z-index: 100;
	pointer-events: none;
	cursor: pointer;
	visibility: hidden;
	position: fixed;
	inset: 0 0 0 -1px;
	overflow: clip;
}
.underlay-nav__dark {
	opacity: 0;
	background: rgba(0, 0, 0, 0.3);
	position: absolute;
	inset: 0;
}
.underlay-nav__borders {
	position: absolute;
	inset: 0;
	display: flex;
	flex-flow: column;
	justify-content: space-between;
}
.underlay-nav__border-row {
	display: flex;
	flex-flow: column;
	align-items: flex-start; /* corners frame the LEFT (content) edge */
}
.underlay-nav__border {
	width: 100%;
	height: 1rem;
	background: var(--t-canvas, #141414);
}
.underlay-nav__corner {
	width: 1rem;
	height: 1rem;
	color: var(--t-canvas, #141414);
	transform-origin: 0 0;
	background-image: radial-gradient(circle farthest-side at 100% 100%, #fff0 99%, currentColor);
}
.underlay-nav__corner.is--bottom {
	transform-origin: 0 100%;
	background-image: radial-gradient(circle farthest-side at 100% 0, #fff0 99%, currentColor);
}

/* ---- Toggle (Menu/Close swap + burger → X), lives in .bulls-bar ---- */
.underlay-nav__toggle {
	display: flex;
	align-items: center;
	gap: 0.625rem;
	min-height: 44px;
	padding: 0.5rem;
	margin: -0.5rem 0;
	background: none;
	border: 0;
	color: var(--t-fg, #fff);   /* theme-aware (white in dark / ink in light) */
	cursor: pointer;
}
.underlay-nav__toggle:focus-visible {
	outline: 2px solid var(--c-focus-ring, currentColor);
	outline-offset: 2px;
	border-radius: var(--radius-sm, 0.25rem);
}
/* White over the transparent homepage hero header, like the crest + icon rail. */
body.home .bulls-site-header:not(.is-scrolled) .underlay-nav__toggle { color: var(--c-white, #fff); }

/* === Header layout: inline desktop nav + flow crest =========================
 * Supersedes the Juventus "immersive" header (absolute centred crest that
 * animated, + hide-the-nav-at-the-homepage-top). That conflicted with the
 * burger (the absolute crest sat over it) and hid the main links. Crest now
 * flows inline (burger · crest · nav), and the main nav + commerce stay visible
 * on desktop including at the top of the homepage.
 * ========================================================================== */
.bulls-bar__inner { justify-content: space-between; }
/* Crest absolute-centred in the bar on every page/width (matches the interior
   pages). Out of flow, so it also removes the in-flow crest gap beside the
   burger — bar__left becomes burger · nav, the crest floats centred, commerce
   sits on the right. Overrides the immersive homepage crest reposition. */
.bulls-crest-link,
body.home .bulls-site-header .bulls-crest-link,
body.home .bulls-site-header:not(.is-scrolled) .bulls-crest-link {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
}
body.home .bulls-site-header .bulls-crest {
	width: 48px;
	height: 48px;
}
/* White crest, first shown at the top of the homepage hero — larger than the
   red/scrolled crest; shrinks to 48px on scroll via the parent's width transition. */
body.home .bulls-site-header:not(.is-scrolled) .bulls-crest {
	width: 72px;
	height: 72px;
}
@media (min-width: 1200px) {
	body.home .bulls-site-header .bulls-primary-nav,
	body.home .bulls-site-header .bulls-header-commerce,
	body.home .bulls-site-header:not(.is-scrolled) .bulls-primary-nav,
	body.home .bulls-site-header:not(.is-scrolled) .bulls-header-commerce {
		opacity: 1;
		visibility: visible;
	}
}
.underlay-nav__toggle-text {
	display: flex;
	flex-flow: column;
	align-items: flex-start;
	font-size: 0.8125rem;   /* match the label so 1.25em height clips to exactly one line */
	height: 1.25em;
	overflow: hidden;
}
.underlay-nav__toggle-label {
	font-family: var(--ff-mono, monospace);
	font-size: 0.8125rem;
	letter-spacing: var(--ls-wider, 0.08em);
	text-transform: uppercase;
	line-height: 1.25em;
}
.underlay-nav__toggle-icon {
	display: flex;
	flex-flow: column;
	justify-content: center;
	align-items: center;
	gap: 0.3125rem;
	width: 1.375rem;
}
.underlay-nav__toggle-bar {
	width: 100%;
	height: 2px;
	background: currentColor;
}

/* Without JS the opaque shell (z-index:2) simply covers the menu (z-index:1) —
   it's never revealed, so no extra hiding rule is needed. */

@media (prefers-reduced-motion: reduce) {
	/* JS swaps to instant show/hide; ensure the panel + overlay are usable without transforms */
	.underlay-nav__overlay { transition: none; }
}

/* ---- Fallback push: html.underlay-no-anim (no GSAP / reduced motion) ---- */
html.underlay-no-anim .body_wrap[data-main],
html.underlay-no-anim .underlay-nav__overlay { transition: transform 0.35s ease; }
html.underlay-no-anim body[data-menu-status="open"] .body_wrap[data-main],
html.underlay-no-anim body[data-menu-status="open"] .underlay-nav__overlay {
	transform: translateX(var(--underlay-menu-width));
}
html.underlay-no-anim body[data-menu-status="open"] .underlay-nav__overlay {
	visibility: visible;
	pointer-events: auto;
}
html.underlay-no-anim body[data-menu-status="open"] .underlay-nav__dark {
	opacity: 1;
	transition: opacity 0.35s ease;
}

@media screen and (max-width: 767px) {
	:root { --underlay-menu-width: 82vw; }
	.underlay-nav__inner { padding: 5rem var(--space-5, 1.25rem) var(--space-5, 1.25rem); }
	.underlay-nav__link-label { font-size: clamp(1.75rem, 9vw, 2.5rem); }
	.underlay-nav__bottom { flex-flow: column; gap: var(--space-5, 1.25rem); }
}
