.mc-gallery-access {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: .5rem;
    margin-block: .75rem 1.25rem;
}

.mc-gallery-inline {
    margin-block: 1.25rem .75rem;
}

.mc-gallery-action {
    min-height: 44px;
    padding: .5em .9em;
    border: 1px solid currentColor;
    border-radius: .35rem;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: .875rem;
    font-weight: 650;
    cursor: pointer;
}

.mc-gallery-action:hover {
    text-decoration: underline;
}

.mc-gallery-action:focus-visible,
.mc-gallery-viewer button:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

html:has(.mc-gallery-viewer[open]) {
    overflow: hidden;
}

.mc-gallery-viewer {
    box-sizing: border-box;
    width: min(96vw, 75rem);
    max-width: none;
    max-height: 94dvh;
    padding: 0;
    border: 1px solid #525252;
    border-radius: .6rem;
    background: #171717;
    color: #fff;
}

.mc-gallery-viewer::backdrop {
    background: rgb(0 0 0 / 88%);
}

.mc-gallery-viewer__frame {
    padding: clamp(.5rem, 2vw, 1rem);
}

.mc-gallery-viewer__bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
    padding-inline: .5rem;
    margin-bottom: .5rem;
    font-variant-numeric: tabular-nums;
}

.mc-gallery-viewer__stage {
    position: relative;
}

.mc-gallery-viewer__stage img {
    display: block;
    width: 100%;
    height: min(69dvh, 48rem);
    object-fit: contain;
    touch-action: pan-y;
}

.mc-gallery-viewer button {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid #a3a3a3;
    border-radius: 50%;
    background: #171717;
    color: #fff;
    font: 1.75rem / 1 system-ui, sans-serif;
    cursor: pointer;
}

.mc-gallery-viewer__stage button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.mc-gallery-viewer__stage button:first-of-type {
    inset-inline-start: .25rem;
}

.mc-gallery-viewer__stage button:last-of-type {
    inset-inline-end: .25rem;
}

.mc-gallery-viewer__caption {
    margin: .75rem 0 0;
    padding-inline: .5rem;
    text-align: center;
}
