/**
 * Tokens + Elementor header flush so the 2026 header CSS works under Hello.
 *
 * Change log:
 * 2026-09-27 Hide Theme Builder header in Elementor editor too (same as live).
 * 2026-09-27 Stronger hide for Theme Builder header duplicate (fallback if PHP
 *     skip hook does not run). Enqueued after elementor-frontend.
 * 2026-09-27 Social icons stay visible on mobile; size 22px. Side padding
 *     comes from theme.css --pw-page-gutter so Hello matches the 2026 header.
 * 2026-09-27 Added. Hello Elementor has no theme.json palette, and Elementor
 *     flexbox defaults add a 10px white padding around the Theme Builder header.
 * 2026-09-28 Site chrome uses 100vw breakout (Hello has no #page wrapper).
 * 2026-09-28 Use width 100% on document chrome (100vw + overflow-x clipped right gutter).
 * 2026-09-29 Elementor preview: hide TB header 12858 shortcode dump (E4 direct-child
 *     selector missed nested flexbox); force desktop mega menu in narrow editor iframe.
 * 2026-09-30 Elementor Floating Bar site alert stacks above toolkit header chrome.
 */
body.has-pwt-elementor-site-alert .e-floating-bars.has-vertical-position-top {
	z-index: 902;
}
body.has-pwt-elementor-site-alert.admin-bar .e-floating-bars.has-vertical-position-top {
	top: var(--wp-admin--admin-bar--height, 32px);
}
@media (max-width: 782px) {
	body.has-pwt-elementor-site-alert.admin-bar .e-floating-bars.has-vertical-position-top {
		top: var(--wp-admin--admin-bar--height, 46px);
	}
}
/* Hello boxes #page / .site; toolkit header + Elementor footer stay edge-to-edge. */
body.hello-elementor,
body.hello-pennichuck #page,
body.hello-elementor,
body.hello-pennichuck .site,
body.hello-elementor,
body.hello-pennichuck .site-content {
	width: 100% !important;
	max-width: none !important;
	margin-inline: 0 !important;
	padding-inline: 0 !important;
	box-sizing: border-box;
}
body.hello-elementor,
body.hello-pennichuck .pw-full-bleed,
body.hello-elementor,
body.hello-pennichuck > .pw-alert,
body.hello-elementor,
body.hello-pennichuck > .pw-topbar,
body.hello-elementor,
body.hello-pennichuck > .pw-header,
body.hello-elementor,
body.hello-pennichuck .pw-page-header--branded,
body.hello-elementor,
body.hello-pennichuck footer.elementor-location-footer {
	box-sizing: border-box !important;
	width: 100% !important;
	max-width: 100% !important;
	margin-inline: 0 !important;
}
/* Homepage hero wave still uses theme.css 100vw rules on .pwt-elementor-home only. */
body.pwt-elementor-home.hello-pennichuck .pw-full-bleed,
body.pwt-elementor-home.hello-elementor > .pw-alert,
body.pwt-elementor-home.hello-elementor > .pw-topbar,
body.pwt-elementor-home.hello-elementor > .pw-header,
body.pwt-elementor-home.hello-pennichuck footer.elementor-location-footer {
	width: 100vw !important;
	max-width: 100vw !important;
	margin-inline: calc(50% - 50vw) !important;
}

:root {
	--wp--preset--color--primary: #00518f;
	--wp--preset--color--primary-dark: #003a66;
	--wp--preset--color--navy: #1f3181;
	--wp--preset--color--sky: #00a5df;
	--wp--preset--color--accent: #ffd23e;
	--wp--preset--color--tint: #eaf8fe;
	--wp--preset--color--tint-2: #d3e9f5;
	--wp--preset--color--surface: #f4f7fa;
	--wp--preset--color--ink: #1d2a35;
	--wp--preset--color--muted: #5c6670;
	--wp--preset--color--alert: #b3261e;
	--wp--preset--color--white: #ffffff;
	--wp--preset--color--success: #2e7d32;
	--wp--preset--font-family--body: "Source Sans 3", "Source Sans Pro", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--wp--preset--spacing--30: 1.5rem;
	--wp--style--global--wide-size: 1240px;
}

/* Live site: hide Theme Builder header when PHP chrome is canonical. */
body:not(.pwt-elementor-preview):not(.pwt-elementor-theme-header) header.elementor-location-header,
body:not(.pwt-elementor-preview):not(.pwt-elementor-theme-header) .elementor.elementor-location-header,
body:not(.pwt-elementor-preview):not(.pwt-elementor-theme-header) .elementor-location-header,
body:not(.pwt-elementor-preview):not(.pwt-elementor-theme-header) .site-header {
	display: none !important;
	visibility: hidden !important;
	height: 0 !important;
	max-height: 0 !important;
	overflow: hidden !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
}

/* Page editor preview: same as live — TB header 12858 is skipped in PHP; no duplicate menu dump. */

/* Editor iframe is often <1280px; keep the toolkit PHP mega menu in desktop layout. */
body.pwt-elementor-preview .pw-header .pw-mega__burger {
	display: none !important;
}
body.pwt-elementor-preview .pw-header .pw-mega__list {
	display: flex !important;
	flex-direction: row !important;
	flex-wrap: wrap !important;
	margin-top: 0 !important;
	border-top: 0 !important;
}
body.pwt-elementor-preview .pw-header .pw-mega__panel[hidden] {
	display: none !important;
}
body.pwt-elementor-preview .pw-header .pw-mega__panel:not([hidden]) {
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
}
body.pwt-elementor-preview .pw-header .pw-mega__toggle {
	width: auto;
	border-radius: 999px;
	padding: 0.7rem 0.8rem;
	font-size: 1rem;
}
body.pwt-elementor-preview .pw-header .pw-mega__toggle::after {
	display: block;
}
body.pwt-elementor-preview .pw-header .pw-header__nav {
	order: unset;
	flex-basis: auto;
}

.admin-bar .elementor-location-header { top: 32px; }
@media (max-width: 782px) {
	.admin-bar .elementor-location-header { top: 46px; }
}

.pw-topbar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
	padding-top: 0.45rem;
	padding-bottom: 0.45rem;
}

.pw-topbar__right {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 1.25rem;
}

.pw-topbar__social {
	display: flex;
	align-items: center;
	gap: 0.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.pw-topbar__social a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	padding: 0.4rem;
}

.pw-header__search {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
}

.pw-header__search-input {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	border: 0;
}

.pw-header__search:focus-within .pw-header__search-input {
	position: static;
	width: 12rem;
	height: auto;
	margin: 0;
	clip: auto;
	overflow: visible;
	padding: 0.45rem 0.75rem;
	border: 2px solid var(--wp--preset--color--tint-2);
	border-radius: 999px;
	font: inherit;
}

/**
 * @deprecated 2026-09-27
 * Replaced by: icons remain visible; size from theme.css
 * Reason: client asked for social icons on mobile
 * Remove after: 2026-11-27
 */
/* @media (max-width: 781px) {
	.pw-topbar .pw-topbar__social { display: none; }
} */
