/* ---- Grilla de la galería (editor + frontend) ---- */
.eg-gallery {
	display: grid;
	grid-template-columns: repeat( var( --eg-cols, 3 ), 1fr );
	gap: 10px;
	margin: 1.6em 0;
}

.eg-gallery .eg-item {
	margin: 0;
	overflow: hidden;
	border-radius: 6px;
	background: #f2f2f2;
}

.eg-gallery .eg-link {
	display: block;
	line-height: 0;
	cursor: zoom-in;
}

.eg-gallery .eg-img {
	width: 100%;
	height: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	display: block;
	transition: transform .4s ease, filter .4s ease;
}

.eg-gallery .eg-item:hover .eg-img {
	transform: scale( 1.06 );
	filter: brightness( .9 );
}

/* Responsive: tablet 3 columnas, celular 2 columnas */
@media ( max-width: 1024px ) {
	.eg-gallery {
		grid-template-columns: repeat( 3, 1fr );
	}
}

@media ( max-width: 782px ) {
	.eg-gallery {
		grid-template-columns: repeat( 2, 1fr );
	}
}

/* ---- Lightbox ---- */
.eg-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba( 0, 0, 0, .92 );
	-webkit-user-select: none;
	user-select: none;
}

.eg-lightbox.is-open {
	display: flex;
}

.eg-lightbox .eg-lb-figure {
	margin: 0;
	max-width: 92vw;
	max-height: 88vh;
	text-align: center;
}

.eg-lightbox .eg-lb-img {
	max-width: 92vw;
	max-height: 82vh;
	object-fit: contain;
	box-shadow: 0 10px 44px rgba( 0, 0, 0, .5 );
	border-radius: 4px;
}

.eg-lightbox .eg-lb-cap {
	color: #eee;
	font-size: 14px;
	margin-top: 12px;
	line-height: 1.4;
}

.eg-lightbox button {
	position: absolute;
	background: none;
	border: 0;
	color: #fff;
	cursor: pointer;
	line-height: 1;
	transition: opacity .2s ease;
}

.eg-lightbox .eg-lb-close {
	top: 14px;
	right: 20px;
	font-size: 42px;
}

.eg-lightbox .eg-lb-prev,
.eg-lightbox .eg-lb-next {
	top: 50%;
	transform: translateY( -50% );
	font-size: 52px;
	padding: 8px 18px;
	opacity: .75;
}

.eg-lightbox .eg-lb-prev:hover,
.eg-lightbox .eg-lb-next:hover,
.eg-lightbox .eg-lb-close:hover {
	opacity: 1;
}

.eg-lightbox .eg-lb-prev {
	left: 6px;
}

.eg-lightbox .eg-lb-next {
	right: 6px;
}

/* Si hay una sola imagen, ocultamos las flechas */
.eg-lightbox.eg-single .eg-lb-prev,
.eg-lightbox.eg-single .eg-lb-next {
	display: none;
}
