/* ============================================================
   KONDIDO — Galerie (page-specific; enqueued only on page-galerie.php)
   Source: /reference-static/assets/css/gallery.css
   ============================================================ */

.gallery-toolbar {
	position: sticky;
	top: var(--nav-h-solid);
	z-index: 150;
	background: rgba(250, 245, 236, 0.96);
	backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--border-soft);
	padding: 18px clamp(20px, 5vw, 64px);
	display: flex;
	justify-content: center;
}
.gallery-filters {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	justify-content: center;
	max-width: var(--max-w);
}

.gallery-main {
	max-width: 1500px;
	margin: 0 auto;
	padding: 44px clamp(20px, 5vw, 64px) 80px;
}
.gallery-grid {
	column-count: 3;
	column-gap: 20px;
}
.gallery-item {
	position: relative;
	break-inside: avoid;
	margin-bottom: 20px;
	border-radius: var(--r);
	overflow: hidden;
	box-shadow: var(--shadow-sm);
	cursor: pointer;
	display: block;
}
.gallery-item img {
	width: 100%;
	display: block;
	transition: transform 800ms var(--ease);
}
.gallery-item:hover img {
	transform: scale(1.06);
}
.gallery-item::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(23, 15, 10, 0) 55%, rgba(23, 15, 10, 0.82) 100%);
	opacity: 0;
	transition: opacity var(--dur) var(--ease);
}
.gallery-item:hover::after {
	opacity: 1;
}
.gallery-caption {
	position: absolute;
	inset-inline: 0;
	bottom: 0;
	z-index: 2;
	padding: 20px;
	color: var(--cream-soft);
	opacity: 0;
	transform: translateY(8px);
	transition: all var(--dur) var(--ease);
}
.gallery-item:hover .gallery-caption {
	opacity: 1;
	transform: translateY(0);
}
.gallery-caption-cat {
	font-size: var(--text-xs);
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--accent-light);
	display: block;
	margin-bottom: 4px;
}
.gallery-caption-title {
	font-family: var(--font-display);
	font-size: 19px;
	color: var(--cream-soft);
}
.gallery-caption-meta {
	display: block;
	margin-top: 5px;
	font-size: var(--text-xs);
	color: var(--cream-soft);
	opacity: 0.85;
	letter-spacing: 0.01em;
}

@media (max-width: 960px) {
	.gallery-grid {
		column-count: 2;
	}
}
@media (max-width: 560px) {
	.gallery-grid {
		column-count: 1;
	}
}

/* ---- Lightbox ---- */
.lightbox {
	position: fixed;
	inset: 0;
	z-index: 500;
	background: rgba(15, 10, 7, 0.96);
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity var(--dur) var(--ease);
	padding: 40px;
}
.lightbox.open {
	opacity: 1;
	visibility: visible;
}
.lightbox-img-wrap {
	max-width: min(1000px, 90vw);
	max-height: 82vh;
	position: relative;
}
.lightbox-img-wrap img {
	max-width: 100%;
	max-height: 82vh;
	display: block;
	margin: 0 auto;
	border-radius: var(--r);
	box-shadow: var(--shadow-lg);
}
.lightbox-caption {
	text-align: center;
	margin-top: 18px;
	color: var(--cream-soft);
}
.lightbox-caption-cat {
	font-size: 11px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--gold-light);
}
.lightbox-caption-title {
	font-family: var(--font-display);
	font-size: 22px;
	margin-top: 4px;
}
.lightbox-caption-meta {
	display: block;
	margin-top: 8px;
	font-size: 13px;
	color: var(--cream-soft);
	opacity: 0.7;
}
.lightbox-cta {
	margin-top: 22px;
	padding: 12px 28px;
	font-size: 11.5px;
}
.lightbox-close {
	position: absolute;
	top: 28px;
	inset-inline-end: 28px;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	border: 1px solid rgba(250, 245, 236, 0.3);
	background: transparent;
	color: var(--cream-soft);
	font-size: 18px;
	cursor: pointer;
	transition: all var(--dur-fast);
	z-index: 2;
}
.lightbox-close:hover {
	background: var(--cream-soft);
	color: var(--espresso);
}
.lightbox-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: 1px solid rgba(250, 245, 236, 0.3);
	background: transparent;
	color: var(--cream-soft);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all var(--dur-fast);
}
.lightbox-nav:hover {
	background: var(--cream-soft);
	color: var(--espresso);
}
.lightbox-nav.prev {
	inset-inline-start: -10px;
}
.lightbox-nav.next {
	inset-inline-end: -10px;
}
@media (max-width: 760px) {
	.lightbox {
		padding: 20px;
	}
	.lightbox-nav {
		width: 44px;
		height: 44px;
	}
	.lightbox-nav.prev {
		inset-inline-start: 4px;
	}
	.lightbox-nav.next {
		inset-inline-end: 4px;
	}
	.lightbox-close {
		top: 16px;
		inset-inline-end: 16px;
	}
}

/* Hover-revealed captions never show on touch devices — surface them by default there instead. */
@media (hover: none) {
	.gallery-caption {
		opacity: 1;
		transform: translate(0, 0);
	}
	.gallery-item::after {
		opacity: 1;
	}
}
