/*
 * Hero widget — full-bleed background carousel + static content overlay.
 *
 * Design source: Figma file o2Fw8rOZW4xOIEcs13IWzo, nodes 1:208 / 1:205 / 1:206 + new
 * 3-slide carousel reference (2026-05-13).
 * Tokens defined inline here since the hero is the highest-LCP section.
 */

.greengrass-hero {
	position: relative;
	min-height: 65vh;
	color: #f8fffd;
	overflow: hidden;
	font-family: 'Polin', sans-serif;
	isolation: isolate; /* contain stacking context for slides */
	direction: rtl; /* widget owns its direction — independent of page direction */
}

/* ── Slides — absolute-positioned, fade transition ────── */
.greengrass-hero__slides {
	position: absolute;
	inset: 0;
}

.greengrass-hero__slide {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	opacity: 0;
	transition: opacity 0.7s ease-in-out;
}

.greengrass-hero__slide.is-active {
	opacity: 1;
}

/* ── Overlay — Figma's directional gradient + optional solid tint ── */
.greengrass-hero__overlay {
	position: absolute;
	inset: 0;
	background-color: transparent;
	background-image: linear-gradient(128.38deg, rgba(0, 0, 0, 0) 43.11%, rgba(0, 0, 0, 0.9) 77.44%);
	pointer-events: none;
}

/* ── Content overlay (static across slides) ───────────── */
.greengrass-hero__container {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: var(--gg-container-max, 1280px);
	margin-inline: auto;
	min-height: inherit;
	padding-block: clamp(48px, 8vw, 96px);
	padding-inline: var(--gg-container-pad, 24px);
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: flex-start;
}

.greengrass-hero__inner {
	display: flex;
	flex-direction: column;
	gap: clamp(16px, 1.8vw, 28px);
	max-width: 780px;
	width: 100%;
	text-align: start;
}

.greengrass-hero__eyebrow {
	font-size: clamp(14px, 1.1vw, 16px);
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #00a3e9;
	line-height: 1.2;
}

.greengrass-hero__title {
	margin: 0;
	font-family: 'Polin', sans-serif;
	font-size: clamp(32px, 5vw, 70px);
	font-weight: 700;
	line-height: 1.05;
	color: #f8fffd;
}

.greengrass-hero__title .accent {
	color: #00a3e9;
}

.greengrass-hero__sub {
	margin: 0;
	font-family: 'Polin', sans-serif;
	font-size: clamp(15px, 1.6vw, 24px);
	font-weight: 400;
	line-height: 1.4;
	color: #f8fffd;
	max-width: 50ch;
}

/* ── Bottom row — CTA and arrow controls sitting next to each other (not pushed apart). ── */
.greengrass-hero__bottom-row {
	display: inline-flex;
	align-items: center;
	gap: clamp(12px, 1.4vw, 24px);
	margin-block-start: 12px;
	flex-wrap: wrap;
}

.greengrass-hero__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 14px 28px;
	background-color: #629c55;
	color: #f8fffd;
	font-family: 'Polin', sans-serif;
	font-size: clamp(15px, 1.4vw, 20px);
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	border: 0;
	border-radius: 15px;
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
	min-width: 280px;
	text-align: center;
	flex-shrink: 0;
}

.greengrass-hero__cta:hover {
	background-color: #4f7d44;
	transform: translateY(-1px);
	box-shadow: 0 8px 20px rgba(98, 156, 85, 0.32);
}

.greengrass-hero__cta:focus-visible {
	outline: 2px solid #f8fffd;
	outline-offset: 3px;
}

/* ── Carousel controls — sit right next to the CTA per Figma, not pushed apart ─ */
.greengrass-hero__controls {
	display: inline-flex;
	align-items: center;
	gap: clamp(8px, 0.8vw, 12px);
}

/*
 * Arrows — outlined rectangular boxes per Figma (Rectangle 18/19): 70×70 with 1px solid
 * border and 15px radius, transparent fill, chevron centered. White border on the hero's
 * dark background. Hover gives a subtle filled state.
 */
/* `!important` on background/border/color so the theme's generic button:hover
 * (which is bleeding maroon through on Yuval's setup) can't override us. */
.greengrass-hero__arrow,
.greengrass-hero__arrow:link,
.greengrass-hero__arrow:visited {
	display: flex;
	align-items: center;
	justify-content: center;
	width: clamp(44px, 4.5vw, 70px);
	height: clamp(44px, 4.5vw, 70px);
	box-sizing: border-box;
	background-color: transparent !important;
	color: #f8fffd !important;
	border: 1px solid #f8fffd !important;
	border-radius: 15px;
	padding: 0;
	font-family: 'Polin', sans-serif;
	font-size: clamp(20px, 2vw, 28px);
	font-weight: 400;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.15s ease;
}

.greengrass-hero__arrow:hover,
.greengrass-hero__arrow:focus {
	background-color: rgba(248, 255, 253, 0.15) !important;
	color: #f8fffd !important;
	border-color: #f8fffd !important;
	transform: translateY(-1px);
}

.greengrass-hero__arrow:focus-visible {
	outline: 2px solid #f8fffd;
	outline-offset: 3px;
}

.greengrass-hero__dots {
	display: inline-flex;
	gap: 8px;
	align-items: center;
}

.greengrass-hero__dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background-color: rgba(248, 255, 253, 0.45);
	border: 0;
	padding: 0;
	cursor: pointer;
	transition: background-color 0.15s ease, width 0.2s ease, border-radius 0.2s ease;
}

.greengrass-hero__dot:hover {
	background-color: rgba(248, 255, 253, 0.85);
}

.greengrass-hero__dot.is-active {
	background-color: #f8fffd;
	width: 22px;
	border-radius: 4px;
}

.greengrass-hero__dot:focus-visible {
	outline: 2px solid #f8fffd;
	outline-offset: 3px;
}

/* Mobile tweaks */
@media (max-width: 640px) {
	.greengrass-hero {
		/* `!important` beats the per-instance Elementor "Min Height" setting (e.g. 839px),
		 * whose selector (.elementor-element-XXXX .greengrass-hero) is more specific than ours. */
		min-height: 56vh !important;
	}
	.greengrass-hero__container {
		padding-block: 24px;
	}
	.greengrass-hero__inner {
		gap: 12px; /* tighten spacing between title / sub / button */
	}
	.greengrass-hero__title {
		font-size: clamp(24px, 6.5vw, 32px); /* smaller headline on phones */
		line-height: 1.1;
	}
	.greengrass-hero__sub {
		font-size: 14px;
		line-height: 1.35;
	}
	.greengrass-hero__cta {
		min-width: 0;
		width: 100%;
	}
	.greengrass-hero__bottom-row {
		gap: 12px;
		margin-block-start: 4px;
	}
	.greengrass-hero__controls {
		margin-inline-start: 0;
		width: 100%;
		justify-content: center;
	}
}

/* Reduce motion: stop fade animation and autoplay (autoplay killed in JS too). */
@media (prefers-reduced-motion: reduce) {
	.greengrass-hero__slide {
		transition: none;
	}
	.greengrass-hero__dot {
		transition: none;
	}
}
