/* ============================================================
   ЛАЙТБОКС — единый источник правды.
   ============================================================ */

.tdps-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.tdps-lightbox.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.tdps-lightbox__content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    max-width: 90vw;
    max-height: 90vh;
    /* Не даём браузеру интерпретировать свайп по фото как скролл/жест. */
    touch-action: none;
}

.tdps-lightbox__content > img {
    max-width: 90vw;
    max-height: 70vh;
    object-fit: contain;
    display: block;
    border-radius: var(--tdps-radius-sm);
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    background: rgba(0, 0, 0, 0.3);
}

.tdps-lightbox__close {
    position: absolute;
    top: -48px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.8;
    line-height: 1;
    padding: 8px;
    transition: opacity 0.15s ease;
}

.tdps-lightbox__close:hover {
    opacity: 1;
}

/* --- Миниатюры --- */
.tdps-lightbox__thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    max-width: 90vw;
    padding: 4px 0;
    width: 100%;
    justify-content: center;
    touch-action: pan-x;
}

.tdps-lightbox__thumbs::-webkit-scrollbar {
    display: none;
}

.tdps-lightbox__thumb {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--tdps-radius-sm);
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    background: none;
    scroll-snap-align: center;
    opacity: 0.6;
    transition: opacity 0.2s ease, border-color 0.2s ease;
}

.tdps-lightbox__thumb:hover {
    opacity: 0.9;
    border-color: rgba(255, 255, 255, 0.6);
}

.tdps-lightbox__thumb.active {
    border-color: #fff;
    opacity: 1;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4);
}

.tdps-lightbox__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

/* --- Картинки в контенте поста: курсор-зум --- */
.tdps-single-post__content img {
    cursor: zoom-in;
    transition: opacity 0.15s ease;
}

.tdps-single-post__content img:hover {
    opacity: 0.92;
}

.tdps-single-post__content a > img {
    cursor: pointer;
}

@media (max-width: 768px) {
    .tdps-lightbox__thumb {
        flex: 0 0 48px;
        width: 48px;
        height: 48px;
    }
    .tdps-lightbox__content > img {
        max-height: 65vh;
    }
    .tdps-lightbox__close {
        top: -40px;
        font-size: 1.6rem;
    }
}