/* LBI Menu — header bar. Rendered inside Genesis .site-header > .wrap.
   The theme still provides the fixed positioning, dark bg and content offset;
   this file styles the bar contents. Colours come from :root vars injected
   by class-assets.php so a single skin can be retuned per site. */

.lbimenu {
	display: flex;
	align-items: center;
	width: 100%;
	min-height: 31px;
	font-family: inherit;
	color: var(--lbimenu-text, #fefefe);
}

.lbimenu-group {
	display: flex;
	align-items: center;
}

.lbimenu-group--left {
	margin-right: auto;
	min-width: 0;
}

/* ---- Brand (site title) ---- */
.lbimenu-brand {
	font-size: 21px;
	font-weight: 700;
	letter-spacing: 3px;
	line-height: 1;
	text-transform: uppercase;
	text-decoration: none;
	color: #fcfcfc;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.lbimenu-brand:hover,
.lbimenu-brand:focus {
	color: #fcfcfc;
}

/* ---- Shared bar items (link / search / toggle) ---- */
.lbimenu-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 10px;
	font-size: 14px;
	font-weight: 400;
	letter-spacing: 3px;
	line-height: 1;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--lbimenu-text, #fefefe);
	background: transparent;
	border: 0;
	cursor: pointer;
	white-space: nowrap;
}

.lbimenu-item:hover,
.lbimenu-item:focus {
	color: var(--lbimenu-text-dim, #cfcfcf);
}

.lbimenu-icon {
	display: inline-flex;
	align-items: center;
}

.lbimenu-svg {
	display: block;
	flex: 0 0 auto; /* stop the icon collapsing inside flex parents (e.g. the accordion toggle) */
	width: 20px;
	height: 20px;
}

.lbimenu-acc-toggle .lbimenu-svg {
	width: 18px;
	height: 18px;
}

/* Dividers between right-hand items, matching the current header. */
.lbimenu-group--right > * + * {
	border-left: 1px solid rgba(255, 255, 255, 0.22);
}

/* ---- CTA pill (e.g. Plan your trip) ---- */
.lbimenu-pill {
	display: inline-flex;
	align-items: center;
	padding: 7px 16px;
	margin-left: 6px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 2px;
	line-height: 1;
	text-transform: uppercase;
	text-decoration: none;
	border-radius: 999px;
	white-space: nowrap;
}

.lbimenu-pill--accent {
	background: var(--lbimenu-accent, #008542);
	color: #fff;
}

.lbimenu-pill--accent:hover,
.lbimenu-pill--accent:focus {
	background: #006e37;
	color: #fff;
}

.lbimenu-pill--outline {
	background: transparent;
	color: var(--lbimenu-text, #fefefe);
	box-shadow: inset 0 0 0 1px currentColor;
}

/* The pill sits inside the right group but shouldn't get a divider border. */
.lbimenu-group--right > .lbimenu-pill + *,
.lbimenu-group--right > * + .lbimenu-pill {
	border-left: 0;
}

/* ---- Slot (filled by other plugins) ---- */
/* Center the slot's contents in the bar so a slotted pill lines up with the
   flanking items instead of sitting on the text baseline (a touch low). */
.lbimenu-slot {
	display: inline-flex;
	align-items: center;
}

.lbimenu-slot:empty {
	display: none;
}

/* A slot carries a CTA (e.g. the account pill), so treat it like a pill for
   dividers — no separator pipe hugging either side of it. */
.lbimenu-group--right > .lbimenu-slot + *,
.lbimenu-group--right > * + .lbimenu-slot {
	border-left: 0;
}

/* ---- Search: icon opens a white search bar that drops below the header ----
   The form is absolutely positioned against .site-header (the fixed, full-width
   ancestor), so it spans the viewport just under the bar. */
.lbimenu-search {
	display: inline-flex;
	align-items: center;
}

.lbimenu-search-form {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 14px 5%;
	background: #fff;
	box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
	z-index: 4;
	/* Animate the drop-down. */
	opacity: 0;
	visibility: hidden;
	transform: translateY(-10px);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
}

/* The form ships hidden and JS unhides it only while it is open (class-header.php
   + lbi-menu.js). This rule is what makes the `hidden` attribute stick: without
   it the `display: flex` above would beat the UA sheet's [hidden] { display: none }
   and the white form would paint for as long as this stylesheet took to apply. */
.lbimenu-search-form[hidden] {
	display: none;
}

.lbimenu-search.is-open .lbimenu-search-form {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Dark text on the white search area. Scoped under .lbimenu so the theme's
   input border/box-shadow (bleeding via body.entry-content) can't override. */
.lbimenu .lbimenu-search-field {
	flex: 1 1 auto;
	min-width: 0;
	height: 40px;
	margin: 0;
	padding: 6px 6px;
	font-size: 17px;
	color: #303942;
	background: transparent;
	border: 0;
	border-bottom: 1px solid #d5d5d5;
	border-radius: 0;
	box-shadow: none;
	outline: none;
}

.lbimenu .lbimenu-search-field:focus {
	border-bottom-color: var(--lbimenu-accent, #008542);
	box-shadow: none;
}

.lbimenu .lbimenu-search-field::placeholder {
	color: #8a8a8a;
	opacity: 1;
}

.lbimenu-search-submit,
.lbimenu-search-close {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 8px;
	background: transparent;
	border: 0;
	color: #303942;
	cursor: pointer;
	line-height: 0;
}

.lbimenu-search-submit:hover,
.lbimenu-search-submit:focus,
.lbimenu-search-close:hover,
.lbimenu-search-close:focus {
	color: var(--lbimenu-accent, #008542);
}

/* ---- Hide-on-scroll ----
   NOTE: will-change makes .site-header the containing block for any
   `position: fixed` descendant, so an overlay rendered into a header slot would
   be positioned against the bar and would scroll away with it. Slot consumers
   render overlays on wp_footer instead (see class-header.php::render_slot). */
.site-header {
	transition: transform 0.3s ease;
	will-change: transform;
}

.site-header.lbimenu-bar--hidden {
	transform: translateY(-100%);
}

/* ---- Responsive: collapse iconed items to icon-only at the label breakpoint.
   Matches the theme's existing <=600px behaviour. ---- */
@media (max-width: 600px) {
	.lbimenu-item--iconed .lbimenu-label {
		position: absolute;
		width: 1px;
		height: 1px;
		padding: 0;
		margin: -1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
		border: 0;
	}

	.lbimenu-item {
		padding: 6px 10px;
		letter-spacing: 0;
	}
}

/* Hard show/hide by breakpoint. */
@media (max-width: 600px) {
	.lbimenu-show--desktop {
		display: none !important;
	}
}

@media (min-width: 601px) {
	.lbimenu-show--mobile {
		display: none !important;
	}
}

/* =====================================================================
   Slide-in panel
   ===================================================================== */

.lbimenu-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
	z-index: 100000;
}

.lbimenu-backdrop.is-open {
	opacity: 1;
	pointer-events: auto;
}

.lbimenu-panel {
	position: fixed;
	top: 0;
	bottom: 0;
	width: var(--lbimenu-panel-width, 400px);
	max-width: 90vw;
	background: var(--lbimenu-panel-bg, #303942);
	color: var(--lbimenu-text, #fefefe);
	z-index: 100001;
	display: flex;
	flex-direction: column;
	transition: transform 0.3s ease;
	overflow: hidden;
	box-shadow: 0 0 40px rgba(0, 0, 0, 0.35);
}

.lbimenu-panel--right {
	right: 0;
	transform: translateX(100%);
}

.lbimenu-panel--left {
	left: 0;
	transform: translateX(-100%);
}

.lbimenu-panel.is-open {
	transform: translateX(0);
}

/* Same reason as the search form: `display: flex` above would otherwise beat the
   UA sheet's [hidden] { display: none }. Without this the closed panel is merely
   translated off-screen — still painted, still hit-testable, and its links still
   in the tab order, so a keyboard user tabs into an invisible menu. JS toggles
   the attribute around the transition (lbi-menu.js). The no-JS stylesheet in
   class-panel.php deliberately overrides this to expose the panel as static nav. */
.lbimenu-panel[hidden] {
	display: none;
}

.lbimenu-panel__head {
	flex: 0 0 auto;
	display: flex;
	justify-content: flex-end;
	padding: 11px 20px;
}

.lbimenu-panel__close {
	background: transparent;
	border: 0;
	color: var(--lbimenu-text, #fefefe);
	cursor: pointer;
	padding: 4px;
	line-height: 0;
}

.lbimenu-panel__close:hover,
.lbimenu-panel__close:focus {
	color: var(--lbimenu-text-dim, #cfcfcf);
}

.lbimenu-panel__nav {
	flex: 1 1 auto;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	/* Keep a flick at the end of the menu from scrolling the page behind it —
	   body { overflow: hidden } alone doesn't hold on iOS Safari. */
	overscroll-behavior: contain;
}

.lbimenu-panel__cta {
	flex: 0 0 auto;
	padding: 16px 20px;
	border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.lbimenu-panel__cta .lbimenu-pill {
	display: flex;
	justify-content: center;
	margin: 0;
}

/* ---- Panel nav list ----
   Rules are scoped under .lbimenu-panel so they outrank the theme's
   content styles: this theme puts `entry-content` on <body> on some page
   types, which otherwise bleeds `.entry-content ul > li` (list bullets),
   `.entry-content a` (link colour) etc. into the panel. */
.lbimenu-panel .lbimenu-panel__nav ul,
.lbimenu-panel .lbimenu-nav,
.lbimenu-panel .lbimenu-nav .sub-menu {
	list-style: none;
	margin: 0;
	padding: 0;
}

.lbimenu-panel .lbimenu-panel__nav li,
.lbimenu-panel .lbimenu-nav li {
	position: relative;
	list-style: none;
	margin: 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.lbimenu-panel .lbimenu-panel__nav li::before {
	content: none;
}

.lbimenu-panel .lbimenu-nav a {
	display: block;
	padding: 13px 24px;
	color: var(--lbimenu-text, #fefefe);
	text-decoration: none;
	font-size: 15px;
	letter-spacing: 1px;
}

.lbimenu-panel .lbimenu-nav a:hover,
.lbimenu-panel .lbimenu-nav a:focus {
	color: var(--lbimenu-text-dim, #cfcfcf);
}

/* Active-section highlight (WP core classes). */
.lbimenu-panel .lbimenu-nav .current-menu-item > a,
.lbimenu-panel .lbimenu-nav .current-menu-ancestor > a {
	box-shadow: inset 3px 0 0 var(--lbimenu-accent, #008542);
	font-weight: 700;
}

/* ---- Accordion sub-menus ---- */
.lbimenu-panel .lbimenu-nav .sub-menu {
	display: none;
	background: rgba(0, 0, 0, 0.18);
}

.lbimenu-panel .lbimenu-nav .is-expanded > .sub-menu {
	display: block;
}

.lbimenu-panel .lbimenu-nav .sub-menu a {
	padding-left: 40px;
	font-size: 14px;
}

.lbimenu-panel .lbimenu-nav .sub-menu .sub-menu a {
	padding-left: 56px;
}

/* Split control: chevron toggle for items with children. */
.lbimenu-acc-toggle {
	position: absolute;
	top: 0;
	right: 0;
	height: 47px;
	width: 52px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: 0;
	border-left: 1px solid rgba(255, 255, 255, 0.08);
	color: var(--lbimenu-text, #fefefe);
	cursor: pointer;
}

.lbimenu-acc-toggle:hover,
.lbimenu-acc-toggle:focus {
	color: var(--lbimenu-text-dim, #cfcfcf);
	background: rgba(255, 255, 255, 0.05);
}

.lbimenu-acc-toggle .lbimenu-svg {
	transition: transform 0.2s ease;
}

.lbimenu-acc-toggle[aria-expanded="true"] .lbimenu-svg {
	transform: rotate(180deg);
}

/* Keep the parent link clear of the toggle control. */
.lbimenu-nav .menu-item-has-children > a {
	padding-right: 60px;
}

/* Body scroll lock while the panel is open. */
body.lbimenu-panel-open {
	overflow: hidden;
}
