/*
 * HG Photos v2: homepage hero slideshow (front end only).
 * The photos come from the Gallery block at the top of the hero.
 * In the editor that Gallery shows as normal thumbnails so it's easy to edit.
 */

.hg-hero {
	position: relative;
	overflow: hidden;
	background-color: #0b1a2e;
}

/* The gallery becomes a stack of full-screen slides */
.hg-hero > .wp-block-gallery.hg-slides {
	position: absolute !important;
	inset: 0;
	z-index: 0;
	display: block !important;
	margin: 0 !important;
	padding: 0 !important;
	gap: 0 !important;
}

.hg-hero > .wp-block-gallery.hg-slides > figure.wp-block-image {
	position: absolute !important;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	margin: 0 !important;
	opacity: 0;
	transition: opacity 1.2s ease;
}

.hg-hero > .wp-block-gallery.hg-slides > figure.wp-block-image:first-child,
.hg-hero.is-ready > .wp-block-gallery.hg-slides > figure.wp-block-image:first-child {
	opacity: 1;
}

.hg-hero.is-ready > .wp-block-gallery.hg-slides > figure.wp-block-image {
	opacity: 0;
}

.hg-hero.is-ready > .wp-block-gallery.hg-slides > figure.wp-block-image.is-active {
	opacity: 1;
}

.hg-hero > .wp-block-gallery.hg-slides > figure.wp-block-image img {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: none;
	object-fit: cover;
	transform: scale(1);
	transition: transform 7s linear;
}

.hg-hero.is-ready > .wp-block-gallery.hg-slides > figure.is-active img {
	transform: scale(1.06);
}

.hg-hero > .wp-block-gallery.hg-slides figcaption,
.hg-hero > .wp-block-gallery.hg-slides > .blocks-gallery-caption {
	display: none !important;
}

/* Darken top (for the menu) and bottom (for the text) */
.hg-hero::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
	background: linear-gradient(180deg, rgba(7, 17, 31, 0.55) 0%, rgba(7, 17, 31, 0) 28%, rgba(7, 17, 31, 0) 50%, rgba(7, 17, 31, 0.92) 100%);
}

.hg-hero > :not(.hg-slides) {
	position: relative;
	z-index: 2;
}

/* Lower-right slide switcher */
.hg-slide-nav {
	display: flex;
	flex-wrap: wrap;
	row-gap: 4px;
	column-gap: 20px;
	min-width: min(100%, 220px);
	max-width: 260px;
}

.hg-slide-nav button {
	all: unset;
	box-sizing: border-box;
	flex: 1 1 100%;
	display: grid;
	grid-template-columns: 28px 1fr;
	gap: 10px;
	align-items: center;
	padding: 8px 0;
	border-top: 1px solid rgba(214, 238, 252, 0.25);
	color: rgba(255, 255, 255, 0.55);
	cursor: pointer;
	transition: color 0.4s, border-color 0.4s;
}

.hg-slide-nav button:hover {
	color: rgba(255, 255, 255, 0.85);
}

.hg-slide-nav button.is-active {
	border-top-color: #d6eefc;
	color: #ffffff;
}

.hg-slide-nav button:focus-visible {
	outline: 2px solid #9fd3f5;
	outline-offset: 4px;
}

.hg-slide-nav__num {
	font: 600 13px/1 var(--wp--preset--font-family--condensed);
	letter-spacing: 0.1em;
}

.hg-slide-nav__tag {
	font: 500 13px/1.2 var(--wp--preset--font-family--sans);
}

@media (max-width: 600px) {
	.hg-slide-nav {
		max-width: none;
		width: 100%;
	}

	.hg-slide-nav button {
		flex: 1 1 calc(50% - 10px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.hg-hero > .wp-block-gallery.hg-slides > figure.wp-block-image,
	.hg-hero > .wp-block-gallery.hg-slides > figure.wp-block-image img {
		transition: none;
		transform: none !important;
	}
}
