/* LIGHTBOX — Modern redesign */

.lightbox-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(8, 12, 24, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 250;
    animation: lbFadeIn 0.2s ease;
    outline: none;
    cursor: zoom-out;
}

@keyframes lbFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Image wrapper — stops backdrop click from closing when clicking the image */
.lightbox-inner {
    max-width: calc(100vw - 180px);
    max-height: calc(100vh - 140px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
}

.lightbox-image {
    max-width: 100%;
    max-height: calc(100vh - 140px);
    width: auto;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.65);
    display: block;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

/* ── Close button ─────────────────────────────────────────────────────────── */

.lightbox-close {
    position: fixed;
    top: 18px;
    right: 20px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: #f9fafb;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.2s ease;
    z-index: 252;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.45);
    transform: rotate(90deg);
}

/* ── Arrow buttons ────────────────────────────────────────────────────────── */

.lightbox-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: #f9fafb;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.18s ease;
    z-index: 252;
}

.lightbox-arrow-left  { left: 18px; }
.lightbox-arrow-right { right: 18px; }

.lightbox-arrow:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.45);
}

.lightbox-arrow-left:hover  { transform: translateY(-50%) translateX(-2px); }
.lightbox-arrow-right:hover { transform: translateY(-50%) translateX(2px);  }

/* ── Image counter ────────────────────────────────────────────────────────── */

.lightbox-counter {
    position: fixed;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    padding: 0.28rem 0.85rem;
    color: rgba(249, 250, 251, 0.88);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    z-index: 252;
    white-space: nowrap;
    pointer-events: none;
}

/* ── Caption ──────────────────────────────────────────────────────────────── */

.lightbox-caption {
    position: fixed;
    bottom: 64px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(249, 250, 251, 0.55);
    font-size: 0.8rem;
    text-align: center;
    max-width: 70vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 252;
    pointer-events: none;
    margin: 0;
}

/* ── Mobile ───────────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
    .lightbox-inner {
        max-width: calc(100vw - 20px);
        max-height: calc(100vh - 120px);
    }

    .lightbox-image {
        max-height: calc(100vh - 120px);
        border-radius: 8px;
    }

    .lightbox-arrow {
        width: 38px;
        height: 38px;
    }

    .lightbox-arrow-left  { left:  8px; }
    .lightbox-arrow-right { right: 8px; }

    .lightbox-close {
        top: 12px;
        right: 12px;
        width: 38px;
        height: 38px;
    }

    .lightbox-counter { bottom: 14px; }
    .lightbox-caption { bottom: 54px; max-width: 92vw; }
}
