/**
 * SG Hero Slider — front-end
 */

.sg-hero-slider {
	--sg-hero-accent: #1a5a5e;
	/* Navigation arrows (← →) */
	--sg-hero-arrow: #1a6bb8;
	--sg-hero-arrow-prev: var(--sg-hero-arrow);
	--sg-hero-arrow-next: var(--sg-hero-arrow);
	--sg-hero-dot-active: #1a5a5e;
	--sg-hero-dot-idle: #d4d4d4;
	/* Desktop height: stepped down ~15% twice vs original wide banner */
	--sg-hero-min-height: clamp(145px, 33vw, 405px);
	/* How far past the slider box desktop arrows sit (100% wide viewport). */
	--sg-hero-arrow-shift: clamp(2.35rem, 5vw, 3.5rem);
	position: relative;
	width: 100%;
	max-width: 100%;
	margin-left: auto;
	margin-right: auto;
	box-sizing: border-box;
	overflow: visible;
}

.sg-hero-slider *,
.sg-hero-slider *::before,
.sg-hero-slider *::after {
	box-sizing: inherit;
}

/*
 * Desktop: viewport is full width of the shortcode/container; arrows are
 * absolutely positioned outside that box (negative inset) so they do not
 * shrink the slider.
 */
.sg-hero-slider__main {
	position: relative;
	display: block;
	width: 100%;
	overflow: visible;
}

.sg-hero-slider__viewport {
	position: relative;
	width: 100%;
	min-width: 0;
	min-height: var(--sg-hero-min-height);
	aspect-ratio: 31 / 9;
	max-height: min(58vh, 462px);
	overflow: hidden;
	background: #1a1a1a;
}

@supports not (aspect-ratio: 31 / 9) {
	.sg-hero-slider__viewport {
		height: 0;
		padding-bottom: 29.032%;
		min-height: 0;
		max-height: none;
	}
}

.sg-hero-slider__track {
	position: absolute;
	inset: 0;
}

.sg-hero-slider__slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.55s ease;
	z-index: 0;
}

.sg-hero-slider__slide.is-active {
	opacity: 1;
	pointer-events: auto;
	z-index: 1;
}

.sg-hero-slider__bg {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	transform: scale(1.02);
}

.sg-hero-slider__slide.is-active .sg-hero-slider__bg {
	transform: scale(1);
	transition: transform 6s ease-out;
}

.sg-hero-slider__scrim {
	position: absolute;
	inset: 0;
	pointer-events: none;
	background:
		linear-gradient(
			to top,
			rgba(0, 0, 0, 0.55) 0%,
			rgba(0, 0, 0, 0.18) 38%,
			transparent 65%
		),
		linear-gradient(
			to right,
			rgba(0, 0, 0, 0.42) 0%,
			transparent 55%
		);
}

.sg-hero-slider__content {
	position: absolute;
	left: clamp(1rem, 4vw, 3.5rem);
	right: clamp(1rem, 6vw, 4rem);
	bottom: clamp(1.25rem, 4vw, 3rem);
	max-width: min(36rem, 92%);
	z-index: 2;
	color: #fff;
	text-align: left;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

/* Divi Theme Customizer → global heading font (e.g. --et_global_heading_font: 'ranade'). */
.sg-hero-slider__title {
	margin: 0 0 0.35em;
	font-family: var(--et_global_heading_font, "ranade"), sans-serif;
	font-size: 50px;
	font-weight: var(--et_global_heading_font_weight, 700);
	line-height: 1.05;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: inherit;
}

.sg-hero-slider__desc {
	margin: 0;
	font-family: var(--et_global_body_font, sans-serif);
	font-size: clamp(0.9375rem, 2.1vw, 1.25rem);
	font-weight: var(--et_global_body_font_weight, 400);
	line-height: 1.45;
	color: rgba(255, 255, 255, 0.95);
	max-width: 32em;
}

/* Desktop: arrows sit outside the slider container (sibling to full-width viewport). */
.sg-hero-slider__arrow {
	position: absolute;
	top: 50%;
	z-index: 4;
	width: clamp(2.25rem, 7vw, 3rem);
	height: clamp(3.25rem, 12vw, 4.5rem);
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	color: var(--sg-hero-arrow);
	display: flex;
	align-items: center;
	justify-content: center;
	-webkit-tap-highlight-color: transparent;
	transition: color 0.2s ease, opacity 0.2s ease;
	transform: translateY(-50%);
}

.sg-hero-slider__arrow--prev {
	left: calc(-1 * var(--sg-hero-arrow-shift));
	right: auto;
}

.sg-hero-slider__arrow--next {
	right: calc(-1 * var(--sg-hero-arrow-shift));
	left: auto;
}

.sg-hero-slider__arrow:hover,
.sg-hero-slider__arrow:focus-visible {
	opacity: 0.85;
}

.sg-hero-slider__arrow:focus-visible {
	outline: 2px solid var(--sg-hero-arrow);
	outline-offset: 3px;
}

.sg-hero-slider__arrow-icon {
	display: flex;
	align-items: center;
	justify-content: center;
}

.sg-hero-slider__arrow-svg {
	width: clamp(28px, 6vw, 40px);
	height: auto;
	display: block;
}

/* Pagination */
.sg-hero-slider__pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: clamp(0.4rem, 1.5vw, 0.65rem);
	padding: clamp(0.65rem, 2vw, 1rem) 0.5rem 0;
	margin: 0;
}

