
/* Hide original galleries until processed */
.wp-block-gallery:not(.kursuok-processed),
.gallery:not(.kursuok-processed) {
    display: none !important;
}

.kursuok-gallery-wrapper {
    margin-bottom: 40px;
    background-color: #dfe0f5;
    padding: 20px;
    border-radius: 10px;
}

.kursuok-gallery-main-trigger {
    display: block;
    margin-bottom: 16px;
}

.kursuok-gallery-main-image {
    width: 100%;
    height: 700px;
    object-fit: contain;
    border-radius: 10px;
    display: block;
    transition: opacity .16s ease;
    -webkit-user-drag: none;
}

.kursuok-gallery-main-image.is-changing {
    opacity: .75;
}

.kursuok-gallery-thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    cursor: grab;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.kursuok-gallery-thumbs::-webkit-scrollbar {
    display: none;
}

.kursuok-gallery-thumbs.is-dragging {
    cursor: grabbing;
    user-select: none;
}

.kursuok-gallery-thumb {
    border: 0;
    background: transparent;
    padding: 0;
    flex: 0 0 auto;
    opacity: 0.6;
    cursor: pointer;
    transition: opacity .2s ease;
}

.kursuok-gallery-thumb:focus-visible,
.kursuok-gallery-main-trigger:focus-visible,
.kursuok-lightbox-close:focus-visible,
.kursuok-lightbox-nav:focus-visible {
    outline: 2px solid #6a6de0;
    outline-offset: 2px;
}

.kursuok-gallery-thumb.is-active {
    opacity: 1;
}

.kursuok-gallery-thumb img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 8px;
    display: block;
    -webkit-user-drag: none;
}

body.kursuok-lightbox-open {
    overflow: hidden;
}

.kursuok-lightbox-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, .92);
}

.kursuok-lightbox-modal.is-open {
    display: flex;
}

.kursuok-lightbox-image {
    max-width: min(94vw, 1400px);
    max-height: 82vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

.kursuok-lightbox-close,
.kursuok-lightbox-nav {
    position: absolute;
    border: 0;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    cursor: pointer;
}

.kursuok-lightbox-close {
    top: 14px;
    right: 14px;
    font-size: 28px;
    line-height: 1;
    width: 42px;
    height: 42px;
    border-radius: 50%;
}

.kursuok-lightbox-nav {
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 56px;
    border-radius: 10px;
    font-size: 24px;
}

.kursuok-lightbox-prev {
    left: 14px;
}

.kursuok-lightbox-next {
    right: 14px;
}

.kursuok-lightbox-caption,
.kursuok-lightbox-counter {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    text-align: center;
    font-size: 14px;
}

.kursuok-lightbox-caption {
    bottom: 22px;
    max-width: 90vw;
}

.kursuok-lightbox-counter {
    top: 18px;
}

@media (max-width: 768px) {

    .kursuok-gallery-main-image {
        height: 320px;
    }

    .kursuok-gallery-thumb img {
        width: 96px;
        height: 96px;
    }

    .kursuok-lightbox-modal {
        padding: 12px;
    }

    .kursuok-lightbox-nav {
        width: 38px;
        height: 48px;
    }
}
