/* Tidy Lightbox */

#tidy-lb-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, .92);
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

#tidy-lb-overlay.is-open {
    display: flex;
}

#tidy-lb-overlay.is-loading #tidy-lb-img { opacity: 0; }

/* Main image */
#tidy-lb-img {
    display: block;
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 2px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, .6);
    transition: opacity .2s ease;
    cursor: default;
}

/* Caption */
#tidy-lb-caption {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 60px;
    text-align: center;
    color: rgba(255, 255, 255, .85);
    font-size: 14px;
    line-height: 1.5;
    background: linear-gradient(transparent, rgba(0, 0, 0, .55));
    pointer-events: none;
}

/* Close button */
#tidy-lb-close {
    position: fixed;
    top: 14px;
    right: 18px;
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    opacity: .7;
    padding: 4px 8px;
    transition: opacity .15s;
    z-index: 1;
}
#tidy-lb-close:hover { opacity: 1; }

/* Prev / Next arrows */
#tidy-lb-prev,
#tidy-lb-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, .12);
    border: none;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    padding: 16px 14px;
    cursor: pointer;
    border-radius: 3px;
    transition: background .15s;
    z-index: 1;
}
#tidy-lb-prev { left: 10px; }
#tidy-lb-next { right: 10px; }
#tidy-lb-prev:hover,
#tidy-lb-next:hover { background: rgba(255, 255, 255, .25); }

#tidy-lb-prev.is-hidden,
#tidy-lb-next.is-hidden { display: none; }

/* Spinner */
#tidy-lb-spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, .2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: tidy-spin .7s linear infinite;
    display: none;
}
#tidy-lb-overlay.is-loading #tidy-lb-spinner { display: block; }

@keyframes tidy-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}
