/**
 * Top Navigation Bar — WL Custom Theme
 * DESKTOP (≥768px): #topnav-bar — single row
 * MOBILE  (<768px): #topnav-mobile-wrap — two rows
 *
 * IMPORTANT: All selectors inside #topnav-bar and .topnav-mobile-wrap
 * explicitly reset font/line-height so that "ul { font-size:… }"
 * in Additional CSS cannot bleed in.
 */

/* =====================================================
   COMPLETE CSS ISOLATION — resets ul/li/a inheritance
   inside both nav containers so site-wide ul{} rules
   from Additional CSS cannot affect nav text.
===================================================== */
#topnav-bar ul,
#topnav-bar li,
#topnav-bar a,
.topnav-mobile-wrap ul,
.topnav-mobile-wrap li,
.topnav-mobile-wrap a,
.topnav-mob-panel ul,
.topnav-mob-panel li,
.topnav-mob-panel a {
	font-size: unset;
	line-height: unset;
	font-family: unset;
	list-style: none;
	margin: 0;
	padding: 0;
}

/* =====================================================
   DESKTOP BAR — visible ≥ 768px only
===================================================== */
#topnav-bar {
	--topnav-h: 60px;
	background-color: #1a1a1a;
	border-top: none;           /* #7 — thin top line hidden by default */
	border-bottom: 3px solid #d22254;
	position: relative;
	z-index: 9000;
	width: 100%;
	/* display is controlled by header.php inline <style> + media queries below.
	   Do NOT set display here — the element starts with style="display:none" on
	   the HTML element and the media queries reveal the correct one. */
}
#topnav-bar.topnav-sticky {
	position: sticky;
	top: 0;
	z-index: 9100;
}

/* --- Equal-space layout: logo | menu | buttons — each section takes equal width ---
   The inner uses 3 equal columns so logo+name, menu, and CTA buttons all have the
   same horizontal real-estate, keeping the design perfectly balanced. */
.topnav-inner {
	display: flex;
	align-items: center;
	min-height: var(--topnav-h, 60px);
	padding: 0 20px;
	position: relative;
}

/* Brand section — takes flex:1 so it's equal width to the CTA section */
.topnav-brand-wrap {
	flex: 1;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: flex-start;   /* logo/name stays left-aligned within its section */
	max-height: var(--topnav-h, 60px);
	overflow: visible;
	margin-right: 0;               /* no extra margin — spacing handled by flex:1 */
}

/* Navigation area — stays centred in its natural flex space */
.topnav-navigation {
	display: flex;
	align-items: center;
	flex: 0 0 auto;               /* don't grow/shrink; natural width of menu items */
	position: relative;
	min-width: 0;
	justify-content: center;
}

/* CTA group — takes flex:1 so it's equal width to the brand section */
.topnav-cta-group {
	flex: 1;
	display: flex; align-items: center;
	justify-content: flex-end;     /* buttons stay right-aligned within their section */
	gap: var(--topnav-cta-gap, calc(var(--topnav-menu-px, 15px) * 2)); flex-shrink: 0;
	margin-left: 0;                /* no extra margin — spacing handled by flex:1 */
}.topnav-brand {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	text-decoration: none;
	color: #ffffff;
	max-height: var(--topnav-h, 60px);
}
.topnav-brand-img {
	display: block;
	width: auto;
	height: calc(var(--topnav-h, 60px) - 12px);
	max-height: calc(var(--topnav-h, 60px) - 12px);
	max-width: 240px;
	object-fit: contain;
	flex-shrink: 0;
}
.topnav-brand-name {
	font-size: 17px !important;
	font-weight: 700;
	letter-spacing: 0.4px;
	white-space: nowrap;
	line-height: 1.2 !important;
	padding-bottom: 2px;
	font-family: inherit;
	color: inherit;
}

/* --- Navigation area centering --- */
#topnav-bar.topnav-centered .topnav-navigation { justify-content: center; }
#topnav-bar.topnav-centered .topnav-menu-desktop { justify-content: center; }

