/* ===== Galería mosaico ===== */
.gfh-gallery {
	--gfh-cols: 3;
	--gfh-cols-tablet: 3;
	--gfh-cols-mobile: 2;
	--gfh-gap: 8px;
	margin: 0 auto;
	width: 100%;
	box-sizing: border-box;
}

/* Fallback sin JS: columnas CSS */
.gfh-gallery:not(.gfh-ready) { column-count: var(--gfh-cols); column-gap: var(--gfh-gap); }
.gfh-gallery:not(.gfh-ready) .gfh-item { break-inside: avoid; margin-bottom: var(--gfh-gap); }

/* Con JS: columnas flex (respeta el orden de izquierda a derecha) */
.gfh-gallery.gfh-ready { display: flex; gap: var(--gfh-gap); align-items: flex-start; }
.gfh-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: var(--gfh-gap); }

.gfh-item { margin: 0; padding: 0; position: relative; overflow: hidden; }
.gfh-link { display: block; line-height: 0; }
.gfh-item img {
	display: block;
	width: 100%;
	height: auto;
	object-fit: unset;
	transition: transform .4s ease, filter .4s ease;
}
.gfh-item:hover img { transform: scale(1.04); filter: brightness(1.05); }
.gfh-item figcaption {
	font-size: 13px;
	line-height: 1.3;
	padding: 6px 2px 2px;
	color: #444;
	text-align: center;
}

@media (max-width: 1024px) {
	.gfh-gallery:not(.gfh-ready) { column-count: var(--gfh-cols-tablet); }
}
@media (max-width: 600px) {
	.gfh-gallery:not(.gfh-ready) { column-count: var(--gfh-cols-mobile); }
}

/* ===== Lightbox ===== */
.gfh-lb {
	position: fixed; inset: 0; z-index: 99999;
	background: rgba(0, 0, 0, .92);
	display: flex; align-items: center; justify-content: center;
	opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s;
	touch-action: pan-y;
}
.gfh-lb.is-open { opacity: 1; visibility: visible; }
.gfh-lb-img {
	max-width: 92vw; max-height: 84vh;
	width: auto; height: auto;
	object-fit: contain;
	box-shadow: 0 10px 40px rgba(0, 0, 0, .6);
	user-select: none;
}
.gfh-lb-caption {
	position: absolute; left: 0; right: 0; bottom: 14px;
	text-align: center; color: #fff; font-size: 16px; padding: 0 60px;
	text-shadow: 0 1px 4px rgba(0,0,0,.8);
}
.gfh-lb-counter { position: absolute; top: 14px; left: 18px; color: #bbb; font-size: 13px; }
.gfh-lb button {
	position: absolute; background: none; border: 0; color: #fff; cursor: pointer;
	font-size: 44px; line-height: 1; padding: 10px 16px; opacity: .8; transition: opacity .2s;
	font-family: Arial, sans-serif;
}
.gfh-lb button:hover, .gfh-lb button:focus { opacity: 1; outline: none; }
.gfh-lb-close { top: 6px; right: 10px; }
.gfh-lb-prev { left: 4px; top: 50%; transform: translateY(-50%); }
.gfh-lb-next { right: 4px; top: 50%; transform: translateY(-50%); }
.gfh-lb-spinner {
	position: absolute; width: 40px; height: 40px; border-radius: 50%;
	border: 3px solid rgba(255,255,255,.25); border-top-color: #fff;
	animation: gfh-spin .8s linear infinite; display: none;
}
.gfh-lb.is-loading .gfh-lb-spinner { display: block; }
.gfh-lb.is-loading .gfh-lb-img { opacity: .3; }
@keyframes gfh-spin { to { transform: rotate(360deg); } }
body.gfh-lb-open { overflow: hidden; }

@media (max-width: 600px) {
	.gfh-lb button { font-size: 34px; padding: 8px 10px; }
	.gfh-lb-caption { font-size: 14px; padding: 0 40px; }
}
