/* The Hero carousel: Photos crossfade behind the heading, line and button. */

.leimer-hero {
	position: relative;
	isolation: isolate;
	display: flex;
	align-items: flex-end;
	min-height: 78vh;
	min-height: 78svh;
	overflow: hidden;
	background-color: var(--wp--preset--color--accent-deep);
	color: var(--wp--preset--color--paper);
}

.leimer-hero__slides {
	position: absolute;
	inset: 0;
	z-index: -2;
}

.leimer-hero__slide {
	position: absolute;
	inset: 0;
	margin: 0;
	opacity: 0;
	transition: opacity 1.2s ease-in-out;
}

.leimer-hero__slide.is-active {
	opacity: 1;
}

.leimer-hero__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Darker toward the bottom, where the words sit, so they read over any Photo. */
.leimer-hero.has-photos::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(to top, rgb(0 0 0 / 0.8) 0%, rgb(0 0 0 / 0.55) 45%, rgb(0 0 0 / 0.2) 100%);
	pointer-events: none;
}

.leimer-hero__content {
	box-sizing: border-box;
	width: 100%;
	padding: var(--wp--preset--spacing--70) var(--wp--style--root--padding-right, 1.5rem) var(--wp--preset--spacing--60) var(--wp--style--root--padding-left, 1.5rem);
}

.leimer-hero__inner {
	max-width: var(--wp--style--global--wide-size, 1200px);
	margin-inline: auto;
}

.leimer-hero__inner > * {
	max-width: 40rem;
}

.leimer-hero__inner > .wp-block-heading {
	max-width: 52rem;
	text-wrap: balance;
}

/* Pause button and dots: bottom right. Every target is at least 24px for fingers. */
.leimer-hero__controls {
	position: absolute;
	right: var(--wp--style--root--padding-right, 1.5rem);
	bottom: var(--wp--preset--spacing--40);
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--20);
}

.leimer-hero__dots {
	display: flex;
}

.leimer-hero__pause,
.leimer-hero__dot {
	display: grid;
	place-items: center;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--wp--preset--color--paper);
	cursor: pointer;
}

.leimer-hero__pause {
	width: 2.25rem;
	height: 2.25rem;
	border: 2px solid currentcolor;
	border-radius: 50%;
	background-color: rgb(0 0 0 / 0.3);
}

.leimer-hero__pause svg {
	width: 0.875rem;
	height: 0.875rem;
	fill: currentcolor;
}

.leimer-hero__icon-play,
.leimer-hero.is-paused .leimer-hero__icon-pause {
	display: none;
}

.leimer-hero.is-paused .leimer-hero__icon-play {
	display: block;
}

.leimer-hero__dot {
	width: 1.75rem;
	height: 1.75rem;
}

.leimer-hero__dot::before {
	content: "";
	width: 0.625rem;
	height: 0.625rem;
	border: 2px solid currentcolor;
	border-radius: 50%;
	box-shadow: 0 0 2px rgb(0 0 0 / 0.6);
	transition: background-color 0.3s;
}

.leimer-hero__dot[aria-current="true"]::before {
	background-color: currentcolor;
}

.leimer-hero__pause:focus-visible,
.leimer-hero__dot:focus-visible {
	outline: 2px solid var(--wp--preset--color--paper);
	outline-offset: 2px;
}

/* Phones: the button sits bottom left under the words, so the controls move to the top. */
@media (max-width: 640px) {
	.leimer-hero {
		min-height: 72svh;
	}

	.leimer-hero__controls {
		top: var(--wp--preset--spacing--30);
		bottom: auto;
	}

	.leimer-hero.has-photos::after {
		background: linear-gradient(to top, rgb(0 0 0 / 0.82) 0%, rgb(0 0 0 / 0.6) 55%, rgb(0 0 0 / 0.3) 100%);
	}
}

@media (prefers-reduced-motion: reduce) {
	.leimer-hero__slide,
	.leimer-hero__dot::before {
		transition: none;
	}
}

/* Editor: no Photos there, just a note on how to choose them. */
.leimer-hero.is-editor {
	flex-direction: column;
	justify-content: flex-end;
}

.leimer-hero__note {
	position: absolute;
	top: var(--wp--preset--spacing--30);
	right: var(--wp--preset--spacing--30);
	max-width: 22rem;
	margin: 0;
	padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--30);
	border-radius: 4px;
	background-color: var(--wp--preset--color--paper);
	color: var(--wp--preset--color--ink);
	font-size: 0.875rem;
}