/* --- Desktop menu --- */
.topnav-menu-desktop {
	display: flex;
	list-style: none !important;
	margin: 0 !important; padding: 0 !important;
	align-items: stretch;
	flex-wrap: wrap;
}
.topnav-menu-desktop li { position: relative; margin: 0 !important; padding: 0 !important; list-style: none !important; }
.topnav-menu-desktop > li > a {
	display: flex; align-items: center;
	color: #ffffff; text-decoration: none;
	/* --topnav-menu-px controls spacing: each link has this padding on left AND right,
	   so the visual gap between two adjacent item texts = px * 2. Default 15px = 30px gap. */
	padding: 0 var(--topnav-menu-px, 15px) !important;
	height: var(--topnav-h, 60px);
	font-size: 13px !important; font-weight: 600;
	letter-spacing: 0.5px; text-transform: var(--topnav-text-transform, none);
	white-space: nowrap; line-height: 1 !important;
	font-family: inherit;
	transition: color 0.2s, background-color 0.2s;
}
.topnav-menu-desktop > li > a:hover,
.topnav-menu-desktop > li.current-menu-item > a,
.topnav-menu-desktop > li.current-menu-ancestor > a {
	color: #d22254;
	background-color: rgba(255,255,255,0.06);
}
/* Dropdown */
.topnav-menu-desktop ul {
	list-style: none !important; margin: 0 !important; padding: 0 !important;
	position: absolute; top: 100%; left: 0;
	background: #2a2a2a; min-width: 200px;
	box-shadow: 0 4px 16px rgba(0,0,0,0.3);
	opacity: 0; visibility: hidden;
	transform: translateY(6px);
	transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
	z-index: 10001;
}
.topnav-menu-desktop li:hover > ul,
.topnav-menu-desktop li:focus-within > ul { opacity: 1; visibility: visible; transform: translateY(0); }
.topnav-menu-desktop ul li { list-style: none !important; margin: 0 !important; }
.topnav-menu-desktop ul li a {
	display: block; color: #ccc; padding: 11px 18px !important;
	font-size: 13px !important; line-height: 1.4 !important;
	text-decoration: none;
	border-bottom: 1px solid rgba(255,255,255,0.06);
	transition: color 0.2s, background-color 0.2s;
}
.topnav-menu-desktop ul li:last-child a { border-bottom: none; }
.topnav-menu-desktop ul li a:hover { color: #fff; background: #d22254; }
.topnav-menu-desktop ul ul { top: 0; left: 100%; }

@media (min-width: 768px) and (max-width: 991px) {
	/* On tablets, reduce default padding but still respect the customizer variable.
	   We set --topnav-menu-px to 10px as the tablet default; if the user has set a
	   custom value in the customizer, the inline style on #topnav-bar overrides this. */
	#topnav-bar { --topnav-menu-px: 10px; }
	.topnav-menu-desktop > li > a { padding: 0 var(--topnav-menu-px, 10px) !important; font-size: 12px !important; }
}

/* CTA group styles handled above in equal-space layout */
.topnav-cta-btn {
	display: inline-flex; align-items: center;
	text-decoration: none; padding: 7px 16px !important;
	border-radius: 5px; font-size: 13px !important; font-weight: 700;
	letter-spacing: 0.3px; white-space: nowrap; line-height: 1 !important;
	transition: filter 0.2s, transform 0.15s;
}
.topnav-cta-btn:hover { filter: brightness(1.12); transform: translateY(-1px); }

/* =====================================================
   MOBILE TWO-ROW WRAP — hidden by default, shown on phones
===================================================== */
.topnav-mobile-wrap {
	display: none;
	width: 100%;
	z-index: 9000;
}
/* shown via media queries in RESPONSIVE SHOW/HIDE section below */

.topnav-mobile-row {
	width: 100%;
	background-color: #1a1a1a;
	position: relative;
	/* NOTE: sticky is intentionally NOT used here — the wrap parent is only as tall
	   as its children, so sticky can never activate. Fixed is used instead via JS. */
}

/* When sticky is enabled via JS, rows become position:fixed.
   A spacer div (.topnav-mobile-spacer) is injected by JS to push content down. */
.topnav-mobile-row.is-fixed {
	position: fixed !important;
	left: 0;
	right: 0;
	width: 100%;
	z-index: 9100;
}
.topnav-mobile-row1.is-fixed { top: 0; z-index: 9101; }
/* Row2 top is set by JS = row1.offsetHeight */
.topnav-mobile-row2.is-fixed { z-index: 9100; }

/* --- Row 1 --- */
.topnav-mobile-row1-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: var(--mob-row1-h, 52px);
	padding: 0 14px;
}

