/* Gallery page — filterable masonry grid + lightbox ---------------------- */

.lv-gallery-page {
	background: var(--lv-white);
	padding: clamp(48px, 7vw, 96px) clamp(20px, 4vw, 48px);
}

.lv-gallery-page__inner {
	max-width: var(--lv-container);
	margin: 0 auto;
}

/* Tabs — mirrors .lv-media__tab for visual consistency ------------------- */

.lv-gallery-page__tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: clamp(28px, 4vw, 44px);
}

.lv-gallery-page__tab {
	height: 46px;
	padding: 0 26px;
	font-family: var(--lv-font-body);
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: .12em;
	text-transform: uppercase;
	cursor: pointer;
	border: 1px solid rgba(26, 26, 26, .18);
	background: transparent;
	color: rgba(26, 26, 26, .7);
	transition: all .25s ease;
	border-radius: var(--lv-radius-full);
}

.lv-gallery-page__tab.is-active {
	border-color: var(--lv-ink);
	background: var(--lv-burgundy);
	color: var(--lv-white);
}

/* Masonry grid — CSS multi-column, not CSS Grid: preserves natural aspect
 * ratios (no aspect-ratio/object-fit crop), reflows top-to-bottom-per-column
 * rather than true row-packed masonry — accepted trade-off, no JS library. */

.lv-gallery-page__grid {
	columns: 1;
	column-gap: 14px;
}

@media (min-width: 690px) {
	.lv-gallery-page__grid {
		columns: 2;
	}
}

@media (min-width: 1000px) {
	.lv-gallery-page__grid {
		columns: 3;
	}
}

.lv-gallery-page__item {
	margin: 0 0 14px;
	break-inside: avoid;
	-webkit-column-break-inside: avoid;
}

.lv-gallery-page__item[hidden] {
	display: none;
}

.lv-gallery-page__trigger {
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	border-radius: var(--lv-radius-sm);
	overflow: hidden;
}

.lv-gallery-page__trigger img {
	display: block;
	width: 100%;
	height: auto;
	transition: transform .3s ease;
}

.lv-gallery-page__trigger:hover img,
.lv-gallery-page__trigger:focus-visible img {
	transform: scale(1.03);
}

@media (prefers-reduced-motion: reduce) {
	.lv-gallery-page__trigger img {
		transition: none;
	}

	.lv-gallery-page__trigger:hover img,
	.lv-gallery-page__trigger:focus-visible img {
		transform: none;
	}
}

/* Lightbox ---------------------------------------------------------------- */

.lv-gallery-lightbox {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
}

.lv-gallery-lightbox[hidden] {
	display: none;
}

.lv-gallery-lightbox__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(13, 13, 13, .92);
}

.lv-gallery-lightbox__figure {
	position: relative;
	z-index: 1;
	max-width: min(92vw, 1100px);
	max-height: 88vh;
	margin: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.lv-gallery-lightbox__image {
	max-width: 100%;
	max-height: 78vh;
	width: auto;
	height: auto;
	display: block;
	border-radius: var(--lv-radius-sm);
}

.lv-gallery-lightbox__caption {
	margin-top: 12px;
	color: var(--lv-white);
	font-size: 13px;
	text-align: center;
}

.lv-gallery-lightbox__close,
.lv-gallery-lightbox__nav {
	position: absolute;
	z-index: 2;
	border: 0;
	background: transparent;
	color: var(--lv-white);
	cursor: pointer;
	line-height: 1;
}

.lv-gallery-lightbox__close {
	top: clamp(12px, 3vw, 28px);
	right: clamp(12px, 3vw, 28px);
	font-size: 34px;
}

.lv-gallery-lightbox__nav {
	top: 50%;
	transform: translateY(-50%);
	font-size: 44px;
	padding: 8px 14px;
}

.lv-gallery-lightbox__nav--prev {
	left: clamp(4px, 2vw, 24px);
}

.lv-gallery-lightbox__nav--next {
	right: clamp(4px, 2vw, 24px);
}

.lv-gallery-lightbox__nav[hidden] {
	display: none;
}

.lv-gallery-lightbox__close:focus-visible,
.lv-gallery-lightbox__nav:focus-visible {
	outline: 2px solid var(--lv-white);
	outline-offset: 2px;
}
