/*
 * WebCMS content image preview (lightbox) — theme-agnostic styles.
 *
 * This stylesheet is only linked when the operator enabled
 * "content image preview" (SettingContentImagePreview), so every rule here
 * may assume the feature is on. Class names are prefixed to stay clear of
 * the themes' own .aurora-* / .zhuoone-* namespaces and of the removed
 * per-theme lightbox implementation.
 */

/* The script adds this class only while an image is a working preview target,
   keeping the pointer affordance aligned with click and keyboard behaviour. */
.richtext img.webcms-lightbox-trigger {
    cursor: zoom-in;
}

.webcms-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2050;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(15, 23, 42, .92);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.webcms-lightbox.is-open {
    display: flex;
}

.webcms-lightbox-image {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    border-radius: .5rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
    cursor: zoom-out;
}

.webcms-lightbox-close {
    position: absolute;
    top: .75rem;
    right: .75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .14);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.webcms-lightbox-close:hover {
    background: rgba(255, 255, 255, .28);
}

.webcms-lightbox-close:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.webcms-lightbox-caption {
    position: absolute;
    right: 1.5rem;
    bottom: 1rem;
    left: 1.5rem;
    margin: 0 auto;
    max-width: 60rem;
    color: #e2e8f0;
    font-size: .875rem;
    text-align: center;
}

.webcms-lightbox-caption:empty {
    display: none;
}

html.webcms-lightbox-open {
    overflow: hidden;
}

@media (prefers-reduced-motion: no-preference) {
    .webcms-lightbox.is-open .webcms-lightbox-image {
        animation: webcms-lightbox-in .18s ease-out;
    }

    @keyframes webcms-lightbox-in {
        from {
            opacity: 0;
            transform: scale(.96);
        }

        to {
            opacity: 1;
            transform: none;
        }
    }
}