/* Mobile branding — #4 centre option via class */
.topnav-mob-brand-wrap {
	flex: 1;
	min-width: 0;
	display: flex;
	align-items: center;
}
/* centred: fill full row, absolute-centre the link */
.topnav-mob-brand-wrap.is-centered {
	position: absolute;
	left: 0; right: 0;
	justify-content: center;
	pointer-events: none;
}
.topnav-mob-brand-wrap.is-centered .topnav-mob-brand {
	pointer-events: auto;
}
.topnav-mob-brand {
	display: inline-flex; align-items: center;
	gap: 8px; text-decoration: none;
	color: #ffffff; max-width: 100%;
}
.topnav-mob-brand-img {
	display: block; width: auto;
	height: calc(var(--mob-row1-h, 52px) - 12px);
	max-height: 40px; max-width: 140px;
	object-fit: contain; flex-shrink: 0;
}
.topnav-mob-brand-name {
	font-size: 16px !important; font-weight: 700;
	letter-spacing: 0.3px; white-space: nowrap;
	overflow: hidden; text-overflow: ellipsis;
	color: inherit; line-height: 1.2 !important;
	padding-bottom: 2px;
	font-family: inherit;
}

/* Hamburger */
.topnav-mob-hamburger {
	display: flex; align-items: center; justify-content: center;
	background: none; border: none; cursor: pointer;
	padding: 6px 8px; margin-left: auto; flex-shrink: 0;
	color: #ffffff;
	transition: opacity 0.2s;
	position: relative; z-index: 1;
}
.topnav-mob-hamburger:hover { opacity: 0.75; }
.topnav-mob-ham-icon {
	display: flex; flex-direction: column;
	gap: 5px; width: 22px;
}
.topnav-mob-ham-icon span {
	display: block; height: 2px; width: 100%;
	background: currentColor; border-radius: 2px;
	transition: transform 0.25s, opacity 0.25s;
}
.topnav-mob-hamburger[aria-expanded="true"] .topnav-mob-ham-icon span:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}
.topnav-mob-hamburger[aria-expanded="true"] .topnav-mob-ham-icon span:nth-child(2) {
	opacity: 0; transform: scaleX(0);
}
.topnav-mob-hamburger[aria-expanded="true"] .topnav-mob-ham-icon span:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

/* --- Row 2 — #6 horizontal scroll so buttons never overlap --- */
.topnav-mobile-row2 {
	border-top: 1px solid rgba(255,255,255,0.08);
}
.topnav-mobile-row2-inner {
	display: flex;
	align-items: center;
	min-height: var(--mob-row2-h, 44px);
	padding: 0 6px;
	overflow-x: auto;          /* horizontal scroll when items overflow */
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;     /* hide scrollbar but keep scrollable */
}
/* Centre all items — set when topnav_mobile_row2_center is enabled */
.topnav-mobile-row2-inner.row2-centered {
	justify-content: center;
	overflow-x: hidden;        /* hide scroll when centered; items wrap if needed */
	flex-wrap: wrap;
}
.topnav-mobile-row2-inner::-webkit-scrollbar { display: none; }

