#section-gallery {
    /* height: 100vh; */
    padding: 80px 20px;
    text-align: center;
    padding-top: 40px;
}

/* Gallery Container */
.gallery-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 0 20px;
}

/* Gallery Item */
.gallery-item {
    position: relative;
    width: 500px;
    height: 440px;
    /* Adjusted for title section */
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease-in-out;
    margin: 10px;
}

/* Image Styling */
.gallery-item img {
    width: 100%;
    height: 85%;
    /* Adjusted to leave space for title */
    object-fit: cover;
    border-bottom: 2px solid #ddd;
}

/* Title Section */
.project-title {
    position: relative;
    width: 100%;
    height: 50px;
    /* Adjusted height for title */
    background-color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    text-transform: uppercase;
    padding: 10px;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    border-top: 2px solid #ddd;
    box-sizing: border-box;
}

/* Overlay Styling */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 50px;
    /* Excludes title section */
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease-in-out;
}

.gallery-item:hover .overlay {
    opacity: 1;
}

.gallery-item:hover {
    transform: scale(1.05);
    /* Slight zoom on hover */
    cursor: pointer;
}

/* Text inside the overlay */
.overlay-text {
    color: white;
    font-size: 18px;
    font-weight: bold;
    margin: 25px;
    text-align: justify;
}

/* Responsive Design */
@media (max-width: 839px) {
    .gallery-item {
        flex: 0 0 auto;
        width: 80%;
        margin-bottom: 20px;
        height: 400px;
        position: relative;
        margin-bottom: 10px;
    }

    .gallery-item img {
        height: 350px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .gallery-title {
        font-size: 30px;
    }

    .gallery-container {
        flex-direction: column;
        align-items: center;
    }
}

/* mob */
@media (max-width: 767px) {

    #section-gallery {
        /* Allow horizontal scrolling */
        padding-bottom: 50px;
        /* Add padding to avoid overlap with footer */
    }

    .gallery-container {
        display: flex;
        gap: 15px;
        flex-wrap: nowrap;
    }

    .gallery-container {
        flex-direction: column;
        /* Stack items vertically on smaller screens */
        align-items: center;
    }
}

/* Responsive Design */
@media (max-width: 650px) {
    .gallery-item {
        flex: 0 0 auto;
        width: 80%;
        margin-bottom: 20px;
        height: auto;
        position: relative;
        margin-bottom: 10px;
    }

    .gallery-item img {
        height: auto;
    }
}