.gallery-preview {
    --preview-space: 64px;
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(var(--preview-space) / 2);
    background: #09182b99;
}

.gallery-preview-dialog {
    position: relative;
    display: flex;
    width: max-content;
    max-width: 100%;
    max-height: calc(100svh - var(--preview-space));
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.gallery-preview-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.gallery-preview-frame img {
    display: block;
    width: auto;
    height: auto;
    max-width: min(800px, calc(100vw - var(--preview-space)));
    max-height: calc(100svh - var(--preview-space));
    object-fit: contain;
}

.gallery-preview-status {
    min-width: min(320px, calc(100vw - var(--preview-space)));
    margin: 0;
    padding: 72px 56px;
    color: #fff;
    text-align: center;
}

.gallery-preview-dialog .icon-button {
    position: absolute;
    z-index: 1;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 10px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #fff;
    opacity: .8;
    transition: color .2s ease, opacity .2s ease;
}

.gallery-preview-dialog .icon-button .icon {
    filter: drop-shadow(0 1px 2px #000b);
}

.gallery-preview-dialog .icon-button:hover,
.gallery-preview-dialog .icon-button:focus-visible {
    background: transparent;
    color: var(--red);
    opacity: 1;
}

.gallery-preview-close {
    top: 12px;
    right: 12px;
}

.gallery-preview-prev,
.gallery-preview-next {
    top: calc(50% - 22px);
}

.gallery-preview-prev {
    left: 12px;
}

.gallery-preview-next {
    right: 12px;
}

@media (max-width: 640px) {
    .gallery-preview {
        --preview-space: 32px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gallery-preview-dialog .icon-button {
        transition: none;
    }
}