.sg-hero-slider__dot {
	width: clamp(7px, 1.8vw, 10px);
	height: clamp(7px, 1.8vw, 10px);
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--sg-hero-dot-idle);
	cursor: pointer;
	transition: background 0.25s ease, transform 0.2s ease;
	-webkit-tap-highlight-color: transparent;
}

.sg-hero-slider__dot:hover,
.sg-hero-slider__dot:focus-visible {
	transform: scale(1.12);
}

.sg-hero-slider__dot:focus-visible {
	outline: 2px solid var(--sg-hero-accent);
	outline-offset: 2px;
}

.sg-hero-slider__dot.is-active {
	background: var(--sg-hero-dot-active);
}

/* Tablets & mobile: arrows overlay inside hero (no side overflow), white icons */
@media (max-width: 782px) {
	.sg-hero-slider {
		--sg-hero-min-height: 0;
	}

	.sg-hero-slider__main {
		display: grid;
		grid-template-columns: 1fr;
		grid-template-rows: 1fr;
		align-items: stretch;
		gap: 0;
	}

	.sg-hero-slider__viewport {
		grid-column: 1;
		grid-row: 1;
		aspect-ratio: 16 / 9;
		min-height: min(160px, 28vw);
		max-height: min(42vh, 360px);
		height: auto;
		width: 100%;
	}

	.sg-hero-slider__content {
		left: clamp(1rem, 5vw, 2rem);
		right: clamp(1rem, 5vw, 2rem);
		bottom: clamp(0.85rem, 4vw, 1.5rem);
		top: auto;
		transform: none;
		max-width: 100%;
		text-align: left;
	}

	.sg-hero-slider__arrow {
		position: static;
		top: auto;
		transform: none;
		grid-column: 1;
		grid-row: 1;
		z-index: 5;
		align-self: center;
		width: 2.5rem;
		height: 3.75rem;
		margin: 0;
		color: #fff;
		filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.55));
		pointer-events: auto;
	}

	.sg-hero-slider__arrow--prev {
		justify-self: start;
		left: auto;
		right: auto;
		margin-left: clamp(0.2rem, 1.5vw, 0.5rem);
	}

	.sg-hero-slider__arrow--next {
		justify-self: end;
		left: auto;
		right: auto;
		margin-right: clamp(0.2rem, 1.5vw, 0.5rem);
	}

	.sg-hero-slider__arrow:focus-visible {
		outline: 2px solid #fff;
		outline-offset: 2px;
	}

	.sg-hero-slider__title {
		font-size: clamp(1.5rem, 4vw, 2.25rem);
	}
}

/* Mobile: compact height + title/description centered in frame */
@media (max-width: 600px) {
	.sg-hero-slider__viewport {
		aspect-ratio: 16 / 9;
		min-height: clamp(180px, 52vw, 260px);
		max-height: min(50vh, 340px);
	}

	.sg-hero-slider__content {
		top: 50%;
		left: 50%;
		right: auto;
		bottom: auto;
		transform: translate(-50%, -50%);
		width: calc(100% - 1.75rem);
		max-width: 22rem;
		text-align: center;
	}

	.sg-hero-slider__title {
		font-size: clamp(1.2rem, 6vw, 1.85rem);
		text-align: center;
	}

	.sg-hero-slider__desc {
		font-size: clamp(0.8rem, 3.4vw, 1rem);
		margin-left: auto;
		margin-right: auto;
		text-align: center;
	}

	.sg-hero-slider__scrim {
		background:
			radial-gradient(
				ellipse 85% 75% at 50% 50%,
				rgba(0, 0, 0, 0.45) 0%,
				rgba(0, 0, 0, 0.22) 55%,
				transparent 85%
			),
			linear-gradient(
				to bottom,
				rgba(0, 0, 0, 0.2) 0%,
				rgba(0, 0, 0, 0.35) 100%
			);
	}

	.sg-hero-slider__pagination {
		padding-top: 0.5rem;
	}

	.sg-hero-slider__dot {
		min-width: 10px;
		min-height: 10px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sg-hero-slider__slide,
	.sg-hero-slider__slide.is-active .sg-hero-slider__bg {
		transition: none;
	}
}
