.photo-viewer figure {
    margin: 0;
}

.photo-viewer button:focus-visible {
    outline: 3px solid #174da1;
    outline-offset: 2px;
}

.photo-viewer {
    box-sizing: border-box;
    max-width: calc(100% - 20px);
    max-height: calc(100% - 20px);
    padding: 10px;
    margin: auto;
    border: 0;
    background: #fff;
    color: #303030;
}

.photo-viewer:not([open]),
.photo-viewer [hidden] {
    display: none;
}

.photo-viewer::backdrop {
    background: rgb(0 0 0 / 60%);
}

.photo-viewer-stage {
    position: relative;
    display: grid;
    place-items: center;
    min-width: min(220px, 75vw);
    min-height: 112px;
}

.photo-viewer-stage img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 116px);
    max-height: calc(100dvh - 116px);
    object-fit: contain;
}

.photo-viewer-stage button {
    position: absolute;
    inset-block: 0;
    width: 50%;
    display: flex;
    align-items: center;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 4px;
}

.photo-viewer-stage button span {
    padding: 4px 10px;
    border-radius: 4px;
    background: #252525;
    color: #fff;
    font: 26px/1 Arial, sans-serif;
}

.photo-viewer-stage [data-photo-previous] {
    left: 0;
}

.photo-viewer-stage [data-photo-next] {
    right: 0;
    justify-content: flex-end;
}

.photo-viewer figcaption {
    min-height: 40px;
    padding: 7px 78px 0 0;
    font: 12px/16px Verdana, Arial, sans-serif;
}

.photo-viewer figcaption span {
    display: block;
}

.photo-viewer-close {
    position: absolute;
    right: 10px;
    bottom: 10px;
}

.photo-viewer-close button {
    min-height: 32px;
    cursor: pointer;
}

.photo-viewer [data-photo-original] {
    display: inline-block;
    margin-top: 4px;
}
