html.image-preview-open {
    overflow: hidden;
}

.image-preview {
    position: fixed;
    inset: 0;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 76px 16px 20px;
    border: 0;
    background: rgb(15 27 61 / 95%);
}

.image-preview[open] {
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-preview::backdrop {
    background: rgb(15 27 61 / 65%);
}

.image-preview > img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.image-preview__close {
    position: absolute;
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid var(--yellow);
    border-radius: 50%;
    background: var(--navy);
    color: var(--yellow);
    font-family: Arial, sans-serif;
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
}

.image-preview__close:hover {
    background: var(--yellow);
    color: var(--navy);
}

.image-preview__close:focus-visible {
    outline: 3px solid white;
    outline-offset: 4px;
}

.gallery__item:focus-visible {
    outline: 3px solid var(--navy);
    outline-offset: 4px;
}

.image-preview {
    background: rgb(13 58 34 / 95%);
}

.image-preview::backdrop {
    background: rgb(13 58 34 / 65%);
}