/*
 * TEP 2026: site header (Themer 6137) and footer (Themer 6138) polish.
 * Figma: header set 842:3483 (default 787:33, hamburger 2605:3961), footer 787:99 / stacked 852:3448.
 * Enqueued by classes/class-tep-home.php. Values come from the "TEP Group 2026" tokens (--ds-*).
 * Transparent-over-hero header (Figma 842:3484, used on every page): Themer header settings
 * Overlay = Yes, Background = Transparent; page offset at the end of this file.
 */

/* ---------- Utility bar (Figma: 66px tall, 36px region toggle) ---------- */
.tep-utility-bar > .fl-row-content-wrap {
	padding-top: 15px;
	padding-bottom: 15px;
}

.tep-utility-bar .tep-region .tep-region__opt {
	padding: 9px 14px;
}

/* US/CA slider (js/tep-region.js adds .is-slider; review feedback 2026-11-02 "make this an actual
   slider"). Both halves get the same width and a white thumb slides between them; the option
   backgrounds from the module CSS are dropped so the thumb is the only white shape. */
.tep-utility-bar .tep-region.is-slider {
	position: relative;
	isolation: isolate;
	cursor: pointer;
}

.tep-utility-bar .tep-region.is-slider .tep-region__opt {
	position: relative;
	z-index: 1;
	min-width: 3.4em;
	text-align: center;
	background: transparent;
	transition: color var(--ds-transition-base);
}

.tep-utility-bar .tep-region.is-slider::before {
	content: "";
	position: absolute;
	z-index: 0;
	top: 2px;
	bottom: 2px;
	left: 2px;
	width: calc(50% - 2px);
	border-radius: 25px;
	background: var(--ds-color-surface);
	transition: transform 280ms ease;
}

/* Hover/focus on CA: the thumb leans toward it, so the control reads as a switch */
.tep-utility-bar .tep-region.is-slider:hover::before,
.tep-utility-bar .tep-region.is-slider:focus-within::before {
	transform: translateX(8%);
}

.tep-utility-bar .tep-region.is-slider.is-switching::before {
	transform: translateX(100%);
}

.tep-utility-bar .tep-region.is-slider a.tep-region__opt:hover,
.tep-utility-bar .tep-region.is-slider a.tep-region__opt:focus-visible {
	background: transparent;
}

/* No-bar look (BugHerd 7, 2026-11-12/13): the utility bar is clear over the hero and white once scrolled, and the
   US/CA toggle is a solid black pill (the grey track blended into the light bar). Overrides the track and text
   colours in the module's own Custom CSS (node 53k9174hmfws); the white thumb and the dark-red active option are
   unchanged. This is what the site falls back to when the gradient bar below is switched off. */
html body .fl-node-53k9174hmfws .tep-region {
	border-color: var(--ds-color-black);
	background: var(--ds-color-black);
}

html body .fl-node-53k9174hmfws .tep-region a.tep-region__opt,
html body .fl-node-53k9174hmfws .tep-region a.tep-region__opt:hover,
html body .fl-node-53k9174hmfws .tep-region a.tep-region__opt:focus-visible {
	color: var(--ds-color-surface);
}

/* Gradient utility bar (BugHerd 111; trial 2026-11-13, the client approved it 2026-11-14 and asked for it lighter).
   Only while <body> has .tep-utility-gradient, which TEPHeader adds unless the option tep_utility_bar_gradient is
   "0": `wp option update tep_utility_bar_gradient 0` rolls back to the no-bar look above, `… 1` brings it back.
   Pale blue on the left, through the light and brand blues, to a deep brand blue under the search and toggle, so
   their white stays readable (the 2026-11-13 trial ran to near-black from a third of the way in). It stays painted
   over the hero too (Themer's Transparent header would otherwise clear it until the visitor scrolls). The search
   icon and toggle are white on it: white outline, transparent track, white "CA", white thumb behind the dark-red
   "US". Overrides the row's White background, the search icon's Black and the black pill above (header 6137 nodes
   zvmyespt3gbw, recpf59qu64s, 53k9174hmfws). */
html body.tep-utility-gradient .fl-node-zvmyespt3gbw.tep-utility-bar > .fl-row-content-wrap {
	background: linear-gradient(90deg, color-mix(in srgb, var(--ds-color-secondary-light) 50%, var(--ds-color-surface)) 0%, var(--ds-color-secondary-light) 20%, var(--ds-color-secondary) 52%, color-mix(in srgb, var(--ds-color-secondary) 55%, var(--ds-color-black)) 100%) !important;
}

