/* ==========================================================================
   Header — graduated 2026-10-10 from the d2mma demo default (?logo=d with
   ?topbar=1 / ?searchicon=1, #1231). Moved verbatim out of
   css/reskin-2026-demo.css; only body.logo-demo-d became body.reskin-header
   (same specificity) and the A/B/C layouts and topbar 2-4 / searchicon 2
   variants were left behind. The :not([class*="header-demo"]) guards are
   kept as-is so the cascade is byte-for-byte what was reviewed.
   - full-size seal floated left off the viewport edge, one-row nav pushed
     to a matching right gutter
   - search as the last nav item -> full-screen search panel (script in
     functions/reskin-2026.php)
   - utility bar: "Newsletter" as a navy button at the far right
   Desktop (>=1024px) only, except the search panel. It was 768 on d2mma,
   but the one-row nav wraps to two rows below 992px and runs into the
   seal's wordmark below 1024 (audit 2026-10-11), so tablets keep the
   shipped header.
   ========================================================================== */

@media only screen and (min-width: 1024px) {
	body.reskin-header > header > .container > .row {
		align-items: center;
		flex-wrap: nowrap;
		min-height: 76px;
	}
	/* D: the row carries the full-size seal — tall enough that the seal
	   sits ON the bar (Kalman: "now the logo is off the menu bar"), with
	   the top bleeding into #top_bar like the #1198 pick and only a small
	   bleed below. */
	body.reskin-header > header > .container > .row {
		min-height: 120px;
	}
	body.reskin-header > header > .container > .row > .col-md-9 {
		position: relative;
		display: flex;
		align-items: center;
		justify-content: flex-end;
	}
	body.reskin-header #mob-menu-w {
		display: flex;
		align-items: center;
	}
	body.reskin-header #main_menu {
		float: none;
	}
	body.reskin-header #main_menu > li.menu-item > a.menu-link {
		height: 120px;
		line-height: 120px;
	}
	body.reskin-header:not([class*="header-demo"]) > header #searchform {
		display: none;
		position: absolute;
		top: 100%;
		right: 0;
		left: auto;
		margin: 8px 0 0;
		padding: var(--space-4, 16px);
		width: 320px;
		max-width: calc(100vw - 32px);
		background: var(--c-white, #fff);
		box-shadow: var(--shadow-md, 0 6px 18px rgba(16, 24, 32, .08));
		border-radius: 0 0 var(--radius-sm, 6px) var(--radius-sm, 6px);
		text-align: left;
		z-index: var(--z-dropdown, 700);
	}
	body.reskin-header:not([class*="header-demo"]) > header #searchform input {
		width: 100%;
	}
	/* D reveals the same toggle, but not here -- it gets lifted out of the
	   utility bar and into the nav row further down (Kalman 2026-08-31:
	   "move a search icon into the line with the main menu (not the upper
	   menu) giving it real emphasis there"). */
}

/* ---- Tablet header, 768-1023px: one layout across the whole range.
   Bootstrap's lg columns (33/67) and the legacy 960px container used to kick
   in at 992, so 992-1023 got a big logo above a full-width search instead of
   the 768-991 layout (small logo left, search and nav right). Reviewed
   2026-11-28: keep the 768-991 layout up to the desktop header at 1024, and
   centre the logo vertically against the search + nav block instead of
   bleeding it up into the utility bar (#1198 bleed stays on desktop). */
@media only screen and (min-width: 992px) and (max-width: 1023px) {
	body.reskin-header > header > .container > .row > .desk-logo {
		flex: 0 0 25%;
		max-width: 25%;
	}
	body.reskin-header > header > .container > .row > .col-md-9 {
		flex: 0 0 75%;
		max-width: 75%;
	}
	/* global.css's <=991 nav size, or the six items wrap to two rows */
	body.reskin-header > header #main_menu > li.menu-item > a.menu-link {
		padding: 0 5px;
		font-size: 13px;
	}
}
@media only screen and (min-width: 768px) and (max-width: 1023px) {
	body.reskin-header > header > .container > .row > .desk-logo {
		display: flex;
		align-items: center;
		align-self: stretch;
	}
	body.reskin-header > header #logo {
		margin-top: 0;
		margin-bottom: 0;
	}
}

