



.lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    grid-template-rows: 1fr auto auto;
    place-items: center;
    gap: 12px;
    padding: 56px 20px 24px;
    background: rgba(6, 6, 9, .92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    opacity: 0;
    transition: opacity .2s ease;
}




.lightbox[hidden] { display: none; }


.lightbox:not(.is-open) { pointer-events: none; }

.lightbox.is-open { opacity: 1; }

.lightbox__stage {
    grid-row: 1;
    display: grid;
    place-items: center;
    min-height: 0;
    max-width: 100%;
}

.lightbox__img {
    max-width: min(1100px, 100%);
    
    max-height: calc(100vh - 130px);
    width: auto;
    height: auto;
    border-radius: 14px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, .6);
    transform: scale(.97);
    transition: transform .22s ease;
}

.lightbox.is-open .lightbox__img { transform: scale(1); }

.lightbox__caption {
    grid-row: 2;
    max-width: 70ch;
    color: rgba(255, 255, 255, .72);
    font-size: .84rem;
    text-align: center;
}

.lightbox__original {
    grid-row: 3;
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 999px;
    color: rgba(255, 255, 255, .78);
    font-size: .78rem;
    font-weight: 600;
    transition: color .18s ease, border-color .18s ease, background .18s ease;
}

.lightbox__original:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, .3);
    background: rgba(255, 255, 255, .07);
}

.lightbox__close {
    position: absolute;
    top: 14px;
    right: 14px;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .06);
    color: #fff;
    transition: background .18s ease, transform .18s ease;
}

.lightbox__close:hover { background: rgba(255, 255, 255, .13); transform: scale(1.06); }

.lightbox__close svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}


body.lightbox-open { overflow: hidden; }


a.wall-post__photo,
a.feed-photo,
a.post-photo { cursor: zoom-in; }

@media (max-width: 640px) {
    .lightbox { padding: 52px 10px 18px; }
    .lightbox__img { max-height: calc(100vh - 118px); border-radius: 10px; }
    .lightbox__caption { font-size: .78rem; }
}

@media (prefers-reduced-motion: reduce) {
    .lightbox,
    .lightbox__img,
    .lightbox__close { transition: none; }
    .lightbox__img { transform: none; }
}
