/* reader.css - Optimized for Law Reading */
.reader-layout {
    display: flex;
    height: calc(100vh - 70px);
    background: var(--bg-color, #ffffff);
    overflow: hidden;
}

body.menu-open .reader-layout {
    overflow: hidden;
}

.reader-sidebar {
    width: 250px;
    flex-shrink: 0;
    border-right: 1px solid var(--border-color, #e2e8f0);
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    overflow-y: auto;
    font-family: 'Inter', sans-serif;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    position: sticky;
    top: 0;
    background: #f8fafc;
    z-index: 10;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-primary, #1e293b);
}

.sidebar-content {
    padding: 10px 0;
}

.nav-bookmark {
    display: block;
    padding: 8px 20px;
    color: var(--text-secondary, #64748b);
    text-decoration: none;
    font-size: 0.95rem;
    transition: background 0.2s, color 0.2s;
    cursor: pointer;
}

.nav-bookmark:hover {
    background: #e2e8f0;
    color: #4f46e5;
}

.nav-bookmark.active {
    background: #e0e7ff;
    color: #4f46e5;
    font-weight: 600;
    border-left: 3px solid #4f46e5;
}

.reader-main {
    flex-grow: 1;
    overflow-y: auto;
    scroll-behavior: smooth;
    position: relative;
    contain: strict;
    /* UI Optimization */
}

.reader-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px;
    font-family: 'Merriweather', serif;
    /* Serif typography for better long-form reading */
    line-height: 1.6;
    color: var(--text-primary, #1e293b);
    font-size: 1.05rem;
}

.reader-block {
    margin-bottom: 2rem;
}

.reader-paragraph {
    margin-bottom: 3rem;
}

.reader-paragraph h4 {
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 8px;
    color: #4f46e5;
    font-weight: 600;
}

.reader-paragraph h5 {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    margin-top: 0;
    margin-bottom: 12px;
    color: var(--text-secondary, #64748b);
    font-weight: 500;
}

.reader-paragraph p {
    margin-bottom: 1rem;
    text-align: justify;
    hyphens: auto;
}

.reader-paragraph p.legal-list-num {
    padding-left: 3.5rem;
    position: relative;
    margin-bottom: 0.5rem;
    margin-top: 0.5rem;
}

.reader-paragraph p.legal-list-letter {
    padding-left: 5.5rem;
    position: relative;
    margin-bottom: 0.5rem;
    margin-top: 0.5rem;
}

.list-num {
    position: absolute;
    left: 1.5rem;
    width: 2rem;
    font-weight: 500;
}

.list-letter {
    position: absolute;
    left: 3.5rem;
    width: 2rem;
    font-weight: 500;
}

.reader-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50vh;
    font-family: 'Inter', sans-serif;
    color: var(--text-secondary, #64748b);
    font-size: 1.2rem;
}

.mobile-sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #4f46e5;
    color: white;
    border: none;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 50;
    cursor: pointer;
}

/* Mobile Layout */
@media (max-width: 768px) {
    .mobile-sidebar-toggle {
        display: flex;
    }

    .reader-sidebar {
        position: fixed;
        left: 0;
        top: 70px;
        bottom: 0;
        transform: translateX(-100%);
        z-index: 40;
        box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
    }

    .reader-sidebar.open {
        transform: translateX(0);
    }

    .reader-container {
        padding: 20px;
    }
}