
/* Premium Gallery Section */
.gallery-section-premium {
    padding: 6rem 0;
    position: relative;
    overflow: hidden;
}

.gallery-header {
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
    z-index: 2;
}

.gallery-eyebrow {
    font-family: var(--font-body);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--accent-primary);
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.gallery-title {
    font-family: var(--font-heading);
    font-size: 3rem;
    color: var(--text-heading);
    margin-bottom: 1rem;
}

.gallery-desc {
    font-family: var(--font-body);
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* Bento Grid Layout */
.bento-grid-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    grid-auto-rows: 250px;
    grid-auto-flow: dense;
    gap: 1.5rem;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

/* Responsive Grid Adjustments */
@media (min-width: 768px) {
    .bento-grid-gallery {
        grid-template-columns: repeat(4, 1fr);
        grid-auto-rows: 300px;
    }

    .item-large {
        grid-column: span 2;
        grid-row: span 2;
    }

    .item-medium {
        grid-column: span 2;
        grid-row: span 1;
    }

    .item-tall {
        grid-column: span 1;
        grid-row: span 2;
    }
}

/* Gallery Item Styling */
.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: zoom-in;
    box-shadow: var(--shadow-sm);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0; /* Hidden initially for animation */
    transform: translateY(30px);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
    display: block;
}

/* Ensure last row doesn't explode - Not needed for Grid */
/* .gallery-item:last-child { flex-grow: 0; } */

@media (max-width: 768px) {
    .bento-grid-gallery {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        grid-auto-rows: 150px;
    }
}

/* Reveal Animation Class (added by JS) */
.gallery-item.revealed {
    animation: fadeInUp 0.6s ease-out forwards;
}

/* Hover Effects */
.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
    z-index: 2;
}

.gallery-item:hover img {
    transform: scale(1.03);
}

/* Animation Keyframes */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.lightbox-modal.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    border-radius: 4px;
    box-shadow: 0 0 50px rgba(0,0,0,0.5);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.lightbox-img {
    max-width: 100%;
    max-height: 90vh;
    display: block;
    border-radius: 4px;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    background: none;
    border: none;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    z-index: 10001;
    transition: transform 0.2s ease, color 0.2s ease;
    line-height: 1;
    padding: 0;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.lightbox-close:hover {
    color: var(--accent-primary);
    transform: rotate(90deg);
}

.lightbox-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 2rem;
    padding: 1rem;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
}

.lightbox-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

@media (max-width: 768px) {
    .lightbox-close {
        top: 10px;
        right: 15px;
        font-size: 2.5rem;
    }
    .lightbox-nav-btn {
        padding: 0.5rem;
        font-size: 1.5rem;
        width: 40px;
        height: 40px;
    }
    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }
}
