/* ОБЩИЙ LAYOUT */
.reader-layout {
    display: flex;
    min-height: 100vh;
}

/* ===== БОКОВАЯ ПАНЕЛЬ ===== */
.sidebar {
    width: 280px;
    flex-shrink: 0;
    background: rgba(29, 61, 102, 0.25);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    flex-direction: column;
    padding: 24px 0 32px;
    overflow-y: auto;
    position: sticky;
    top: 0;
    height: 100vh;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

.sidebar-logo {
    padding: 0 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    margin-bottom: 16px;
}

.sidebar-logo img {
    width: 80px;
    height: auto;
}

.sidebar-back {
    display: block;
    margin: 0 12px 16px;
    padding: 9px 14px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.45);
    border-radius: 10px;
    text-decoration: none;
    font-size: 12px;
    font-weight: bold;
    color: #1d3d66;
    transition: background 0.2s;
}

.sidebar-back:hover {
    background: rgba(255,255,255,0.35);
}

.sidebar-nav {
    padding: 0 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-section {
    margin-bottom: 8px;
}

.nav-section-title {
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(29, 61, 102, 0.5);
    padding: 10px 10px 6px;
}

.nav-item {
    display: block;
    padding: 8px 10px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 12px;
    color: #1d3d66;
    line-height: 1.4;
    transition: background 0.2s;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(255,255,255,0.25);
}

.nav-item.active {
    background: rgba(255,255,255,0.35);
    border-left-color: #E06E37;
    font-weight: bold;
    padding-left: 8px;
}

.test-nav {
    color: #E06E37 !important;
    font-weight: bold;
}

.test-nav:hover {
    background: rgba(224,110,55,0.12) !important;
}

/* ===== КНОПКА ТОГГЛ (мобайл) ===== */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 200;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255,255,255,0.45);
    border: 1.5px solid rgba(255,255,255,0.8);
    font-size: 18px;
    color: #1d3d66;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background 0.2s;
}

.sidebar-toggle:hover {
    background: rgba(255,255,255,0.65);
}

/* ===== ОСНОВНОЙ КОНТЕНТ ===== */
.reader-main {
    flex: 1;
    overflow-y: auto;
    padding: 32px 32px 64px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.reader-content {
    width: 100%;
    max-width: 1200px;
    background: #ffffff;
    border-radius: 24px;
    padding: 48px 56px;
    box-shadow: 0 4px 32px rgba(29, 61, 102, 0.1);
}

.chapter-tag {
    display: inline-block;
    background: rgba(224,110,55,0.15);
    border: 1px solid rgba(224,110,55,0.35);
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.1em;
    color: #E06E37;
    margin-bottom: 14px;
}

.reader-title {
    font-size: clamp(1.4em, 3vw, 2.2em);
    font-weight: bold;
    color: #1d3d66;
    line-height: 1.3;
    margin: 0 0 16px;
}

.title-divider {
    width: 48px;
    height: 4px;
    background: linear-gradient(90deg, #E06E37, #1d3d66);
    border-radius: 2px;
    margin-bottom: 28px;
}

/* ТЕКСТ */
.reader-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.reader-body p {
    font-size: 15px;
    color: #2c3e50;
    line-height: 1.9;
    margin: 0;
}

.reader-body strong {
    color: #1d3d66;
    font-weight: bold;
}

.reader-body ul, .reader-body ol {
    padding-left: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reader-body li {
    font-size: 15px;
    color: #2c3e50;
    line-height: 1.8;
}

/* ФУТЕР НАВИГАЦИИ */
.reader-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid rgba(29,61,102,0.15);
    gap: 12px;
}

.nav-footer-btn {
    display: inline-block;
    padding: 10px 22px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 13px;
    font-weight: bold;
    color: #1d3d66;
    background: rgba(255,255,255,0.35);
    border: 1.5px solid rgba(255,255,255,0.7);
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-footer-btn:hover {
    background: rgba(255,255,255,0.55);
    transform: translateY(-2px);
}

.nav-footer-btn.primary {
    background: rgba(29,61,102,0.2);
    border-color: rgba(29,61,102,0.35);
    color: #1d3d66;
}

.nav-footer-btn.primary:hover {
    background: rgba(29,61,102,0.32);
}



/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 900px) {
    .sidebar {
        width: 240px;
    }
    .reader-main {
        padding: 28px 20px 48px;
    }
    .reader-content {
        padding: 36px 36px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 150;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 280px;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .reader-main {
        padding: 72px 12px 48px;
    }
    .reader-content {
        padding: 28px 20px;
        border-radius: 16px;
    }
    .reader-footer {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    .nav-footer-btn {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .reader-title {
        font-size: 1.4em;
    }
    .reader-body p {
        font-size: 14px;
    }
}