/**
 * Fullscreen Hero: one photograph or video filling the screen, with a star row, a headline and a scroll cue.
 *
 * @package Atheria_Core
 * @since   1.0.0
 */

.ath-fs-hero {
	--ath-fs-hero-screen: 100vh;
	--ath-fs-hero-taken: var(--ath-admin-bar-height, 0px);
	--ath-fs-hero-focal: center;
	--ath-fs-hero-overlay: var(--ath-surface-inverse, #243C4C);
	--ath-fs-hero-overlay-opacity: 0.55;
	--ath-fs-hero-text: var(--ath-on-inverse, #F4FCFB);
	/* Frost held back by alpha, because no on-inverse role is both quieter than frost and legible over a photograph (D-083). */
	--ath-fs-hero-text-muted: rgba(244, 252, 251, 0.85);
	--ath-fs-hero-eyebrow: var(--ath-on-inverse, #F4FCFB);
	--ath-fs-hero-eyebrow-space: clamp(0.75rem, 0.607rem + 0.586vw, 1.25rem);
	--ath-fs-hero-maxw: 44rem;
	--ath-fs-hero-side: clamp(1.25rem, 0.536rem + 2.93vw, 3.75rem);
	--ath-fs-hero-star: var(--ath-rating-star-inverse, var(--ath-on-inverse, #F4FCFB));
	--ath-fs-hero-star-size: clamp(0.75rem, 0.679rem + 0.293vw, 1rem);
	--ath-fs-hero-star-gap: clamp(0.5rem, 0.429rem + 0.293vw, 0.75rem);
	--ath-fs-hero-star-space: clamp(1rem, 0.786rem + 0.879vw, 1.75rem);
	--ath-fs-hero-cue: var(--ath-on-inverse, #F4FCFB);
	--ath-fs-hero-cue-dot: currentColor;
	--ath-fs-hero-cue-w: clamp(2.5rem, 2.314rem + 0.762vw, 3rem);
	--ath-fs-hero-cue-ratio: 1.75;
	--ath-fs-hero-cue-stroke: 1px;
	--ath-fs-hero-cue-dot-size: 0.4rem;
	/* A length, because a percentage on translateY resolves against the dot's own box. */
	--ath-fs-hero-cue-travel: calc(var(--ath-fs-hero-cue-w) * 0.78);
	--ath-fs-hero-cue-speed: 3s;
	--ath-fs-hero-cue-bottom: clamp(1.75rem, 1.179rem + 2.344vw, 3.75rem);

	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	isolation: isolate;
	overflow: hidden;
	box-sizing: border-box;
	min-height: calc(var(--ath-fs-hero-screen) - var(--ath-fs-hero-taken));
	padding-top: var(--ath-fs-hero-top, 1.5rem);
	/* The cue is out of the flow, so the content is given its room back. */
	padding-bottom: calc(var(--ath-fs-hero-cue-bottom) + var(--ath-fs-hero-cue-w) * var(--ath-fs-hero-cue-ratio) + 1.5rem);
	background-color: var(--ath-surface-inverse, #243C4C);
	color: var(--ath-fs-hero-text);
	width: 100cqw;
	margin-left: calc(50% - 50cqw);
	margin-right: calc(50% - 50cqw);
}

@supports (height: 100svh) {
	.ath-fs-hero {
		--ath-fs-hero-screen: 100svh;
	}
}

/* The site wrapper, never body, is the query container: containment on body breaks the sticky header (D-068). */
.atheria-site:has(.ath-fs-hero) {
	container-type: inline-size;
}

/* A header that keeps its own room takes it from the screen as well. */
body:not(.atheria-header-overlay) .ath-fs-hero {
	--ath-fs-hero-taken: calc(var(--ath-admin-bar-height, 0px) + var(--ath-header-height, 0px));
}

body.atheria-header-overlay .ath-fs-hero {
	padding-top: calc(var(--ath-header-overlay-clearance, 0px) + var(--ath-fs-hero-top, 1.5rem));
}

.ath-fs-hero__bg {
	position: absolute;
	inset: 0;
	z-index: 1;
	overflow: hidden;
}

.ath-fs-hero__bg-img,
.ath-fs-hero__bg-video {
	position: absolute !important;
	inset: 0 !important;
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	object-fit: cover !important;
	object-position: var(--ath-fs-hero-focal);
	border-radius: 0 !important;
}

.ath-fs-hero__bg-video {
	opacity: 0;
	transition: opacity 0.6s var(--ath-ease-out, ease-out);
}

.ath-fs-hero--playing .ath-fs-hero__bg-video {
	opacity: 1;
}

.ath-fs-hero__overlay {
	position: absolute;
	inset: 0;
	background-color: var(--ath-fs-hero-overlay);
	opacity: var(--ath-fs-hero-overlay-opacity);
}

.ath-fs-hero__content {
	position: relative;
	z-index: 2;
	box-sizing: border-box;
	width: 100%;
	max-width: var(--ath-fs-hero-maxw);
	margin-inline: auto;
	padding-inline: var(--ath-fs-hero-side);
	text-align: center;
}

.ath-fs-hero__stars {
	display: flex;
	justify-content: var(--ath-fs-hero-justify, center);
	align-items: center;
	gap: var(--ath-fs-hero-star-gap);
	margin: 0 0 var(--ath-fs-hero-star-space);
	line-height: 0;
}

.ath-fs-hero__star {
	display: block;
	flex: 0 0 auto;
	width: var(--ath-fs-hero-star-size);
	height: var(--ath-fs-hero-star-size);
	fill: var(--ath-fs-hero-star);
}

.ath-fs-hero__eyebrow {
	display: block;
	margin: 0 0 var(--ath-fs-hero-eyebrow-space);
	color: var(--ath-fs-hero-eyebrow);
	font-family: var(--ath-font-eyebrow, sans-serif);
	font-size: var(--ath-text-eyebrow-size);
	font-weight: var(--ath-text-eyebrow-weight, 650);
	line-height: var(--ath-text-eyebrow-lh, 1.3);
	letter-spacing: var(--ath-text-eyebrow-ls, 0.18em);
	text-transform: var(--ath-text-eyebrow-transform, uppercase);
}

.ath-fs-hero__headline {
	margin: 0;
	color: inherit;
	font-family: var(--ath-font-heading, serif);
	font-size: var(--ath-text-h1-size);
	font-weight: var(--ath-text-h1-weight, 400);
	/* At the h1 leading one line's descenders meet the next line's ascenders; 1.06 is the least that keeps them apart. */
	line-height: max(var(--ath-text-h1-lh, 0.92), 1.06);
	letter-spacing: var(--ath-text-h1-ls, -0.024em);
}

.ath-fs-hero__headline .ath-muted-text {
	color: var(--ath-fs-hero-text-muted);
}

.ath-fs-hero__cue {
	position: absolute;
	z-index: 3;
	inset-inline: 0;
	bottom: var(--ath-fs-hero-cue-bottom);
	display: block;
	width: fit-content;
	margin: 0 auto;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: none;
	color: var(--ath-fs-hero-cue);
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.ath-fs-hero__cue:hover {
	color: var(--ath-fs-hero-cue-hover, var(--ath-fs-hero-cue));
}

.ath-fs-hero__cue:focus-visible {
	color: var(--ath-fs-hero-cue-hover, var(--ath-fs-hero-cue));
	outline: 2px solid var(--ath-focus-ring-inverse, #82A9C4);
	outline-offset: 4px;
}

.ath-fs-hero__cue-shape {
	position: relative;
	display: block;
	box-sizing: border-box;
	width: var(--ath-fs-hero-cue-w);
	height: calc(var(--ath-fs-hero-cue-w) * var(--ath-fs-hero-cue-ratio));
	border: var(--ath-fs-hero-cue-stroke) solid currentColor;
	border-radius: 999px;
}

.ath-fs-hero__cue-shape::after {
	content: "";
	position: absolute;
	top: 30%;
	left: 50%;
	width: var(--ath-fs-hero-cue-dot-size);
	height: var(--ath-fs-hero-cue-dot-size);
	margin-left: calc(var(--ath-fs-hero-cue-dot-size) / -2);
	border-radius: 50%;
	background: var(--ath-fs-hero-cue-dot);
	animation: ath-fs-hero-cue var(--ath-fs-hero-cue-speed) var(--ath-ease-out, ease-out) infinite;
}

@keyframes ath-fs-hero-cue {
	0% {
		transform: translateY(0);
		opacity: 1;
	}
	62% {
		transform: translateY(var(--ath-fs-hero-cue-travel));
		opacity: 1;
	}
	76% {
		transform: translateY(var(--ath-fs-hero-cue-travel));
		opacity: 0;
	}
	100% {
		transform: translateY(0);
		opacity: 0;
	}
}

.ath-fs-hero--cue-bar {
	--ath-fs-hero-cue-ratio: 1.545;
	--ath-fs-hero-cue-travel: calc(var(--ath-fs-hero-cue-w) * 0.5);
}

.ath-fs-hero--cue-bar .ath-fs-hero__cue-shape::after {
	top: 16.5%;
	width: 2px;
	height: 26.5%;
	margin-left: -1px;
	border-radius: 2px;
	animation-name: ath-fs-hero-cue-bar;
	animation-timing-function: ease-in-out;
}

@keyframes ath-fs-hero-cue-bar {
	0% {
		transform: translateY(0);
		opacity: 1;
	}
	70% {
		transform: translateY(var(--ath-fs-hero-cue-travel));
		opacity: 0;
	}
	100% {
		transform: translateY(0);
		opacity: 0;
	}
}

.ath-fs-hero__notice {
	position: absolute;
	z-index: 4;
	top: 1rem;
	left: 1rem;
	max-width: 60ch;
	margin: 0;
	padding: 0.55rem 0.8rem;
	border-radius: 10px;
	background: rgba(15, 26, 32, 0.62);
	color: var(--ath-frost, #F4FCFB);
	font-size: 0.8125rem;
	line-height: 1.45;
	text-align: left;
}

@media (prefers-reduced-motion: reduce) {
	.ath-fs-hero .ath-fs-hero__cue-shape::after {
		animation: none;
		opacity: 1;
	}

	.ath-fs-hero__bg-video {
		transition: none;
	}
}

@media (max-width: 767px) {
	.ath-fs-hero {
		--ath-fs-hero-maxw: 24rem;
	}
}

/* Elementor's own entrance animation would otherwise hide the whole widget. */
.elementor-widget-atheria_fullscreen_hero.elementor-invisible {
	visibility: visible !important;
}