html body.tep-utility-gradient .fl-node-recpf59qu64s .fl-button,
html body.tep-utility-gradient .fl-node-recpf59qu64s .fl-button i,
html body.tep-utility-gradient .fl-node-recpf59qu64s .fl-button-icon,
html body.tep-utility-gradient .fl-node-recpf59qu64s .fl-button-icon::before {
	color: var(--ds-color-surface) !important;
}

html body.tep-utility-gradient .fl-node-53k9174hmfws .tep-region {
	border-color: var(--ds-color-surface);
	background: transparent;
}

html body.tep-utility-gradient .fl-node-53k9174hmfws .tep-region a.tep-region__opt:focus-visible {
	outline-color: var(--ds-color-surface);
}

/* tep-a11y.css forces the active option to dark red with !important (contrast fix); while the thumb
   moves to CA, US turns white (it is then on the black track or the gradient band) and CA takes the red. */
html body .fl-node-53k9174hmfws .tep-region.is-switching .tep-region__opt.is-active {
	color: var(--ds-color-surface) !important;
}

html body .fl-node-53k9174hmfws .tep-region.is-switching a.tep-region__opt {
	color: var(--ds-color-primary-dark) !important;
}

@media (prefers-reduced-motion: reduce) {
	.tep-utility-bar .tep-region.is-slider::before {
		transition: none;
	}
}

/* ---------- Main bar ---------- */
/* Figma buttons are 47px tall (text + 12.5px padding + border) */
.tep-main-bar .fl-button-wrap a.fl-button {
	padding-top: 12.5px;
	padding-bottom: 12.5px;
}

/* Red nav text is 16px, so hover/open states use the dark red (accessibility rule, decisions.md) */
.tep-main-bar .fl-menu .menu a:hover,
.tep-main-bar .fl-menu .menu a:focus-visible,
.tep-main-bar .fl-menu .menu li.fl-active > a,
.tep-main-bar .fl-menu .menu li.fl-active > .fl-has-submenu-container > a,
.tep-main-bar .fl-menu .menu li:hover > .fl-has-submenu-container > a {
	color: var(--ds-color-primary-dark) !important;
}

/* "Contact Us" menu item (class tep-menu-mobile-only) only shows when the header button is hidden */
.tep-main-bar .fl-menu .menu > li.tep-menu-mobile-only {
	display: none;
}

/* ---------- Mega menus (Figma 2754:23420-23422; classes/class-tep-header.php) ----------
 * 700px white panel: the "TEP – Mega Menu Intro" saved row on the left, a light-blue divider,
 * then the item's heading and its links. Desktop only; the hamburger keeps the plain list. */
.tep-main-bar .fl-menu .menu li.tep-mega__intro,
.tep-main-bar .fl-menu .menu li.tep-mega__heading {
	display: none;
}

@media (min-width: 993px) {
	.tep-main-bar .fl-menu .menu > li.tep-mega > ul.sub-menu {
		left: 50%;
		width: 700px;
		min-width: 0;
		padding: 25px;
		border-radius: var(--ds-radius-sm);
		background: var(--ds-color-surface);
		box-shadow: var(--ds-shadow-card);
		transform: translateX(-50%);
	}

	/* :focus-within opens the panel for keyboard users: with Submenu Icon "none" (no chevrons, as in
	 * Figma) BB has no toggle button, and Enter on a parent link with a URL just follows the link. */
	.tep-main-bar .fl-menu .menu > li.tep-mega.fl-has-submenu:hover > ul.sub-menu,
	.tep-main-bar .fl-menu .menu > li.tep-mega.fl-has-submenu.focus > ul.sub-menu,
	.tep-main-bar .fl-menu .menu > li.tep-mega.fl-has-submenu:focus-within > ul.sub-menu {
		display: grid !important;
		grid-template-columns: 1fr 1fr;
		align-content: start;
		visibility: visible;
		opacity: 1;
	}

	.tep-main-bar .fl-menu .menu > li.tep-mega > ul.sub-menu > li {
		grid-column: 2;
		padding-left: 50px;
		border: 0;
	}

	.tep-main-bar .fl-menu .menu > li.tep-mega > ul.sub-menu > li.tep-mega__intro {
		display: block;
		grid-column: 1;
		grid-row: 1 / span 10;
		padding: 0 50px 0 0;
		border-right: 1px solid var(--ds-color-secondary-light);
	}

	.tep-main-bar .fl-menu .menu > li.tep-mega > ul.sub-menu > li.tep-mega__heading {
		display: block;
		padding-bottom: 15px;
	}

	.tep-mega__heading-text {
		display: block;
		font-family: var(--ds-font-heading);
		font-size: var(--ds-text-lg);
		font-weight: var(--ds-weight-semibold);
		letter-spacing: var(--ds-letter-caps);
		line-height: 1.2;
		text-transform: uppercase;
		color: var(--ds-color-black);
	}

	.tep-main-bar .fl-menu .menu > li.tep-mega > ul.sub-menu > li > a {
		padding: 12px 0;
		color: var(--ds-color-black);
	}

	/* Intro saved row (6637): Poppins 18 intro text, then the .tep-btn button (tep-services.css) */
	.tep-mega__intro .tep-mega-intro .fl-row-content-wrap {
		padding: 0;
	}

	.tep-mega__intro .tep-mega-intro__text,
	.tep-mega__intro .tep-mega-intro__text p {
		margin: 0;
		font-family: var(--ds-font-heading);
		font-size: var(--ds-text-base);
		font-weight: var(--ds-weight-regular);
		line-height: 1.5;
		text-transform: none;
		letter-spacing: 0;
		color: var(--ds-color-text);
	}

	.tep-mega__intro .tep-mega-intro__btn {
		margin-top: 33px;
	}

	/* The Menu module rounds only the top corners of the first dropdown link to 1px
	   (.fl-node-… .sub-menu li:first-child a); the intro row is that first item, so its button
	   came out flat on top. Keep the button's own radius on all four corners. */
	.tep-main-bar .fl-menu .sub-menu li.tep-mega__intro a.fl-button {
		border-radius: var(--ds-radius-sm);
	}

	/* Figma 2754:23421: 16px label with ~16px side padding (button ~202 x 47). The Menu module's
	   dropdown-link padding had zeroed the sides and the button inherited the 18px button size,
	   so the label ran edge to edge (review feedback 2026-11-02). */
	.tep-main-bar .fl-menu .sub-menu li.tep-mega__intro a.fl-button {
		padding: 12.5px 16px;
	}

	.tep-main-bar .fl-menu .sub-menu li.tep-mega__intro a.fl-button,
	.tep-main-bar .fl-menu .sub-menu li.tep-mega__intro a.fl-button .fl-button-text {
		font-size: var(--ds-text-sm);
		line-height: 1.375;
	}
}

