/* ============================================
   Лайтбокс — просмотр фото в карточке
   ============================================ */

.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    box-sizing: border-box;
    padding: 20px;
    touch-action: manipulation;
}

.lightbox-overlay.is-open {
    display: flex;
    opacity: 1;
}

/* Карточка-рамочка (точка отсчета для кнопок) */
.lightbox-content {
    position: relative !important;
    background: #1E293B;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    padding: 24px 20px 20px 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    max-width: 88vw;
    max-height: 85vh;
    box-sizing: border-box;
    margin: auto;
}

/* Фотография строго внутри карточки */
.lightbox-img {
    max-width: 100%;
    max-height: 55vh;
    width: auto;
    height: auto;
    border-radius: 12px;
    object-fit: contain;
    background: #0F172A;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

/* Видео строго внутри карточки */
.lightbox-video {
    max-width: 100%;
    max-height: 55vh;
    width: auto;
    height: auto;
    border-radius: 12px;
    object-fit: contain;
    background: #0F172A;
    display: block;
}

/* Описание под фото */
.lightbox-caption {
    text-align: center;
    color: #FFFFFF;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
}

.lightbox-caption__title {
    display: block;
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 2px;
}

.lightbox-caption__date {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

/* Кнопка «Перейти к комментариям» */
.lightbox-comments-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
    padding: 10px 22px;
    background: #FFC93C;
    border-radius: 100px;
    color: #1E3A5F;
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 0.9rem;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.lightbox-comments-link:hover {
    background: #FFD84D;
    transform: translateY(-2px);
}

/* Кнопка закрытия (Крестик) */
.lightbox-close {
    position: absolute !important;
    top: -12px !important;
    right: -12px !important;
    left: auto !important;
    bottom: auto !important;
    width: 38px !important;
    height: 38px !important;
    border-radius: 50%;
    background: #FF6B6B;
    border: 3px solid #FFFFFF;
    color: #FFFFFF;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 10001;
}

.lightbox-close:hover {
    background: #FF4D4D;
    transform: scale(1.1) rotate(90deg);
}

/* Стрелки навигации */
.lightbox-btn {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    bottom: auto !important;
    width: 38px !important;
    height: 38px !important;
    border-radius: 50%;
    background: #FFC93C;
    border: 3px solid #FFFFFF;
    color: #1E3A5F;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    user-select: none;
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    padding-bottom: 2px;
}

.lightbox-btn:hover {
    background: #FFD84D;
    transform: translateY(-50%) scale(1.1) !important;
}

.lightbox-btn--prev {
    left: -14px !important;
    right: auto !important;
}

.lightbox-btn--next {
    right: -14px !important;
    left: auto !important;
}

.lightbox-btn[disabled] {
    opacity: 0.3;
    cursor: not-allowed;
    background: #94A3B8;
}

/* Мобильная адаптация */
@media (max-width: 640px) {
    .lightbox-overlay {
        padding: 12px;
    }

    .lightbox-content {
        max-width: 82vw;
        padding: 18px 12px 14px 12px;
    }

    .lightbox-img,
    .lightbox-video {
        max-height: 48vh;
    }

    /* Увеличиваем кликабельную область кнопок для пальцев */
    .lightbox-close {
        top: -10px !important;
        right: -10px !important;
        width: 36px !important;
        height: 36px !important;
        font-size: 18px;
    }

    .lightbox-btn {
        width: 36px !important;
        height: 36px !important;
        font-size: 20px;
    }

    .lightbox-btn--prev { left: -10px !important; }
    .lightbox-btn--next { right: -10px !important; }
}