.gallery-enlarge {
    display: block;
    width: 100%;
    height: 100%;
    cursor: zoom-in;
}

.gallery-enlarge:focus-visible {
    outline: 3px solid var(--red);
    outline-offset: 4px;
}

.gallery-modal .modal-dialog {
    width: max-content;
    max-width: calc(100% - 32px);
    margin-right: auto;
    margin-left: auto;
}

.gallery-modal .modal-content {
    min-width: 0;
    background: var(--paper, #fffdf8);
}

.gallery-modal .modal-title {
    margin: 0;
    font-size: 18px;
    line-height: 1.4;
    font-weight: 700;
}

.gallery-modal .modal-body {
    overflow: auto;
    max-height: calc(100vh - 180px);
    max-height: calc(100dvh - 180px);
    padding: 16px;
}

.gallery-modal-image {
    display: block;
    width: auto;
    height: auto;
    max-width: min(100%, calc(100vw - 66px));
    max-height: calc(100vh - 212px);
    max-height: calc(100dvh - 212px);
    margin: auto;
    object-fit: contain;
}

.gallery-modal.is-original .gallery-modal-image {
    max-width: none;
    max-height: none;
}

.gallery-modal-image[hidden] {
    display: none;
}

.gallery-modal-status {
    margin: 0;
    font-size: 14px;
}

.gallery-modal .modal-footer {
    justify-content: space-between;
    gap: 12px;
}

.gallery-size-toggle {
    padding: 9px 15px;
    border: 1px solid var(--dark-turquoise, #122e2e);
    background: transparent;
    color: var(--dark-turquoise, #122e2e);
    font: inherit;
}

.gallery-size-toggle:hover,
.gallery-size-toggle[aria-pressed="true"] {
    background: var(--dark-turquoise, #122e2e);
    color: white;
}

.gallery-original-link {
    color: #087578;
    font-size: 13px;
}

.gallery-original-link:hover {
    text-decoration: underline;
}

.gallery-modal-stage {
    position: relative;
    min-width: 0;
}

.gallery-image-navigation {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.gallery-arrow {
    position: absolute;
    top: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 64px;
    padding: 0 0 6px;
    border: 0;
    border-radius: 4px;
    background: rgb(0 0 0 / 35%);
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 56px;
    line-height: 1;
    cursor: pointer;
    pointer-events: auto;
    transform: translateY(-50%);
}

.gallery-arrow-prev {
    left: 8px;
}

.gallery-arrow-next {
    right: 8px;
}

.gallery-arrow:hover {
    background: rgb(0 0 0 / 65%);
}

.gallery-arrow:focus-visible {
    outline: 3px solid var(--turquoise, #47b7b6);
    outline-offset: 2px;
}

.gallery-arrow:disabled {
    display: none;
}

.gallery-modal .modal-title {
    letter-spacing: normal;
}
