/* AG Hero */

.ag-hero {
	position: relative;
	display: flex;
	align-items: flex-end;
	min-height: 100vh;
	min-height: 100svh;
	overflow: hidden;
	isolation: isolate;
	background-color: var(--ag-charcoal);
	color: var(--ag-ivory);
}

.ag-hero--large {
	min-height: 85vh;
	min-height: 85svh;
}

.ag-hero--medium {
	min-height: 70vh;
	min-height: 70svh;
}

.ag-hero__media {
	position: absolute;
	inset: 0;
	z-index: -2;
}

/* On-brand backdrop until a photo is chosen. */
.ag-hero__media--empty {
	background:
		radial-gradient(120% 90% at 85% 10%, rgba(176, 141, 87, 0.28) 0%, rgba(176, 141, 87, 0) 55%),
		linear-gradient(160deg, #2e2c28 0%, #1e1d1b 60%);
}

.ag-hero__img,
.ag-hero__video {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Dark gradient for legibility: lighter at the top, strongest behind the text. */
.ag-hero::after {
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(
		180deg,
		rgba(30, 29, 27, calc(var(--ag-hero-overlay, 0.6) * 0.75)) 0%,
		rgba(30, 29, 27, calc(var(--ag-hero-overlay, 0.6) * 0.7)) 38%,
		rgba(30, 29, 27, var(--ag-hero-overlay, 0.6)) 100%
	);
	content: "";
	pointer-events: none;
}

.ag-hero__inner {
	width: 100%;
	padding-top: calc(var(--ag-header-h, 88px) + 3rem);
	padding-bottom: clamp(4.5rem, 9vw, 8rem);
}

.ag-hero__content {
	max-width: 60rem;
}

.ag-hero .ag-eyebrow.ag-hero__eyebrow {
	margin-bottom: 1.75rem;
	color: var(--ag-ivory);
}

.ag-hero__title {
	max-width: 16ch;
	margin: 0;
	color: var(--ag-ivory);
	font-size: var(--ag-h1);
	line-height: 1.02;
}

.ag-hero__sub {
	max-width: 36rem;
	margin: 1.75rem 0 0;
	color: rgba(247, 243, 236, 0.9);
	font-size: clamp(1.0625rem, 0.5vw + 1rem, 1.3125rem);
	line-height: 1.6;
}

.ag-hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin-top: 2.5rem;
}

/* Scroll cue */
.ag-hero__scroll {
	position: absolute;
	right: var(--ag-gutter, 24px);
	bottom: 0;
	display: none;
	align-items: center;
	gap: 14px;
	padding-bottom: 88px;
	color: var(--ag-ivory);
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	writing-mode: vertical-rl;
}

.ag-hero__scroll::after {
	position: absolute;
	bottom: 0;
	left: 50%;
	width: 1px;
	height: 72px;
	background: currentColor;
	content: "";
	transform-origin: top center;
	animation: ag-hero-scroll 2.4s var(--ag-ease, ease) infinite;
}

@keyframes ag-hero-scroll {
	0% {
		transform: scaleY(0);
		transform-origin: top center;
	}

	45% {
		transform: scaleY(1);
		transform-origin: top center;
	}

	55% {
		transform: scaleY(1);
		transform-origin: bottom center;
	}

	100% {
		transform: scaleY(0);
		transform-origin: bottom center;
	}
}

@media (min-width: 1024px) {
	.ag-hero__scroll {
		display: flex;
	}
}

/* Entrance: text rises in once on load. */
.ag-motion .ag-hero__content > * {
	animation: ag-hero-in 0.9s var(--ag-ease, ease) both;
}

.ag-motion .ag-hero__content > *:nth-child(2) {
	animation-delay: 0.1s;
}

.ag-motion .ag-hero__content > *:nth-child(3) {
	animation-delay: 0.2s;
}

.ag-motion .ag-hero__content > *:nth-child(4) {
	animation-delay: 0.3s;
}

@keyframes ag-hero-in {
	from {
		opacity: 0;
		transform: translateY(24px);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

/* The headline only slides (never hidden): it is the first thing painted on the page. */
.ag-motion .ag-hero__content > .ag-hero__title {
	animation-name: ag-hero-rise;
}

@keyframes ag-hero-rise {
	from {
		transform: translateY(24px);
	}

	to {
		transform: none;
	}
}

.elementor-editor-active .ag-hero__content > * {
	animation: none;
}

@media (prefers-reduced-motion: reduce) {
	.ag-hero__scroll::after {
		animation: none;
	}
}

/* ---------- Slideshow (slow cross-fade) ---------- */
.ag-hero__slide {
	opacity: 0;
	transition: opacity 1.8s var(--ag-ease, ease);
}

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

/* While the slideshow runs, the first photo fades like the others. */
[data-ag-hero-slides].is-running .ag-hero__img {
	opacity: 0;
	transition: opacity 1.8s var(--ag-ease, ease);
}

[data-ag-hero-slides].is-running .ag-hero__img.is-active {
	opacity: 1;
}

button.ag-hero__pause {
	position: absolute;
	bottom: 24px;
	left: var(--ag-gutter, 24px);
	z-index: 2;
	display: grid;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid rgba(247, 243, 236, 0.5);
	border-radius: 50%;
	background: rgba(30, 29, 27, 0.35);
	color: var(--ag-ivory);
	cursor: pointer;
	place-items: center;
}

button.ag-hero__pause[hidden] {
	display: none;
}

button.ag-hero__pause:hover,
button.ag-hero__pause:focus {
	border-color: var(--ag-ivory);
	background: rgba(30, 29, 27, 0.7);
	color: var(--ag-ivory);
}

.ag-hero__pause:focus-visible {
	outline: 2px solid var(--ag-ivory);
	outline-offset: 3px;
}

/* Pause bars; turns into a play triangle when paused. */
.ag-hero__pause-icon {
	width: 10px;
	height: 12px;
	border-right: 3px solid currentColor;
	border-left: 3px solid currentColor;
}

.ag-hero__pause[aria-pressed="true"] .ag-hero__pause-icon {
	width: 0;
	height: 0;
	margin-left: 3px;
	border-top: 7px solid transparent;
	border-right: 0;
	border-bottom: 7px solid transparent;
	border-left: 11px solid currentColor;
}
