/* Every card has the same size: a 4:3 frame the photo fills, cropped from the centre. */
.gallery__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.25rem;
}

.album-card {
	position: relative;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: var(--ink-raised);
}

.album-card[hidden] {
	display: none;
}

.album-card__link {
	position: absolute;
	inset: 0;
}

/* .gallery__grid in front: Elementor's own "img { height: auto }" would otherwise win on its pages. */
.gallery__grid .album-card img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transition: transform 0.8s var(--ease);
}

.album-card:hover img {
	transform: scale(1.04);
}

.album-card__caption {
	position: absolute;
	inset: auto 0 0;
	padding: 3rem 1.25rem 1.125rem;
	background: linear-gradient(0deg, rgba(16, 19, 24, 0.92), transparent);
}

.album-card__category {
	color: var(--sky);
	font-family: var(--font-heading);
	font-size: 1rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.album-card__title {
	font-size: clamp(1.5rem, 2.5vw, 2.25rem);
}

.album-card__link {
	display: block;
	color: inherit;
	text-decoration: none;
}

/* The caption sits on the photo, above the zooming image. */
.album-card__caption {
	z-index: 1;
}

.album-card__link:focus-visible {
	outline-offset: -4px;
}

.album-card__count {
	display: inline-block;
	margin-top: 0.5rem;
	color: var(--bone-muted);
	font-size: 0.8125rem;
}

.gallery__filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 2rem;
}

.gallery__filters button {
	padding: 0.5rem 1.125rem;
	border: 1px solid var(--ink-line);
	border-radius: 999px;
	background: transparent;
	color: var(--bone);
	font-family: var(--font-heading);
	font-size: 1rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease);
}

.gallery__filters button:hover {
	border-color: var(--sky);
}

.gallery__filters button[aria-pressed="true"] {
	border-color: var(--sky);
	background: var(--sky);
	color: var(--ink);
}

/* Photo viewer (gallery.js). */
.lightbox-open {
	overflow: hidden;
}

.lightbox {
	width: 100vw;
	max-width: none;
	height: 100vh;
	height: 100dvh;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--bone);
}

.lightbox::backdrop {
	background: rgba(8, 10, 13, 0.94);
}

.lightbox__figure {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	height: 100%;
	margin: 0;
	padding: 4.5rem clamp(1rem, 6vw, 6rem) 2rem;
	pointer-events: none;
	touch-action: pan-y;
}

.lightbox__image {
	width: auto;
	max-width: 100%;
	height: auto;
	max-height: calc(100% - 3.5rem);
	object-fit: contain;
	border-radius: 0.5rem;
	pointer-events: auto;
}

.lightbox__caption {
	display: flex;
	gap: 1rem;
	align-items: baseline;
	font-family: var(--font-heading);
	font-size: 1.125rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.lightbox__count {
	color: var(--sky);
}

.lightbox__close,
.lightbox__nav {
	position: absolute;
	display: grid;
	place-items: center;
	width: 3rem;
	height: 3rem;
	padding: 0;
	border: 1px solid rgba(240, 242, 243, 0.3);
	border-radius: 50%;
	background: rgba(16, 19, 24, 0.6);
	color: var(--bone);
	font-size: 2rem;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease);
}

.lightbox__close:hover,
.lightbox__nav:hover {
	border-color: var(--sky);
	background: var(--sky);
	color: var(--ink);
}

.lightbox__close {
	top: 1rem;
	right: 1rem;
}

.lightbox__nav {
	top: 50%;
	transform: translateY(-50%);
}

.lightbox__nav--prev {
	left: clamp(0.5rem, 2vw, 1.5rem);
}

.lightbox__nav--next {
	right: clamp(0.5rem, 2vw, 1.5rem);
}

@media (max-width: 599px) {
	.lightbox__nav {
		top: auto;
		bottom: 1rem;
		transform: none;
	}
}

@media (min-width: 600px) {
	.gallery__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 900px) {
	.gallery__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}
