/* RUP Book Custom Theme */

/* Bilingual annotation styling */
.content main {
    max-width: 900px;
    margin: 0 auto;
}

/* Chinese annotations in parentheses */
.content p, .content li {
    line-height: 1.8;
}

/* Table styling */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}

table th, table td {
    border: 1px solid #ddd;
    padding: 8px 12px;
    text-align: left;
}

table th {
    background-color: #f5f5f5;
    font-weight: 600;
}

/* Image sizing */
img {
    max-width: 100%;
    height: auto;
}

/* Blockquote styling for notes */
blockquote {
    border-left: 4px solid #4a90d9;
    padding: 0.5em 1em;
    margin: 1em 0;
    background: #f8f9fa;
}

/* ============================================
   TreeView Sidebar Enhancements
   ============================================ */

/* Sidebar section headers */
.sidebar .chapter li.part-title {
    font-weight: 700;
    font-size: 0.9em;
    color: #2c3e50;
    letter-spacing: 0.02em;
    margin-top: 12px;
    padding: 4px 0;
    border-bottom: 1px solid #e0e0e0;
}

/* Better nesting indentation */
.sidebar .chapter ol.section {
    padding-left: 16px;
}

/* Current active item highlight */
.sidebar .chapter li.chapter-item .active {
    background: linear-gradient(90deg, #4a90d9 3px, #eef4fb 3px);
    border-radius: 0 4px 4px 0;
    padding-left: 10px;
    font-weight: 600;
}

/* Hover effect on sidebar items */
.sidebar .chapter li a:hover {
    background: #f0f4f8;
    border-radius: 3px;
    transition: background 0.15s ease;
}

/* Collapsed sections visual cue */
.sidebar .chapter li.expanded > a::before {
    content: "";
    display: inline-block;
    width: 0;
    height: 0;
    margin-right: 5px;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 5px solid #888;
    transition: transform 0.2s ease;
    transform: rotate(90deg);
}

/* Discipline section styling - visual grouping */
.sidebar .chapter > ol > li > ol > li > ol {
    border-left: 2px solid #e8e8e8;
    margin-left: 4px;
    padding-left: 12px;
}

/* Compact sidebar for deep nesting */
.sidebar .chapter li a {
    padding: 3px 8px;
    font-size: 0.88em;
    line-height: 1.5;
}

/* Sidebar scrollbar styling */
.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Dark theme sidebar adjustments */
.coal .sidebar .chapter li.part-title,
.navy .sidebar .chapter li.part-title {
    color: #ccc;
    border-bottom-color: #444;
}

.coal .sidebar .chapter li a:hover,
.navy .sidebar .chapter li a:hover {
    background: #333;
}

.coal .sidebar .chapter li.chapter-item .active,
.navy .sidebar .chapter li.chapter-item .active {
    background: linear-gradient(90deg, #5ba0e0 3px, #2a2e33 3px);
}

.coal .sidebar .chapter > ol > li > ol > li > ol,
.navy .sidebar .chapter > ol > li > ol > li > ol {
    border-left-color: #444;
}
