.hero-banner {
	position: relative;
	display: grid;
	max-width: 100%;
	margin-bottom: var(--section-space);
	background: var(--color-surface);
}

.hero-banner__bg,
.hero-banner__content {
	grid-area: 1 / 1;
	min-width: 0;
}

.hero-banner__bg {
	line-height: 0;
	min-width: 0;
}

.hero-banner__bg-img,
.hero-banner__bg-video {
	display: block;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	height: auto;
}

.hero-banner__bg-img--mobile {
	display: none;
}

@media (max-width: 767px) {
	.hero-banner__bg-img--desktop {
		display: none;
	}

	.hero-banner__bg-img--mobile {
		display: block;
	}
}

.hero-banner__content {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-self: center;
	justify-self: center;
	width: min(100%, 36rem);
	padding: var(--space-5) var(--space-4);
	text-align: center;
}

/* Mobile: horizontal center; left = top, center = middle, right = bottom */
.hero-banner--pos-left .hero-banner__content {
	align-self: start;
	justify-self: center;
}

.hero-banner--pos-center .hero-banner__content {
	align-self: center;
	justify-self: center;
}

.hero-banner--pos-right .hero-banner__content {
	align-self: end;
	justify-self: center;
}

@media (min-width: 768px) {
	.hero-banner--pos-left .hero-banner__content {
		align-self: center;
		justify-self: start;
		margin-left: max(1rem, calc((100% - min(100% - 2rem, var(--container))) / 2));
	}

	.hero-banner--pos-center .hero-banner__content {
		align-self: center;
		justify-self: center;
	}

	.hero-banner--pos-right .hero-banner__content {
		align-self: center;
		justify-self: end;
		margin-right: max(1rem, calc((100% - min(100% - 2rem, var(--container))) / 2));
	}

	.hero-banner__content {
		position: static;
		padding: var(--space-6) var(--space-4);
	}
}

@media (max-width: 767px) {
	/* Overlay only. Static content lets the button pin to the banner, not the text box. */
	.hero-banner:not(.hero-banner--mobile-below) .hero-banner__content {
		position: static;
	}

	.hero-banner:not(.hero-banner--mobile-below) .hero-banner__cta {
		position: absolute;
		z-index: 2;
		bottom: 1.5rem;
		left: 50%;
		margin-top: 0;
		transform: translateX(-50%);
	}

	.hero-banner--mobile-below {
		display: flex;
		flex-direction: column;
		margin-bottom: var(--space-4);
	}

	.hero-banner--mobile-below .hero-banner__bg,
	.hero-banner--mobile-below .hero-banner__content {
		grid-area: auto;
		width: 100%;
	}

	.hero-banner--mobile-below .hero-banner__content {
		align-self: stretch;
		justify-self: stretch;
		max-width: none;
		margin: 0;
		padding: 0 var(--space-4);
		background-color: var(--hero-mobile-below-bg, var(--color-bg));
	}

	.hero-banner--mobile-below .hero-banner__rich-text,
	.hero-banner--mobile-below .hero-banner__cta {
		margin-top: var(--space-4);
	}

	/* Short rule under the button. Not on the CTA: that element uses ::before and overflow: hidden. */
	.hero-banner--mobile-below .hero-banner__content:has(.hero-banner__cta)::after {
		content: "";
		align-self: center;
		width: 4.5rem;
		height: 1px;
		margin-top: var(--space-4);
		background: #d0d0d0;
	}
}

.hero-banner--align-left .hero-banner__content {
	text-align: left;
}

.hero-banner--align-left .hero-banner__cta {
	align-self: flex-start;
}

.hero-banner--align-center .hero-banner__content {
	text-align: center;
}

.hero-banner--align-right .hero-banner__content {
	text-align: right;
}

.hero-banner--align-right .hero-banner__cta {
	align-self: flex-end;
}

.hero-banner__rich-text {
	font-size: clamp(1rem, 2.4vw, 1.375rem);
	line-height: 1.4;
	color: var(--color-copy);
}

.hero-banner__rich-text > *:first-child {
	margin-top: 0;
}

.hero-banner__rich-text > *:last-child {
	margin-bottom: 0;
}

.hero-banner__rich-text h1,
.hero-banner__rich-text h2,
.hero-banner__rich-text h3,
.hero-banner__rich-text h4 {
	margin: 0 0 var(--space-3);
	font-size: clamp(2.5rem, 10vw, 6rem);
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.05;
	text-transform: uppercase;
	color: var(--color-heading);
}

.hero-banner__rich-text p {
	margin: 0 0 var(--space-3);
}

.hero-banner__rich-text strong,
.hero-banner__rich-text b {
	font-weight: 700;
}

.hero-banner__rich-text a {
	color: var(--color-brand-blue, #003da5);
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.hero-banner__rich-text a:focus-visible {
	outline: 2px solid var(--color-brand-blue, #003da5);
	outline-offset: 2px;
}

.hero-banner__cta {
	position: relative;
	align-self: center;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	min-width: 14rem;
	margin-top: var(--space-4);
	padding: 1.05rem 2.5rem;
	border: 1px solid #1a2340;
	border-radius: 0.5rem;
	background: #1a2340;
	color: #fff;
	font: inherit;
	font-size: 1rem;
	line-height: 1;
	text-align: center;
	text-decoration: none;
}

.hero-banner__cta::before {
	content: "";
	position: absolute;
	top: -1px;
	right: -1px;
	bottom: -1px;
	left: -1px;
	background: #1a2340;
	transition: transform 0.25s ease;
	transform: translateX(0);
}

.hero-banner__cta-label {
	position: relative;
	z-index: 1;
	transition: color 0.25s ease;
}

@media (hover: hover) {
	.hero-banner__cta:hover::before {
		transform: translateX(-100%);
	}

	.hero-banner__cta:hover {
		background: #fff;
		color: #1a2340;
	}

	.hero-banner__cta:hover .hero-banner__cta-label {
		color: #1a2340;
	}
}

.hero-banner__cta:focus-visible::before {
	transform: translateX(-100%);
}

.hero-banner__cta:focus-visible {
	background: #fff;
	color: #1a2340;
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.hero-banner__cta:focus-visible .hero-banner__cta-label {
	color: #1a2340;
}

@media (min-width: 768px) {
	.hero-banner__cta {
		position: absolute;
		z-index: 2;
		bottom: 1.5rem;
		left: 50%;
		margin-top: 0;
		transform: translateX(-50%);
	}
}
