/*
 * SYNLawn Feature (Elementor widget): a frosted card over a background image or video, with copy
 * on one side and a media panel (photo plus logo overlay) on the other. With default settings it
 * reproduces the Utah landing page's "The Only Turf Trusted by the Pros" section.
 *
 * Every default is a --sl-feature-* token on .sl-feature; data-theme="light" swaps the token set.
 * The widget's Style controls either set these tokens or target elements directly, and they
 * always win over the defaults below. Fonts and the .sl-btn button come from common.css.
 *
 * No breakpoints of its own. Sizes, padding and gaps are fluid clamp() values that interpolate the
 * Figma mobile (393) and desktop (1440) frames. Side by side vs stacked is the responsive Layout
 * control, which sets tokens per Elementor device; the fallbacks below are the stacked layout.
 */

/* Tokens */

.sl-feature {
	--sl-feature-green: #78be20;
	--sl-feature-deep-green: #2c5234;
	--sl-feature-soft-black: #2e2e30;

	--sl-feature-font-display: "SL Mostin", "Mostin", "Bebas Neue", "Arial Narrow", sans-serif;
	--sl-feature-font-body: "SL Segoe UI", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;

	--sl-feature-ease: cubic-bezier(0.22, 1, 0.36, 1);

	/* Section */
	--sl-feature-bg: var(--sl-feature-deep-green);
	--sl-feature-overlay: rgba(0, 0, 0, 0.4);
	--sl-feature-content: 76.75rem;

	/* Card */
	--sl-feature-card-bg: rgba(0, 0, 0, 0.7);
	--sl-feature-card-blur: 0.625rem;
	--sl-feature-row-gap: 3.75rem;
	--sl-feature-col-gap: clamp(2.5rem, 5.6vw, 5rem);
	--sl-feature-copy-width: 34.3125rem;
	--sl-feature-row: row;

	/* Copy */
	--sl-feature-text: #fff;
	--sl-feature-heading-color: var(--sl-feature-text);
	--sl-feature-em-color: var(--sl-feature-green);
	--sl-feature-body-color: var(--sl-feature-text);
	--sl-feature-copy-shadow: 0 2px 2.05rem rgba(0, 0, 0, 0.1);
	--sl-feature-body-gap: 1.25rem;
	--sl-feature-btn-gap: 2.625rem;

	/* Media panel */
	--sl-feature-media-bg: #000;
	--sl-feature-media-border: var(--sl-feature-green);
	--sl-feature-media-fade: linear-gradient(180deg, rgba(0, 0, 0, 0.65) 40%, rgba(0, 0, 0, 0) 85%);
}

/*
 * Light: light grey section, white card lifted with a soft shadow, dark copy. The media panel keeps
 * its dark styling, so the photo and logos read the same in both themes.
 */
.sl-feature[data-theme="light"] {
	--sl-feature-bg: #f5f5f5;
	--sl-feature-overlay: none;
	--sl-feature-card-bg: #fff;
	--sl-feature-card-blur: 0;
	--sl-feature-card-shadow: 0 1.5rem 3.5rem rgba(46, 46, 48, 0.08);
	--sl-feature-text: #000;
	--sl-feature-body-color: var(--sl-feature-soft-black);
	--sl-feature-copy-shadow: none;
	--sl-btn-hover-color: var(--sl-feature-deep-green);
}

/* Base */

.sl-feature {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: clamp(43.75rem, 69.4vw, 62.5rem);
	padding: 5.625rem clamp(0.75rem, -1.455rem + 8.978vw, 6.625rem);
	border-radius: clamp(1.5625rem, 0.3894rem + 4.776vw, 4.6875rem) clamp(1.5625rem, 0.3894rem + 4.776vw, 4.6875rem) 0 0;
	background-color: var(--sl-feature-bg);
	color: var(--sl-feature-text);
	font-family: var(--sl-feature-font-body);
	overflow: hidden;
	isolation: isolate;
}

.sl-feature *,
.sl-feature *::before,
.sl-feature *::after {
	box-sizing: border-box;
}

.sl-feature :where(h1, h2, h3, h4, h5, h6, p, div) {
	margin: 0;
}

.sl-feature img {
	max-width: 100%;
	display: block;
}

/* Background media */

.sl-feature__bg {
	position: absolute;
	inset: 0;
	z-index: -1;
	overflow: hidden;
	border-radius: inherit;
}

.sl-feature__bg::after {
	content: "";
	position: absolute;
	inset: 0;
}

/* The default overlay steps aside once an overlay is chosen in the Style tab. */
.elementor-widget-synlawn-feature:not(.sl-feature-overlay-classic):not(.sl-feature-overlay-gradient) .sl-feature__bg::after {
	background: var(--sl-feature-overlay);
}

/* Scoped under .sl-feature to outrank Elementor's `.elementor img { height: auto }`. */
.sl-feature .sl-feature__media {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
}

/* Fades in over the cover image once frames are playing. */
.sl-feature__video {
	opacity: 0;
	transition: opacity 800ms var(--sl-feature-ease);
}

.sl-feature__video.is-playing {
	opacity: 1;
}

/* Card */

.sl-feature__inner {
	width: 100%;
	max-width: var(--sl-feature-content);
	margin-inline: auto;
}

/*
 * Content › Layout › Layout (responsive: Side by side on Desktop, Stacked below by default) sets
 * --sl-feature-direction and the flex tokens per Elementor device.
 */