/* ---------- Hamburger (≤992px; no Figma design for the open panel) ---------- */
@media (max-width: 992px) {
	.tep-main-bar .fl-menu .fl-menu-mobile-toggle {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-width: 44px;
		min-height: 44px;
	}

	.tep-main-bar .fl-menu .fl-menu-mobile-toggle .svg-container,
	.tep-main-bar .fl-menu .fl-menu-mobile-toggle svg {
		width: 28px !important;
		height: 24px !important;
	}

	/* Full-screen menu (BugHerd 74, 2026-11-09: "take over the screen … and have the sub-pages visible"; no Figma design,
	   layout left to us). Themer header 6137's Menu module uses BB's own Flyout Overlay (from the right, 1000px wide:
	   scripts/header-mobile-menu-20261109.php); BB slides it in with an inline `right` offset and adds the close
	   button. Here it is held to the screen width and laid out as: TEP logo and close button on top, each section's
	   name with all of its sub-pages listed under it (no tap to expand), and Contact Us as a red button at the end. */
	.tep-main-bar .fl-menu .fl-menu-mobile-flyout {
		width: 100vw !important;
		max-width: 100vw;
		padding: 0 var(--ds-space-gutter) 40px;
		box-shadow: none;
	}

	/* The TEP logo where the header's logo sits, so the panel reads as the site's own screen */
	.tep-main-bar .fl-menu .fl-menu-mobile-flyout::before {
		content: "";
		display: block;
		width: 150px;
		height: 76px;
		margin: 25px 0 15px;
		background: url("../../../uploads/2026/10/tep-group-logo-768x390.png") left center / contain no-repeat;
	}

	.tep-main-bar .fl-menu .fl-menu-mobile-flyout .fl-menu-mobile-close {
		position: absolute;
		top: 40px;
		right: var(--ds-space-gutter);
		width: 44px;
		height: 44px;
		padding: 0;
		border: 0;
		background: transparent;
		font-size: 26px;
		color: var(--ds-color-black);
		cursor: pointer;
	}

	.tep-main-bar .fl-menu .fl-menu-mobile-flyout .fl-menu-mobile-close:focus-visible {
		outline: 3px solid var(--ds-color-primary);
		outline-offset: 2px;
	}

	.tep-main-bar .fl-menu .fl-menu-mobile-flyout .menu {
		position: static !important;
		margin: 0;
		padding: 0;
		border: 0;
		box-shadow: none;
	}

	/* One block per section, a hairline between them */
	.tep-main-bar .fl-menu .fl-menu-mobile-flyout .menu > li {
		float: none;
		padding: 20px 0;
		border: 0;
		border-bottom: 1px solid var(--ds-color-field);
	}

	.tep-main-bar .fl-menu .fl-menu-mobile-flyout .menu > li > a,
	.tep-main-bar .fl-menu .fl-menu-mobile-flyout .menu > li > .fl-has-submenu-container > a {
		padding: 0 !important;
		font-family: var(--ds-font-heading);
		font-size: var(--ds-text-lg);
		font-weight: var(--ds-weight-semibold);
		letter-spacing: var(--ds-letter-caps);
		line-height: var(--ds-line-snug);
		text-transform: uppercase;
		color: var(--ds-color-black);
	}

	/* Sub-pages always shown; BB's expand arrows are not needed */
	.tep-main-bar .fl-menu .fl-menu-mobile-flyout .fl-menu-toggle {
		display: none !important;
	}

	.tep-main-bar .fl-menu .fl-menu-mobile-flyout .sub-menu {
		display: block !important;
		position: static !important;
		visibility: visible !important;
		opacity: 1 !important;
		width: auto !important;
		margin: 0;
		padding: 10px 0 0;
		border: 0;
		background: transparent;
		box-shadow: none;
	}

	.tep-main-bar .fl-menu .fl-menu-mobile-flyout .sub-menu > li > a {
		padding: 10px 0 !important;
		font-family: var(--ds-font-body);
		font-size: var(--ds-text-base);
		font-weight: var(--ds-weight-regular);
		letter-spacing: normal;
		line-height: var(--ds-line-snug);
		text-transform: none;
		color: var(--ds-color-text);
	}

	.tep-main-bar .fl-menu .fl-menu-mobile-flyout .menu a:hover,
	.tep-main-bar .fl-menu .fl-menu-mobile-flyout .menu .current-menu-item > a {
		color: var(--ds-color-primary-dark);
	}

	/* BB moves focus to the first link when the menu opens: an outline, not the "current page" red, so nothing
	   looks selected that isn't */
	.tep-main-bar .fl-menu .fl-menu-mobile-flyout .menu a:focus-visible {
		outline: 2px solid var(--ds-color-primary);
		outline-offset: 3px;
	}

	/* Contact Us (menu item class tep-menu-mobile-only) as the panel's closing button */
	.tep-main-bar .fl-menu .fl-menu-mobile-flyout .menu > li.tep-menu-mobile-only {
		display: block;
		padding: 30px 0 0;
		border-bottom: 0;
	}

	.tep-main-bar .fl-menu .fl-menu-mobile-flyout .menu > li.tep-menu-mobile-only > a {
		display: block;
		padding: 15px 20px !important;
		border-radius: var(--ds-radius-sm);
		background: var(--ds-color-primary);
		text-align: center;
		color: var(--ds-color-surface);
	}

	/* The page behind the open menu doesn't scroll */
	html:has(.tep-main-bar .fl-menu-mobile-toggle.fl-active) {
		overflow: hidden;
	}
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
	.tep-main-bar .fl-menu .menu > li.tep-menu-mobile-only {
		display: block;
	}

	.tep-main-bar .fl-menu .menu > li.tep-menu-mobile-only > a {
		color: var(--ds-color-primary-dark);
	}

	/* Mobile header (Figma 3302:12139): 150px logo in a 25px-padded main bar; the utility bar keeps its 15px padding */
	.tep-main-bar > .fl-row-content-wrap {
		padding-top: 25px !important;
		padding-bottom: 25px !important;
	}

	.tep-main-bar .fl-module-photo .fl-photo-content,
	.tep-main-bar .fl-module-photo img {
		width: 150px;
		max-width: none;
	}

	.tep-main-bar .fl-module-photo > .fl-module-content {
		margin-top: 0;
		margin-bottom: 0;
	}
}

