/* Ghost galleries become square, editorial slideshows. The first block is
   also the centred fallback shown before JavaScript loads. */
.gh-content .kg-gallery-card {
    width: min(900px, calc(100vw - 40px));
    margin: 3em 50%;
    transform: translateX(-50%);
}

.kg-gallery-card:not(.is-slideshow) .kg-gallery-container {
    margin-inline: auto;
}

.kg-gallery-card.is-slideshow {
    position: relative;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.honegger-gallery-viewport {
    overflow: hidden;
    background: transparent;
    aspect-ratio: 1;
    touch-action: pan-y pinch-zoom;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.honegger-gallery-viewport.is-dragging {
    cursor: grabbing;
}

.honegger-gallery-track {
    display: flex;
    height: 100%;
    background: transparent;
    transition: transform 500ms cubic-bezier(.2, .7, .2, 1);
    will-change: transform;
}

.honegger-gallery-track .kg-gallery-image {
    display: grid !important;
    place-items: center;
    flex: 0 0 100% !important;
    width: 100% !important;
    min-width: 100%;
    max-width: none !important;
    height: 100%;
    margin: 0;
    background: transparent !important;
}

.honegger-gallery-track .kg-gallery-image picture {
    display: block;
    width: 100%;
    height: 100%;
    background: transparent !important;
}

.honegger-gallery-track .kg-gallery-image img {
    display: block !important;
    width: 100%;
    height: 100%;
    object-fit: contain !important;
    object-position: center center;
    background: transparent !important;
    visibility: visible !important;
    opacity: 1 !important;
    -webkit-user-drag: none;
}

.honegger-gallery-controls {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 24px;
    min-height: 64px;
    padding-top: 14px;
}

.honegger-gallery-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.honegger-gallery-dot,
.honegger-gallery-arrow {
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font: inherit;
}

.honegger-gallery-dot {
    padding: 3px 0;
    font-size: .72em;
    opacity: .45;
}

.honegger-gallery-dot[aria-current="true"] {
    opacity: 1;
    text-decoration: underline;
    text-underline-offset: 5px;
}

.honegger-gallery-arrows {
    display: flex;
    gap: 8px;
}

.honegger-gallery-arrow {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid currentColor;
    border-radius: 50%;
    line-height: 1;
    transition: background .2s, color .2s;
}

.honegger-gallery-arrow:hover {
    background: var(--ink);
    color: var(--paper);
}

.kg-gallery-card.is-slideshow > figcaption {
    margin-top: 4px;
}

@media (max-width: 850px) {
    .gh-content .kg-gallery-card {
        width: calc(100vw - 40px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .honegger-gallery-track {
        transition: none;
    }
}
