.ts-gallery {
    width: 100%;
}

/* ── Main image ── */
.ts-gallery__main-wrap {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    line-height: 0;
    margin-bottom: 1rem;
}

/* Gradient overlays at edges for arrow visibility */
.ts-gallery__main-wrap::before,
.ts-gallery__main-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 80px;
    z-index: 1;
    pointer-events: none;
}

.ts-gallery__main-wrap::before {
    left: 0;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.4) 0%, transparent 100%);
}

.ts-gallery__main-wrap::after {
    right: 0;
    background: linear-gradient(to left, rgba(0, 0, 0, 0.4) 0%, transparent 100%);
}

.ts-gallery__main-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    aspect-ratio: 16 / 9;
    cursor: pointer;
}

/* ── Prev / Next arrows ── */
.ts-gallery__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 2;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.4));
    transition: opacity 0.2s ease;
}

.ts-gallery__arrow svg {
    width: 2rem;
    height: 2rem;
}

.ts-gallery__arrow:hover {
    opacity: 0.8;
}

.ts-gallery__arrow--prev {
    left: 0.5rem;
}

.ts-gallery__arrow--next {
    right: 0.5rem;
}

/* ── Expand / fullscreen button ── */
.ts-gallery__expand {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(0, 0, 0, 0.35);
    border: none;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 2;
    line-height: 0;
    transition: background 0.2s ease;
}

.ts-gallery__expand:hover {
    background: rgba(0, 0, 0, 0.55);
}

/* ── Thumbnail strip ── */
.ts-gallery__thumbs {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.25rem;
}

.ts-gallery__thumbs::-webkit-scrollbar {
    display: none;
}

.ts-gallery__thumb {
    flex: 0 0 auto;
    width: 12rem;
    height: 8rem;
    padding: 0;
    border: 3px solid transparent;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    background: none;
    transition: border-color 0.2s ease, opacity 0.2s ease;
    opacity: 0.65;
}

.ts-gallery__thumb:hover,
.ts-gallery__thumb.is-active {
    border-color: #333;
    opacity: 1;
}

.ts-gallery__thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── Credit ── */
.ts-gallery__credit {
    font-size: 14px;
    font-style: italic;
    color: #666;
    margin: 0.75rem 0 0;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .ts-gallery__heading {
        font-size: 1.5rem;
    }

    .ts-gallery__thumb {
        width: 8rem;
        height: 5.5rem;
    }

    .ts-gallery__arrow svg {
        width: 1.5rem;
        height: 1.5rem;
    }
}

@media (max-width: 480px) {
    .ts-gallery__thumb {
        width: 6rem;
        height: 4rem;
    }
}