/**
 * Ixtli Galería — frontend CSS.
 *
 * Grid responsivo: el número de columnas llega por la variable CSS inline
 * --ixtli-gal-columnas; colapsa a 2 columnas en móvil y a 1 en pantallas
 * muy angostas. Estilos sobrios, sin emojis.
 */

.ixtli-gal-grid {
	display: grid;
	grid-template-columns: repeat(var(--ixtli-gal-columnas, 3), 1fr);
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ixtli-gal-item {
	margin: 0;
	min-width: 0;
}

.ixtli-gal-figura {
	margin: 0;
}

.ixtli-gal-figura img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 4px;
}

.ixtli-gal-enlace-lightbox,
.ixtli-gal-enlace-externo {
	display: block;
	border: none;
	text-decoration: none;
	box-shadow: none;
}

.ixtli-gal-enlace-lightbox:focus-visible,
.ixtli-gal-enlace-externo:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

.ixtli-gal-enlace-lightbox:hover img,
.ixtli-gal-enlace-externo:hover img {
	opacity: 0.9;
}

.ixtli-gal-pie {
	margin-top: 6px;
	font-size: 0.875rem;
	line-height: 1.4;
	color: #50575e;
	text-align: center;
}

/* Móvil: 2 columnas. */
@media (max-width: 782px) {
	.ixtli-gal-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* Pantallas muy angostas: 1 columna. */
@media (max-width: 480px) {
	.ixtli-gal-grid {
		grid-template-columns: 1fr;
	}
}

/* Lightbox */
.ixtli-gal-lb-activo {
	overflow: hidden;
}

.ixtli-gal-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.85);
}

.ixtli-gal-lightbox[hidden] {
	display: none;
}

.ixtli-gal-lb-figura {
	margin: 0;
	max-width: 90vw;
	max-height: 90vh;
}

.ixtli-gal-lb-imagen {
	display: block;
	max-width: 90vw;
	max-height: 85vh;
	width: auto;
	height: auto;
	border-radius: 4px;
}

.ixtli-gal-lb-flecha {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 48px;
	height: 48px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.15);
	color: #ffffff;
	font-size: 24px;
	line-height: 48px;
	cursor: pointer;
}

.ixtli-gal-lb-flecha:hover,
.ixtli-gal-lb-flecha:focus-visible {
	background: rgba(255, 255, 255, 0.3);
}

.ixtli-gal-lb-anterior {
	left: 16px;
}

.ixtli-gal-lb-anterior::before {
	content: "\2039";
}

.ixtli-gal-lb-siguiente {
	right: 16px;
}

.ixtli-gal-lb-siguiente::before {
	content: "\203A";
}

.ixtli-gal-lb-cerrar {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 40px;
	height: 40px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.15);
	color: #ffffff;
	font-size: 20px;
	line-height: 40px;
	cursor: pointer;
}

.ixtli-gal-lb-cerrar::before {
	content: "\00D7";
}

.ixtli-gal-lb-cerrar:hover,
.ixtli-gal-lb-cerrar:focus-visible {
	background: rgba(255, 255, 255, 0.3);
}
