/* ═══════════════════════════════════════════════
   Gallery Page — Masonry grid + Lightbox
   ═══════════════════════════════════════════════ */

.gal-section {
    padding-bottom: 60px;
}

/* ── Masonry Grid ── */
.gal-masonry {
    columns: 6;
    column-gap: 8px;
}

.gal-item {
    break-inside: avoid;
    margin-bottom: 8px;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: opacity .3s;
}

.gal-item:hover {
    opacity: 0.85;
}

.gal-item img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* ── Lightbox ── */
.gal-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .3s cubic-bezier(.4,0,.2,1), visibility .3s;
}

.gal-lightbox.gal-lb-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.gal-lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.92);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.gal-lightbox-img-wrap {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 90vw;
    max-height: 90vh;
}

.gal-lightbox-img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 8px;
    transition: opacity .25s;
}

.gal-lightbox-img.gal-lb-loading {
    opacity: 0.3;
}

.gal-lightbox-close,
.gal-lightbox-prev,
.gal-lightbox-next {
    position: absolute;
    z-index: 2;
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: color .25s, background .25s;
}

.gal-lightbox-close:hover,
.gal-lightbox-prev:hover,
.gal-lightbox-next:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

.gal-lightbox-close {
    top: 16px;
    right: 16px;
}

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

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

.gal-lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    letter-spacing: 0.05em;
}

/* ── Responsive ── */
@media (max-width: 1200px) {
    .gal-masonry { columns: 5; }
}

@media (max-width: 991px) {
    .gal-masonry { columns: 4; }
}

@media (max-width: 768px) {
    .gal-masonry { columns: 3; }
}

@media (max-width: 680px) {
    .gal-masonry {
        columns: 2;
        column-gap: 6px;
    }
    .gal-item {
        margin-bottom: 6px;
        border-radius: 4px;
    }

    .gal-lightbox-prev { left: 6px; }
    .gal-lightbox-next { right: 6px; }
    .gal-lightbox-close { top: 10px; right: 10px; }
    .gal-lightbox-img { border-radius: 4px; }
}
