.alex-gallery {
	--alex-gallery-accent: #00269a;
	width: 100%;
}

.alex-gallery,
.alex-gallery * {
	box-sizing: border-box;
}

.alex-gallery .alex-gallery__main {
	width: 100%;
	aspect-ratio: 1.35 / 1;
	overflow: hidden;
	background: #eee;
}

.alex-gallery img.alex-gallery__main-image {
	display: block;
	width: 100%;
	max-width: none;
	height: 100%;
	margin: 0;
	border-radius: 0;
	object-fit: cover;
}

.alex-gallery .alex-gallery__thumbnails {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
	margin-top: 12px;
}

.alex-gallery button.alex-gallery__thumbnail {
	display: block;
	position: relative;
	appearance: none;
	width: 100%;
	min-width: 0;
	aspect-ratio: 4 / 3;
	margin: 0;
	padding: 0;
	overflow: hidden;
	border: 2px solid transparent;
	border-radius: 0;
	background: #eee;
	box-shadow: none;
	cursor: pointer;
	opacity: 0.65;
	transition: opacity 0.2s ease, border-color 0.2s ease;
}

.alex-gallery img.alex-gallery__thumbnail-image {
	display: block;
	width: 100%;
	max-width: none;
	height: 100%;
	margin: 0;
	border-radius: 0;
	object-fit: cover;
}

.alex-gallery button.alex-gallery__thumbnail:hover,
.alex-gallery button.alex-gallery__thumbnail.is-active {
	opacity: 1;
}

.alex-gallery button.alex-gallery__thumbnail.is-active {
	border-color: var(--alex-gallery-accent);
}

.alex-gallery button.alex-gallery__thumbnail:focus-visible {
	outline: 2px solid var(--alex-gallery-accent);
	outline-offset: 3px;
	opacity: 1;
}

.alex-gallery .alex-gallery__caption {
	margin: 12px 0 0;
	color: #81766f;
	font-size: 14px;
	line-height: 1.5;
	letter-spacing: 0.02em;
	white-space: pre-line;
}

@media (max-width: 767px) {
	.alex-gallery .alex-gallery__main {
		aspect-ratio: 4 / 3;
	}

	.alex-gallery .alex-gallery__thumbnails {
		gap: 8px;
		margin-top: 8px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.alex-gallery button.alex-gallery__thumbnail {
		transition: none;
	}
}