/**
 * Mobile flyout navigation.
 *
 * Breakpoint is 1024px: the desktop header splits the logo and links 40/60, and
 * four 18px Prata links stop fitting well before phone width.
 *
 * Elementor element ids referenced below belong to header template 237:
 *   .elementor-element-a343c0d  navy top bar (social icons + JOIN US / MEMBERS)
 *   .elementor-element-bb1d6e3  cream row (logo + desktop links)
 *   .elementor-element-d726c23  logo container
 *   .elementor-element-4baab3a  container holding the hardcoded desktop links
 * Rebuilding the header in Elementor will change these ids.
 *
 * Every rule that hides existing markup is gated on .brb-nav-ready, which the
 * script sets once it has taken over. If the script never runs, the header is
 * left exactly as the parent theme rendered it.
 */

:root {
	--brb-navy: #173a63;
	--brb-cream: #f8f4ee;
	--brb-rose: #c27d81;
}

.brb-nav-toggle .screen-reader-text,
.brb-nav-close .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* ---------------------------------------------------------------- toggle -- */

.brb-nav-toggle {
	display: none;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--brb-navy);
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.brb-nav-toggle:focus-visible {
	outline: 2px solid var(--brb-rose);
	outline-offset: 2px;
}

.brb-nav-toggle__bars {
	display: block;
	width: 26px;
}

.brb-nav-toggle__bars span {
	display: block;
	height: 2px;
	border-radius: 2px;
	background: currentColor;
}

.brb-nav-toggle__bars span + span {
	margin-top: 6px;
}

/* Until the script lifts it into the header row, keep it out of the flow so it
   never flashes at the bottom of the page. */
.brb-nav-toggle:not(.brb-nav-toggle--placed) {
	position: fixed;
	top: 12px;
	right: 12px;
	z-index: 9998;
}

/* -------------------------------------------------------------- backdrop -- */

.brb-nav-backdrop {
	position: fixed;
	inset: 0;
	z-index: 9999;
	background: rgba(23, 58, 99, 0.55);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.brb-nav-open .brb-nav-backdrop {
	opacity: 1;
	visibility: visible;
	transition: opacity 0.3s ease, visibility 0s;
}

/* Lock the page behind the panel. */
html.brb-nav-open,
html.brb-nav-open body {
	overflow: hidden;
}

/* ----------------------------------------------------------------- panel -- */

.brb-nav-panel {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	z-index: 10000;
	width: min(320px, 84vw);
	padding: 72px 0 32px;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--brb-navy);
	box-shadow: -8px 0 32px rgba(0, 0, 0, 0.25);
	transform: translateX(100%);
	visibility: hidden;
	transition: transform 0.3s ease, visibility 0s linear 0.3s;
}

.brb-nav-open .brb-nav-panel {
	transform: none;
	visibility: visible;
	transition: transform 0.3s ease, visibility 0s;
}

@media (prefers-reduced-motion: reduce) {
	.brb-nav-panel,
	.brb-nav-backdrop {
		transition-duration: 0s;
	}
}

.brb-nav-close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--brb-cream);
	font-size: 30px;
	line-height: 1;
	cursor: pointer;
}

.brb-nav-close:focus-visible {
	outline: 2px solid var(--brb-rose);
	outline-offset: 2px;
}

/* ------------------------------------------------------------------ list -- */

.brb-nav-list,
.brb-nav-list ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.brb-nav-list li {
	margin: 0;
}

.brb-nav-list a {
	display: block;
	padding: 16px 28px;
	border-bottom: 1px solid rgba(248, 244, 238, 0.14);
	color: var(--brb-cream);
	font-family: "Prata", Georgia, serif;
	font-size: 18px;
	letter-spacing: 0.4px;
	text-transform: uppercase;
	text-decoration: none;
}

.brb-nav-list a:hover,
.brb-nav-list a:focus {
	background: rgba(248, 244, 238, 0.08);
	color: var(--brb-rose);
}

.brb-nav-list .current-menu-item > a,
.brb-nav-list .current_page_item > a {
	color: var(--brb-rose);
	box-shadow: inset 3px 0 0 var(--brb-rose);
}

/* Submenus are shown inline — the panel is a flat list, not a dropdown. */
.brb-nav-list ul a {
	padding-left: 48px;
	font-size: 16px;
	text-transform: none;
}

/* --------------------------------------------------------- header at ≤1024 -- */

@media (max-width: 1024px) {
	.brb-nav-ready .brb-nav-toggle {
		display: inline-flex;
	}

	/* The hardcoded desktop links; the flyout replaces them. */
	.brb-nav-ready .elementor-element-4baab3a {
		display: none !important;
	}

	/* Cream row becomes logo + toggle. */
	.brb-nav-ready .elementor-element-bb1d6e3 {
		flex-direction: row !important;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		padding: 8px 16px !important;
	}

	/* The logo container is a column flex box, so its default align-items:
	   stretch forces the image to the container's full width. Constrain the
	   container and let the image fill it at its natural ratio — setting a
	   max-height here instead would fight the stretch and squash the logo. */
	.brb-nav-ready .elementor-element-d726c23 {
		width: auto !important;
		max-width: min(58vw, 260px);
		min-width: 0;
		flex: 0 1 auto;
		align-items: flex-start;
	}

	/* Logo is a 2560x1053 banner pinned to 500px wide on desktop. */
	.elementor-237 .elementor-element-d726c23 img {
		width: 100% !important;
		height: auto !important;
		max-width: 100%;
		max-height: none;
		object-fit: contain;
	}

	/* Navy bar: let the icons and buttons wrap instead of overflowing. */
	.elementor-237 .elementor-element-a343c0d {
		flex-wrap: wrap;
		justify-content: center;
		gap: 8px;
		padding: 8px 12px;
	}

	.elementor-237 .elementor-element-81ee9cc {
		flex-basis: auto !important;
		flex-grow: 0 !important;
	}
}

@media (max-width: 600px) {
	.brb-nav-ready .elementor-element-d726c23 {
		max-width: min(52vw, 200px);
	}
}

/* Belt and braces: the panel is mobile-only. */
@media (min-width: 1025px) {
	.brb-nav-toggle,
	.brb-nav-panel,
	.brb-nav-backdrop {
		display: none !important;
	}
}
