/*
 * Ethnos scroll effects (from ethnos-parallax-demo_3.html).
 * Add these class names in Elementor: select a container > Advanced > CSS Classes.
 * Set background images, colors and overlays in Elementor as usual.
 */

/* 1. FIXED BACKGROUND ("Who We Are", "Our Promise")
 *    The background image stays still while the content scrolls over it. */
.ethnos-fixed-bg {
	background-attachment: fixed !important;
	background-size: cover;
	background-position: center;
}

/* 2. DEPTH ("Strategic Alignment")
 *    The background moves slower than the page. ethnos-effects.js moves the
 *    container's background image onto a layer and shifts it on scroll. */
.ethnos-depth {
	position: relative;
	overflow: hidden;
	isolation: isolate;
}
.ethnos-depth.ethnos-depth--ready {
	background-image: none !important;
}
.ethnos-depth__layer {
	position: absolute;
	inset: -15% 0;
	z-index: -1;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	pointer-events: none;
	will-change: transform;
}

/* 3. REVEAL PANELS (Solutions)
 *    A row (class ethnos-panel) with two containers side by side: a photo half
 *    (ethnos-panel-media, background image) and a text half (ethnos-panel-copy).
 *    The photo is pinned to the screen while the page scrolls, so the solid text
 *    half of the next row slides up over it. The text halves are light "paper",
 *    as in the parallax demo, so that sliding block stands out on the dark page. */
.ethnos-panel {
	--ethnos-header: 91px; /* height of the sticky header (slimmed in style.css); the pinned photo sits below it */
}
.ethnos-panel-media {
	background-size: cover;
	background-repeat: no-repeat;
	min-height: 100vh;
}
.ethnos-panel-copy {
	min-height: 100vh;
}
/* Exactly half each, whatever the text inside wants (beats Elementor's own sizing) */
.e-con.ethnos-panel > .ethnos-panel-media,
.e-con.ethnos-panel > .ethnos-panel-copy {
	flex: 0 0 50% !important;
	max-width: 50% !important;
}
/* No padding, so the pinned copy of the photo lines up with the panel's edges */
.e-con.ethnos-panel > .ethnos-panel-media {
	padding: 0 !important;
}
/* The text starts at the top of its panel, so it shows as soon as the panel scrolls in */
.ethnos-panel-copy {
	justify-content: flex-start !important;
}
.ethnos-panel-copy .title,
.ethnos-panel-copy .title span:first-child,
.ethnos-panel-copy .title .char,
.ethnos-panel-copy strong {
	color: #0b0b0c !important; /* Elementor's widget color is near-white, for dark sections */
}
/* The highlighted end of the title. Split-text puts each wrapped line in its own div,
   so the highlight span isn't always a sibling of the first one (e.g. on phones). */
.ethnos-panel-copy .title span + span,
.ethnos-panel-copy .title span[class*="elementor-repeater-item-"],
.ethnos-panel-copy .title span[class*="elementor-repeater-item-"] * {
	color: #e8b24d !important; /* same gold as the hero titles ("Advantage") */
}
.ethnos-panel-copy .subtitle {
	color: #5a5246;
}
.ethnos-panel-copy p {
	color: #2f2a23;
	font-size: 18px;
	line-height: 1.75;
}
/* A fixed background would be sized to the whole screen, so only a slice of the photo
 * would show. Instead a copy of the photo the size of the visible half-screen is pinned
 * below the header, and clip-path keeps it inside its own panel. */
@media (min-width: 1025px) and (prefers-reduced-motion: no-preference) {
	.ethnos-panel-media {
		clip-path: inset(0);
	}
	.ethnos-panel-media::after {
		content: "";
		position: fixed;
		top: var(--ethnos-header);
		width: 50%;
		height: calc(100vh - var(--ethnos-header));
		background-image: inherit;
		background-position: inherit;
		background-size: cover;
		background-repeat: no-repeat;
		pointer-events: none;
	}
	/* ...then stays pinned just under the header until the next panel covers it */
	body:has(.ethnos-panel) {
		overflow-x: clip;
		overflow-y: visible;
	}
	.ethnos-panel-copy > .e-con-inner {
		position: sticky;
		top: calc(var(--ethnos-header) + 64px);
		flex-grow: 0;
		height: auto;
	}
}