/* ---- D — Big seal float (Kalman's direction, live follow-up on #1231):
   "logo is tiny... it can float left and be the same size it was before."
   The header bar itself is the same compact one-row shell as A, but the
   logo keeps its original size and is pulled out of flow so it can bleed
   DOWNWARD past the bar's own bottom edge, over the #page_head title bar
   below -- the mirror image of the #1198 upward bleed into #top_bar. It's
   anchored at the container's left edge (not the viewport edge like B):
   .col-md-3 collapses to a zero-width, position:relative anchor point
   (same technique as B) and #logo is positioned absolute against it.
   The seal carries no glow or shadow -- an earlier white halo was dropped
   on Kalman's call ("no glow needed on the logo"); the mark sits flat
   against whatever it overlaps. Because the logo now occupies real width in
   front of the title bar, .col-md-9's nav row AND #page_head's own
   container both get a matching left reserve so nothing sits underneath
   it illegibly, checked at 1440 and 1200px. */
@media only screen and (min-width: 1024px) {
	body.reskin-header > header {
		position: relative;
	}
	body.reskin-header > header > .container > .row > .col-md-3 {
		/* static, not relative: the seal anchors against the full-width
		   header now (Kalman: "the logo doesn't float left yet" — he
		   means the SCREEN's left edge, not the container's). */
		position: static;
		flex: 0 0 0;
		max-width: 0;
		width: 0;
		min-height: 0;
		padding: 0;
	}
	body.reskin-header > header > .container > .row > .col-md-9 {
		flex: 0 0 100%;
		max-width: 100%;
		width: 100%;
		padding-left: 380px;
	}
	body.reskin-header #logo {
		/* Explicit width, not shrink-to-fit: an absolutely positioned
		   anchor with width:auto has to shrink-to-fit around its content,
		   and #logo img's own max-width:100% (global.css) is a percentage
		   against that still-undetermined width -- Chromium resolves the
		   circularity to 0 instead of ignoring it, collapsing the whole
		   logo to nothing. A concrete pixel width sidesteps the circularity
		   entirely. 317x160 matches the real 621x313 (~1.98:1) image. */
		position: absolute;
		/* 24px off the VIEWPORT's left edge at every width: the positioned
		   ancestor is a centered box (the header-band code keeps .container
		   positioned), so 50% - 50vw walks back to x=0 regardless of which
		   centered ancestor wins. top is relative to that same box (the
		   nav row), so -34px lifts the crown up through #top_bar (Kalman:
		   "logo could be higher up") with ~23px passing below the bar. */
		/* 350x177 stepped down 5% to 333x168 (Kalman: "the logo needs a
		   touch more padding at the top which could just mean reduce the
		   size of the logo by 5%"). The 9px saved is handed entirely to
		   the TOP -- top goes -34px -> -25px so the crown clears the
		   viewport edge by ~12px instead of ~3px, while the bleed below
		   the bar stays at the same ~23px it was tuned to. */
		top: -25px;
		left: calc(50% - 50vw + var(--mma-hdr-gutter, 24px));
		margin-top: 0;
		width: 333px;
		z-index: var(--z-logo, 600);
	}
	body.reskin-header #logo img {
		display: block;
		width: 333px;
		height: 168px;
		/* No glow (Kalman 2026-08-31: "no glow needed on the logo"). The
		   chained white drop-shadow() was insurance for the ~27px of seal
		   that bleeds below the bar onto a dark title bar; the seal reads
		   as its own shape there, so the halo was doing more harm than
		   good. */
	}
	/* The title/breadcrumb area the logo now overlaps -- indent it to match
	   .col-md-9's reserve above so text never sits under the seal. Inner
	   pages render #page_head; the homepage instead runs straight into its
	   own VC hero section (.news-report-row, the "Navigating the Storm"
	   band) with no #page_head at all -- verified live that without this
	   second rule the seal sat directly over that heading's text at both
	   1440 and 1200px. */
	/* With the seal anchored on the bar (only ~27px bleeds below), the
	   old deep-hang indents on #page_head/.news-report-row are retired —
	   titles sit well below the bleed line. */
}

/* ---- D, menus to the right edge (Kalman: "lets have the menus float
   right...with this"). The seal sits 24px off the VIEWPORT's left edge but
   both menus still stopped at the 1140px container's right edge -- 165px in
   from the viewport at 1440, which read as lopsided next to the floated
   seal. Rather than push each menu out with negative margins, the header's
   own containers go full-width with a matching 24px gutter, so the utility
   row and the main nav share one right edge with the seal's left one.
   The seal doesn't move: its left:calc(50% - 50vw + 24px) is
   self-correcting -- 50% of ANY horizontally centered ancestor minus 50vw
   lands on the viewport's left edge, so widening .row from 1140 to
   full-bleed leaves the crown exactly where it was (verified: x=24 before
   and after). Only the header's two containers are touched; #page_head and
   every content container keep the 1140px measure. */
