/* 13-header-boxed.css — Al's header: boxed nav, equal cells, logo above.
   Loads last on purpose: these rules must beat 07-mobile-header.css and
   09-desktop-menu.css, and filename order IS cascade order here.

   Requirement (Al via Ricky, 2026-11-18):
     - boxed layout, 1140px
     - header menu constrained to that same boxed width
     - menu items equally spaced, each cell = boxed width / item count
     - labels centred within their own cell
     - logo above the nav row, centred
     - aurora band FULL WIDTH; only the nav row is boxed
     - no links strip above the logo; tight logo row
     - search is a magnifying glass that expands on click
     - spacing must not shift when the nav goes sticky

   Avada header v4 structure (measured, not assumed):
     .fusion-header > .fusion-row > .fusion-logo
         └─ a.fusion-logo-link
         └─ .fusion-header-content-3-wrapper   <- a CHILD of .fusion-logo
     .fusion-secondary-main-menu > .fusion-row > .fusion-main-menu
   Avada sets .fusion-logo to justify-content:space-between and its dynamic
   CSS loads AFTER this file, so the overrides below need !important. That is
   the same ordering constraint documented in 05-woo-support.css. */

/* ---- nav band: full-bleed, boxed inner row -------------------------- */
.fusion-header-v4 .fusion-secondary-main-menu {
	width: 100%;
	border-top: 1px solid var(--awb-color3);
	border-bottom: 1px solid var(--awb-color3);
	background:
		radial-gradient(120% 420% at 18% 130%, rgba(122,31,184,.17) 0%, rgba(122,31,184,0) 58%),
		radial-gradient(110% 380% at 80% 130%, rgba(56,214,240,.09) 0%, rgba(56,214,240,0) 60%),
		var(--awb-color8);
}
.fusion-header-v4 .fusion-secondary-main-menu > .fusion-row {
	max-width: 1140px;
	margin: 0 auto;
	padding-left: 0;
	padding-right: 0;
}

/* ---- equal cells, centred labels ------------------------------------ */
@media (min-width: 1025px) {

	.fusion-header-v4 .fusion-main-menu,
	.fusion-header-v4 .fusion-main-menu > ul.fusion-menu {
		width: 100%;
		float: none;
	}
	.fusion-header-v4 .fusion-main-menu > ul.fusion-menu {
		display: flex;
		align-items: stretch;
		position: relative;   /* positioning context for the mega menu */
	}

	/* flex:1 1 0 (not 1 1 auto) is what makes the cells EQUAL rather than
	   proportional to label length — SUBSCRIBE must not get a wider cell
	   than HOME. The !important and the :last-child arm defend against
	   Avada's own last-item rules, which were measured taking 48px off the
	   final cell (198/198/198/198/198/150). */
	.fusion-header-v4 .fusion-main-menu > ul.fusion-menu > li,
	.fusion-header-v4 .fusion-main-menu > ul.fusion-menu > li:last-child,
	.fusion-header-v4 .fusion-main-menu > ul.fusion-menu > li.fusion-last-menu-item {
		flex: 1 1 0 !important;
		width: auto !important;
		max-width: none !important;
		min-width: 0 !important;
		margin: 0 !important;
		padding: 0 !important;
		float: none;
	}

	/* The label is centred in its own cell. Avada renders the dropdown
	   caret as a separate element inside the <a>, so centring the text
	   alone would leave parent items visually off-centre against their
	   siblings — centring the flex line handles both together. */
	.fusion-header-v4 .fusion-main-menu > ul.fusion-menu > li > a {
		position: relative;
		display: flex;
		align-items: center;
		justify-content: center;
		text-align: center;
		width: 100%;
		box-sizing: border-box;
		padding: 0 6px !important;
		text-transform: uppercase;
		letter-spacing: .08em;
		font-size: 13px;
		font-weight: 500;
		line-height: 1.2;
	}
	.fusion-header-v4 .fusion-main-menu > ul.fusion-menu > li > a .fusion-menu-description,
	.fusion-header-v4 .fusion-main-menu > ul.fusion-menu > li > a > span {
		text-align: center;
	}

	/* Avada draws the active state as a bordered box sized to the label,
	   which reads ragged against equal cells. Replace it with a rule along
	   the bottom of the whole cell. */
	.fusion-header-v4 .fusion-main-menu > ul.fusion-menu > li > a::after {
		content: "";
		position: absolute;
		left: 0; right: 0; bottom: 0;
		height: 2px;
		background: transparent;
		transition: background .15s ease;
	}
	.fusion-header-v4 .fusion-main-menu > ul.fusion-menu > li.current-menu-item > a::after,
	.fusion-header-v4 .fusion-main-menu > ul.fusion-menu > li.current-menu-ancestor > a::after,
	.fusion-header-v4 .fusion-main-menu > ul.fusion-menu > li.current_page_item > a::after,
	.fusion-header-v4 .fusion-main-menu > ul.fusion-menu > li > a:hover::after {
		background: var(--awb-color4);
	}
	.fusion-header-v4 .fusion-main-menu > ul.fusion-menu > li > a .fusion-menu-highlight-label {
		display: none;
	}

	/* ---- Episodes mega menu ----------------------------------------- */
	/* 13 series in a single column is a long thin list. Span the boxed
	   width in columns instead, with the counts kept in the labels. */
	.fusion-header-v4 .fusion-main-menu > ul.fusion-menu > li.fb-mega > ul.sub-menu {
		position: absolute;
		left: 0 !important;
		right: 0;
		width: 100% !important;
		max-width: none !important;
		box-sizing: border-box;
		padding: 18px 20px 20px !important;
		columns: 3;
		column-gap: 28px;
		background: var(--awb-color7);
		border: 1px solid var(--awb-color3);
		border-top: 0;
		border-radius: 0 0 10px 10px;
		box-shadow: 0 18px 40px rgba(0,0,0,.45);
	}
	.fusion-header-v4 .fusion-main-menu > ul.fusion-menu > li.fb-mega > ul.sub-menu > li {
		width: 100% !important;
		break-inside: avoid;
		border: 0 !important;
	}
	.fusion-header-v4 .fusion-main-menu > ul.fusion-menu > li.fb-mega > ul.sub-menu > li > a {
		display: block;
		width: 100% !important;
		padding: 7px 8px !important;
		height: auto !important;
		line-height: 1.35;
		border: 0 !important;
		border-radius: 6px;
		text-transform: none;
		letter-spacing: 0;
		font-size: 14px;
		white-space: normal;
	}
	.fusion-header-v4 .fusion-main-menu > ul.fusion-menu > li.fb-mega > ul.sub-menu > li > a:hover {
		background: hsla(var(--awb-color4-h),var(--awb-color4-s),var(--awb-color4-l),calc(var(--awb-color4-a) - 75%));
	}
}

