/* Grilla de base (especificidad cero: si la plantilla ya define la suya, se respeta la de la plantilla). */
:where(.galeria-aavf) { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 1rem 0; }
:where(.galeria-aavf) a { display: block; line-height: 0; }
:where(.galeria-aavf) img { display: block; width: 100%; height: auto; }

/* Visor */
html.aavf-lb-open { overflow: hidden; }
.aavf-lb { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .92); }
.aavf-lb[hidden] { display: none; }
.aavf-lb-fig { margin: 0; max-width: min(94vw, 1600px); max-height: 94vh; display: flex; flex-direction: column; align-items: center; }
.aavf-lb-img { display: block; max-width: 100%; max-height: calc(94vh - 3.5rem); width: auto; height: auto; object-fit: contain; background: #111; }
.aavf-lb-cap { margin: .6rem 0 0; max-width: 90vw; color: #f2f2f2; font-size: 1rem; line-height: 1.3; text-align: center; }
.aavf-lb-cap[hidden] { display: none; }
.aavf-lb-count { position: absolute; top: 14px; left: 18px; color: #ddd; font-size: .9rem; }
.aavf-lb-btn { position: absolute; z-index: 2; display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%;
	background: rgba(255, 255, 255, .14); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; transition: background .15s; }
.aavf-lb-btn:hover, .aavf-lb-btn:focus-visible { background: rgba(255, 255, 255, .32); outline: 2px solid #fff; outline-offset: 2px; }
.aavf-lb-btn[hidden] { display: none; }
.aavf-lb-close { top: 12px; right: 14px; font-size: 32px; }
.aavf-lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.aavf-lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
@media (max-width: 575.98px) {
	.aavf-lb-btn { width: 40px; height: 40px; font-size: 20px; }
	.aavf-lb-prev { left: 6px; } .aavf-lb-next { right: 6px; }
}
