/* Gallery Section */
.gallery {
    text-align: center;
    background-color: #1b1b1b;
    margin-top: 110px;
    padding: 70px 25px;
    color: white;
}

.gallery h2 {
    font-size: 38px;
    margin-bottom: 25px;
    font-family: 'Poppins', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #7abd98;
}

/* Portfolio Menu */
.portfolio-menu {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
}

.portfolio-btn {
    padding: 12px 22px;
    font-size: 17px;
    font-weight: 600;
    border: none;
    background: #2e8b57;
    color: white;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    border-radius: 5px;
    font-family: 'Poppins', sans-serif;
    margin: 8px 12px;
}

.portfolio-btn.active,
.portfolio-btn:hover {
    background: #1c5c3f;
    transform: scale(1.06);
}

/* Portfolio Content */
.portfolio-item {
    display: none;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.portfolio-item.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.portfolio-item h3 {
    font-size: 28px;
    margin-bottom: 15px;
    font-family: 'Poppins', sans-serif;
    color: #7abd98;
}

.portfolio-item p {
    font-size: 17px;
    margin-bottom: 20px;
    font-family: 'Roboto', sans-serif;
    color: #dcdcdc;
    line-height: 1.6;
}

/* Image Grid - 3 Images Per Row */
.image-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 Columns */
    gap: 10px; /* Reduced space between images */
    padding-top: 10px;
}

.image-grid img,
.image-grid video {
    width: 100%; /* Full width of column */
    height: 280px; /* Increased fixed height */
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.image-grid img:hover,
.image-grid video:hover {
    transform: scale(1.06);
    box-shadow: 0px 5px 12px rgba(0, 0, 0, 0.4);
}

/* Responsive Adjustments */
@media screen and (max-width: 1024px) {
    .image-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 images per row on tablet */
    }
}

@media screen and (max-width: 768px) {
    .gallery {
        padding-top: 10px !important; /* Further reduce space */
        margin-top: 0 !important;
    }

    .gallery h2 {
        font-size: 32px;
    }

    .portfolio-menu {
        flex-direction: column;
        align-items: center;
    }

    .portfolio-btn {
        width: 85%;
        font-size: 16px;
        margin: 10px 0;
    }

    .portfolio-item h3 {
        font-size: 26px;
    }

    .image-grid {
        grid-template-columns: 1fr; /* 1 image per row on mobile */
    }

    .image-grid img,
    .image-grid video {
        width: 100%;
        max-width: 400px; /* Increased max width */
        height: auto;
    }
}

@media screen and (max-width: 480px) {
    .gallery {
        padding-top: 80px !important; /* Minimize spacing */
        margin-top: 0 !important;
    }

    .gallery h2 {
        font-size: 28px;
    }

    .portfolio-btn {
        font-size: 14px;
        padding: 10px 20px;
    }

    .portfolio-item p {
        font-size: 16px;
    }

    .image-grid img,
    .image-grid video {
        width: 100%;
        max-width: 350px; /* Slightly increased max width */
    }
}