:root {
    --primary: #e41a2b;
    --secondary: #BDBDBF;
    --light: #F4F5F8;
    --dark: #222429;
}



section.gallery {
    padding: 100px 0;

}

section.gallery .grid-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    position: relative;
    top: -150px;
}



section.gallery .box-gallery {
    margin: 10px;
}

section.gallery .grid-gallery .box-gallery a {
    text-decoration: none;
}

section.gallery .grid-gallery .box-gallery .card {
    border: none;
    overflow: hidden;
    height: 100%;

}

section.gallery .grid-gallery .box-gallery .card:hover img {
    transform: scale(1.2);
}

section.gallery .grid-gallery .box-gallery .card img {
    border-radius: 5px;
    transition: .5s;
    width:  100%;
    height: 100%;
    object-fit: cover;

}

section.gallery .grid-gallery .box-gallery .card .card-body {
    position: absolute;
    bottom: 0;
    text-align: center;
    width: 100%;
}

section.gallery .grid-gallery .box-gallery .card .card-body h5.card-title {
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    color: var(--light);
}



section.gallery .grid-gallery .box-gallery .team-overlay {
    position: absolute;
    top: 50%;
    right: 50%;
    bottom: 50%;
    left: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(34, 36, 41, .9);
    transition: .5s;
    opacity: 0;
}

section.gallery .grid-gallery .box-gallery:hover .team-overlay {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    opacity: 1;
}

section.gallery .grid-gallery .box-gallery:hover .card .card-body {
    position: absolute;
    top: 65%;
    left: 50%;
    transform: translate(-50%, -50%);
}


.swiper {
    width: 100%;
    height: 100%;
}

.swiper-slide {
    text-align: center;
    font-size: 18px;
    background: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
}



.swiper-slide img {
    display: block;
    width: 100%;
    height: 450px;
    object-fit: cover;
}

section.gallery .swiper .swiper-button-next::after,
section.gallery .swiper .swiper-button-prev::after {
    font-size: 24px;
    color: var(--light);
    background: var(--primary);
    padding: 10px 15px;
    font-weight: bold;
    border-radius: 5px;
}

/* view */


/* สไตล์สำหรับแกลเลอรี่ */
.lightgallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 10px;
    padding: 10px;
    margin: 25px 0;
    margin-bottom: 50px;
}

.lightgallery a {
    display: block;
    overflow: hidden;
    border-radius: 10px;
    position: relative;
    height: 200px;
    /* Set a fixed height for each image container */
}

.lightgallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.lightgallery a:hover img {
    transform: scale(1.1);
}

.grid-video-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

.grid-video-gallery .box-item {
    margin: 15px;
}

.grid-video-gallery .box-item iframe.youtube {
    width: 100%;
    height: 315px;
    border-radius: 10px;
    box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
}

.grid-video-gallery .box-item iframe {}

.grid-video-gallery .box-item video {
    width: 100%;
    height: 100%;
}

/* Responsive adjustments */
@media only screen and (max-width: 768px) {
    section.gallery .grid-gallery {
        display:block;
    }
    
    .lightgallery {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .grid-video-gallery {
        display: block;
    }
}

@media only screen and (max-width: 480px) {
    .lightgallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .lightgallery a {
        height: 150px;
        /* Adjust height for smaller screens */
    }

    .grid-video-gallery {
        display: block;
    }
}

@media screen and (min-width:767px) and (max-width:1023px) {
    .grid-video-gallery {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
}