/* LightBoxJapan */

.lbj-no-scroll {
    overflow: hidden;
}

.lbj-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px;
    box-sizing: border-box;

    background: rgba(0, 0, 0, 0.92);

    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease;
}

.lbj-overlay.lbj-active {
    opacity: 1;
    visibility: visible;
}

.lbj-image {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    touch-action: pan-y;
}

.lbj-close {
    position: absolute;
    top: 15px;
    right: 25px;

    border: 0;
    background: transparent;
    color: #fff;

    font-size: 42px;
    line-height: 1;
    cursor: pointer;
}

.lbj-close:hover {
    color: #ccc;
}

@media (max-width: 600px) {
    .lbj-overlay {
        padding: 15px;
    }

    .lbj-close {
        top: 10px;
        right: 15px;
        font-size: 36px;
    }
}

/* Navigation buttons */

.lbj-prev,
.lbj-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);

    width: 55px;
    height: 70px;

    border: none;
    border-radius: 6px;

    background: rgba(255, 255, 255, 0.15);
    color: #fff;

    font-size: 48px;
    line-height: 1;
    cursor: pointer;

    transition: background 0.2s;
}

.lbj-prev:hover,
.lbj-next:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lbj-prev {
    left: 15px;
}

.lbj-next {
    right: 15px;
}

.lbj-prev[hidden],
.lbj-next[hidden] {
    display: none;
}

/* Image counter */

.lbj-counter {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);

    color: #fff;
    font-size: 14px;
    letter-spacing: 1px;
}

/* Mobile */

@media (max-width: 600px) {
    .lbj-prev,
    .lbj-next {
        width: 38px;
        height: 55px;
        font-size: 36px;
    }

    .lbj-prev {
        left: 5px;
    }

    .lbj-next {
        right: 5px;
    }
}


/* Image loading and error states */

.lbj-status {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 15px;
    text-align: center;
    z-index: 1;
}

.lbj-overlay.lbj-loading .lbj-status,
.lbj-overlay.lbj-error .lbj-status {
    display: block;
}

.lbj-overlay.lbj-loading .lbj-status::before {
    content: '';
    display: block;
    width: 34px;
    height: 34px;
    margin: 0 auto 14px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lbj-spin 0.8s linear infinite;
}

.lbj-overlay.lbj-loading .lbj-image,
.lbj-overlay.lbj-error .lbj-image {
    opacity: 0;
}

@keyframes lbj-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .lbj-overlay.lbj-loading .lbj-status::before {
        animation: none;
    }
}


/* Screen-reader announcements */
.lbj-announcement {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
