.toybox-sketch-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 1.25em 0;
}

.toybox-sketch-gallery-item {
    position: relative;
    min-width: 0;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.04);
    cursor: zoom-in;
}

.toybox-sketch-gallery-item > *,
.toybox-sketch-gallery-item p,
.toybox-sketch-gallery-item figure,
.toybox-sketch-gallery-item a {
    width: 100%;
    height: 100%;
    margin: 0 !important;
}

.toybox-sketch-gallery-item img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover;
    cursor: zoom-in;
}

.toybox-sketch-gallery-item figcaption {
    display: none;
}

.toybox-sketch-gallery-lightbox[hidden] {
    display: none !important;
}

.toybox-sketch-gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.92);
    padding: 54px 72px;
    box-sizing: border-box;
}

.toybox-sketch-gallery-lightbox__image {
    display: block;
    max-width: min(100%, 1600px);
    max-height: calc(100vh - 108px);
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

.toybox-sketch-gallery-lightbox__button {
    position: absolute;
    z-index: 2;
    border: 0;
    background: rgba(0, 0, 0, 0.32);
    color: #fff;
    cursor: pointer;
    line-height: 1;
    font: inherit;
}

.toybox-sketch-gallery-lightbox__close {
    top: 14px;
    right: 14px;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    font-size: 30px;
}

.toybox-sketch-gallery-lightbox__prev,
.toybox-sketch-gallery-lightbox__next {
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 62px;
    border-radius: 6px;
    font-size: 38px;
}

.toybox-sketch-gallery-lightbox__prev { left: 14px; }
.toybox-sketch-gallery-lightbox__next { right: 14px; }

.toybox-sketch-gallery-lightbox__count {
    position: absolute;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    color: #fff;
    font-size: 14px;
    line-height: 1;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.32);
}

body.toybox-sketch-gallery-open {
    overflow: hidden;
}

@media (max-width: 720px) {
    .toybox-sketch-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .toybox-sketch-gallery-lightbox {
        padding: 50px 12px 58px;
    }

    .toybox-sketch-gallery-lightbox__prev,
    .toybox-sketch-gallery-lightbox__next {
        top: auto;
        bottom: 10px;
        transform: none;
        width: 44px;
        height: 44px;
    }

    .toybox-sketch-gallery-lightbox__prev { left: 12px; }
    .toybox-sketch-gallery-lightbox__next { right: 12px; }
    .toybox-sketch-gallery-lightbox__count { bottom: 22px; }
}
