/* ==========================================================
   Random Photo Sidebar — rps.css
   ========================================================== */

/* Grid */
.rps-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0;
    padding: 0;
}

.rps-item {
    display: block;
    width: calc(var(--rps-col-pct) - 4px);
    aspect-ratio: 1 / 1;
    overflow: hidden;
    flex-shrink: 0;
}

.rps-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease, opacity 0.2s ease;
}

.rps-item:hover img,
.rps-item:focus img {
    transform: scale(1.07);
    opacity: 0.88;
}

.rps-item:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.rps-empty {
    font-style: italic;
    color: #888;
    font-size: 0.9em;
}

/* ==========================================================
   Lightbox overlay
   ========================================================== */

.rps-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.88);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    box-sizing: border-box;
    cursor: zoom-out;
}

.rps-overlay[hidden] {
    display: none;
}

.rps-lightbox-img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 2px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
    cursor: default;
    display: block;
}

.rps-caption {
    color: #e8e8e8;
    font-size: 0.9rem;
    margin-top: 0.75rem;
    text-align: center;
    max-width: 60ch;
}

.rps-close {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    opacity: 0.75;
    transition: opacity 0.15s;
}

.rps-close:hover,
.rps-close:focus {
    opacity: 1;
    outline: 1px solid rgba(255,255,255,0.5);
}