/* The header gutter is one token so the seal's left inset, both containers
   and the search item can never drift apart. It steps up with the viewport
   (Kalman 2026-08-31: "the logo may need a little more padding on the left
   of it for larger/medium screens") -- 24px is right when the screen is
   tight, but at desk widths the seal sat too close to the edge. Raised on
   BOTH sides, not just the left: the whole point of the layout is that the
   seal's left edge and the menus' right edge are the same line. */
@media only screen and (min-width: 1024px) {
	body.reskin-header { --mma-hdr-gutter: 24px; }
}
@media only screen and (min-width: 992px) {
	body.reskin-header { --mma-hdr-gutter: 40px; }
}
@media only screen and (min-width: 1400px) {
	body.reskin-header { --mma-hdr-gutter: 56px; }
}
@media only screen and (min-width: 1024px) {
	body.reskin-header > header > .container,
	body.reskin-header > header #top_bar > .container {
		max-width: none;
		width: 100%;
		padding-left: var(--mma-hdr-gutter, 24px);
		padding-right: var(--mma-hdr-gutter, 24px);
	}
	body.reskin-header > header > .container > .row {
		margin-left: 0;
		margin-right: 0;
	}
	/* Bootstrap's 15px column gutter would leave the last menu item 39px
	   in, not 24px -- zero it so the nav's right edge is the gutter. The
	   380px left reserve stays: measured from the container's new x=24 it
	   still clears the seal's 333px width with room to spare. */
	/* Exactly the search item's own width -- the nav is right-aligned, so
	   this reserve is what makes the row stop precisely where the search
	   item starts, leaving them flush as one row. */
	body.reskin-header > header > .container > .row > .col-md-9 {
		padding-right: 56px;
	}
}

/* ---- D, search becomes the last item of the nav row (Kalman 2026-08-31:
   "I want a search icon to the right of Events and About MMA and for that
   row of menu items to float right...it might be that that one item has a
   thin vertical line to the left of it"). It is a MENU ITEM, not a button:
   same row, same 120px height, same hover as its neighbours, set off by a
   short centred hairline rather than a box -- so the row reads as
   ...EVENTS  ABOUT MMA | (search), floated right as one unit.
   The element is NOT moved in the DOM -- it stays the theme's own
   <li id="menu-item-search"> inside #top_bar's menu, and is simply taken out
   of flow and positioned against <header> (which D already makes
   position:relative). That matters: jsMMAHeader binds the toggle with a
   DELEGATED handler on body>header, so the click still works anywhere inside
   the header, with no new JS and no duplicate-id clone. It also leaves the
   mobile header alone -- all of this is inside the 768px query, so below
   that the icon is still the utility-bar item the mobile menu expects.
   The 56px reserve on .col-md-9 above is this item's exact width, so it sits
   flush against ABOUT MMA instead of floating off on its own. */
@media only screen and (min-width: 1024px) {
	body.reskin-header:not([class*="header-demo"]) > header #top_bar ul.menu li.sl#menu-item-search {
		display: flex;
		align-items: center;
		justify-content: center;
		position: absolute;
		right: var(--mma-hdr-gutter, 24px);
		bottom: 0;
		width: 56px;
		height: 120px;
		float: none;
		border-left: 0;
		z-index: var(--z-logo, 600);
	}
	/* The thin vertical line: centred and short (22px of a 120px row) so it
	   separates the icon without drawing a full column rule through the bar. */
	body.reskin-header:not([class*="header-demo"]) > header #top_bar ul.menu li.sl#menu-item-search::before {
		content: '';
		position: absolute;
		left: 0;
		top: 50%;
		width: 1px;
		height: 22px;
		margin-top: -11px;
		background: rgba(0, 0, 0, .18);
	}
	body.reskin-header:not([class*="header-demo"]) > header #top_bar ul.menu li.sl#menu-item-search > a {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 100%;
		height: 100%;
		padding: 0;
		background: none;
		color: #000;
		font-size: 16px;
		transition: color .15s ease, background .15s ease;
	}
	/* Same hover language as the nav links beside it. */
	body.reskin-header:not([class*="header-demo"]) > header #top_bar ul.menu li.sl#menu-item-search > a:hover,
	body.reskin-header:not([class*="header-demo"]) > header #top_bar ul.menu li.sl#menu-item-search.toggled > a {
		background: var(--color-brand-tint, #fdeaea);
		color: var(--color-brand-on-tint, #a80007);
	}
} /* end @media (min-width: 1024px) opened at the search-toggle rules above */

