/* ===============================================
   YOUR LENSES - MASONRY GALLERY STYLES
   =============================================== */

.gallery-header {
    padding: 100px 0 60px 0;
    text-align: center;
    background: linear-gradient(to bottom, #121212, var(--dark-bg));
}

.gallery-header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    margin-bottom: 30px;
    background: rgba(99, 230, 178, 0.05);
    padding: 8px 16px;
    border-radius: 50px;
    border: 1px solid rgba(99, 230, 178, 0.2);
}

.back-link:hover {
    background: rgba(99, 230, 178, 0.15);
    transform: translateX(5px);
}

.gallery-title {
    font-size: 3.5rem;
    margin: 0;
    color: #fff;
    font-weight: bold;
    letter-spacing: -2px;
    background: linear-gradient(45deg, #fff, var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.gallery-subtitle {
    color: #666;
    font-size: 1.2rem;
    margin-top: 5px;
    font-weight: 300;
}

/* MASONRY GRID ENGINE */
.gallery-main {
    padding: 20px 40px 100px 40px;
    max-width: 60rem;
    margin: 0 auto;
}

.masonry-grid {
    column-count: 3;
    column-gap: 20px;
    width: 100%;
}

.masonry-grid img {
    width: 100%;
    display: block;
    margin-bottom: 20px;
    border-radius: 16px;
    break-inside: avoid;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    cursor: zoom-in;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.masonry-grid img:nth-child(even) { animation-delay: 0.1s; }
.masonry-grid img:nth-child(3n) { animation-delay: 0.2s; }

.masonry-grid img:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 15px 35px rgba(0,0,0,0.6);
    filter: brightness(1.2);
}

/* RESPONSIVE BREAKPOINTS */
@media (max-width: 1200px) {
    .masonry-grid {
        column-count: 3;
    }
}

@media (max-width: 992px) {
    .masonry-grid {
        column-count: 2;
        padding: 0 20px;
    }
    .gallery-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 576px) {
    .gallery-header {
        padding: 60px 0 30px 0;
    }
    .gallery-title {
        font-size: 2.2rem;
    }
    .masonry-grid {
        column-count: 1;
        max-width: 400px;
        margin-inline: auto;
    }
    .masonry-grid img {
        margin-bottom: 30px;
    }
    .gallery-main {
        padding: 0 20px 80px 20px;
    }
}

.gallery-footer {
    text-align: center;
    padding: 40px 0;
    border-top: 1px solid rgba(255,255,255,0.05);
    color: #555;
    font-size: 0.9rem;
}

/* --- LIGHTBOX MODAL SYSTEM --- */
.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(15px);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-modal.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 12px;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.8);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.lightbox-modal.active img {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: -60px;
    right: 0;
    color: #fff;
    font-size: 45px;
    cursor: pointer;
    transition: all 0.3s;
}

.lightbox-close:hover { color: var(--primary-color); }

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 45px;
    cursor: pointer;
    padding: 20px;
    transition: all 0.3s;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-nav:hover { background: rgba(255, 255, 255, 0.15); color: var(--primary-color); }

.lightbox-prev { right: -100px; }
.lightbox-next { left: -100px; }

@media (max-width: 992px) {
    .lightbox-prev { right: 10px; }
    .lightbox-next { left: 10px; }
    .lightbox-close { top: -50px; left: 0; text-align: center; }
}
