.akm-gallery__grid {
    columns: 220px;
    column-gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.akm-gallery__item {
    break-inside: avoid;
    min-width: 0;
    margin: 0 0 16px;
}

.akm-gallery__open {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.akm-gallery__open:focus-visible,
.akm-gallery__close:focus-visible,
.akm-gallery__nav:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 3px;
}

.akm-gallery__image {
    display: block;
    width: 100%;
    height: auto;
}

html.akm-gallery-viewer-open,
html.akm-gallery-viewer-open body {
    overflow: hidden;
}

.akm-gallery__dialog {
    box-sizing: border-box;
    width: min(96vw, 1400px);
    max-width: none;
    max-height: 94vh;
    max-height: 94dvh;
    padding: 16px;
    border: 0;
    background: #fff;
    color: #1e1e1e;
    overflow: auto;
}

.akm-gallery__dialog::backdrop {
    background: rgb(0 0 0 / 75%);
}

.akm-gallery__dialog:focus {
    outline: none;
}

.akm-gallery .akm-gallery__close {
    position: absolute;
    z-index: 2;
    top: 8px;
    right: 8px;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: rgb(85 85 85 / 55%);
    font: normal 26px/1 sans-serif;
    text-shadow: 0 1px 2px rgb(255 255 255 / 90%);
    box-shadow: none;
    cursor: pointer;
}

.akm-gallery .akm-gallery__close:hover,
.akm-gallery .akm-gallery__close:focus,
.akm-gallery .akm-gallery__close:active {
    background: transparent;
    box-shadow: none;
}

.akm-gallery .akm-gallery__close:hover {
    color: rgb(85 85 85 / 90%);
}

.akm-gallery__dialog-content {
    display: grid;
    gap: 16px;
    align-items: stretch;
}

.akm-gallery__image-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    touch-action: pan-y;
}

.akm-gallery__dialog-image {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 80vh;
    max-height: 80dvh;
    object-fit: contain;
}

.akm-gallery .akm-gallery__nav {
    position: absolute;
    top: 50%;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    transform: translateY(-50%);
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    font: normal 36px/1 sans-serif;
    text-shadow: 0 1px 3px #000, 0 0 6px #000;
    box-shadow: none;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
}

.akm-gallery .akm-gallery__nav:hover,
.akm-gallery .akm-gallery__nav:focus,
.akm-gallery .akm-gallery__nav:active {
    background: transparent;
    box-shadow: none;
}

.akm-gallery__image-stage:hover .akm-gallery__nav,
.akm-gallery__image-stage:focus-within .akm-gallery__nav {
    opacity: 1;
    pointer-events: auto;
}

.akm-gallery__previous {
    left: 8px;
}

.akm-gallery__next {
    right: 8px;
}

.akm-gallery__description {
    min-width: 0;
    max-height: 80vh;
    max-height: 80dvh;
    align-self: end;
    overflow: auto;
    overflow-wrap: anywhere;
}

.akm-gallery__description > :first-child {
    margin-top: 0;
}

.akm-gallery__description > :last-child {
    margin-bottom: 0;
}

@media (min-width: 720px) {
    .akm-gallery__dialog-content {
        grid-template-columns: minmax(0, 4fr) minmax(0, 1fr);
    }
}

@media (max-width: 719px) {
    .akm-gallery__dialog {
        padding: 8px;
    }

    .akm-gallery__dialog-image {
        max-height: 65vh;
        max-height: 65dvh;
    }

    .akm-gallery__description {
        max-height: 24vh;
        max-height: 24dvh;
    }
}
