/* Storylinn Lightbox (v1.4)
   Locked UI Layer + Scrolling Glass Content
*/

#lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2000;
    display: none; /* Controlled by JS */
    opacity: 0;
    transition: opacity 0.5s ease;
    
    /* The Glass Foundation */
    background-color: var(--glass);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
}

/* 1. The Scrolling Layer */
#reader-viewport {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 120px 0; /* Space for the top/bottom */
}

#reader-track {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 40px;
}

/* 2. The Fixed UI Layer (The Anchor) */
#reader-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Clicks pass through to the scroll layer */
    z-index: 2100;
}

#back-btn {
    position: fixed; /* Double-locked to the screen */
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: auto; /* Re-enable clicks for the button */
    
    background: var(--text);
    color: var(--bg);
    border: none;
    padding: 14px 40px;
    font-family: sans-serif;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: transform 0.2s ease;
}

#back-btn:hover {
    transform: translateX(-50%) scale(1.05);
}

/* Typography & Content Layout */
.reader-image {
    width: 100%;
    max-height: 50vh;
    object-fit: cover;
    margin-bottom: 40px;
    border-radius: 8px;
}

#reader-track h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    line-height: 1.1;
    margin-bottom: 20px;
    color: var(--text);
}

.reader-text {
    font-family: 'Lora', serif;
    font-size: 21px;
    line-height: 1.8;
    color: var(--text);
}

.reader-text p {
    margin-bottom: 1.5em;
}

/* Hide navigation zones */
.nav-zone {
    display: none;
}

/* Scrollbar Styling for a premium feel */
#reader-viewport::-webkit-scrollbar {
    width: 6px;
}
#reader-viewport::-webkit-scrollbar-track {
    background: transparent;
}
#reader-viewport::-webkit-scrollbar-thumb {
    background: rgba(var(--text-rgb), 0.2);
    border-radius: 10px;
}