/* ==========================================
   Lightbox (просмотр фото в постах)
   ========================================== */

.lightbox-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.lightbox-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.lightbox-content {
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 92vw;
    max-height: 88vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    animation: lightboxZoomIn 0.18s ease;
}

.lightbox-error {
    color: #fff;
    text-align: center;
    background: rgba(255, 255, 255, 0.08);
    padding: 16px 18px;
    border-radius: 10px;
    max-width: 92vw;
}

.lightbox-close {
    position: fixed;
    top: 14px;
    right: 14px;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: scale(1.05);
}

.lightbox-close:focus {
    outline: 2px solid rgba(255, 255, 255, 0.65);
    outline-offset: 2px;
}

@keyframes lightboxZoomIn {
    from {
        transform: scale(0.98);
        opacity: 0.6;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* На мобильных немного уменьшаем отступы, чтобы фото занимало больше места */
@media (max-width: 480px) {
    .lightbox-modal {
        padding: 10px;
    }

    .lightbox-image {
        max-width: 96vw;
        max-height: 84vh;
    }
}