/* ---------- Footer on phones (Figma mobile footer 3302:12479) ----------
 * Themer footer 6138 rows: 2a05ewpy1r4z Partner With Us band, d347migt5spw logo + links, sd2tg3afhmix black bar.
 * The rows have no classes of their own, so their node ids are the hooks (as in TEPArchiveTemplates::short_footer()). */
@media (max-width: 768px) {
	.fl-node-2a05ewpy1r4z > .fl-row-content-wrap {
		padding-top: 50px !important;
		padding-bottom: 50px !important;
	}

	.fl-node-2a05ewpy1r4z .fl-col + .fl-col {
		margin-top: 50px;
	}

	/* Logo → socials 35px; Quick Links and Contact Info stacked full width, 50px apart */
	.fl-node-d347migt5spw .fl-col {
		width: 100% !important;
		float: none;
	}

	.fl-node-d347migt5spw .fl-col + .fl-col {
		margin-top: 50px;
	}

	.fl-node-d347migt5spw .fl-module-photo > .fl-module-content {
		margin-bottom: 35px;
	}

	.fl-node-d347migt5spw .fl-module-photo img {
		width: 200px;
	}

	.fl-node-d347migt5spw .fl-module-heading > .fl-module-content {
		margin-bottom: 25px;
	}

	/* Black bar: left-aligned lines 25px apart */
	.fl-node-sd2tg3afhmix .fl-col-group {
		display: flex;
		flex-direction: column;
		gap: 25px;
	}

	.fl-node-sd2tg3afhmix .fl-col {
		width: 100% !important;
	}

	.fl-node-sd2tg3afhmix .fl-rich-text,
	.fl-node-sd2tg3afhmix .fl-rich-text p {
		text-align: left !important;
	}

	.fl-node-sd2tg3afhmix .fl-rich-text p {
		justify-content: flex-start !important;
	}
}