/* 4. FADE UP
 *    Content fades and rises into view the first time it's scrolled to.
 *    Always visible in the Elementor editor. */
.ethnos-js .ethnos-fade-up {
	opacity: 0;
	transform: translateY(30px);
	transition: opacity 0.8s ease, transform 0.8s ease;
}
.ethnos-js .ethnos-fade-up.is-in-view,
.elementor-editor-active .ethnos-fade-up {
	opacity: 1;
	transform: none;
}

/* 5. INTRO (Home): the logo fills the first screen, then scrolling opens up the video.
 *    Markup lives in an HTML widget; ethnos-effects.js sets --intro (0 to 1) as you scroll. */
/* The theme sets body { overflow-x: hidden }, which makes body a scroll container and
 * stops the stage from pinning. clip hides sideways overflow the same way without that. */
body:has(.ethnos-intro) {
	overflow-x: clip;
	overflow-y: visible;
}
.ethnos-intro-section,
.ethnos-intro-section > .e-con-inner {
	padding: 0 !important;
	max-width: none !important;
}
.ethnos-intro {
	--intro: 0;
	position: relative;
	height: 220vh;
	background: #000;
}
.ethnos-intro__stage {
	position: sticky;
	top: 0;
	height: 100vh;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}
.ethnos-intro__video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	clip-path: inset(calc((1 - var(--intro)) * 38%) calc((1 - var(--intro)) * 42%) round calc((1 - var(--intro)) * 32px));
	opacity: min(1, calc(var(--intro) * 2.5));
}
/* JS moves the video into this frame. The reveal clip sits on the frame because
 * iOS Safari can paint a clipped <video> as black. The poster is the frame's
 * background, so a video that can't play still shows a picture. */
.ethnos-intro__frame {
	position: absolute;
	inset: 0;
	background: #000 center / cover no-repeat;
	-webkit-clip-path: inset(calc((1 - var(--intro)) * 38%) calc((1 - var(--intro)) * 42%) round calc((1 - var(--intro)) * 32px));
	clip-path: inset(calc((1 - var(--intro)) * 38%) calc((1 - var(--intro)) * 42%) round calc((1 - var(--intro)) * 32px));
	opacity: min(1, calc(var(--intro) * 2.5));
}
.ethnos-intro__frame > .ethnos-intro__video {
	-webkit-clip-path: none;
	clip-path: none;
	opacity: 1;
}
.ethnos-intro__shade {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0) 70%, rgba(0, 0, 0, 0.6) 100%);
	opacity: var(--intro);
	pointer-events: none;
}
.ethnos-intro__logo {
	position: relative;
	width: min(70vw, 480px);
	height: auto;
	transform: scale(calc(1 - var(--intro) * 0.5));
	opacity: max(0, calc(1 - var(--intro) * 5));
}
.ethnos-intro__cue {
	position: absolute;
	bottom: 32px;
	left: 50%;
	transform: translateX(-50%);
	color: rgba(255, 255, 255, 0.6);
	font-size: 12px;
	letter-spacing: 0.3em;
	text-transform: uppercase;
	opacity: max(0, calc(1 - var(--intro) * 4));
}
.elementor-editor-active .ethnos-intro {
	height: 100vh;
}
/* Phones and tablets: 100vh counts the space behind Safari's toolbar, which put the logo low
 * and hid "Scroll" under the toolbar. Size the stage to the visible screen (svh = the height
 * left when the toolbar is showing), center the logo, and sit "Scroll" just above the bottom edge. */
