/* CBH Front-end Fixes — each block is scoped to a body class toggled in Settings. */

/* Visually hidden H1 (SEO fallback) */
.cbhff-sr-h1 {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* 1. Scroll-scrubbed text reveal leaves characters at 0.2 opacity ("Job Categories", "Employee Benefits") */
body.cbhff-text-reveal .lqd-text-reveal-el .split-unit,
body.cbhff-text-reveal .lqd-text-reveal-el .split-inner {
	opacity: 1 !important;
	transition: none !important;
}

/* 2. Single-slide hero: stray vertical "— Available Positions" label */
body.cbhff-hero-menu .lqd-vslider-menu:has(> ul > li:only-child),
body.cbhff-hero-menu .lqd-vslider-menu.cbhff-single {
	display: none !important;
}

/* 3. Job category icon boxes — equal height, buttons on one baseline */
body.cbhff-iconbox-equal .e-con:has(> .elementor-widget .iconbox .btn) > .elementor-widget:has(.iconbox .btn) {
	flex-grow: 1;
	display: flex;
	flex-direction: column;
}
body.cbhff-iconbox-equal .elementor-widget:has(.iconbox .btn) > .elementor-widget-container {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	height: 100%;
}
body.cbhff-iconbox-equal .iconbox:has(.btn) {
	flex: 1 1 auto;
	height: 100%;
	align-items: flex-start;
}
body.cbhff-iconbox-equal .iconbox:has(.btn) > .contents {
	display: flex;
	flex-direction: column;
	align-self: stretch;
	flex: 1 1 auto;
	min-height: 100%;
}
body.cbhff-iconbox-equal .iconbox:has(.btn) > .contents > .lqd-iconbox-heading {
	margin-top: 0;
}
/* Hover-arrow SVG wrapped onto a 2nd line ("Engineering & Maintenance"), pushing the text down */
body.cbhff-iconbox-equal .iconbox .lqd-iconbox-heading > svg {
	position: absolute; /* stays at its inline spot but no longer takes up line width */
}
/* Space between description and button (text was touching the button) */
body.cbhff-iconbox-equal .iconbox:has(.btn) > .contents > p:not(:last-child) {
	margin-bottom: 1.5em;
}
body.cbhff-iconbox-equal .iconbox:has(.btn) > .contents > :last-child:has(.btn),
body.cbhff-iconbox-equal .iconbox:has(.btn) > .contents > .btn:last-child {
	margin-top: auto !important;
	align-self: flex-start;
}

/* 3b. Split-text buttons: word-spacing .3em + a spacer span = huge gap ("All   Positions") */
body.cbhff-normalize-spaces a.btn[class*="btn-hover-txt"],
body.cbhff-normalize-spaces a.btn .btn-txt.split-text-applied {
	word-spacing: normal !important;
}

/* 4. WP Job Openings (AWSM) grid */
body.cbhff-job-cards .awsm-grid-item {
	display: flex;
}
body.cbhff-job-cards .awsm-grid-item > .awsm-job-item {
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
}
body.cbhff-job-cards .awsm-grid-item .awsm-grid-right-col {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
}
body.cbhff-job-cards .awsm-grid-item .awsm-job-more-container {
	margin-top: auto;
	padding-top: .5em;
}
body.cbhff-job-cards .awsm-job-post-title {
	overflow-wrap: anywhere;
	hyphens: auto;
}
body.cbhff-job-cards .awsm-load-more-main {
	text-align: center;
}
body.cbhff-job-cards .awsm-load-more-main .awsm-load-more-btn,
body.cbhff-job-cards .awsm-load-more-main .awsm-load-more {
	display: inline-block !important;
	width: auto !important;
	min-width: 220px;
	padding: 14px 36px !important;
	background: var(--cbhff-navy, #054572) !important;
	color: #fff !important;
	border: 2px solid var(--cbhff-navy, #054572) !important;
	border-radius: 0 !important;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
	font-size: 14px;
	transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
body.cbhff-job-cards .awsm-load-more-main .awsm-load-more-btn:hover,
body.cbhff-job-cards .awsm-load-more-main .awsm-load-more-btn:focus-visible {
	background: var(--cbhff-gold, #b39b5f) !important;
	border-color: var(--cbhff-gold, #b39b5f) !important;
	color: #fff !important;
}

/* 5. No horizontal scroll from off-canvas elements. `clip` keeps position:sticky working. */
html:has(body.cbhff-overflow-x),
body.cbhff-overflow-x {
	overflow-x: clip;
}
@supports not (overflow-x: clip) {
	body.cbhff-overflow-x { overflow-x: hidden; }
}

/* 6. In-page anchors land below the sticky header (value set by JS, CSS fallback) */
html:has(body.cbhff-anchor-offset) {
	scroll-padding-top: var(--cbhff-header-h, 110px);
}

/* Visible keyboard focus on icon-only links we label */
.cbhff-labelled:focus-visible {
	outline: 2px solid var(--cbhff-gold, #b39b5f);
	outline-offset: 3px;
}

@media (max-width: 767px) {
	/* Job category buttons: full width tap targets on phones */
	body.cbhff-iconbox-equal .iconbox:has(.btn) > .contents .btn {
		min-height: 44px;
	}
	body.cbhff-job-cards .awsm-load-more-main .awsm-load-more-btn {
		width: 100% !important;
	}
}
