/* ==========================================================================
   BPV Gallery — bpv-gallery.css
   ========================================================================== */

.bpv-gl-wrap {
    --bpv-gl-accent:  #5C3D28;
    --bpv-gl-gap:     20px;

    box-sizing: border-box;
}

.bpv-gl-wrap *,
.bpv-gl-wrap *::before,
.bpv-gl-wrap *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Placeholder (edit mode) */
.bpv-gl-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(42, 29, 20, 0.06);
    aspect-ratio: 4 / 3;
    color: rgba(42, 29, 20, 0.45);
    font-size: 14px;
}

/* ── Breadcrumb ───────────────────────────────────────────────────── */

.bpv-gl-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: rgba(42, 29, 20, 0.55);
    padding: 0 0 20px;
    flex-wrap: wrap;
}
.bpv-gl-breadcrumb a {
    color: rgba(42, 29, 20, 0.55);
    text-decoration: none;
    transition: color 0.2s;
}
.bpv-gl-breadcrumb a:hover { color: #2A1D14; }
.bpv-gl-breadcrumb__sep { opacity: 0.4; font-size: 15px; }

/* ── Desktop gallery ──────────────────────────────────────────────── */

.bpv-gl-desktop {
    display: flex;
    flex-direction: column;
    gap: var(--bpv-gl-gap);
}

.bpv-gl-mobile { display: none; }

.bpv-gl-row {
    display: grid;
    gap: var(--bpv-gl-gap);
}
.bpv-gl-row--1 { grid-template-columns: 1fr; }
.bpv-gl-row--2 { grid-template-columns: 1fr 1fr; }
.bpv-gl-row--3 { grid-template-columns: 1fr 1fr 1fr; }

.bpv-gl-item {
    overflow: hidden;
    cursor: pointer;
    background: transparent;
}

.bpv-gl-row--1 .bpv-gl-item { height: 420px; }
.bpv-gl-row--2 .bpv-gl-item { height: 280px; }
.bpv-gl-row--3 .bpv-gl-item { height: 200px; }

.bpv-gl-item img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
    transition: transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.bpv-gl-item:hover img { transform: scale(1.04); }

/* ── Lightbox ──────────────────────────────────────────────────────── */

.bpv-gl-lightbox {
    position: fixed; inset: 0; z-index: 99999;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none;
    transition: opacity 0.35s ease;
}
.bpv-gl-lightbox.is-open { opacity: 1; pointer-events: all; }

.bpv-gl-lightbox__backdrop {
    position: absolute; inset: 0;
    background: rgba(250, 246, 240, 0.90);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.bpv-gl-lightbox__shell {
    position: relative; z-index: 1;
    width: 100%; height: 100%;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 60px 80px 20px;
    box-sizing: border-box; gap: 20px;
}

.bpv-gl-lightbox__close {
    position: absolute; top: 24px; right: 28px;
    background: transparent !important;
    border: 1px solid var(--bpv-gl-accent) !important;
    border-radius: 0 !important; outline: none !important;
    box-shadow: none !important; cursor: pointer;
    color: var(--bpv-gl-accent) !important;
    padding: 8px 10px; line-height: 0;
    opacity: 0.7; transition: opacity 0.2s;
    -webkit-appearance: none; appearance: none;
}
.bpv-gl-lightbox__close:hover { opacity: 1; }

.bpv-gl-lightbox__arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: transparent !important;
    border: 1px solid var(--bpv-gl-accent) !important;
    border-radius: 0 !important; outline: none !important;
    box-shadow: none !important; cursor: pointer;
    color: var(--bpv-gl-accent) !important;
    padding: 12px 10px; line-height: 0;
    opacity: 0.6; transition: opacity 0.2s;
    z-index: 2; -webkit-appearance: none; appearance: none;
}
.bpv-gl-lightbox__arrow:hover { opacity: 1; }
.bpv-gl-lightbox__arrow--prev { left: 20px; }
.bpv-gl-lightbox__arrow--next { right: 20px; }

.bpv-gl-lightbox__stage {
    flex: 1; display: flex; align-items: center; justify-content: center;
    overflow: hidden; width: 100%; max-width: 900px;
}

.bpv-gl-lightbox__zoom-wrap {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; cursor: grab;
}
.bpv-gl-lightbox__zoom-wrap.is-grabbing { cursor: grabbing; }

.bpv-gl-lightbox__main-img {
    max-width: 100%; max-height: 100%; object-fit: contain; display: block;
    transform-origin: center center; transition: transform 0.1s ease;
    pointer-events: none; user-select: none; -webkit-user-drag: none;
}

.bpv-gl-lightbox__thumbs {
    display: flex; gap: 10px; justify-content: center;
    flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px;
    max-width: 100%; scrollbar-width: none;
}
.bpv-gl-lightbox__thumbs::-webkit-scrollbar { display: none; }

.bpv-gl-lightbox__thumb {
    width: 60px; height: 60px; flex-shrink: 0;
    object-fit: cover; cursor: pointer;
    opacity: 0.4; transition: opacity 0.2s;
    border: 1.5px solid transparent;
}
.bpv-gl-lightbox__thumb:hover { opacity: 0.7; }
.bpv-gl-lightbox__thumb.is-active {
    opacity: 1;
    border-color: var(--bpv-gl-accent);
}

/* ── Mobile ────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .bpv-gl-desktop { display: none; }
    .bpv-gl-mobile  { display: flex; flex-direction: column; gap: 10px; }

    .bpv-gl-mob-wrap { width: 100%; overflow: hidden; position: relative; }

    .bpv-gl-mob-track {
        display: flex;
        transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        will-change: transform;
    }

    .bpv-gl-mob-slide {
        flex: 0 0 100%; width: 100%;
        aspect-ratio: 4 / 3; overflow: hidden;
    }
    .bpv-gl-mob-slide img {
        width: 100%; height: 100%; object-fit: cover; display: block;
        pointer-events: none; user-select: none; -webkit-user-drag: none;
    }

    .bpv-gl-mob-thumbs {
        display: flex; gap: 10px; overflow-x: auto;
        scrollbar-width: none; padding-bottom: 2px;
    }
    .bpv-gl-mob-thumbs::-webkit-scrollbar { display: none; }

    .bpv-gl-mob-thumb {
        flex: 0 0 72px; height: 72px; overflow: hidden;
        cursor: pointer; opacity: 0.45; transition: opacity 0.2s;
        border: 2px solid transparent;
    }
    .bpv-gl-mob-thumb.is-active {
        opacity: 1;
        border-color: var(--bpv-gl-accent);
    }
    .bpv-gl-mob-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

    .bpv-gl-lightbox__arrow  { display: none; }
    .bpv-gl-lightbox__shell  { padding: 52px 16px 12px; gap: 12px; }
    .bpv-gl-lightbox__thumb  { width: 48px; height: 48px; }
}

@media (max-width: 480px) {
    .bpv-gl-mob-thumb { flex: 0 0 60px; height: 60px; }
}