/* ---------- "Learn more" link: Figma's long red arrow everywhere ----------
 * The design system's .bb-link-arrow uses a "\2192" text arrow; Figma draws a 22px line arrow.
 * `body` raises specificity above the design-system base CSS. */

/* Figma's arrow (Primary Nav Label 2625:9899): a 20px line with a 2px stroke and a line-arrow end, drawn in a
 * 22 × 14.72px box (inset -7.36px top/bottom, -5% left/right). Round caps and join: the shaft runs x 1 → 21
 * at y = 7.36 and its caps reach 0 and 22; the 45° head arms end at y = 1 and 13.72, their caps reach 0 and 14.72.
 * Shared by every "Learn more" arrow (this file, tep-home.css, tep-services.css); set 2026-11-09 to
 * Figma's exact size after review (the previous 22 × 14 arrow's head was ~2px shorter). */
:root {
	--tep-arrow-red: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='14.72' viewBox='0 0 22 14.72'%3E%3Cpath d='M1 7.36h20M14.64 1l6.36 6.36-6.36 6.36' fill='none' stroke='%23E32428' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	--tep-arrow-white: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='14.72' viewBox='0 0 22 14.72'%3E%3Cpath d='M1 7.36h20M14.64 1l6.36 6.36-6.36 6.36' fill='none' stroke='%23FFFFFF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

body .bb-link-arrow {
	gap: 10px;
}

/* .fl-ds-page variant: inside Posts-module cards the design system's (0,2,1) "\2192" rule beat (0,1,2),
   so the text arrow showed on top of this line arrow (double arrow on event and news cards). */
body .bb-link-arrow::after,
body .fl-ds-page .bb-link-arrow::after {
	content: "";
	width: 22px;
	height: 14.72px;
	background: var(--tep-arrow-red) center / contain no-repeat;
}

/* Figma's "Learn more" hover (2625:9452) only moves the arrow 5px; the text keeps the design system's black.
 * `.fl-ds-page` matches the design system's own (0,3,1) hover rule so this one wins. */
body .bb-link-arrow:hover,
body .bb-link-arrow:focus-visible,
body .fl-ds-page .bb-link-arrow:hover,
body .fl-ds-page .bb-link-arrow:focus-visible {
	color: var(--ds-color-black);
	text-decoration: none;
}

body .bb-link-arrow:hover::after,
body .bb-link-arrow:focus-visible::after,
body .fl-ds-page .bb-link-arrow:hover::after,
body .fl-ds-page .bb-link-arrow:focus-visible::after {
	transform: translateX(5px);
}

/* ---------- Gravity Forms (Figma 787:99 footer "Partner With Us", 807:6129 Contact) ----------
 * Forms 11 (Partner With Us 2026) and 12 (Contact 2026), CSS class tep-gform, placed with the PowerPack
 * Gravity Form module. Grey borderless fields, Arial labels with a red asterisk, red Poppins submit button. */
.fl-module-pp-gravity-form .tep-gform_wrapper.gravity-theme .gform_required_legend {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap; /* kept for screen readers; not in Figma */
}

.fl-module-pp-gravity-form .tep-gform_wrapper.gravity-theme .gform_fields {
	column-gap: 35px;
	row-gap: 25px;
}

.fl-module-pp-gravity-form .tep-gform_wrapper.gravity-theme .gfield_label {
	margin-bottom: 12px;
	padding: 0;
	font-family: var(--ds-font-body);
	font-size: var(--ds-text-base);
	font-weight: var(--ds-weight-regular);
	line-height: 1.2;
	color: var(--ds-color-black);
}

.fl-module-pp-gravity-form .tep-gform_wrapper.gravity-theme .gfield_required {
	margin-left: 0;
	font-size: inherit; /* Figma: asterisk the size of the label */
	color: var(--ds-color-primary-dark); /* red text under 24px (A11Y-10) */
}

.fl-module-pp-gravity-form .tep-gform_wrapper.gravity-theme input:not([type="submit"]):not([type="button"]):not([type="hidden"]),
.fl-module-pp-gravity-form .tep-gform_wrapper.gravity-theme select,
.fl-module-pp-gravity-form .tep-gform_wrapper.gravity-theme textarea {
	width: 100%;
	min-height: 36px;
	padding: 8px 15px;
	border: 0;
	border-radius: var(--ds-radius-sm);
	background-color: var(--ds-color-field);
	box-shadow: none;
	font-family: var(--ds-font-body);
	font-size: 13px;
	line-height: 1.4;
	color: var(--ds-color-text);
}

.fl-module-pp-gravity-form .tep-gform_wrapper.gravity-theme textarea {
	height: 88px;
	min-height: 88px;
	padding-top: 12px;
	resize: vertical;
}

.fl-module-pp-gravity-form .tep-gform_wrapper.gravity-theme select {
	appearance: none;
	padding-right: 40px;
	background: var(--ds-color-field) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23595959' stroke-width='1.5'/%3E%3C/svg%3E") right 15px center / 12px 8px no-repeat;
	color: #595959; /* placeholder grey (A11Y-7, tep-a11y.css) until a service is chosen */
}

.fl-module-pp-gravity-form .tep-gform_wrapper.gravity-theme select:has(option:checked:not([value=""])) {
	color: var(--ds-color-text);
}

.fl-module-pp-gravity-form .tep-gform_wrapper.gravity-theme .gform_footer {
	margin: 25px 0 0;
	padding: 0;
}

body .fl-module-pp-gravity-form .tep-gform_wrapper.gravity-theme .gform_footer .gform_button {
	min-height: 47px; /* Figma button height */
	padding: 12.5px 15px;
	border: 0;
	border-radius: var(--ds-radius-sm);
	background: var(--ds-color-primary);
	font-family: var(--ds-font-heading);
	font-size: var(--ds-text-base);
	font-weight: var(--ds-weight-semibold);
	letter-spacing: var(--ds-letter-caps);
	line-height: 1.2;
	text-transform: uppercase;
	color: var(--ds-color-surface);
	cursor: pointer;
}

body .fl-module-pp-gravity-form .tep-gform_wrapper.gravity-theme .gform_footer .gform_button:hover,
body .fl-module-pp-gravity-form .tep-gform_wrapper.gravity-theme .gform_footer .gform_button:focus-visible {
	background: var(--ds-color-secondary); /* Figma button hover (787:63 Variant4) */
}

/* Validation: dark red message and a red edge on the field (no Figma state; kept quiet) */
.fl-module-pp-gravity-form .tep-gform_wrapper.gravity-theme .gfield_error .gfield_label,
.fl-module-pp-gravity-form .tep-gform_wrapper.gravity-theme .gfield_validation_message,
.fl-module-pp-gravity-form .tep-gform_wrapper.gravity-theme .gform_validation_errors h2 {
	color: var(--ds-color-primary-dark);
}

.fl-module-pp-gravity-form .tep-gform_wrapper.gravity-theme .gfield_validation_message {
	margin-top: 6px;
	padding: 0;
	border: 0;
	background: none;
	font-size: var(--ds-text-sm);
}

.fl-module-pp-gravity-form .tep-gform_wrapper.gravity-theme .gfield_error input,
.fl-module-pp-gravity-form .tep-gform_wrapper.gravity-theme .gfield_error select,
.fl-module-pp-gravity-form .tep-gform_wrapper.gravity-theme .gfield_error textarea {
	box-shadow: inset 0 0 0 1px var(--ds-color-primary-dark);
}

@media (max-width: 640px) {
	/* Gravity Forms stacks fields full width at ≤640px; the 12-track grid's 11 × 35px gaps (385px) would still overflow a 320px phone */
	.fl-module-pp-gravity-form .tep-gform_wrapper.gravity-theme .gform_fields {
		column-gap: 0;
	}
}

@media (max-width: 768px) {
	/* 16px stops iOS zooming into a field on focus */
	.fl-module-pp-gravity-form .tep-gform_wrapper.gravity-theme input:not([type="submit"]):not([type="button"]):not([type="hidden"]),
	.fl-module-pp-gravity-form .tep-gform_wrapper.gravity-theme select,
	.fl-module-pp-gravity-form .tep-gform_wrapper.gravity-theme textarea {
		font-size: 16px;
	}
}

/* ---------- Hover states (Figma component library 205:74) ----------
 * Project cards (2645:4770, 2649:4903): on hover the photo sits under a near-opaque blue-to-black wash.
 * Used by .tep-projcard (tep-home.css) and .tep-ocard (tep-services.css). */
:root {
	--tep-card-hover-overlay: linear-gradient(180deg, color-mix(in srgb, var(--ds-color-secondary) 85%, transparent) 0%, rgba(0, 0, 0, 0.95) 100%);
}

/* ---------- Header overlay: page offset ----------
 * With Themer's Overlay on, the header sits on top of the page, so every page's content starts under it.
 * Only applies while Overlay is on, and not in the BB editor (Themer hides the overlay header there).
 * --tep-header-h is the measured header height (utility bar + main bar); update it if the header's padding changes. */
body:not(.fl-builder-edit):has(> .fl-page > [data-type="header"][data-overlay="1"]) {
	--tep-header-h: 192px;
}

@media (max-width: 992px) {
	body:not(.fl-builder-edit):has(> .fl-page > [data-type="header"][data-overlay="1"]) {
		--tep-header-h: 182px;
	}
}

@media (max-width: 768px) {
	body:not(.fl-builder-edit):has(> .fl-page > [data-type="header"][data-overlay="1"]) {
		--tep-header-h: 190px; /* 64px utility bar + 126px main bar (Figma 3302:12139: 189px) */
	}
}

/* ---------- Desktop-only line break (2026-11-09, BugHerd 48) ----------
 * Editors can add <br class="tep-br-desktop"> in a Rich Text module to choose where a short line breaks on wider
 * screens; phones ignore it and let the text wrap naturally. Leave a space before the <br> so the words stay
 * apart when it's hidden. First used in the Land Development & Management hero lead (page 6265). */
@media (max-width: 768px) {
	br.tep-br-desktop {
		display: none;
	}
}

/* ---------- Phone rhythm (Figma page "mobile" 878:3305) ----------
 * The mobile frames put 115px between sections (100px on the post, team and project singles) and a 24px side
 * gutter. 2026-11-09 (BugHerd 83 "even out spacing on mobile for ALL pages", with 75, 82 and 84): the designer
 * found 115px too much on real phones, so sections are now 80px apart everywhere and the offsets below shrink
 * to match. BB's per-row mobile paddings (16–20px sides, 32–64px top/bottom) are overridden here in one place:
 * each content row gets half the section gap top and bottom; rows that continue the section above (intro row +
 * card grid, hero + logo strip, …) are listed below with a 40px internal gap instead. */
@media (max-width: 768px) {
	.fl-builder-content .fl-row > .fl-row-content-wrap {
		padding-right: var(--ds-space-gutter) !important;
		padding-left: var(--ds-space-gutter) !important;
	}

	#fl-main-content .fl-builder-content > .fl-row > .fl-row-content-wrap {
		padding-top: 40px;
		padding-bottom: 40px;
	}

	body.single #fl-main-content .fl-builder-content > .fl-row > .fl-row-content-wrap {
		padding-top: 40px;
		padding-bottom: 40px;
	}

	/* Wash and archive heroes keep Figma's 50px hero padding under the intro before the section gap */
	#fl-main-content .fl-builder-content > .fl-row.tep-wash-hero > .fl-row-content-wrap,
	#fl-main-content .fl-builder-content > .fl-row.tep-archive-hero > .fl-row-content-wrap {
		padding-bottom: 90px; /* Figma's 50px hero padding + half the 80px section gap */
	}

	/* Continuations: the row above loses its bottom padding, the row gets the 50px internal gap */
	#fl-main-content .fl-row.fl-node-ng7xclw94qmj > .fl-row-content-wrap, /* Home hero → logo strip */
	#fl-main-content .fl-row.fl-node-xg8vh19lq7tz > .fl-row-content-wrap, /* Services hero → logo strip */
	#fl-main-content .fl-row.fl-node-j7opl3nrs9g0 > .fl-row-content-wrap, /* Industries hero → logo strip */
	#fl-main-content .fl-row.fl-node-0rn621e743yb > .fl-row-content-wrap, /* Home industries intro → cards */
	#fl-main-content .fl-row.fl-node-19qkca8rpx5e > .fl-row-content-wrap { /* Contact "Contact Information" → its text (BugHerd 84) */
		padding-bottom: 0;
	}

	/* About: the three value cards belong to the "Who We Are" section (Figma 3301:6598), so 40px under its text, not the
	   80px section gap. That also matches the 40px that reads below them, where the stats band's tint starts
	   (Zach, 2026-11-09, BugHerd 82). */
	#fl-main-content .fl-row.fl-node-3ys6d1jpgwet > .fl-row-content-wrap {
		padding-top: 0;
	}

	/* The Contact heading's own 20px margin is the whole gap to its text */
	#fl-main-content .fl-row.fl-node-qp8g74cvtwuj > .fl-row-content-wrap {
		padding-top: 0;
	}

	#fl-main-content .fl-row.fl-node-obge1czam5ui > .fl-row-content-wrap {
		padding-top: 40px; /* Home industries intro → cards (BugHerd 77) */
	}

	/* Logo strip inside a split hero: 40px below the nav cards, then the 80px section gap */
	#fl-main-content .fl-row.fl-node-sa20yum8x7j4 > .fl-row-content-wrap,
	#fl-main-content .fl-row.fl-node-xu37c29ny0aq > .fl-row-content-wrap,
	#fl-main-content .fl-row.fl-node-mi4grflpos7e > .fl-row-content-wrap {
		padding-top: 40px;
		padding-bottom: 40px;
	}
}

