/**
 * Isolation layer for the unified header when it renders inside Salient.
 *
 * Loaded on corporate only (see usl_enqueue_unified_chrome_assets). Salient's
 * own header markup is no longer rendered, so this no longer has to hide
 * #header-outer / #header-space / #header-secondary-outer. What remains is:
 *
 *   1. design tokens the zee theme.json supplies on subsites but not here
 *   2. resets for Salient global rules that still leak into the header
 *   3. corporate/location variant toggling
 *   4. styling for the city/ZIP search form in its new home
 */

body.usl-unified-chrome {
	--wp--preset--font-family--bebas-neue: "BebasNeue-Regular", "Bebas Neue", sans-serif;
	--wp--preset--font-family--roboto: "Roboto", Helvetica, Arial, sans-serif;
	--wp--preset--color--accent: #203a6f;
	--wp--preset--color--extra: #ae262a;
	--wp--preset--color--link: #b33a43;
	--wp--preset--color--background-gray: #f2f2f2;
	--wp--preset--color--text-default: #333333;
	--wp--preset--color--text-blue: #1f396f;
	--wp--preset--color--text-on-dark: #ffffff;
	--wp--preset--color--white: #ffffff;
	--usl-header-blue: #203a6f;
	--usl-header-red: #ae262a;
	--usl-header-link: #b33a43;
	--usl-header-gray-bg: #f2f2f2;
}

/* Keep the admin bar above the header. */
body.usl-unified-chrome #wpadminbar {
	z-index: 1000000 !important;
}

body.usl-unified-chrome .usl-site-header {
	top: 0;
}

body.usl-unified-chrome.admin-bar:has(#wpadminbar) .usl-site-header {
	top: 32px;
}

@media screen and (max-width: 782px) {
	body.usl-unified-chrome.admin-bar:has(#wpadminbar) .usl-site-header {
		top: 46px;
	}
}

/* If WP left the admin-bar class but the bar is missing, drop the ghost gap. */
html.admin-bar:has(body.usl-unified-chrome):not(:has(#wpadminbar)) {
	margin-top: 0 !important;
}

/* ------------------------------------------------------------------ Lists (Salient: ul li { list-style: disc }) */

body.usl-unified-chrome .usl-site-header ul,
body.usl-unified-chrome .usl-site-header ol {
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

body.usl-unified-chrome .usl-site-header ul li,
body.usl-unified-chrome .usl-site-header ol li {
	list-style: none !important;
	list-style-position: outside !important;
	margin: 0 !important;
	padding-left: 0 !important;
}

/* No nav-list margin override is needed: the menu is left-aligned in both
 * variants, which the blanket `margin: 0` above already produces. */

/* ------------------------------------------------------------------ Typography
 * Salient's skin sets the body font on `a`; a blanket rule on `.usl-site-header a`
 * out-specifies `.usl-site-header__nav-link` (0,2,1 vs 0,2,0), so target the
 * classed elements directly.
 */

body.usl-unified-chrome .usl-site-header {
	font-family: "Roboto", Helvetica, Arial, sans-serif;
}

body.usl-unified-chrome .usl-site-header a.usl-site-header__nav-link,
body.usl-unified-chrome .usl-site-header button.usl-site-header__nav-link,
body.usl-unified-chrome .usl-site-header a.usl-site-header__proposal-link,
body.usl-unified-chrome .usl-site-header a.usl-site-header__change-location,
body.usl-unified-chrome .usl-site-header .usl-site-header__dropdown-item > a,
body.usl-unified-chrome .usl-site-header .usl-mobile-nav__link,
body.usl-unified-chrome .usl-site-header .usl-mobile-nav__sublink,
body.usl-unified-chrome .usl-site-header .usl-mobile-nav__accordion-toggle {
	font-family: "BebasNeue-Regular", "Bebas Neue", sans-serif !important;
}

body.usl-unified-chrome .usl-site-header a.usl-site-header__nav-link,
body.usl-unified-chrome .usl-site-header button.usl-site-header__nav-link {
	font-size: 23px !important;
	line-height: 1 !important;
	text-transform: uppercase !important;
	font-weight: 400 !important;
	letter-spacing: normal !important;
}

body.usl-unified-chrome .usl-site-header .usl-site-header__dropdown-item > a {
	font-size: 23px !important;
	line-height: 1.25 !important;
	text-transform: uppercase !important;
	font-weight: 400 !important;
	letter-spacing: normal !important;
}

/* Salient material skin adds paragraph padding that leaks into the header. */
body.usl-unified-chrome .usl-site-header p {
	margin: 0 !important;
	padding: 0 !important;
}

/* ------------------------------------------------------------------ Variant toggle
 * The corporate variant ships in the HTML so the page stays cacheable. When a
 * location cookie is present, the pre-paint snippet flags <html> before first
 * paint and site-chrome-hydrate.js then fills in the location data.
 */

.usl-site-header[data-usl-variant="corporate"] .usl-site-header__location-status {
	display: none;
}

.usl-site-header[data-usl-variant="location"] .usl-site-header__search {
	display: none;
}

/* Pre-paint: cookie present, hydration pending. */
html[data-usl-pending-variant="location"] .usl-site-header__search {
	display: none;
}

html[data-usl-pending-variant="location"] .usl-site-header[data-usl-variant="corporate"] .usl-site-header__location-status {
	display: flex;
}

/* ------------------------------------------------------------------ City / ZIP search
 * Reproduces the appearance it had in Salient's header, in its new position.
 */

body.usl-unified-chrome .usl-site-header__search {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin: 0;
	padding: 0 0 0 1.25rem;
}

body.usl-unified-chrome .usl-site-header__search input[type="text"] {
	width: 175px;
	height: 35px;
	padding: 10px;
	border: 1px solid #e2e2e2;
	border-radius: 4px;
	font-family: "Roboto", Helvetica, Arial, sans-serif;
	font-size: 14px;
	background-color: #ffffff;
	color: #555555;
}

body.usl-unified-chrome .usl-site-header__search input[type="submit"] {
	height: 35px;
	padding: 0 20px;
	border: 0;
	border-radius: 4px;
	font-family: "Roboto", Helvetica, Arial, sans-serif;
	font-size: 14px;
	font-weight: 700;
	background-color: #ad272a;
	color: #ffffff;
	cursor: pointer;
}

@media screen and (max-width: 999px) {
	body.usl-unified-chrome .usl-site-header__search {
		display: none;
	}
}
