/* Lightbox (Full Screen Overlay) */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    margin: 0;
    padding: 0;
    /* Use flex to center small images, but allow scrolling */
    display: flex;
    flex-direction: column;
    /* justify-content: center;  <-- REMOVED to allow scrolling without clipping top */
    align-items: center;
    overflow-y: auto;
    /* Enable vertical scrolling */
    -webkit-overflow-scrolling: touch;

    /* Animation & Visibility */
    opacity: 0;
    visibility: hidden;
    /* IMPORTANT: Hides element so it doesn't block clicks */
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
    /* Extra safety */
}

.lightbox.active {
    display: flex;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.lightbox-content {
    max-width: 100%;
    /* max-height: 100%; <-- REMOVED to allow long infographics to Expand */
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    margin: auto;
    /* Centers the image vertically/horizontally if smaller than screen */
    padding: 20px 0 80px 0;
    /* Add padding at bottom so content isn't covered by button */
}

/* Close Button (Bottom Center) */
.lightbox-close-btn {
    position: fixed;
    bottom: 15px !important;
    top: auto !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    right: auto !important;

    /* Reduced Size (Further reduced by ~20%) */
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    font-size: 18px;
    /* Adjusted prompt font size */
    border-radius: 50%;
    cursor: pointer;
    z-index: 10001;
    backdrop-filter: blur(5px);
    /* Flex Center for Perfect X alignment */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    /* padding-bottom removed for better centering */
}

.lightbox-close-btn:active {
    background: rgba(255, 255, 255, 0.4);
}