/**
 * BP Events Sync — Gallery Grid Styles
 * Lightbox styles are handled by LightGallery CSS.
 */

/* ── Grid ────────────────────────────────────────────────────────── */
.bpes-gallery {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px;
    box-sizing: border-box;
}

.bpes-gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.bpes-gallery[data-columns="1"] .bpes-gallery-grid { grid-template-columns: repeat(1, 1fr); }
.bpes-gallery[data-columns="2"] .bpes-gallery-grid { grid-template-columns: repeat(2, 1fr); }
.bpes-gallery[data-columns="3"] .bpes-gallery-grid { grid-template-columns: repeat(3, 1fr); }
.bpes-gallery[data-columns="4"] .bpes-gallery-grid { grid-template-columns: repeat(4, 1fr); }
.bpes-gallery[data-columns="5"] .bpes-gallery-grid { grid-template-columns: repeat(5, 1fr); }
.bpes-gallery[data-columns="6"] .bpes-gallery-grid { grid-template-columns: repeat(6, 1fr); }

/* ── Gallery Items ───────────────────────────────────────────────── */
.bpes-gallery-item {
    display: block;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    border-radius: 2px;
    aspect-ratio: 4 / 3;
}

.bpes-gallery-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.bpes-gallery-item:hover img {
    transform: scale(1.03);
    opacity: 0.9;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 1200px) {
    .bpes-gallery[data-columns="5"] .bpes-gallery-grid,
    .bpes-gallery[data-columns="6"] .bpes-gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .bpes-gallery-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .bpes-gallery-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .bpes-gallery {
        padding: 0 8px;
    }
}

@media (max-width: 480px) {
    .bpes-gallery-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px;
    }
}

/* ── LightGallery Overrides ──────────────────────────────────────── */
.lg-backdrop {
    z-index: 99999;
}

.lg-outer {
    z-index: 99999;
}

/* ── Photo Captions (hover overlay) ─────────────────────────────── */
.bpes-gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 12px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.75));
    color: #fff;
    font-size: 13px;
    line-height: 1.4;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.bpes-gallery-item:hover .bpes-gallery-caption {
    opacity: 1;
}

/* ── Section Titles ─────────────────────────────────────────────── */
.bpes-section-title {
    text-align: center;
    color: #000;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 20px;
}

.bpes-section-photo-title {
    margin-top: 30px;
}

/* ── Videos Section ─────────────────────────────────────────────── */
.bpes-videos {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto 32px;
    padding: 0 16px;
    box-sizing: border-box;
}

.bpes-videos-hero {
    margin-bottom: 16px;
}

.bpes-videos-hero .bpes-video-embed {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 4px;
}

.bpes-videos-hero .bpes-video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.bpes-videos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.bpes-videos-grid[data-count="1"] {
    grid-template-columns: 1fr;
    max-width: 33.333%;
    margin: 0 auto;
}

.bpes-videos-grid[data-count="2"] {
    grid-template-columns: repeat(2, 1fr);
    max-width: 66.666%;
    margin: 0 auto;
}

.bpes-video-item .bpes-video-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 4px;
}

.bpes-video-item .bpes-video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.bpes-video-title {
    margin-top: 8px;
    font-size: 14px;
    color: #333;
    text-align: center;
}

/* ── Videos Responsive ──────────────────────────────────────────── */
@media (max-width: 992px) {
    .bpes-videos-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .bpes-videos-grid[data-count="1"] {
        max-width: 50%;
    }
    .bpes-videos-grid[data-count="2"] {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .bpes-videos-grid,
    .bpes-videos-grid[data-count="1"],
    .bpes-videos-grid[data-count="2"] {
        grid-template-columns: 1fr;
        max-width: 100%;
    }

    .bpes-videos {
        padding: 0 8px;
    }
}

/* ── Error / Empty States ────────────────────────────────────────── */
.bpes-gallery-error {
    color: #d63638;
    padding: 16px;
    text-align: center;
}

.bpes-gallery-empty {
    color: #666;
    padding: 32px 16px;
    text-align: center;
    font-style: italic;
}