.container-gallery {
	--bg: #0b0c0f;
	--fg: #0f1115;
	--text: #e8eaf1;
	--muted: #a7b0c0;
	--ring: #ffffff;
	--card: #111319;
	margin: 0 auto;
	padding: 24px;
}

/* Masonry-style columns (no cuadrícula rígida) */
.container-gallery .gallery {
	column-gap: 16px;
}

@media (min-width: 0px) {
	.container-gallery .gallery {
		columns: 1;
	}
}

@media (min-width: 640px) {
	.container-gallery .gallery {
		columns: 2;
	}
}

@media (min-width: 1024px) {
	.container-gallery .gallery {
		columns: 3;
	}
}

.container-gallery .gallery-item {
	display: block;
	margin: 0 0 16px;
	/* espacio vertical entre items */
	border-radius: 16px;
	overflow: hidden;
	background: var(--card);
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
	cursor: zoom-in;
	/* Evitar que los elementos se partan entre columnas */
	break-inside: avoid;
	-webkit-column-break-inside: avoid;
	-moz-column-break-inside: avoid;
	position: relative;
}

.container-gallery .gallery-item img {
	display: block;
	width: 100%;
	height: auto;
	object-fit: cover;
	transition: transform 0.2s ease;
}

.container-gallery .gallery-item:hover img {
	transform: scale(1.02);
}

.container-gallery .gallery-item .caption {
	position: absolute;
	left: 10px;
	bottom: 10px;
	padding: 6px 10px;
	font-size: 12px;
	color: #fff;
	background: rgba(0, 0, 0, 0.45);
	border-radius: 999px;
	backdrop-filter: blur(6px);
	pointer-events: none;
}

/* Lightbox */
body.no-scroll {
	overflow: hidden;
}

#lightbox-cfy {
	position: fixed;
	inset: 0;
	display: none;
	z-index: 9999;
	background: rgba(0, 0, 0, 0.8);
	backdrop-filter: blur(3px);
	/* layout */
	display: none;
	/* se muestra con jQuery */
}

#lightbox-cfy .lb-inner {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

#lightbox-cfy .lb-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 10px 14px;
}

#lightbox-cfy .lb-title {
	text-align: center;
	color: #fff;
	opacity: 0.85;
	font-size: 14px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

#lightbox-cfy .lb-btn {
	border: 0;
	background: transparent;
	color: #fff;
	padding: 8px;
	border-radius: 999px;
	cursor: pointer;
}

#lightbox-cfy .lb-btn:hover {
	background: rgba(255, 255, 255, 0.12);
}

#lightbox-cfy .lb-viewer {
	position: relative;
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 8px 56px;
}

#lightbox-cfy .lb-img {
	max-width: 92vw;
	max-height: 78vh;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 16px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
	display: none;
}

#lightbox-cfy .lb-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
}

#lightbox-cfy .lb-prev {
	left: 12px;
}

#lightbox-cfy .lb-next {
	right: 12px;
}

#lightbox-cfy .lb__close {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	font-size: 1.5rem;
	line-height: 1;
	border: 0;
	background: transparent;
	padding: 0.25rem 0.5rem;
	cursor: pointer;
}
#lightbox-cfy .lb__close:focus {
	outline: 2px solid #000;
}

#lightbox-cfy .nav-btn {
	border: 0;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	width: 44px;
	height: 44px;
	border-radius: 999px;
	cursor: pointer;
	font-size: 26px;
	line-height: 1;
	display: grid;
	place-items: center;
}

#lightbox-cfy .nav-btn:hover {
	background: rgba(255, 255, 255, 0.2);
}

#lightbox-cfy .lb-thumbs {
	padding: 10px 12px 16px;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.45));
}

#lightbox-cfy .thumbs-row {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	padding-bottom: 4px;
}

#lightbox-cfy .thumb {
	border: 1px solid rgba(255, 255, 255, 0.18);
	background: transparent;
	padding: 0;
	border-radius: 10px;
	overflow: hidden;
	cursor: pointer;
	opacity: 0.9;
}

#lightbox-cfy .thumb:hover {
	opacity: 1;
}

#lightbox-cfy .thumb.active {
	border-color: #fff;
	opacity: 1;
}

#lightbox-cfy .thumb img {
	width: 96px;
	height: 64px;
	object-fit: cover;
	display: block;
}

/* Accesibilidad: reducir animaciones si el usuario lo pide */
@media (prefers-reduced-motion: reduce) {
	.container-gallery .gallery-item img {
		transition: none;
	}
}