/* ---- D, mega panels follow the nav to the right (Kalman 2026-08-31: "with
   the new advocacy menu placement the menu from it is landing totally in the
   wrong place"). Regression from the full-bleed header above, and worth
   spelling out: li.menu-megamenu is position:STATIC (global.css), so its
   panel resolves against .col-md-9. That column used to be the 1140px
   container, so a capped panel pinned to its left edge landed under the nav;
   now the column runs the full viewport, so the same left:0 drops the panel
   under the floated seal instead -- ~630px adrift.
   Every mega panel (Members, Advocacy, Resources) hangs from that right
   gutter, sized to its content, with the same 40px inset each side. Members
   used to run full-bleed with its 1140px grid centered (~390px of white each
   side at 1920) and Resources sat in a fixed 800px box (85px each side);
   reviewed 2026-11-28, all three now match Advocacy's inset. Resources also
   drops back to position:static, instead of the -100px nudge off its own
   item, so it hangs from the gutter like the others. */
@media only screen and (min-width: 1024px) {
	body.reskin-header > header #main_menu > li.menu-item.menu-megamenu {
		position: static;
	}
	body.reskin-header > header #main_menu > li.menu-megamenu > ul.sub-menu {
		left: auto;
		right: 0;
		width: auto;
		padding-left: var(--space-10, 40px);
		padding-right: var(--space-10, 40px);
	}
	body.reskin-header > header #main_menu > li.menu-megamenu > ul.sub-menu > li > .container {
		width: auto;
		max-width: 1140px;
	}
	/* Members' WPBakery columns carry their own inset (15px column padding +
	   20px on the barred text block) on top of the row's -15px; pull the row
	   out by that 35px so its first red bar sits at the same 40px as the
	   other panels' headings. */
	body.reskin-header > header #main_menu > li.menu-megamenu > ul.sub-menu .row:has(> .flex-column) {
		margin-left: -50px;
		margin-right: -50px;
	}
}

/* Flyouts hang from their item's RIGHT edge, same as the nav hangs from the
   gutter. They were left-anchored (left:0 off a position:relative li), which
   was fine when the nav sat mid-container; with the nav pushed to the right
   gutter the News panel ran 13px past the viewport at 1024 and scrolled the
   page sideways. Right-anchoring is both the fix and the consistent choice --
   nothing in this header grows rightward any more. */
@media only screen and (min-width: 1024px) {
	body.reskin-header > header #main_menu > li.menu-flyout > ul.sub-menu {
		left: auto;
		right: 0;
	}
}

/* ==========================================================================
   D's utility bar: newsletter button + social cluster (?topbar=1|2|3|4)
   Kalman 2026-08-31: "making newseltter not newsletter sign up and making it
   all the way on the right and some sort of emphasis color...not red...thats
   too much...maybe a dark blue with white text...like the callout bar", then
   "maybe newsletter button can also have something in common with the social
   media icons as well... subtle tints maybe signifying each networks native
   color..or just a gradation toward the tone of the newsletter".
   The navy is lifted straight off the homepage callout band, whose radial
   gradient runs rgb(51,88,122) -> rgb(27,51,70); #25445F sits between those
   two, so the button reads as the same material. White on it is 10.14:1.
   The reorder is flex `order` on the ul the theme already prints -- the menu
   keeps its real order in wp-admin, nothing is moved in the DOM, and the
   shortened "Newsletter" label is a demo-only wp_nav_menu_objects filter
   (functions/reskin-2026.php), NOT an edit to the live menu title.
   Every glyph colour below was contrast-checked against the bar's own #eee:
   the native brand colours are darkened a step (Facebook #1877F2 -> #1257B0,
   Bluesky #0285FF -> #0166CC) because the stock values land at 3.6:1 and
   3.1:1 -- over the 3:1 icon floor but with no headroom at 14px.
   ========================================================================== */