@media (max-width: 1024px) {
	.ethnos-intro__stage {
		box-sizing: border-box;
		height: 100svh;
		/* Room for "Scroll" at the bottom; the 1023px block below adds the header's height at the top,
		 * so the logo sits centered between the header and "Scroll". */
		padding-bottom: calc(63px + env(safe-area-inset-bottom, 0px));
	}
	.ethnos-intro__cue {
		bottom: calc(20px + env(safe-area-inset-bottom, 0px));
	}
}
/* Below 1024px the theme's 62px header sits above the page instead of over it, which pushed
 * the intro (and "Scroll") 62px below the screen. Tuck the intro up behind the header. */
@media (max-width: 1023px) {
	body:has(.ethnos-intro) > header.header,
	body:has(.ethnos-intro) header.header-layout-type-header-default {
		position: relative;
		z-index: 20;
	}
	.ethnos-intro {
		margin-top: calc(-1 * var(--ethnos-intro-lift, 62px));
	}
	.ethnos-intro__stage {
		padding-top: var(--ethnos-intro-lift, 62px);
	}
}

/* Tablets and phones: iOS ignores fixed backgrounds, so use normal scrolling */
@media (max-width: 1024px) {
	.ethnos-fixed-bg,
	.ethnos-panel-media {
		background-attachment: scroll !important;
	}
	.ethnos-panel-media {
		min-height: 56vh;
	}
	.e-con.ethnos-panel > .ethnos-panel-media,
	.e-con.ethnos-panel > .ethnos-panel-copy {
		flex: none !important;
		max-width: 100% !important;
	}
	.ethnos-panel-copy {
		min-height: 0;
	}
}

/* Visitors who turned on "reduce motion" get no movement */
@media (prefers-reduced-motion: reduce) {
	.ethnos-fixed-bg,
	.ethnos-panel-media {
		background-attachment: scroll !important;
	}
	.ethnos-depth__layer {
		transform: none !important;
	}
	.ethnos-js .ethnos-fade-up {
		opacity: 1;
		transform: none;
		transition: none;
	}
	.ethnos-intro {
		height: 100vh;
	}
	.ethnos-intro__video,
	.ethnos-intro__frame {
		clip-path: none;
		opacity: 1;
	}
	.ethnos-intro__logo {
		transform: none;
		opacity: 1;
	}
}

/* 6. CALL TO ACTION ("Not sure which is right for you?" on the solution pages): centered */
.ethnos-cta,
.ethnos-cta .tm-sc-section-title,
.ethnos-cta .title-wrapper {
	text-align: center;
}
.ethnos-cta .subtitle {
	justify-content: center;
}
/* Every widget in the block sits in the middle: the text widgets had a fixed width
   pinned to the left, so "Schedule a free consultation call today!" and, on phones,
   the "Free Consultation" label (star icon + text) and headline sat off-center. */
.ethnos-cta > .e-con-inner,
.e-con.ethnos-cta:not(.e-con-boxed) {
	align-items: center !important;
}
.ethnos-cta > .e-con-inner > .elementor-widget,
.e-con.ethnos-cta:not(.e-con-boxed) > .elementor-widget {
	align-self: center !important;
	margin-left: auto !important;
	margin-right: auto !important;
	max-width: 100%;
}
.ethnos-cta .tm-text-editor,
.ethnos-cta .tm-text-editor p {
	text-align: center !important;
}
/* Star icon and "Free Consultation" side by side, centered as a pair; headline below. */
.ethnos-cta .title-wrapper {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	column-gap: 8px;
}
.ethnos-cta .title-wrapper > .title-icon {
	margin: 0 !important;
}
.ethnos-cta .title-wrapper > .sub-title-outer {
	margin: 0;
}
.ethnos-cta .title-wrapper > :not(.title-icon):not(.sub-title-outer) {
	flex: 0 0 100%;
}

