.gallery-images {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
}

.gallery-image {
    max-height: 350px;
    overflow: hidden;
    position: relative;
}

.gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.gallery-image.square {
    grid-column: span 2;
}

.gallery-image.half {
    grid-column: span 3;
}

.gallery-image.wide {
    grid-column: span 4;
}

.gallery-image.full {
    grid-column: 1 / -1;
}

.gallery-image.top img {
    object-position: top;
}

.gallery-image.bottom img {
    object-position: bottom;
}

.gallery-image.center img {
    object-position: center;
}


.caption {
    font-size: 0.875rem;
    margin-top: 0.5rem;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    padding: 0.5rem;
    text-align: center;
    margin: 0;
    background: linear-gradient(0deg, #000 0%, rgba(0, 0, 0, 0.00) 100%);
}

.gallery-mobile {
    display: none;
}

.thumbnail.selected {
    border: 2px solid #007BFF;
}

.thumbnails-wrapper {
    position: relative;
}

.gallery-thumbnails {
    display: flex;
    overflow-x: auto;
    gap: 0.5rem;
    padding: 1rem 0;
    scroll-behavior: smooth;
}

/* Arrows */
.scroll-arrow {
    position: absolute;
    top: 0;
    height: 100%;
    font-size: 2rem;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 0.2rem 0.5rem;
    z-index: 1;
    cursor: pointer;
    /* user-select: none; */
    display: flex;
    align-items: center;
    transition: background 0.3s ease-in-out;
}

.scroll-arrow.left {
    left: 0;
}

.scroll-arrow.right {
    right: 0;
}

.scroll-arrow:hover {
    background: rgba(0, 0, 0, 0.8);
}

.gallery-featured {
    position: relative;
}

.caption-mobile {
    min-height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
  


@media (max-width: 768px) {

    /* Hide desktop layout on mobile */
    .gallery-images {
        display: none;
    }

    .gallery-mobile {
        display: block;
    }

    .gallery-featured img {
        width: 100%;
        max-height: 300px;
        height: 300px;
        object-fit: cover;
        /* object-fit: contain; */
        object-position: center;
    }

    .gallery-thumbnails {
        display: flex;
        overflow-x: auto;
        gap: 0.5rem;
        margin-top: 1rem;
    }

    .thumbnail {
        flex: 0 0 auto;
        width: 70px;
        height: 70px;
        overflow: hidden;
    }

    .thumbnail img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        cursor: pointer;
    }
}