/* The design system's page floor (.fl-ds-page, on the header wrapper too) paints it white; Themer's Transparent
 * setting only clears rows and columns, so clear the wrapper until the visitor scrolls */
body:not(.single-fl-theme-layout) .fl-builder-content[data-type="header"][data-overlay="1"]:not(.fl-theme-builder-header-scrolled):not([data-overlay-bg="default"]) {
	background: transparent;
}

/* Sticky header (2026-11-10, "like their current site"): Themer keeps header 6137 fixed at every size
 * (scripts/header-sticky-20261110.php). On phones and tablets js/tep-header-scroll.js adds .tep-header-hidden while
 * the visitor scrolls down, and this slides the header out of view; it slides back on scroll up. The transform is
 * only set while hidden, so the full-screen menu (fixed, inside the header) is never offset by it. */
@media (max-width: 992px) {
	.fl-builder-content[data-type="header"].fl-theme-builder-header-pinned {
		transition: transform 0.3s ease;
	}

	.fl-builder-content[data-type="header"].fl-theme-builder-header-pinned.tep-header-hidden {
		transform: translateY(-100%);
	}
}

@media (prefers-reduced-motion: reduce) {
	.fl-builder-content[data-type="header"].fl-theme-builder-header-pinned {
		transition: none;
	}
}

