body {
    background-color: #141414;
    color: #ffffff;
    font-family: 'Lexend', sans-serif;
    font-size: 14px;
    margin: 0;
    padding: 20px;
    height: calc(100vh - 40px);
    box-sizing: border-box;
}

.container {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 25px;
    height: 100%;
}

/* Sidebar styling */
.sidebar {
    padding: 10px 0;
    overflow-y: auto;
}

/* Aligns the sizes of the main column headers and matching sidebar text precisely */
.page-header {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    line-height: 1.2;
    cursor: pointer;
}

/* Horizontal lines align cleanly under headers */
hr.divider {
    border: 0;
    border-top: 1px solid #ffffff;
    margin: 15px 0;
    width: 100%;
    box-sizing: border-box;
}

/* Navigation lists stay all white */
.tree-root {
    line-height: 2.0;
}

.nav-item, .nav-sub-item, .nav-item-header {
    cursor: pointer;
    color: #ffffff;
    text-decoration: none;
}

.nav-item:hover, .nav-sub-item:hover, .nav-item-header:hover {
    text-decoration: underline;
}

.nav-item-header {
    font-weight: 700;
}

.nav-sub-item {
    padding-left: 15px;
}

/* Main Dynamic Window Panel */
.console-panel {
    border: none;
    background-color: transparent;
    padding: 10px 0;
    overflow-y: auto;
}

h3 {
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    margin: 25px 0 10px 0;
}

p, li, span, div {
    color: #ffffff;
    line-height: 1.6;
    font-size: 15px;
}

/* Main Home Feed Links */
.work-link, .chapter-link {
    color: #ffffff;
    cursor: pointer;
    text-decoration: underline;
}

.work-link:hover, .chapter-link:hover {
    font-weight: bold;
}

/* Content Layout Area Utilities */
.display-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-btn {
    background: transparent;
    color: #ffffff;
    border: none;
    font-family: inherit;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    padding: 5px;
}

.close-btn:hover {
    opacity: 0.7;
}

/* The Book Chapter/Excerpt formatting styles */
.book-excerpt {
    border-left: 2px solid #ffffff;  /* Keeps the clean accent vertical line */
    padding-left: 15px;
    margin: 20px 40px;               /* 20px top/bottom space, 40px left/right indentation */
    font-style: italic;
    opacity: 0.8;
}

.commentary {
    margin-bottom: 30px;
}

/* For Chrome, Safari, and Edge */
::-webkit-scrollbar {
    width: 2px; /* Super thin layout line */
}

::-webkit-scrollbar-track {
    background: transparent; /* Makes the scrollbar background invisible */
}

::-webkit-scrollbar-thumb {
    background: #ffffff; /* Smooth solid white handle to match your line dividers */
}

/* For Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #ffffff transparent;
}

/* Mobile Optimization Styles */
@media (max-width: 768px) {
    /* Changes the layout from side-by-side columns to a single vertical column */
    .container {
        grid-template-columns: 1fr; 
        gap: 10px;
        height: auto; /* Allows the page to expand vertically naturally */
    }

    body {
        height: auto;
        padding: 15px;
    }

    /* Adds a little breathing room beneath the sidebar on mobile views */
    .sidebar {
        padding: 0;
        overflow-y: visible; /* Prevents nested scrolling panels on mobile */
    }

    .console-panel {
        padding: 0;
        overflow-y: visible;
    }
    
    /* Slightly increase line-height for navigation links so they are easy to tap with fingers */
    .tree-root {
        line-height: 2.5;
    }
    
    /* Pulls indented excerpts out slightly on smaller phone screens */
    .book-excerpt {
        margin: 20px 15px; 
    }
}