/* Grid */
.prinzgallery__grid {
    display: grid;
    grid-template-columns: repeat(min(2, var(--prinzgallery-columns, 4)), minmax(0, 1fr));
    gap: .75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (min-width: 576px) {
    .prinzgallery__grid {
        grid-template-columns: repeat(min(3, var(--prinzgallery-columns, 4)), minmax(0, 1fr));
    }
}

@media (min-width: 992px) {
    .prinzgallery__grid {
        grid-template-columns: repeat(var(--prinzgallery-columns, 4), minmax(0, 1fr));
    }
}

.prinzgallery__figure {
    margin: 0;
}

.prinzgallery__link {
    display: block;
    overflow: hidden;
    border-radius: .25rem;
    background: #eee;
}

.prinzgallery__thumb {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: var(--prinzgallery-aspect, 1/1);
    object-fit: cover;
    transition: transform .3s ease;
}

.prinzgallery__link:hover .prinzgallery__thumb,
.prinzgallery__link:focus-visible .prinzgallery__thumb {
    transform: scale(1.04);
}

.prinzgallery__figcaption {
    margin-top: .375rem;
    font-size: .875rem;
}

/* Lightbox */
.prinzgallery__dialog {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 3.5rem 4rem;
    border: 0;
    color: #fff;
    background: transparent;
}

.prinzgallery__dialog[open] {
    display: grid;
    place-items: center;
}

.prinzgallery__dialog::backdrop {
    background: rgb(0 0 0 / .9);
}

.prinzgallery__stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
}

.prinzgallery__full {
    max-width: 100%;
    max-height: calc(100dvh - 9rem);
    width: auto;
    height: auto;
    object-fit: contain;
    touch-action: pan-y;
}

.prinzgallery__caption {
    margin-top: .75rem;
    text-align: center;
}

.prinzgallery__counter {
    position: absolute;
    top: 1rem;
    left: 1rem;
    margin: 0;
    font-size: .875rem;
    opacity: .8;
}

.prinzgallery__btn {
    position: absolute;
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgb(255 255 255 / .12);
    cursor: pointer;
}

.prinzgallery__btn:hover,
.prinzgallery__btn:focus-visible {
    background: rgb(255 255 255 / .3);
}

.prinzgallery__btn svg {
    width: 1.5rem;
    height: 1.5rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.prinzgallery__btn--close {
    top: .5rem;
    right: .5rem;
}

.prinzgallery__btn--prev,
.prinzgallery__btn--next {
    top: 50%;
    transform: translateY(-50%);
}

.prinzgallery__btn--prev {
    left: .5rem;
}

.prinzgallery__btn--next {
    right: .5rem;
}

@media (max-width: 575.98px) {
    .prinzgallery__dialog {
        padding: 3.5rem .5rem;
    }

    .prinzgallery__btn--prev,
    .prinzgallery__btn--next {
        top: auto;
        bottom: .5rem;
        transform: none;
    }
}

/* Hero carousel */
.prinzgallery-carousel__image {
    height: min(var(--prinzgallery-height, 800px), 75vh);
    min-height: 260px;
    object-fit: cover;
}

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