.topnav-mob-row2-nav { display: contents; } /* let items flow inline */
.topnav-mob-row2-menu {
	list-style: none !important; margin: 0 !important; padding: 0 !important;
	display: flex; align-items: center;
	flex-wrap: nowrap;
	flex-shrink: 0;
}
.topnav-mob-row2-menu > li {
	flex-shrink: 0;
	list-style: none !important; margin: 0 !important; padding: 0 !important;
}
.topnav-mob-row2-menu > li > a {
	display: flex; align-items: center;
	color: #ffffff; text-decoration: none;
	padding: 0 10px !important;
	height: var(--mob-row2-h, 44px);
	font-size: 14px !important; font-weight: 600;
	text-transform: var(--topnav-text-transform, none); letter-spacing: 0.3px;
	white-space: nowrap; line-height: 1 !important;
	font-family: inherit;
	transition: color 0.2s;
}
.topnav-mob-row2-menu > li > a:hover,
.topnav-mob-row2-menu > li.current-menu-item > a { color: #d22254; }
.topnav-mob-row2-menu ul { display: none !important; }

/* Row2 CTA buttons — #6 flex-shrink:0 so they never get squished */
.topnav-mob-row2-cta {
	display: flex; align-items: center;
	gap: 6px; margin-left: 8px; flex-shrink: 0;
}
.topnav-mob-cta-btn {
	padding: 5px 10px !important; font-size: 13px !important;
	white-space: nowrap; flex-shrink: 0;
}

/* =====================================================
   TOP NAV PANEL — slides UP from bottom (default)
   OR drops DOWN from top (when .drawer-from-top class is set)
===================================================== */
.topnav-mob-panel {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: flex-end;        /* default: panel anchors to bottom */
	justify-content: center;      /* default; overridden by drawer_position setting */
	pointer-events: none;
}
.topnav-mob-panel:not([hidden]) { pointer-events: auto; }

/* Top-drop variant: panel anchors to top instead of bottom */
.topnav-mob-panel.drawer-from-top {
	align-items: flex-start;
}

.topnav-mob-overlay {
	position: absolute; inset: 0;
	background: rgba(0,0,0,0.55);
	opacity: 0;
	transition: opacity 0.3s ease;
	backdrop-filter: blur(2px);
}
.topnav-mob-panel.is-open .topnav-mob-overlay { opacity: 1; }

/* Panel inner — slides UP from the bottom (default) */
.topnav-mob-panel-inner {
	position: relative;
	background: #006666;
	/* width/min-width/max-width set by shared drawer layout CSS from navbars-inline-css.php */
	max-height: 75vh;
	border-radius: 16px 16px 0 0;  /* rounded top corners like bottom drawer */
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transform: translateY(100%);   /* starts off-screen below */
	transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
	box-shadow: 0 -8px 32px rgba(0,0,0,0.4);
}
.topnav-mob-panel.is-open .topnav-mob-panel-inner { transform: translateY(0); }

/* Top-drop variant: panel drops DOWN from top */
.topnav-mob-panel.drawer-from-top .topnav-mob-panel-inner {
	border-radius: 0 0 16px 16px;  /* rounded bottom corners */
	transform: translateY(-100%);   /* starts off-screen above */
	box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.topnav-mob-panel.drawer-from-top.is-open .topnav-mob-panel-inner { transform: translateY(0); }

/* No drag handle pill — removed as it serves no practical purpose */

/* Header row — matches bottom drawer */
.topnav-mob-panel-header {
	display: flex; align-items: center;
	justify-content: space-between;
	padding: 12px 20px 10px;
	border-bottom: 1px solid rgba(255,255,255,0.1);
	flex-shrink: 0;
}

/* Title — matches .bottomnav-drawer-title */
.topnav-mob-panel-title {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: rgba(255,255,255,0.5);
	line-height: 1;
}

.topnav-mob-panel-close {
	background: none; border: none;
	color: rgba(255,255,255,0.5);
	font-size: 18px; cursor: pointer;
	padding: 4px 6px; border-radius: 6px;
	transition: color 0.2s, background 0.2s; line-height: 1;
}
.topnav-mob-panel-close:hover { color: #fff; background: rgba(255,255,255,0.1); }

.topnav-mob-panel-body {
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	flex: 1; padding: 0;
}

/* Social icons footer — inside the drawer, below the menu */
.topnav-mob-panel-social {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
	padding: 14px 16px 18px;
	border-top: 1px solid rgba(255,255,255,0.1);
	flex-shrink: 0;  /* never shrink — stays at bottom of inner panel */
}
.topnav-mob-panel-social a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 8px;
	background: rgba(255,255,255,0.1);
	color: #ffffff;
	text-decoration: none;
	font-size: 16px;
	line-height: 1;
	transition: background 0.2s, transform 0.15s;
	flex-shrink: 0;
}
.topnav-mob-panel-social a:hover {
	background: rgba(255,255,255,0.22);
	transform: translateY(-2px);
}
.topnav-mob-panel-social a svg {
	width: 16px;
	height: 16px;
	fill: currentColor;
	display: block;
}

/* Panel menu */
.topnav-mob-panel-menu {
	list-style: none !important; margin: 0 !important; padding: 0 !important;
}
.topnav-mob-panel-menu > li { margin: 0 !important; list-style: none !important; }
.topnav-mob-panel-menu > li > a {
	display: flex; align-items: center;
	gap: 14px;
	color: #ffffff; text-decoration: none;
	padding: 13px 22px !important; font-size: 15px !important;
	font-weight: 500; line-height: 1.3 !important;
	border-bottom: 1px solid rgba(255,255,255,0.06);
	transition: background 0.15s, color 0.15s;
}
.topnav-mob-panel-menu > li:last-child > a { border-bottom: none; }
.topnav-mob-panel-menu > li > a:hover,
.topnav-mob-panel-menu > li.current-menu-item > a { color: #ffdd00; background: rgba(255,255,255,0.08); }
.topnav-mob-panel-menu ul { list-style: none !important; margin: 0 !important; padding: 0 !important; }
.topnav-mob-panel-menu ul li { list-style: none !important; margin: 0 !important; }
.topnav-mob-panel-menu ul li a {
	display: block; color: rgba(255,255,255,0.65);
	text-decoration: none; padding: 10px 22px 10px 40px !important;
	font-size: 13px !important; line-height: 1.3 !important;
	border-bottom: 1px solid rgba(255,255,255,0.04);
	transition: background 0.15s, color 0.15s;
}
.topnav-mob-panel-menu ul li a:hover { color: #fff; background: rgba(255,255,255,0.04); }

/* =====================================================
   RESPONSIVE SHOW/HIDE
   MOBILE = phones in portrait OR landscape (max 767px portrait width,
            OR touch device narrower than 1024px that is not a tablet).
   We use 767px for portrait phones. For landscape phones (like iPhone 15
   Pro Max at 932px landscape), we additionally check orientation + width.
   Tablets (iPad ≥ 768px portrait) get the desktop bar.

   NOTE: The default show/hide state (#topnav-bar visible, .topnav-mobile-wrap
   hidden) is set by an inline <style> in header.php that loads BEFORE this
   stylesheet. Do NOT add bare (non-media-query) defaults here — they load
   after the inline style and cause a flash of the desktop bar on mobile.
===================================================== */

/* Portrait phones: width ≤ 767px */
@media (max-width: 767px) {
	#topnav-bar         { display: none !important; }
	.topnav-mobile-wrap { display: block !important; }
	.topnav-mob-panel   { display: flex !important; }
}

/* Landscape phones: touch devices in landscape with height ≤ 500px
   (phones landscape have short height; tablets in landscape are taller) */
@media (max-height: 500px) and (orientation: landscape) and (pointer: coarse) {
	#topnav-bar         { display: none !important; }
	.topnav-mobile-wrap { display: block !important; }
	.topnav-mob-panel   { display: flex !important; }
}

/* Force desktop for tablets (min-width 768px portrait, coarse touch — e.g. iPad) */
@media (min-width: 768px) and (min-height: 501px) {
	#topnav-bar         { display: block !important; }
	.topnav-mobile-wrap { display: none !important; }
	.topnav-mob-panel   { display: none !important; }
}
