.bvgallery{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:12px;margin:1rem 0}
.bvgallery-item{display:flex;flex-direction:column;color:inherit;text-decoration:none;min-width:0}
.bvgallery-item img{display:block;width:100%;aspect-ratio:4/3;object-fit:cover;border-radius:3px}
.bvgallery-caption{font-size:.9rem;line-height:1.35;padding:.4rem 0}

/* Keep the dialog and its navigation controls inside the viewport. */
.bvgallery-lightbox{box-sizing:border-box;border:0;padding:3rem 3.5rem 1rem;background:#111;color:#fff;width:min(96vw,1200px);max-width:96vw;max-height:95vh;overflow:auto}
.bvgallery-lightbox::backdrop{background:rgba(0,0,0,.88)}
.bvgallery-lightbox figure{margin:0;text-align:center}
.bvgallery-lightbox figure img{display:block;width:auto;height:auto;max-width:calc(96vw - 7rem);max-height:78vh;object-fit:contain;margin:auto}
.bvgallery-lightbox figcaption{padding:.5rem;overflow-wrap:anywhere}
.bvgallery-lightbox button{position:absolute;z-index:2;display:flex;align-items:center;justify-content:center;min-width:2.75rem;min-height:2.75rem;border:0;border-radius:3px;background:rgba(0,0,0,.72);color:#fff;font-size:2rem;line-height:1;cursor:pointer;padding:.25rem .55rem}
.bvgallery-lightbox button:focus-visible{outline:2px solid #fff;outline-offset:2px}
.bvgallery-lightbox .bvgallery-close{right:.35rem;top:.35rem}
.bvgallery-lightbox .bvgallery-prev{left:.35rem;top:50%;transform:translateY(-50%)}
.bvgallery-lightbox .bvgallery-next{right:.35rem;top:50%;transform:translateY(-50%)}
@media(max-width:600px){
 .bvgallery{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 .bvgallery-lightbox{padding:3rem 2.75rem 1rem;width:96vw;max-width:96vw}
 .bvgallery-lightbox figure img{max-width:calc(96vw - 5.5rem);max-height:76vh}
 .bvgallery-lightbox button{min-width:2.25rem;min-height:2.5rem;font-size:1.7rem}
 .bvgallery-lightbox .bvgallery-prev{left:.2rem}
 .bvgallery-lightbox .bvgallery-next{right:.2rem}
}
