.bfm-fbag-gallery {
    display: grid;
    grid-template-columns: repeat(var(--bfm-fbag-columns, 4), minmax(0, 1fr));
    gap: 12px;
    margin: 1.5rem 0;
}
.bfm-fbag-item { margin: 0; min-width: 0; }
.bfm-fbag-open {
    display: block;
    width: 100%;
    border: 0;
    border-radius: 6px;
    padding: 0;
    background: #111;
    cursor: zoom-in;
    overflow: hidden;
    aspect-ratio: 1 / 1;
}
.bfm-fbag-open img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform .2s ease, opacity .2s ease;
}
.bfm-fbag-open:hover img,
.bfm-fbag-open:focus-visible img { transform: scale(1.035); opacity: .9; }
.bfm-fbag-item figcaption { font-size: .84rem; line-height: 1.35; margin-top: 5px; color: inherit; opacity: .82; }
.bfm-fbag-lightbox[hidden] { display: none !important; }
.bfm-fbag-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0,0,0,.94);
    display: grid;
    grid-template-columns: minmax(48px, 8vw) 1fr minmax(48px, 8vw);
    align-items: center;
    color: #fff;
}
.bfm-fbag-stage { max-width: 1400px; max-height: 94vh; margin: auto; text-align: center; padding: 20px 0; }
.bfm-fbag-stage img { display: block; max-width: 100%; max-height: 78vh; width: auto; height: auto; margin: 0 auto 12px; object-fit: contain; }
.bfm-fbag-lightbox-caption { max-width: 900px; margin: 0 auto 8px; }
.bfm-fbag-photo-link { color: #fff; text-decoration: underline; }
.bfm-fbag-close,
.bfm-fbag-prev,
.bfm-fbag-next {
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    font-size: 52px;
    line-height: 1;
    padding: 16px;
}
.bfm-fbag-close { position: absolute; top: 8px; right: 12px; font-size: 42px; }
body.bfm-fbag-no-scroll { overflow: hidden; }
@media (max-width: 900px) {
    .bfm-fbag-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
    .bfm-fbag-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .bfm-fbag-lightbox { grid-template-columns: 46px 1fr 46px; }
    .bfm-fbag-prev, .bfm-fbag-next { font-size: 38px; padding: 6px; }
}