.sl-feature__card {
	display: flex;
	flex-direction: var(--sl-feature-direction, column);
	align-items: var(--sl-feature-align, stretch);
	row-gap: var(--sl-feature-row-gap);
	column-gap: var(--sl-feature-col-gap);
	padding: clamp(1.25rem, 0.3125rem + 3.82vw, 3.75rem);
	border-radius: 1.875rem;
	background-color: var(--sl-feature-card-bg);
	box-shadow: var(--sl-feature-card-shadow, none);
	-webkit-backdrop-filter: blur(var(--sl-feature-card-blur));
	backdrop-filter: blur(var(--sl-feature-card-blur));
}

.sl-feature--media-left {
	--sl-feature-row: row-reverse;
}

/* Copy */

/* With the media panel hidden, the copy takes the whole card. */
.sl-feature__card--copy-only .sl-feature__content {
	flex: 1 1 auto;
}

.sl-feature__content {
	display: flex;
	flex: var(--sl-feature-content-flex, 0 1 auto);
	flex-direction: column;
	align-items: flex-start;
	min-width: 0;
}

.sl-feature .sl-feature__title {
	color: var(--sl-feature-heading-color);
	font-family: var(--sl-feature-font-display);
	font-size: clamp(3rem, 2.7188rem + 1.146vw, 3.75rem);
	font-weight: 700;
	line-height: 1.25em;
	letter-spacing: 0;
	text-transform: uppercase;
}

/* [h]…[/h] in the heading text; "Highlight on Its Own Line" puts it on its own line. */
.sl-feature__title--em-block .sl-feature__em {
	display: block;
}

.sl-feature .sl-feature__em {
	color: var(--sl-feature-em-color);
}

.sl-feature__body {
	margin-top: var(--sl-feature-body-gap);
	color: var(--sl-feature-body-color);
	font-size: clamp(0.9375rem, 0.9137rem + 0.096vw, 1rem);
	line-height: 1.55em;
	text-shadow: var(--sl-feature-copy-shadow);
}

/* The editor wraps body text in <p>; Foundation gives every p its own line height. */
.sl-feature__body p {
	line-height: inherit;
}

.sl-feature__body p + p {
	margin-top: 0.75rem;
}

.sl-feature__body a {
	color: inherit;
	text-decoration: underline;
}

/* Button (.sl-btn, styled in common.css) */

.sl-feature .sl-feature__content .sl-btn {
	align-self: flex-start;
	margin-top: var(--sl-feature-btn-gap);
}

/* Media panel: photo with a dark fade from the top, logo overlay on it */

.sl-feature__panel {
	position: relative;
	display: flex;
	flex: var(--sl-feature-media-flex, 0 1 auto);
	align-self: var(--sl-feature-media-self, auto);
	justify-content: center;
	align-items: flex-start;
	min-height: clamp(27rem, 26.8123rem + 0.764vw, 27.5rem);
	padding: 2.25rem;
	border: 3px solid var(--sl-feature-media-border);
	border-radius: 1.25rem;
	background-color: var(--sl-feature-media-bg);
	overflow: hidden;
	isolation: isolate;
}

.sl-feature .sl-feature__photo {
	position: absolute;
	inset: 0;
	z-index: -2;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: 100% 50%;
}

.sl-feature__panel::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
}

/* The default fade steps aside once a Fade is chosen in the Style tab. */
.elementor-widget-synlawn-feature:not(.sl-feature-fade-classic):not(.sl-feature-fade-gradient) .sl-feature__panel::before {
	background: var(--sl-feature-media-fade);
}

.sl-feature .sl-feature__logos {
	width: min(16.75rem, 80%);
	height: auto;
	margin-top: var(--sl-feature-logos-offset, 0);
}

/*
 * Scroll reveal (Content › Layout › Reveal on Scroll). Copy rises in, staggered; the media panel
 * slides in from its side. feature.js adds .sl-js, then .is-in once the card nears the viewport,
 * so without JS everything is simply visible.
 */

.sl-feature--reveal.sl-js .sl-feature__content > *,
.sl-feature--reveal.sl-js .sl-feature__panel {
	transition: opacity 700ms var(--sl-feature-ease) var(--sl-feature-delay, 0ms), transform 900ms var(--sl-feature-ease) var(--sl-feature-delay, 0ms);
}

.sl-feature--reveal.sl-js:not(.is-in) .sl-feature__content > * {
	opacity: 0;
	transform: translateY(2.5rem);
}

.sl-feature--reveal.sl-js:not(.is-in) .sl-feature__panel {
	opacity: 0;
	transform: translateX(5rem);
}

.sl-feature--reveal.sl-js.sl-feature--media-left:not(.is-in) .sl-feature__panel {
	transform: translateX(-5rem);
}

.sl-feature__content > :nth-child(2) {
	--sl-feature-delay: 110ms;
}

.sl-feature__content > :nth-child(3) {
	--sl-feature-delay: 220ms;
}

.sl-feature__panel {
	--sl-feature-delay: 250ms;
}

@media (prefers-reduced-motion: reduce) {
	.sl-feature *,
	.sl-feature *::before,
	.sl-feature *::after {
		transition-duration: 1ms !important;
		transition-delay: 0ms !important;
	}

	.sl-feature--reveal.sl-js:not(.is-in) .sl-feature__content > *,
	.sl-feature--reveal.sl-js:not(.is-in) .sl-feature__panel {
		opacity: 1;
		transform: none;
	}
}
