.hero-carousel {
	--hero-blue: #0F79BF;
	--hero-orange: #D97B32;
	--hero-orange-hover: #C26A26;
	--hero-pad: clamp(1.5rem, 4.8vw, 3.75rem);
	--hero-fade: 0.35s;
	--hero-dot: 0.75rem;

	font-family: "Source Sans Pro", sans-serif;
	color: #fff;
}

.hero-carousel__inner {
	position: relative;
	display: grid;
	max-width: 1240px;
	margin: 0 auto;
	overflow: hidden;
	background: var(--hero-blue);
	transition: height var(--hero-fade) ease;
}

.hero-carousel__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* ---------- Tabs (dots) ---------- */

.hero-carousel__tabs {
	position: absolute;
	z-index: 2;
	bottom: var(--hero-pad);
	left: calc(var(--hero-pad) - (2.75rem - var(--hero-dot)) / 2); /* line the dot up with the text edge */
	display: flex;
	flex-wrap: wrap;
	max-width: calc(50% - var(--hero-pad));
}

/* 44px hit area, 12px visible dot */
.hero-carousel__tab {
	display: grid;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	padding: 0;
	background: none;
	border: 0;
	cursor: pointer;
}

.hero-carousel__tab::before {
	content: "";
	width: var(--hero-dot);
	height: var(--hero-dot);
	border: 2px solid #fff;
	border-radius: 50%;
	background: transparent;
	transition: background-color 0.2s, transform 0.2s;
}

.hero-carousel__tab[aria-selected="true"]::before {
	background: #fff;
	transform: scale(1.2);
}

.hero-carousel__tab:focus-visible {
	outline: none;
}

.hero-carousel__tab:focus-visible::before {
	box-shadow: 0 0 0 3px var(--hero-blue), 0 0 0 5px #fff;
}

/* ---------- Panel (crossfade, height follows the active panel) ---------- */

.hero-carousel__panel {
	grid-area: 1 / 1;
	display: grid;
	grid-template-columns: 1fr 1fr;
	min-height: 550px;
	z-index: 1;
	opacity: 1;
	visibility: visible;
	transition: opacity var(--hero-fade) ease, visibility 0s linear 0s;
}

/* Hidden panels leave the layout (so they don't stretch the block) but stay
   rendered so they can fade out and their images preload.
   !important beats themes that set [hidden] { display: none !important }. */
.hero-carousel__panel[hidden] {
	display: grid !important;
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 0;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity var(--hero-fade) ease, visibility 0s linear var(--hero-fade);
}

/* ---------- Text column ---------- */

.hero-carousel__content {
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: var(--hero-pad);
	background: var(--hero-blue);
}

/* Room for the dots at the bottom */
.hero-carousel--has-tabs .hero-carousel__content {
	padding-bottom: calc(var(--hero-pad) + 3.5rem);
}

/* Label: 14px bold */
.hero-carousel .hero-carousel__eyebrow {
	margin: 0 0 1.5rem;
	font-size: 0.875rem;
	font-weight: 700;
	letter-spacing: 0.15em;
	text-transform: uppercase;
}

/* Heading: 40px. Three classes so theme h1/h2 rules can't add spacing */
.hero-carousel .hero-carousel__panel .hero-carousel__heading {
	margin: 0 0 1.75rem;
	padding: 0;
	border: 0;
	color: #fff;
	font-family: inherit;
	font-size: 2.5rem;
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: normal;
	text-transform: none;
}

.hero-carousel .hero-carousel__panel .hero-carousel__heading::before,
.hero-carousel .hero-carousel__panel .hero-carousel__heading::after {
	content: none;
}

/* Body: 16px bold */
.hero-carousel__text {
	max-width: 24rem;
	margin-bottom: 2rem;
}

.hero-carousel .hero-carousel__text,
.hero-carousel .hero-carousel__text p {
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.7;
}

.hero-carousel__text p {
	margin: 0 0 1em;
}

.hero-carousel__text p:last-child {
	margin-bottom: 0;
}

/* Button: 14px bold */
.hero-carousel__cta {
	align-self: flex-start;
	padding: 0.9rem 2.5rem;
	background: var(--hero-orange);
	border-radius: 999px;
	color: #fff;
	font-size: 0.875rem;
	font-weight: 700;
	text-decoration: none;
	transition: background-color 0.2s;
}

.hero-carousel__cta:hover,
.hero-carousel__cta:focus-visible {
	background: var(--hero-orange-hover);
	color: #fff;
	text-decoration: none;
}

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

/* ---------- Media column ---------- */

.hero-carousel__media {
	position: relative;
	overflow: hidden;
	background: var(--hero-blue);
}

.hero-carousel__image,
.hero-carousel__video iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.hero-carousel__image {
	object-fit: cover;
}

/* ---------- Mobile ---------- */

@media (max-width: 991px) {
	.hero-carousel__panel {
		grid-area: 1 / 1;
		grid-template-columns: 1fr;
		min-height: 0;
	}

	.hero-carousel__content,
	.hero-carousel--has-tabs .hero-carousel__content {
		padding: var(--hero-pad);
	}

	.hero-carousel__media {
		aspect-ratio: 4 / 3;
	}

	/* Dots centred below the image */
	.hero-carousel__tabs {
		position: static;
		grid-row: 2;
		justify-content: center;
		max-width: none;
		padding: 0.5rem var(--hero-pad);
	}
}

/* ---------- Accessibility ---------- */

@media (forced-colors: active) {
	.hero-carousel__tab::before {
		border-color: ButtonText;
	}

	.hero-carousel__tab[aria-selected="true"]::before {
		background: Highlight;
		border-color: Highlight;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hero-carousel__inner,
	.hero-carousel__panel,
	.hero-carousel__panel[hidden],
	.hero-carousel__tab::before {
		transition: none;
	}
}