/* =====================
   GALLERY SECTION (Masonry & Lightbox)
   ===================== */

/* Container for the Strict Grid (3 cols x 2 rows) */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 30px;
}

.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: transparent;
    aspect-ratio: 3 / 2;
    /* Force Landscape Format */
}

.gallery-item img {
    width: 100%;
    height: 100%;
    /* Fill the aspect ratio box */
    object-fit: cover;
    /* Crop to fit */
    display: block;
    transition: transform 0.5s ease;
}

/* Hover Effects */
.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Responsive Columns */
@media (max-width: 1200px) {
    .gallery-grid {
        column-count: 3;
    }
}

@media (max-width: 800px) {
    .gallery-grid {
        column-count: 2;
    }
}

@media (max-width: 500px) {
    .gallery-grid {
        column-count: 1;
    }
}


/* =====================
   LIGHTBOX (MODAL)
   ===================== */
.gallery-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-modal.show {
    opacity: 1;
}

.gallery-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.gallery-modal-content img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    object-fit: contain;
}

/* Close Button */
.gallery-modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: 300;
    cursor: pointer;
    z-index: 10001;
    transition: color 0.2s;
}

.gallery-modal-close:hover {
    color: #f1f1f1;
    transform: scale(1.1);
}

/* Navigation Buttons */
.gallery-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    padding: 15px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    font-size: 24px;
    z-index: 10001;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.gallery-nav-prev {
    left: 20px;
}

.gallery-nav-next {
    right: 20px;
}