/* BB pages and Themer layouts: the first row's background runs under the header (as in Figma); its content moves down */
#fl-main-content .fl-builder-content-primary > .fl-row:first-child > .fl-row-content-wrap > .fl-row-content,
#fl-main-content > .fl-builder-content > .fl-row:first-child > .fl-row-content-wrap > .fl-row-content {
	margin-top: var(--tep-header-h, 0px);
}

/* Pages not built in BB, search results and 404 */
#fl-main-content:not(:has(.fl-builder-content-primary, > .fl-builder-content)) {
	padding-top: var(--tep-header-h, 0px);
}

/* ---------- Content width on pages not built in BB ----------
 * The theme's container is 1020px (900px below 1100px); BB rows are capped at the design system's
 * container width with 20px row padding. Match them so every page shares the Figma 120–1320 edges at 1440. */
@media (min-width: 992px) {
	body:not(.fl-builder) #fl-main-content > .container {
		width: var(--ds-width-container, 1200px); /* the design system isn't loaded on 404 */
		max-width: calc(100% - 40px);
	}
}

/* ---------- Phones: footer "Partner With Us" band (Themer 6138) on the 80px rhythm (BugHerd 75, 2026-11-09) ----------
   The band row kept BB's 50px mobile padding, and the form column sat 50px under the dark box; now 30px. */