/* ---- logo row: tight, centred mark, search pinned right ------------- */
.fusion-header-v4 .fusion-header > .fusion-row {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	max-width: 1140px;
	margin: 0 auto;
	min-height: 0;
}
.fusion-header-v4 .fusion-logo {
	position: relative !important;
	justify-content: center !important;
	align-items: center;
	float: none;
	margin: 0 !important;
	padding: 6px 0 !important;      /* the logo row was 96px tall; this is the tightening */
	flex: 1 1 auto;
}
.fusion-header-v4 .fusion-logo-link { margin: 0 !important; }

/* search lives inside .fusion-logo, so it is taken out of flow and pinned */
.fusion-header-v4 .fusion-logo > .fusion-header-content-3-wrapper {
	position: absolute !important;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	width: auto !important;
	max-width: none;
	margin: 0;
}

/* ---- search: a glyph that expands ----------------------------------- */
/* Collapsed it is a 34px circle showing only the magnifying glass. The
   expanded state is driven by .fb-search-open, toggled by js/search-toggle.js.
   Width, not display, is animated so the field can be focused immediately. */
.fusion-header-v4 .fusion-secondary-menu-search {
	display: flex;
	justify-content: flex-end;
}
.fusion-header-v4 .fusion-secondary-menu-search .fusion-search-form-content {
	display: flex;
	align-items: center;
	width: 38px;
	overflow: hidden;
	border: 1px solid transparent;
	border-radius: 19px;
	background: transparent;
	transition: width .22s ease, background .22s ease, border-color .22s ease;
}
.fusion-header-v4 .fusion-secondary-menu-search .fusion-search-field { flex: 1 1 auto; min-width: 0; }
.fusion-header-v4 .fusion-secondary-menu-search .fusion-search-field input {
	width: 100%;
	opacity: 0;
	pointer-events: none;
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
	color: var(--awb-color2) !important;
	transition: opacity .18s ease;
}
.fusion-header-v4 .fusion-secondary-menu-search .fusion-search-field input::placeholder { color: var(--awb-color6) !important; }
.fusion-header-v4 .fusion-secondary-menu-search .fusion-search-button,
.fusion-header-v4 .fusion-secondary-menu-search .search-button {
	order: -1;                      /* glyph first, so the circle reads as a button */
	flex: 0 0 auto;
	width: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent !important;
	border: 0 !important;
	color: var(--awb-color2) !important;
	cursor: pointer;
}
.fusion-header-v4 .fusion-secondary-menu-search .fusion-search-form-content:hover { background: var(--awb-color7); }

.fusion-header-v4 .fusion-secondary-menu-search.fb-search-open .fusion-search-form-content {
	width: 280px;
	background: var(--awb-color7);
	border-color: var(--awb-color3);
}
.fusion-header-v4 .fusion-secondary-menu-search.fb-search-open .fusion-search-field input {
	opacity: 1;
	pointer-events: auto;
}

/* ---- sticky parity --------------------------------------------------- */
/* Avada's sticky nav ships its own font-size and padding, which default to
   values different from the non-sticky ones — that is the padding shift on
   scroll. The options were matched (13px / 6px) and these pin the rest, so
   nothing moves as the row sticks. */
