/* Homepage slider (replaces Soliloquy). Loaded on the front page only. */

.home-slider {
	position: relative;
	margin: -53px 0 0;
	padding: 0;
}

/* All slides share one grid cell, so the track is as tall as the tallest slide. */
.home-slider__track {
	display: grid;
}

.home-slide {
	grid-area: 1 / 1;
	display: flex;
	align-items: center;
	gap: 2%;
	opacity: 0;
	visibility: hidden;
	transition: opacity 600ms ease, visibility 0s linear 600ms;
}

.home-slide.is-active {
	opacity: 1;
	visibility: visible;
	transition: opacity 600ms ease, visibility 0s;
	z-index: 1;
}

.home-slide__media {
	order: 2;
	flex: 0 0 auto;
	width: 750px;
	max-width: 67.5%;
	margin-left: auto;
	display: block;
}

.home-slide__image {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	/* WordPress gives lazy images a 3000x1500 placeholder until they load. */
	contain-intrinsic-size: 750px 500px;
}

.home-slide__caption {
	order: 1;
	flex: 0 1 30%;
	min-width: 0;
	padding: 3em 1.5em 0;
	text-align: left;
}

.home-slide__caption h1 {
	font-size: 2.5em;
	margin: 0 0 0.3em;
	line-height: 1.25;
}

.home-slide__caption p,
.home-slide__caption h3 {
	line-height: 1.4;
	font-weight: bold;
	font-size: 1.2em;
	color: #333;
	margin: 0 0 0.9em;
}

.home-slide__caption a {
	display: inline-block;
	padding: 10px 20px;
	background: #EC7E33;
	border-radius: 10px;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.25;
	color: #fff;
	text-decoration: none;
}

.home-slide__caption a:hover,
.home-slide__caption a:focus-visible {
	background: #BE3627;
	color: #fff;
}

/* Arrows */
.home-slider__arrow {
	position: absolute;
	top: 50%;
	z-index: 2;
	width: 32px;
	height: 32px;
	margin: -16px 0 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(190, 54, 39, 0.25);
	cursor: pointer;
	transition: background-color 150ms ease;
}

.home-slider__arrow::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 9px;
	height: 9px;
	border: solid #fff;
	border-width: 0 3px 3px 0;
}

.home-slider__arrow--prev { left: -20px; }
.home-slider__arrow--next { right: 20px; }
.home-slider__arrow--prev::before { transform: translate(-30%, -50%) rotate(135deg); }
.home-slider__arrow--next::before { transform: translate(-70%, -50%) rotate(-45deg); }

.home-slider__arrow:hover,
.home-slider__arrow:focus-visible {
	background: rgba(190, 54, 39, 0.6);
}

/* Dots */
.home-slider__dots {
	position: absolute;
	right: 0;
	bottom: 10px;
	left: 0;
	z-index: 2;
	display: flex;
	justify-content: center;
	gap: 7px;
}

.home-slider__dots[hidden],
.home-slider__arrow[hidden] {
	display: none;
}

.home-slider__dot {
	width: 14px;
	height: 14px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #951A22;
	cursor: pointer;
}

.home-slider__dot.is-active,
.home-slider__dot:hover {
	background: #EC7E33;
}

.home-slider button:focus-visible,
.home-slide__caption a:focus-visible {
	outline: 2px solid #333;
	outline-offset: 2px;
}

/* Phones: image on top, caption underneath. */
@media only screen and (max-width: 760px) {
	.home-slider {
		margin-top: 0;
		padding-bottom: 30px;
	}

	.home-slide {
		flex-direction: column;
		align-items: stretch;
	}

	.home-slide__media {
		order: 0;
		width: 100%;
		max-width: none;
		margin: 0;
	}

	.home-slide__caption {
		padding: 0.5em 0 0;
	}

	.home-slide__caption h1 {
		font-size: 2em;
	}

	.home-slider__arrow {
		top: 120px;
		top: calc((100vw - 30px) / 3);
	}

	.home-slider__dots {
		bottom: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.home-slide,
	.home-slide.is-active {
		transition: none;
	}
}
