/* =====================================================
 * Bhanoo Gallery – Frontend Styles
 * Plugin: bhanoo-gallery
 * ===================================================== */

/* ----- Section ----- */
.bg-gallery-section { background: transparent; padding: 30px 0 60px; }

/* ----- Filter Bar ----- */
.bg-filter-bar {
    display: none; /* hidden for now — remove this line to show */
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 0 24px 28px;
    max-width: 1320px;
    margin: 0 auto;
}
.bg-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 18px;
    border-radius: 999px;
    border: 1.5px solid #d8dde8;
    background: #fff;
    color: #3a3a4a;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all .18s ease;
    font-family: inherit;
    line-height: 1;
    white-space: nowrap;
}
.bg-filter-btn:hover {
    border-color: #aab4c8;
    background: #f7f8fa;
}
.bg-filter-btn.active {
    background: #1e293b;
    border-color: #1e293b;
    color: #fff;
}
.bg-filter-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}
.bg-filter-btn.active .bg-filter-dot { opacity: 0; width: 0; margin: 0; }

/* ----- Masonry Grid ----- */
.bg-gallery-grid {
    columns: var(--bg-cols, 4);
    column-gap: 14px;
    padding: 0 24px;
    max-width: 1320px;
    margin: 0 auto;
}
.bg-gallery-item {
    break-inside: avoid;
    margin-bottom: 14px;
    border-radius: 14px;
    overflow: hidden;
    cursor: default;
    display: block;
    transition: transform .22s ease, box-shadow .22s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,.07);
}
.bg-gallery-item.bg-has-img { cursor: pointer; }
.bg-gallery-item.bg-has-img:hover { transform: translateY(-4px); box-shadow: 0 10px 28px rgba(0,0,0,.14); }
.bg-gallery-item.bg-hidden { display: none; }

/* ----- Card base ----- */
.bg-item-inner {
    border-radius: 14px;
    overflow: hidden;
    position: relative;
}

/* === IMAGE CARD === */
.bg-item-img {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}
.bg-gallery-item:nth-child(4n+1) .bg-item-img { min-height: 240px; }
.bg-gallery-item:nth-child(4n+2) .bg-item-img { min-height: 185px; }
.bg-gallery-item:nth-child(4n+3) .bg-item-img { min-height: 275px; }
.bg-gallery-item:nth-child(4n)   .bg-item-img { min-height: 210px; }
.bg-item-img::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 60%;
    background: linear-gradient(to bottom, transparent, rgba(0,0,0,.68));
    border-radius: 0 0 14px 14px;
    pointer-events: none;
}

/* === COLORED BG CARD (no image) === */
.bg-item-color { display: flex; flex-direction: column; }
.bg-gallery-item:nth-child(4n+1) .bg-item-color { min-height: 240px; }
.bg-gallery-item:nth-child(4n+2) .bg-item-color { min-height: 185px; }
.bg-gallery-item:nth-child(4n+3) .bg-item-color { min-height: 275px; }
.bg-gallery-item:nth-child(4n)   .bg-item-color { min-height: 210px; }

/* ----- Category badge ----- */
.bg-cat-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .5px;
    color: #fff;
    z-index: 4;
    text-transform: uppercase;
}

/* ----- Media count pill (top-right of card) ----- */
.bg-media-count {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,.45);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 9px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 4;
    backdrop-filter: blur(4px);
}

/* ----- Play button ----- */
.bg-play-wrap {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}
.bg-play-btn {
    width: 52px;
    height: 52px;
    background: rgba(255,255,255,.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #0b3d91;
    padding-left: 4px;
    box-shadow: 0 4px 16px rgba(0,0,0,.22);
    transition: transform .2s;
}
.bg-gallery-item:hover .bg-play-btn { transform: scale(1.1); }

/* ----- Footer: image card ----- */
.bg-footer-img {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 14px;
    z-index: 3;
}
.bg-footer-img .bg-item-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #fff;
    line-height: 1.35;
    margin: 0 0 4px;
    text-shadow: 0 1px 3px rgba(0,0,0,.5);
}
.bg-footer-img .bg-item-meta {
    font-size: 11px;
    color: rgba(255,255,255,.82);
    text-shadow: 0 1px 2px rgba(0,0,0,.4);
}

/* ----- Footer: colored card ----- */
.bg-footer-color {
    padding: 12px 14px;
    margin-top: auto;
    border-radius: 0 0 14px 14px;
}
.bg-footer-color .bg-item-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #fff;
    line-height: 1.35;
    margin: 0 0 4px;
}
.bg-footer-color .bg-item-meta {
    font-size: 11px;
    color: rgba(255,255,255,.8);
}

/* ----- Lightbox ----- */
.bg-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
}
.bg-lightbox.bg-lb-open { display: block; }

.bg-lb-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.92);
    cursor: pointer;
    z-index: 1;
}

.bg-lb-close {
    position: fixed;
    top: 16px;
    right: 20px;
    z-index: 4;
    background: rgba(255,255,255,.12);
    border: none;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .18s;
    backdrop-filter: blur(6px);
}
.bg-lb-close:hover { background: rgba(255,255,255,.25); }

.bg-lb-content {
    position: fixed;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 80px;
    box-sizing: border-box;
    pointer-events: none;
}
.bg-lb-content > * { pointer-events: auto; }

#bg-lb-media { display: flex; align-items: center; justify-content: center; }
#bg-lb-media img {
    max-width: min(90vw, 1100px);
    max-height: 80vh;
    width: auto;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 8px 48px rgba(0,0,0,.6);
    display: block;
    object-fit: contain;
}
#bg-lb-media iframe {
    width: min(88vw, 900px);
    height: min(52vw, 506px);
    border-radius: 10px;
    border: none;
    box-shadow: 0 8px 48px rgba(0,0,0,.6);
}

.bg-lb-caption {
    color: rgba(255,255,255,.88);
    font-size: 14px;
    text-align: center;
    max-width: 700px;
    margin-top: 14px;
    line-height: 1.5;
}
.bg-lb-counter {
    color: rgba(255,255,255,.45);
    font-size: 12px;
    margin-top: 6px;
    letter-spacing: .5px;
    text-align: center;
}

.bg-lb-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    background: rgba(255,255,255,.14);
    border: none;
    color: #fff;
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    cursor: pointer;
    transition: background .18s, transform .18s;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.bg-lb-nav:hover { background: rgba(255,255,255,.28); transform: translateY(-50%) scale(1.08); }
.bg-lb-nav:disabled { opacity: .2; cursor: default; pointer-events: none; }
.bg-lb-prev { left: 16px; }
.bg-lb-next { right: 16px; }

/* ----- Responsive ----- */
@media (max-width: 1100px) { .bg-gallery-grid { columns: 3; } }
@media (max-width: 720px)  { .bg-gallery-grid { columns: 2; } }
@media (max-width: 480px)  { .bg-gallery-grid { columns: 1; padding: 0 14px; } }

@media (max-width: 600px) {
    .bg-lb-content { padding: 60px 16px 50px; }
    .bg-lb-nav { width: 42px; height: 42px; }
    .bg-lb-prev { left: 8px; }
    .bg-lb-next { right: 8px; }
    #bg-lb-media img { max-width: 94vw; max-height: 72vh; border-radius: 8px; }
    #bg-lb-media iframe { width: 94vw; height: 53vw; border-radius: 8px; }
}
