/* ══════════════════════════════════════════════════
   Bro Gallery - Frontend Styles (Fixed)
   ══════════════════════════════════════════════════ */

.bro-gallery-wrap {
    width: 100%;
    position: relative;
    overflow: visible;
}

/* ── Masonry Grid ──────────────────────────────────
   IMPORTANT: display:block — flex breaks masonry.js
   ─────────────────────────────────────────────── */
.bro-masonry-grid {
    display: block;
}

.bro-masonry-grid::after {
    content: '';
    display: table;
    clear: both;
}

/* ── Masonry Item ──────────────────────────────── */
.bro-masonry-item {
    width: calc(100% / 3);
    padding: 8px;
    box-sizing: border-box;
    float: left;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.bro-masonry-item.is-removing {
    opacity: 0 !important;
    transform: scale(0.85);
    pointer-events: none;
}

/* ── Image Wrapper ─────────────────────────────── */
.bro-img-wrap {
    position: relative;
    border-radius: 8px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.13);
    cursor: pointer;
    background: #f0f0f0;
    line-height: 0;
}

/* ── Image — NO scale/overflow (was causing blur) ── */
.bro-img-wrap img.bro-img-click {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
    transition: filter 0.25s ease;
    cursor: pointer;
}

.bro-img-wrap:hover img.bro-img-click {
    filter: brightness(0.80);
}

/* ── Delete Button (Admin Only) ────────────────────
   Hover pe fade-in, red ×, top-right
   ─────────────────────────────────────────────── */
.bro-delete-btn {
    position: absolute;
    top: 7px;
    right: 7px;
    z-index: 20;
    opacity: 0;
    background: #e53e3e;
    color: #fff;
    border: 2px solid rgba(255,255,255,0.85);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s, background 0.2s, transform 0.15s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}

.bro-masonry-item:hover .bro-delete-btn {
    opacity: 1;
}

.bro-delete-btn:hover {
    background: #c53030;
    transform: scale(1.12);
}

/* ── Lightbox ──────────────────────────────────── */
.bro-lightbox {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 999999;
}

.bro-lightbox.bro-active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.bro-lightbox-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.93);
    cursor: pointer;
}

.bro-lightbox-inner {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 10px;
}

.bro-lightbox-img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
}

.bro-lightbox-img {
    display: block;
    max-width: 82vw;
    max-height: 88vh;
    width: auto;
    height: auto;
    border-radius: 6px;
    object-fit: contain;
    box-shadow: 0 8px 40px rgba(0,0,0,0.7);
    transition: opacity 0.2s ease;
}

.bro-lightbox-img.bro-loading {
    opacity: 0.25;
}

.bro-lightbox-prev,
.bro-lightbox-next {
    flex-shrink: 0;
    background: rgba(255,255,255,0.14);
    border: 1.5px solid rgba(255,255,255,0.3);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.15s;
    user-select: none;
}

.bro-lightbox-prev:hover,
.bro-lightbox-next:hover {
    background: rgba(255,255,255,0.28);
    transform: scale(1.08);
}

.bro-lightbox-close {
    position: absolute;
    top: -46px;
    right: 0;
    background: rgba(255,255,255,0.14);
    border: 1.5px solid rgba(255,255,255,0.3);
    color: #fff;
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    line-height: 1;
}

.bro-lightbox-close:hover {
    background: rgba(220,50,50,0.6);
}

.bro-lightbox-counter {
    position: absolute;
    bottom: -36px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.6);
    font-size: 13px;
    white-space: nowrap;
    font-family: sans-serif;
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 900px) {
    .bro-masonry-item { width: 50%; }
}

@media (max-width: 520px) {
    .bro-masonry-item { width: 100%; }
    .bro-lightbox-img { max-width: 94vw; max-height: 80vh; }
    .bro-lightbox-prev, .bro-lightbox-next { width: 38px; height: 38px; font-size: 16px; }
}

.bro-no-images {
    text-align: center;
    color: #888;
    padding: 30px;
    border: 2px dashed #ddd;
    border-radius: 10px;
}
