﻿.gallery-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Title above the gallery */
.gallery-title {
    text-align: center;
    margin-bottom: 4rem; /* space between title and images */
    margin-top: 6rem; /* space between title and images */
}

    .gallery-title h1 {
        font-family: 'Poppins', sans-serif;
        font-size: 3rem;
        font-weight: 700;
        color: #ffffff;
        letter-spacing: 1px;
        text-transform: uppercase;
        text-shadow: 0 4px 15px rgba(0,0,0,0.7);
    }

        /* Decorative line under title */
        .gallery-title h1::after {
            content: '';
            display: block;
            width: 80px;
            height: 3px;
            margin: 10px auto 0;
            background: linear-gradient(90deg, #ff6a00, #ee0979);
            border-radius: 2px;
        }

/* Masonry gallery container */
.gallery-container {
    column-count: 4;
    column-gap: 15px;
    position: relative;
    z-index: 1;
    background: radial-gradient(circle at center, #fff, rgba(255, 255, 255, 0.95), #fff);
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.5);
}

    /* Cinematic light overlay on container */
    .gallery-container::after {
        content: '';
        position: absolute;
        inset: 0;
        background: radial-gradient(circle at 20% 30%, rgba(255,255,255,0.08), transparent 40%), radial-gradient(circle at 80% 70%, rgba(255,255,255,0.06), transparent 50%);
        mix-blend-mode: screen;
        pointer-events: none;
        z-index: 1;
        animation: containerLightFlare 25s linear infinite;
    }

@keyframes containerLightFlare {
    0% {
        background-position: 0% 0%, 100% 100%;
    }

    50% {
        background-position: 100% 50%, 0% 50%;
    }

    100% {
        background-position: 0% 0%, 100% 100%;
    }
}

/* Masonry images */
.gallery-img {
    width: 100%;
    margin-bottom: 15px;
    object-fit: cover;
    border-radius: 15px;
    cursor: pointer;
    display: block;
    break-inside: avoid;
    box-shadow: 0 10px 25px rgba(0,0,0,0.25);
    transform-origin: center;
    opacity: 0;
    transform: translateY(30px) rotate(0deg);
    position: relative;
    z-index: 2;
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55), box-shadow 0.5s ease, filter 0.5s ease;
    animation: fadeInUp 0.8s forwards;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px) rotate(-1deg);
    }

    60% {
        opacity: 0.6;
        transform: translateY(-10px) rotate(1deg);
    }

    100% {
        opacity: 1;
        transform: translateY(0) rotate(0deg);
    }
}

@keyframes lightSweep {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* Hover cinematic motion */
.gallery-container .gallery-img:hover {
    transform: scale(1.12) rotateX(5deg) rotateY(5deg) translateY(-5px);
    box-shadow: 0 25px 50px rgba(0,0,0,0.45);
    filter: brightness(1.12);
    z-index: 10;
}

/* Staggered fade-in */
.gallery-img:nth-child(1) {
    animation-delay: 0.05s;
}

.gallery-img:nth-child(2) {
    animation-delay: 0.1s;
}

.gallery-img:nth-child(3) {
    animation-delay: 0.15s;
}

.gallery-img:nth-child(4) {
    animation-delay: 0.2s;
}

.gallery-img:nth-child(5) {
    animation-delay: 0.25s;
}

/* Random rotation for cinematic effect */
.gallery-img:nth-child(3n) {
    transform: rotate(-2deg);
}

.gallery-img:nth-child(4n) {
    transform: rotate(1.5deg);
}

.gallery-img:nth-child(5n) {
    transform: rotate(-1deg);
}

/* Fullscreen lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    flex-direction: column;
    max-width: 1400px;
    margin: 0 auto;
}

    .lightbox.hidden {
        display: none;
    }

.lightbox-img {
    max-width: 90%;
    max-height: 85vh;
    cursor: grab;
    transition: filter 0.3s ease;
    border-radius: 15px;
    box-shadow: 0 25px 60px rgba(0,0,0,0.6);
}

/* Close button */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 42px;
    color: white;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 10;
    transition: 0.3s;
}

    .lightbox-close:hover {
        color: #ff4444;
    }

/* Arrows */
.lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 50px;
    background: rgba(0,0,0,0.5);
    border: none;
    cursor: pointer;
    padding: 12px 18px;
    border-radius: 50%;
    z-index: 10;
    transition: all 0.3s ease;
}

    .lightbox-arrow:hover {
        background: rgba(255,255,255,0.3);
        transform: scale(1.1) translateY(-50%);
    }

    .lightbox-arrow.left {
        left: 40px;
    }

    .lightbox-arrow.right {
        right: 40px;
    }
/* Responsive adjustments for smaller screens */
@media (max-width: 1024px) {
    .gallery-title h1 {
        font-size: 2.5rem;
    }
}
/* Responsive adjustments */
@media (max-width: 768px) {
    .gallery-container {
        column-count: 2;
        padding: 1rem;
    }

    .lightbox-arrow {
        font-size: 36px;
        padding: 8px 12px;
    }

    .gallery-title h1 {
        font-size: 2rem;
    }

    .lightbox-arrow.left {
        left: 15px;
    }

    .lightbox-arrow.right {
        right: 15px;
    }

    .lightbox-close {
        top: 14px;
        right: 18px;
        font-size: 36px;
    }
}

@media (max-width: 480px) {
    .gallery-container {
        column-count: 1;
    }

    .gallery-title h1 {
        font-size: 1.5rem;
        letter-spacing: 0.5px;
    }

        .gallery-title h1::after {
            width: 50px; /* smaller decorative line */
            height: 2px;
        }
}