/* 7. OUR VALUES (About): cards three across on desktop (the last row centered), one per row on phones */
.e-con.ethnos-values {
	flex-direction: row !important;
	flex-wrap: wrap !important;
	justify-content: center;
	gap: 24px;
	max-width: 1320px;
	margin: 0 auto;
}
.e-con.ethnos-values > .ethnos-value {
	flex: 0 0 calc((100% - 48px) / 3) !important;
	max-width: calc((100% - 48px) / 3);
	padding: 40px 36px !important;
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 24px;
}
.ethnos-value-title {
	margin: 0 0 14px;
	color: var(--theme-color1, #d4a52a);
	font-style: normal;
	font-weight: 400;
}
@media (max-width: 1024px) {
	.e-con.ethnos-values > .ethnos-value {
		flex-basis: calc((100% - 24px) / 2) !important;
		max-width: calc((100% - 24px) / 2);
	}
}
@media (max-width: 767px) {
	.e-con.ethnos-values > .ethnos-value {
		flex-basis: 100% !important;
		max-width: 100%;
		padding: 28px 22px !important;
	}
}

/* 8. CONTACT: first and last name side by side, a map toned to the dark page */
.ethnos-form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 24px;
}
@media (max-width: 767px) {
	.ethnos-form-row { grid-template-columns: 1fr; gap: 0; }
}
.wpcf7 label {
	display: block;
	width: 100%;
	color: rgba(255, 255, 255, 0.7);
}
.ethnos-contact-list .elementor-icon-list-item {
	align-items: flex-start !important;
	font-size: 18px;
	line-height: 1.5;
}
.ethnos-contact-list .elementor-icon-list-icon {
	width: 28px;
	padding-top: 4px;
}
.ethnos-map iframe {
	filter: grayscale(1) invert(0.92) contrast(0.9);
}
.wpcf7 input:not([type="submit"]),
.wpcf7 textarea {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}
.wpcf7 input[type="submit"] {
	padding: 14px 44px;
	color: #0b0b0c !important;
	font-size: 16px;
}

/* 9. NUMBERED STEP CARDS ("Our Promise" on Home and About)
 *    The theme slid each whole card up as one rigid block (WOW fadeInUp), lines and all.
 *    Instead, each card builds in stages: its timeline line draws across and down, the
 *    number pill eases in, then the card glides up. ethnos-effects.js adds .ethnos-steps
 *    to the grid, .is-in-view to each card, and a --step-delay to stagger cards that
 *    arrive together. */
.tm-working-grid .working-block.wow {
	visibility: visible !important;
	animation-name: none !important;
}
.ethnos-steps .working-block {
	--step-ease: cubic-bezier(0.22, 1, 0.36, 1);
	--step-delay: 0ms;
}
.ethnos-steps .working-block-style1::before {
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform 1.1s var(--step-ease) var(--step-delay);
}
.ethnos-steps .working-block-style1::after {
	transform: translateX(-50%) scaleY(0);
	transform-origin: center top;
	transition: transform 0.9s var(--step-ease) calc(var(--step-delay) + 150ms);
}
.ethnos-steps .working-block-style1 .working-count {
	opacity: 0;
	scale: 0.7;
	transition: opacity 0.6s ease calc(var(--step-delay) + 250ms),
		scale 0.8s var(--step-ease) calc(var(--step-delay) + 250ms),
		background-color 0.3s ease, color 0.3s ease;
}
.ethnos-steps .working-block-style1 .inner-box {
	opacity: 0;
	transform: translateY(48px);
	transition: opacity 0.9s ease calc(var(--step-delay) + 350ms),
		transform 1.2s var(--step-ease) calc(var(--step-delay) + 350ms);
}
.ethnos-steps .working-block.is-in-view .working-block-style1::before {
	transform: scaleX(1);
}
.ethnos-steps .working-block.is-in-view .working-block-style1::after {
	transform: translateX(-50%) scaleY(1);
}
.ethnos-steps .working-block.is-in-view .working-count {
	opacity: 1;
	scale: 1;
}
.ethnos-steps .working-block.is-in-view .inner-box {
	opacity: 1;
	transform: none;
}

/* Solution and About pages on phones: a slightly smaller panel title so the longest ones
   ("Unlocking Exponential Growth") wrap onto two rows at most, not three. */
@media (max-width: 767px) {
	:is(.page-id-110, .page-id-111, .page-id-112, .page-id-113, .page-id-114) .ethnos-panel-copy .title {
		font-size: min(37.6px, 7.2vw) !important;
	}
}
