.sa-hero {
	position: relative;
	display: grid;
	align-items: center;
	min-height: 28rem;
	overflow: hidden;
	color: var(--theme-palette-color-7);
	background-color: var(--theme-palette-color-2);
}

.sa-hero__media.ct-media-container,
.sa-hero__shade {
	position: absolute;
	inset: 0;
	display: block;
	width: auto;
	height: auto;
}

.sa-hero__media.ct-media-container img {
	object-position: var(--sa-hero-focal, 50% 50%);
}

.sa-hero__shade {
	background: color-mix(in srgb, var(--theme-palette-color-2) 55%, transparent);
}

.sa-hero__content {
	grid-area: 1 / 1;
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	padding-block: 6rem 0;
}

.sa-hero.has-bottom-space .sa-hero__content {
	padding-block: 6rem 8rem;
}

.sa-hero__content > * {
	max-width: 48rem;
}

.sa-hero :is(h1, h2, h3, h4),
.sa-hero p {
	margin: 0;
	color: inherit!important;
}

.sa-hero .h1 {
	text-wrap: balance;
}

body:not(.home) .sa-hero .h1.is-long {
	--theme-font-size: clamp(64px, 1.502vw + 58.37px, 80px);
}

.sa-hero__cam-container {
	grid-area: 1 / 1;
	position: relative;
	z-index: 1;
	align-self: end;
	justify-self: end;
}

.sa-hero__cam {
    position: relative;
    width: 19.5625rem;
    height: 100%;
    margin: 0 0 5rem auto;
    overflow: hidden;
    border-radius: 6px;
    box-shadow: 0 4px 24px 3px 
color-mix(in srgb, var(--theme-palette-color-2) 13%, transparent);
    aspect-ratio: 16 / 9;
}

.sa-hero__cam-stage,
.sa-hero__cam-stage iframe {
	width: 100%;
	height: 100%;
}

.sa-hero__cam-stage {
	position: absolute;
	inset: 0;
}

.sa-hero__cam-stage iframe,
.sa-hero__cam-slot iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
	object-fit: cover;
}

.sa-hero__live {
	position: absolute;
	z-index: 1;
	top: 4px;
	left: 4px;
	display: inline-flex;
	gap: 5px;
	align-items: center;
	height: 18px;
	margin: 0;
	padding: 0 6px;
	border-radius: 4px;
	background: var(--theme-palette-color-8);
	color: var(--theme-palette-color-7);
	font-size: 12px;
	font-weight: 500;
	line-height: 1;
	text-transform: uppercase;
	pointer-events: none;
}

.sa-hero__live-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--theme-palette-color-7);
}

.sa-hero__cam-expand,
.sa-hero__cam-close {
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 4px;
	background: var(--theme-palette-color-7);
	color: var(--theme-palette-color-3);
	cursor: pointer;
}

.sa-hero__cam-expand {
	position: absolute;
	z-index: 1;
	right: 10px;
	bottom: 10px;
}

.sa-hero__cam-close {
	position: absolute;
	z-index: 1;
	top: 10px;
	right: 10px;
	font-size: 22px;
	line-height: 1;
}

.sa-hero__cam-modal {
	position: fixed;
	z-index: 1000;
	inset: 0;
	display: grid;
	place-items: center;
	padding: 2rem;
	background: color-mix(in srgb, var(--theme-palette-color-3) 72%, transparent);
	width: 100%;
	max-width: 100%;
	margin: 0;
}

.sa-hero__cam-modal[hidden] {
	display: none !important;
}

.sa-hero__cam-dialog {
	position: relative;
	width: min(64rem, 100%);
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: 6px;
	background: var(--theme-palette-color-3);
}

.sa-hero__cam-slot,
.sa-hero__cam-slot iframe {
	width: 100%;
	height: 100%;
}

body.sa-cam-open {
	overflow: hidden;
}

@media (min-width: 900px) {
	.sa-hero {
		min-height: 50rem;
	}
}

@media (max-width: 899px) {
	.sa-hero {
		min-height: 100svh;
		/* Header clearance, then the copy, then the camera. */
		grid-template-rows: 7.5rem 1fr auto;
	}

	.sa-hero__content,
	.sa-hero__cam-container {
		grid-area: auto;
	}

	.sa-hero__content {
		grid-row: 2;
		align-self: end;
		padding-top: 1.5rem;
		padding-bottom: 1.5rem;
	}

	.sa-hero__cam-container {
		grid-row: 3;
		align-self: start;
		justify-self: stretch;
		padding-bottom: 1.5rem;
	}

	.sa-hero__cam {
		width: 12.5rem;
		height: auto;
		margin: 0 auto 0 0;
	}

	.sa-hero.has-bottom-space .sa-hero__content {
		padding-top: 1.5rem;
		padding-bottom: 7rem;
	}

	.sa-hero.has-bottom-space:has(.sa-hero__cam-container) .sa-hero__content {
		padding-bottom: 1.5rem;
	}

	.sa-hero.has-bottom-space .sa-hero__cam-container {
		padding-bottom: 7rem;
	}

	.sa-hero .sa-actions {
		flex-direction: column;
		align-items: flex-start;
	}
}

/* Camera fallback: still image and a message when the feed is offline or does not load */

.sa-hero__cam-fallback {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: end start;
	background: var(--theme-palette-color-3);
	color: var(--theme-palette-color-7);
}

.sa-hero__cam-fallback[hidden] {
	display: none;
}

.sa-hero__cam-fallback img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0.65;
}

.sa-hero__cam-fallback p {
	position: relative;
	margin: 0;
	padding: 0.6rem 0.8rem;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
}

.sa-hero__cam.is-unavailable .sa-hero__live,
.sa-hero__cam.is-unavailable .sa-hero__cam-expand {
	display: none;
}
