/* Serene Wellness — Image Lightbox
   Vanilla, brand-matched, accessibility-aware.
   Scope: eligible <img> inside .entry-content / .post-content / .sw-article-body */

.sw-lightbox-trigger {
    cursor: zoom-in;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.sw-lightbox-trigger:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.sw-lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(30, 25, 20, 0.88);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.sw-lightbox-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.sw-lightbox-media {
    max-width: min(96vw, 1600px);
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.96);
    transition: transform 0.25s ease;
}
.sw-lightbox-overlay.is-open .sw-lightbox-media {
    transform: scale(1);
}

.sw-lightbox-close {
    position: absolute;
    top: 18px;
    right: 22px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}
.sw-lightbox-close:hover,
.sw-lightbox-close:focus-visible {
    background: rgba(255, 255, 255, 0.28);
    transform: scale(1.05);
    outline: none;
}

.sw-lightbox-caption {
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    max-width: min(90vw, 620px);
    padding: 8px 16px;
    color: #f4ede0;
    font-size: 14px;
    font-style: italic;
    text-align: center;
    background: rgba(0, 0, 0, 0.38);
    border-radius: 8px;
    line-height: 1.5;
}
.sw-lightbox-caption[hidden] {
    display: none;
}

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

@media (max-width: 640px) {
    .sw-lightbox-overlay { padding: 12px; }
    .sw-lightbox-close { top: 10px; right: 10px; width: 40px; height: 40px; font-size: 24px; }
    .sw-lightbox-caption { bottom: 10px; font-size: 13px; padding: 6px 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .sw-lightbox-trigger,
    .sw-lightbox-overlay,
    .sw-lightbox-media,
    .sw-lightbox-close {
        transition: none !important;
    }
    .sw-lightbox-trigger:hover { transform: none; }
}
