.lightbox {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    z-index: 9999;
    display: none;
    background: rgba(12, 20, 18, 0.92);
    color: #fff;
}

.lightbox.is-open {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
}

.lightbox__top,
.lightbox__bottom {
    flex: 0 0 auto;
    padding: 12px max(14px, env(safe-area-inset-left))
             12px max(14px, env(safe-area-inset-right));
    display: flex;
    align-items: center;
    gap: 12px;
}

.lightbox__top {
    justify-content: flex-end;
}

.lightbox__stage {
    flex: 1 1 auto;
    min-height: 0;
    max-height: calc(100dvh - var(--lightbox-chrome, 168px));
    display: grid;
    place-items: center;
    padding: 0 clamp(10px, 3vw, 28px);
    overflow: hidden;
}

.lightbox__image {
    max-width: 100%;
    max-height: calc(100dvh - var(--lightbox-chrome, 168px) - 2px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: var(--shadow);
}

.lightbox__bottom {
    justify-content: space-between;
    align-items: flex-end;
    gap: 18px;
    max-height: 38dvh;
    overflow: auto;
    overscroll-behavior: contain;
}

.lightbox__text {
    max-width: 780px;
    min-width: 0;
}

.lightbox__title {
    margin: 0 0 4px;
    font-size: clamp(1.05rem, 3vw, 1.55rem);
    line-height: 1.2;
    letter-spacing: 0;
    color: #efefef;
}

.lightbox__description {
    margin: 0;
    color: rgba(255, 255, 255, 0.74);
    font-size: 0.95rem;
}

.lightbox__actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lightbox__button,
.lightbox__download {
    min-width: 44px;
    min-height: 44px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}

.lightbox__download {
    padding: 0 14px;
    font-weight: 700;
}

.lightbox__button svg,
.download-link svg {
    width: 20px;
    height: 20px;
    display: block;
}

body.lightbox-open {
    overflow: hidden;
}