.dp-gallery {
    display: grid;
    grid-template-columns: repeat(var(--dp-gallery-columns, 3), minmax(0, 1fr));
    gap: clamp(4px, .75vw, 9px);
    align-items: start;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow-x: clip;
}

.dp-gallery *,
.dp-gallery *::before,
.dp-gallery *::after {
    box-sizing: border-box;
}

.dp-gallery__item {
    margin: 0;
    padding: 0;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    background: transparent;
}

.dp-gallery__trigger,
.dp-gallery__link {
    width: 100%;
    max-width: 100%;
    min-width: 0 !important;
    height: auto;
    margin: 0;
    padding: 0;
    border: 0;
    display: block;
    overflow: hidden;
    background: transparent;
    cursor: zoom-in;
}

.dp-gallery__trigger img,
.dp-gallery__link img {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    margin: 0;
    display: block;
    object-fit: contain;
    transition: transform .35s ease, filter .35s ease;
}

.dp-gallery__trigger:hover img,
.dp-gallery__trigger:focus-visible img,
.dp-gallery__link:hover img,
.dp-gallery__link:focus-visible img {
    transform: scale(1.045);
    filter: brightness(.9);
}

.dp-gallery__trigger:focus-visible,
.dp-gallery__link:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: -3px;
}

.dp-gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(10, 10, 12, .92);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
}

.dp-gallery-lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

.dp-gallery-lightbox__figure {
    margin: 0;
    max-width: min(92vw, 1500px);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.dp-gallery-lightbox__image {
    display: block;
    max-width: 100%;
    max-height: 82vh;
    object-fit: contain;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .4);
}

.dp-gallery-lightbox__caption {
    color: #fff;
    font-size: 15px;
    text-align: center;
}

.dp-gallery-lightbox__close,
.dp-gallery-lightbox__nav {
    position: absolute;
    border: 0;
    border-radius: 999px;
    width: 46px;
    height: 46px;
    color: #fff;
    background: rgba(255, 255, 255, .14);
    backdrop-filter: blur(8px);
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
}

.dp-gallery-lightbox__close { top: 20px; right: 20px; }
.dp-gallery-lightbox__prev { left: 20px; top: 50%; transform: translateY(-50%); }
.dp-gallery-lightbox__next { right: 20px; top: 50%; transform: translateY(-50%); }

.dp-gallery-lightbox__close:hover,
.dp-gallery-lightbox__nav:hover,
.dp-gallery-lightbox__close:focus-visible,
.dp-gallery-lightbox__nav:focus-visible {
    background: rgba(255, 255, 255, .26);
}

body.dp-gallery-lightbox-open { overflow: hidden; }

@media (max-width: 767px) {
    .dp-gallery {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 4px;
    }
    .dp-gallery-lightbox { padding: 12px; }
    .dp-gallery-lightbox__nav { width: 42px; height: 42px; }
    .dp-gallery-lightbox__prev { left: 8px; }
    .dp-gallery-lightbox__next { right: 8px; }
}

.dp-gallery__link { text-decoration: none; cursor: pointer; }
.dp-gallery__link--empty { cursor: default; }
