.project-gallery-container {
    max-width: 800px;
    margin: 0 auto;
}

.main-gallery-wrapper {
    position: relative;
    overflow: hidden;
}

.main-gallery {
    width: 100%;
    position: relative;
    aspect-ratio: 1.78 / 1;
}
.main-gallery img:first-child {
    opacity: 1;
}

.main-gallery img,
.main-gallery video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;

    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.5s ease-in-out,
        transform 0.5s ease-in-out;
}

.main-gallery img.active,
.main-gallery video.active  {
    opacity: 1;
    pointer-events: auto;
}

.gallery-prev,
.gallery-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    font-size: 15px;
    cursor: pointer;
    z-index: 10;
    width: 40px;
    height: 40px;
    font-weight: lighter;
}

.gallery-prev { left: 0; }
.gallery-next { right: 0; }

.thumbnail-gallery {
    display: flex;
    gap: 5px;
    margin-top: 10px;
    flex-wrap: nowrap;       /* keep in one line */
    overflow-x: auto;        /* allow horizontal scroll */
    -webkit-overflow-scrolling: touch; /* smooth scroll on mobile */
    cursor: grab;            /* indicate draggable */
}
.thumbnail-gallery::-webkit-scrollbar {
    display: none;
}
.thumbnail-gallery:active {
    cursor: grabbing;
}
.thumbnail-gallery img {
    flex: 0 0 auto;          /* prevent shrinking */
    width: 120px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.3s ease, transform 0.3s ease;
    aspect-ratio: 1.79 / 1;
    object-fit: cover;
    object-position: center;
}

.thumbnail-gallery img:hover,
.thumbnail-gallery img.active-thumb {
    opacity: 1;
}

.video-thumb {
    flex: 0 0 auto;                  
    width: 120px;                     
    aspect-ratio: 1.79 / 1;          
    background: #000;                 
    position: relative;
    cursor: pointer;
    background-size: cover;           
    background-position: center;
}

.video-thumb .play-icon {
    color: #fff;
    font-size: 22px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}