/* Gallery Header */
.gallery-header {
    background: #fff;
    padding: 60px 20px 40px;
    text-align: center;
}

.gallery-title {
    font-size: 42px;
    font-weight: 700;
    color: #00b8a9;
    line-height:  1.3;
    max-width: 900px;
    margin: 0 auto;
}

/* Gallery Section */
.gallery-section {
    background: #fff;
    padding:  40px 20px 80px;
}

/* Grid Layout - 4 Images Per Row */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 columns */
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    cursor: zoom-in;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #f8f9fa;
    height: 250px; /* Fixed height for uniformity */
}

.gallery-item:hover {
    transform:  translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
    width:  100%;
    height: 100%;
    object-fit:  cover; /* Covers the container while maintaining aspect ratio */
    object-position: center; /* Centers the image */
    display: block;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.08);
}

/* Lightbox Modal */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left:  0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.lightbox.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.lightbox-image {
    max-width: 90%;
    max-height: 85vh;
    object-fit: contain; /* Maintains original aspect ratio in lightbox */
    border-radius:  8px;
    animation:  zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Lightbox Controls */
.lightbox-close {
    position: absolute;
    top: 30px;
    right: 50px;
    font-size: 50px;
    color: #fff;
    cursor: pointer;
    transition: color 0.3s;
    font-weight:  300;
    z-index: 10000;
}

.lightbox-close:hover {
    color: #ff6b6b;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 60px;
    color:  #fff;
    cursor: pointer;
    padding: 20px;
    user-select: none;
    transition: all 0.3s;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    z-index: 10000;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(0, 184, 169, 0.8);
    color: #fff;
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

.lightbox-caption {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 18px;
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
    padding: 12px 30px;
    border-radius: 25px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 columns on tablets */
    }
}

@media (max-width: 768px) {
    .gallery-title {
        font-size:  28px;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on mobile */
        gap: 15px;
    }

    .gallery-item {
        height: 200px;
    }

    .lightbox-image {
        max-width: 95%;
        max-height: 80vh;
    }

    .lightbox-close {
        top: 15px;
        right: 20px;
        font-size: 40px;
    }

    .lightbox-prev,
    .lightbox-next {
        font-size: 40px;
        padding: 10px 15px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-caption {
        font-size: 14px;
        padding: 8px 20px;
        bottom: 15px;
    }
}

@media (max-width: 480px) {
    .gallery-title {
        font-size:  22px;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .gallery-item {
        height: 150px;
    }

    .lightbox-prev,
    .lightbox-next {
        font-size: 30px;
        padding: 8px 12px;
    }
}