/* ============================================
   POPUP — модальное окно просмотра работ
   ============================================ */

.popup {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--color-overlay);
    z-index: var(--z-popup);
    justify-content: center;
    align-items: center;
    padding: var(--space-md);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.popup.active {
    display: flex;
    animation: fadeIn var(--duration-normal) var(--ease-smooth);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.popup__content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: var(--color-bg-elevated);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 0 60px var(--color-accent-glow);
    animation: popupIn var(--duration-slow) var(--ease-smooth);
    transform-style: preserve-3d;
}

@keyframes popupIn {
    from {
        transform: perspective(1000px) rotateY(90deg) scale(0.5);
        opacity: 0;
    }
    to {
        transform: perspective(1000px) rotateY(0deg) scale(1);
        opacity: 1;
    }
}

.popup__img {
    max-width: 90vw;
    max-height: 85vh;
    display: block;
    object-fit: contain;
    transition: opacity var(--duration-normal), transform var(--duration-normal);
}

/* Кнопка закрытия */
.popup__close {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    width: 40px;
    height: 40px;
    background: rgba(139, 0, 0, 0.9);
    border-radius: var(--radius-full);
    color: var(--color-text-white);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all var(--duration-normal) var(--ease-smooth);
    line-height: 1;
}

.popup__close:hover {
    background: var(--color-accent-hot);
    transform: rotate(90deg);
}

/* Стрелки навигации */
.popup__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(139, 0, 0, 0.9);
    border-radius: var(--radius-full);
    color: var(--color-text-white);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all var(--duration-normal) var(--ease-smooth);
    line-height: 1;
}

.popup__nav:hover {
    background: var(--color-accent-hot);
    transform: translateY(-50%) scale(1.1);
}

.popup__nav--prev { left: var(--space-sm); }
.popup__nav--next { right: var(--space-sm); }

/* ---------- Meta-информация попапа — скрыта ---------- */

.popup__meta {
    display: none;
}