.ewi-lightbox-trigger { cursor: zoom-in; }

.ewi-lb-lock,
.ewi-lb-lock body { overflow: hidden !important; }

.ewi-lb {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000000;
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: #060b14;
    color: #e8edf5;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.ewi-lb.is-open { display: flex; }

.ewi-lb__bar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    padding: 0 8px 0 16px;
    padding-top: env(safe-area-inset-top);
}

.ewi-lb__count {
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
    color: #a3afc2;
}

.ewi-lb__close {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    font-size: 1.375rem;
    line-height: 1;
    cursor: pointer;
}

.ewi-lb__close:hover,
.ewi-lb__close:focus-visible { background: rgba(255, 255, 255, 0.12); }

.ewi-lb__stage {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0 72px;
    touch-action: none;
}

.ewi-lb__img {
    display: block;
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
    object-fit: contain;
    transform-origin: center center;
    will-change: transform;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    cursor: zoom-in;
}

.ewi-lb.is-zoomed .ewi-lb__img { cursor: grab; }
.ewi-lb.is-dragging .ewi-lb__img { cursor: grabbing; }

.ewi-lb__nav {
    position: absolute;
    top: 50%;
    width: 48px;
    height: 48px;
    margin-top: -24px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
}

.ewi-lb__nav:hover,
.ewi-lb__nav:focus-visible { background: rgba(255, 255, 255, 0.22); }
.ewi-lb__nav--prev { left: 12px; }
.ewi-lb__nav--next { right: 12px; }
.ewi-lb__nav[hidden],
.ewi-lb.is-zoomed .ewi-lb__nav { display: none; }

.ewi-lb__spin {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 28px;
    height: 28px;
    margin: -14px 0 0 -14px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    animation: ewi-lb-spin 0.8s linear infinite;
    transition: opacity 0.2s;
}

.ewi-lb.is-loading .ewi-lb__spin { opacity: 1; transition-delay: 0.25s; }

@keyframes ewi-lb-spin { to { transform: rotate(360deg); } }

.ewi-lb__meta {
    flex: 0 0 auto;
    max-width: 860px;
    margin: 0 auto;
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    text-align: center;
}

.ewi-lb__meta[hidden] { display: none; }

.ewi-lb__caption {
    margin: 0 0 4px !important;
    font-size: 0.9375rem;
    line-height: 1.5;
    font-weight: 500;
    color: #e8edf5 !important;
}

.ewi-lb__time {
    margin: 0 !important;
    font-size: 0.8125rem;
    color: #8e9bb0 !important;
}

.ewi-lb__caption:empty,
.ewi-lb__time:empty { display: none; }

.ewi-lb.is-zoomed .ewi-lb__meta { display: none; }

@media (max-width: 700px) {
    .ewi-lb__stage { padding: 0; }
    .ewi-lb__nav { width: 40px; height: 40px; margin-top: -20px; font-size: 1.5rem; background: rgba(0, 0, 0, 0.45); }
    .ewi-lb__nav--prev { left: 6px; }
    .ewi-lb__nav--next { right: 6px; }
    .ewi-lb__caption { font-size: 0.875rem; }
}
