/* RRS Content & Media – Lightbox styles */

body.rrscm-lb-noscroll { overflow: hidden; }

#rrscm-lb {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}

#rrscm-lb.is-open {
    opacity: 1;
    pointer-events: auto;
}

/* Backdrop */
.rrscm-lb-bd {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Wrap z obrazem */
.rrscm-lb-wrap {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: calc(100vw - 120px);
    max-height: calc(100vh - 80px);
}

.rrscm-lb-img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 140px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
    transition: opacity 0.18s ease;
}

/* Spinner ładowania */
.rrscm-lb-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: #fff;
    border-radius: 50%;
    animation: rrscm-spin 0.7s linear infinite;
    display: none;
}

@keyframes rrscm-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Footer (caption + licznik) */
.rrscm-lb-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    margin-top: 10px;
    padding: 0 4px;
    min-height: 20px;
}

.rrscm-lb-cap {
    margin: 0;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.4;
    text-align: left;
}

.rrscm-lb-count {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Przyciski */
#rrscm-lb button {
    position: absolute;
    z-index: 2;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, transform 0.15s ease;
    line-height: 1;
}

#rrscm-lb button:hover {
    background: rgba(255, 255, 255, 0.18);
}

#rrscm-lb button svg {
    display: block;
    pointer-events: none;
}

.rrscm-lb-close {
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    padding: 0;
}

.rrscm-lb-close svg { width: 18px; height: 18px; }

.rrscm-lb-prev,
.rrscm-lb-next {
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    padding: 0;
}

.rrscm-lb-prev svg,
.rrscm-lb-next svg { width: 24px; height: 24px; }

.rrscm-lb-prev { left: 16px; }
.rrscm-lb-next { right: 16px; }

.rrscm-lb-prev:hover { transform: translateY(-50%) translateX(-2px); }
.rrscm-lb-next:hover { transform: translateY(-50%) translateX(2px); }

/* Mobile */
@media (max-width: 600px) {
    .rrscm-lb-wrap {
        max-width: calc(100vw - 24px);
        max-height: calc(100vh - 120px);
    }

    .rrscm-lb-img {
        max-height: calc(100vh - 180px);
        border-radius: 4px;
    }

    .rrscm-lb-prev { left: 8px; }
    .rrscm-lb-next { right: 8px; }

    .rrscm-lb-prev,
    .rrscm-lb-next {
        width: 40px;
        height: 40px;
    }
}
