.gallery, 
.gallery2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.15);
}

.gallery-item:hover {
    transform: translateY(-5px);
}

.gallery-item img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
}

.item-content {
    padding: 5px 0;
    background-color: beige;
}

.item-content h5 {
    margin: 0;
    font-size: 1.2rem;
    color: #333;
    font-weight: 600;
}

.item-content p {
    font-size: 15px;
    font-weight: 500;
    color: black;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    cursor: pointer;
    animation: fadeIn 0.3s ease;
}

.modal img {
    width: auto;
    height: auto;
    max-width: 95%;
    max-height: 95vh;
    margin: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    object-fit: contain;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    cursor: pointer;
    z-index: 1001;
    background-color: #ff0000;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 100%;
}

@media (max-width: 768px) {
    .gallery, 
    .gallery2 {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 15px;
        padding: 15px;
    }

    .modal img {
        width: 95%;
        height: auto;
    }

    .close-btn {
        top: 100px;
        right: 25px;
        font-size: 40px;
    }
}