@media (max-width: 768px) {
	.fl-builder-content[data-type="footer"] .fl-row.fl-node-2a05ewpy1r4z > .fl-row-content-wrap {
		padding-top: 40px;
		padding-bottom: 40px;
	}

	.fl-builder-content[data-type="footer"] .fl-node-2a05ewpy1r4z .fl-col + .fl-col {
		margin-top: 30px !important;
	}
}

/* ---------- Empty Posts sections stay hidden (2026-11-18, after BugHerd 131–135) ----------
   A Posts module with no results prints Beaver Builder's "Sorry, we couldn't find any posts" + search box. On pages
   without a filter bar that's a broken-looking block, so: hide the empty module, and hide its whole row when no
   Posts module in that row found anything (heading and intro go with it). Pages with a filter bar (Projects,
   Events, News, Contact) keep their "no matches" message. The builder (.fl-builder-edit) still shows everything.
   scripts/site-health-check.php reports these empty sections so someone fixes the content. */
body:not(.fl-builder-edit):not(:has(form.tep-filters)) .fl-module:has(> .fl-module-content > .fl-post-grid-empty),
body:not(.fl-builder-edit):not(:has(form.tep-filters)) .fl-row:has(.fl-post-grid-empty):not(:has(.fl-post-grid-post)),
/* Archive pages: the featured card (`tep-featured-card`, Projects and Events) has its own row above the filter bar; with
   nothing to feature it left a blank band. The grid's "no matches" message stays. */
body:not(.fl-builder-edit) .fl-row:has(.tep-featured-card .fl-post-grid-empty):not(:has(.fl-post-grid-post)):not(:has(form.tep-filters)) {
	display: none;
}