@media only screen and (min-width: 1024px) {
	body.reskin-header > header #top_bar ul.menu#menu-top-bar-right {
		display: flex;
		align-items: stretch;
		border-width: 0;
	}
	/* All the way right, past the social icons (Kalman). order:1 beats the
	   default 0 on every sibling, so it lands last without touching markup. */
	body.reskin-header > header #top_bar ul.menu li.mma-topbar-cta {
		order: 1;
		float: none;
		border-left: 0;
		margin-left: 10px;
	}
	body.reskin-header > header #top_bar ul.menu li.mma-topbar-cta > a {
		background: #25445F;
		color: #fff;
		font-weight: 500;
		letter-spacing: .04em;
		transition: background .15s ease;
	}
	body.reskin-header > header #top_bar ul.menu li.mma-topbar-cta > a:hover {
		background: #33587A;
		color: #fff;
	}
	body.reskin-header > header #top_bar ul.menu li.sl {
		float: none;
		transition: background .15s ease;
	}
}

/* ==========================================================================
   D header: full-screen search panel (#1231). Kalman 2026-08-31: "When
   clicking the Search icon, just give us a full screen pop up and have the
   cursor already active in the search field please."
   Markup is injected by the wp_footer script in functions/reskin-2026.php;
   the old slide-down strip is bypassed there, not deleted.
   Ground is the callout band's deep end (rgb(27,51,70) = #1B3346) so the
   panel belongs to the same family as the NEWSLETTER button and the navy
   dot. White on it is 13.06:1; the label/placeholder tint is 7.57:1 -- both
   AAA. Applies at every width: a full-screen field is at least as good on a
   phone as the header strip it replaces.
   ========================================================================== */
#mma-search-overlay[hidden] {
	display: none;
}
#mma-search-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: #1B3346;
	opacity: 0;
	transition: opacity .2s ease;
}
#mma-search-overlay.is-open {
	opacity: 1;
}
body.mma-search-open {
	overflow: hidden;
}
#mma-search-overlay .mma-search-inner {
	width: 100%;
	max-width: 760px;
	transform: translateY(10px);
	transition: transform .2s ease;
}
#mma-search-overlay.is-open .mma-search-inner {
	transform: translateY(0);
}
#mma-search-overlay .mma-search-label {
	display: block;
	margin-bottom: 18px;
	color: #B9C7D3;
	font-family: 'Lexend', sans-serif;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: .16em;
	text-transform: uppercase;
}
/* One rule under the whole field, input and submit sharing it — the field
   reads as a line to type on rather than a boxed form control. */
#mma-search-overlay .mma-search-field {
	display: flex;
	align-items: center;
	gap: 12px;
	border-bottom: 2px solid rgba(255, 255, 255, .35);
	transition: border-color .15s ease;
}
#mma-search-overlay .mma-search-field:focus-within {
	border-bottom-color: #fff;
}
#mma-search-overlay input[type="search"] {
	flex: 1 1 auto;
	width: 100%;
	padding: 10px 0 14px;
	border: 0;
	background: none;
	color: #fff;
	font-family: 'Lexend', sans-serif;
	font-size: 34px;
	line-height: 1.25;
	font-weight: 400;
	outline: none;
	-webkit-appearance: none;
	appearance: none;
}
#mma-search-overlay input[type="search"]::placeholder {
	color: #B9C7D3;
	opacity: 1;
}
#mma-search-overlay input[type="search"]::-webkit-search-cancel-button {
	-webkit-appearance: none;
}
#mma-search-overlay button[type="submit"] {
	flex: 0 0 auto;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: none;
	color: #fff;
	font-size: 22px;
	cursor: pointer;
	transition: background .15s ease;
}
#mma-search-overlay button[type="submit"]:hover,
#mma-search-overlay button[type="submit"]:focus-visible {
	background: rgba(255, 255, 255, .14);
}
#mma-search-overlay .mma-search-close {
	position: absolute;
	top: 22px;
	right: 24px;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: none;
	color: #fff;
	font-size: 36px;
	line-height: 1;
	cursor: pointer;
	transition: background .15s ease;
}
#mma-search-overlay .mma-search-close:hover,
#mma-search-overlay .mma-search-close:focus-visible {
	background: rgba(255, 255, 255, .14);
}
@media only screen and (max-width: 767px) {
	#mma-search-overlay input[type="search"] {
		font-size: 24px;
	}
}

