/* Cursor hint for clickable images */
.entry-content img:not(.no-lightbox):not(.avatar):not(.wp-smiley),
.wp-block-post-content img:not(.no-lightbox),
article .post-content img:not(.no-lightbox) {
    cursor: zoom-in;
}

/* Overlay */
.image-lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility 0s linear .3s;
    cursor: zoom-out;
}

.image-lightbox-overlay.is-active {
    opacity: 1;
    visibility: visible;
    transition: opacity .3s ease;
}

/* Image inside the overlay */
.image-lightbox-image {
    max-width: 95vw;
    max-height: 92vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, .5);
    transform: scale(.96);
    transition: transform .3s ease;
    cursor: default;
}

.image-lightbox-overlay.is-active .image-lightbox-image {
    transform: scale(1);
}

/* Close button */
.image-lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .1);
    color: #fff;
    border: 0;
    border-radius: 50%;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    transition: background .2s;
}

.image-lightbox-close:hover,
.image-lightbox-close:focus-visible {
    background: rgba(255, 255, 255, .25);
    outline: none;
}

/* Loading spinner */
.image-lightbox-overlay.is-loading .image-lightbox-image {
    opacity: 0;
}

.image-lightbox-overlay.is-loading::after {
    content: "";
    position: absolute;
    width: 42px;
    height: 42px;
    border: 3px solid rgba(255, 255, 255, .25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: image-lightbox-spin .8s linear infinite;
}

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

/* Blur the rest of the page — applied to direct body children
   so it works on any theme regardless of wrapper markup */
body.lightbox-open {
    overflow: hidden;
}

body.lightbox-open > *:not(.image-lightbox-overlay) {
    filter: blur(8px);
    transition: filter .3s ease;
    pointer-events: none;
    user-select: none;
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    .image-lightbox-overlay,
    .image-lightbox-image,
    body.lightbox-open > *:not(.image-lightbox-overlay) {
        transition: none !important;
    }
}