.fusion-header-v4 .fusion-sticky-header-wrapper .fusion-main-menu > ul.fusion-menu > li > a,
.fusion-is-sticky .fusion-header-v4 .fusion-main-menu > ul.fusion-menu > li > a,
.fusion-sticky-menu-only .fusion-main-menu > ul.fusion-menu > li > a {
	font-size: 13px !important;
	letter-spacing: .08em !important;
	padding: 0 6px !important;
	height: 54px !important;
	line-height: 1.2 !important;
}
.fusion-sticky-menu-only .fusion-secondary-main-menu > .fusion-row,
.fusion-is-sticky .fusion-secondary-main-menu > .fusion-row {
	max-width: 1140px;
	padding-left: 0;
	padding-right: 0;
}

/* ---- boxed exterior: the slow aurora -------------------------------- */
/* Pure CSS, so no image asset and no provenance question — which matters
   because Al's audience rejects AI art and the mockups are all AI.

   PERFORMANCE: the first version used filter:blur(42px) on a fixed,
   viewport-sized element. A blur filter on a fixed layer is re-rasterised
   on every scroll frame over the whole viewport, which is what made
   scrolling feel like it was rendering. The blur is gone; the softness now
   comes from wide gradient stops, which cost nothing, and the only animated
   property is transform, which stays on the compositor. */
body.layout-boxed-mode::before {
	content: "";
	position: fixed;
	inset: -25vmax;
	z-index: 0;
	pointer-events: none;
	opacity: .25;
	background:
		radial-gradient(45vmax 32vmax at 22% 18%, rgba(122,31,184,.55) 0%, rgba(122,31,184,.22) 38%, rgba(122,31,184,0) 72%),
		radial-gradient(42vmax 30vmax at 78% 74%, rgba(56,214,240,.40) 0%, rgba(56,214,240,.15) 40%, rgba(56,214,240,0) 74%),
		radial-gradient(38vmax 28vmax at 58% 30%, rgba(44,192,170,.28) 0%, rgba(44,192,170,.10) 42%, rgba(44,192,170,0) 76%);
	transform: translate3d(0,0,0);
	will-change: transform;
	animation: fb-aurora-drift 60s ease-in-out infinite alternate;
}
@keyframes fb-aurora-drift {
	from { transform: translate3d(-2.5%, -1.5%, 0) scale(1);    }
	to   { transform: translate3d( 2.5%,  1.5%, 0) scale(1.06); }
}
@media (prefers-reduced-motion: reduce) {
	body.layout-boxed-mode::before { animation: none; }
}
body.layout-boxed-mode #wrapper {
	position: relative;
	z-index: 1;
	background: var(--awb-color8);
}

/* ---- below 1024px: Avada's burger takes over ------------------------ */
/* The equal-cell rules are scoped to min-width:1025px, so nothing is undone
   here. Mobile menu contrast is handled in 04-mobile-menu.css. */

/* ---- measured corrections, 2026-11-18 ------------------------------- */
/* The nav row measured 1080px inside a 1140px box: Avada's .fusion-row
   carries 30px of horizontal padding and plain padding-left/right lost to
   it. Al's rule is that the cells fill the boxed width, so it has to go. */
.fusion-header-v4 .fusion-secondary-main-menu > .fusion-row,
.fusion-sticky-menu-only .fusion-secondary-main-menu > .fusion-row,
.fusion-is-sticky .fusion-secondary-main-menu > .fusion-row {
	padding-left: 0 !important;
	padding-right: 0 !important;
	max-width: 1140px !important;
}

/* The secondary header renders as an empty div once both content slots are
   'none'. It is invisible but still in the box model; collapse it so it
   cannot contribute stray height. */
.fusion-header-wrapper .fusion-secondary-header { display: none !important; }

/* The logo row measured 84px — the logo file is 72px tall and nav_height
   governs the nav row, not this one. Cap the mark so the row lands near
   56px. Avada writes max-height inline on the <img>, so this needs
   !important to win. */
.fusion-header-v4 .fusion-logo img,
.fusion-header-v4 img.fusion-standard-logo {
	max-height: 44px !important;
	width: auto !important;
	height: auto !important;
}

/* Measured: the row's max-width was already 1140 with zero padding, yet it
   rendered 1080 — the constraint is the BAND, not the row. In boxed mode the
   whole header lives inside #wrapper (1140px), so the band is 1140 wide and
   its own 30px side padding left the row 1080. Zero it and the cells fill
   the boxed width, which is what Al asked for. */
.fusion-header-v4 .fusion-secondary-main-menu {
	padding-left: 0 !important;
	padding-right: 0 !important;
}

/* Avada sets .fusion-main-menu li { position: relative }, so the mega
   submenu's absolute positioning resolved against its 154px cell: width:100%
   became 154px and columns:3 split that into three overlapping strips. Make
   the mega item the one static li so the submenu resolves against the <ul>. */
.fusion-header-v4 .fusion-main-menu > ul.fusion-menu > li.fb-mega {
	position: static !important;
}
.fusion-header-v4 .fusion-main-menu > ul.fusion-menu > li.fb-mega > ul.sub-menu {
	top: 100% !important;
}
