.fg-gallery {
    width: 100%;
}

.fg-gallery-grid {
    column-count: var(--fg-columns, 2);
    column-gap: 16px;
}

.fg-gallery-figure {
    margin: 0 0 16px;
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
}

.fg-gallery.fg-layout-grid .fg-gallery-grid {
    display: grid;
    grid-template-columns: repeat(var(--fg-columns, 2), minmax(0, 1fr));
    gap: 16px;
    column-count: auto;
}

.fg-gallery.fg-layout-grid .fg-gallery-figure {
    margin: 0;
}

.fg-gallery-item {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    position: relative;
}

.fg-gallery-thumb {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
}

.fg-gallery-video-thumb {
    background: #0f1115;
}

.fg-gallery-video-badge {
    position: absolute;
    right: 10px;
    bottom: 10px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 999px;
}

.fg-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.fg-lightbox.is-open {
    display: flex;
}

.fg-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.86);
}

.fg-lightbox-dialog {
    position: relative;
    z-index: 1;
    width: min(96vw, 1200px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
}

.fg-lightbox-image {
    display: block;
    width: auto;
    max-width: 92vw;
    height: auto;
    max-height: 82vh;
    border-radius: 8px;
}

.fg-lightbox-video {
    display: none;
    width: min(92vw, 1200px);
    height: auto;
    max-height: 82vh;
    border-radius: 8px;
    background: #000;
}

.fg-lightbox-caption {
    color: #ffffff;
    font-size: 15px;
    line-height: 1.5;
    text-align: center;
    max-width: min(90vw, 900px);
}

.fg-lightbox-close,
.fg-lightbox-nav {
    position: absolute;
    border: 0;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 999px;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    line-height: 1;
}

.fg-lightbox-close {
    top: 12px;
    right: 12px;
}

.fg-lightbox-prev {
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
}

.fg-lightbox-next {
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
}

@media (max-width: 767px) {
    .fg-gallery-grid {
        column-count: var(--fg-mobile-columns, 1);
        column-gap: 12px;
    }

    .fg-gallery-figure {
        margin: 0 0 12px;
    }

    .fg-gallery.fg-layout-grid .fg-gallery-grid {
        grid-template-columns: repeat(var(--fg-mobile-columns, 1), minmax(0, 1fr));
        gap: 12px;
    }

    .fg-gallery.fg-layout-grid .fg-gallery-figure {
        margin: 0;
    }

    .fg-lightbox {
        padding: 12px;
    }

    .fg-lightbox-prev {
        left: 4px;
    }

    .fg-lightbox-next {
        right: 4px;
    }
}
