/* === Global Styles & Variables === */
:root {
    --primary-color: #005f73; /* Darker Cyan/Blue for a more academic feel */
    --secondary-color: #0a9396; /* Teal */
    --accent-color: #94d2bd; /* Pale Cyan/Green */
    --background-color: #fdfdfd; /* Very Light Gray / Off-white */
    --surface-color: #ffffff; /* White */
    --text-color: #212529; /* Dark Gray for text */
    --text-muted-color: #6c757d; /* Muted Gray */
    --border-color: #e0e0e0; /* Lighter Gray Border */
    --hover-color: #003f5c; /* Darker shade of primary */
    --code-bg-color: #282c34;
    --code-text-color: #abb2bf;
    --font-family-serif: 'Georgia', 'Times New Roman', serif; /* For main text, better readability for long docs */
    --font-family-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; /* For UI elements */
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --border-radius: 6px;
}

body {
    font-family: var(--font-family-serif); /* Serif for content readability */
    margin: 0;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.7; /* Increased line height for better readability of dense text */
}

.page-container {
    display: flex;
    min-height: 100vh;
}

/* === Sidebar Navigation === */
.sidebar {
    width: 400px; /* Slightly wider for potentially longer TOC items */
    background-color: #f8f9fa; /* Light background for sidebar */
    padding: 25px;
    border-right: 1px solid var(--border-color);
    box-shadow: 2px 0 5px rgba(0,0,0,0.03);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    font-family: var(--font-family-sans-serif); /* Sans-serif for UI */
}

.sidebar h2 { /* TOC Title */
    color: var(--primary-color);
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.6em;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}

.sidebar ul {
    list-style-type: none;
    padding-left: 0;
    margin-bottom: 20px;
}

.sidebar ul ul { /* Nested lists for sub-sections */
    padding-left: 20px; /* Indent sub-items */
    margin-top: 5px;
    margin-bottom: 10px;
}

.sidebar li a {
    text-decoration: none;
    color: var(--text-color);
    display: block;
    padding: 8px 12px; /* Adjust padding for density */
    border-radius: var(--border-radius);
    transition: background-color 0.2s ease, color 0.2s ease;
    font-weight: 500;
    font-size: 0.95em;
}
.sidebar ul ul li a {
    font-size: 0.9em; /* Smaller font for sub-items */
    font-weight: normal;
    padding-left: 15px; /* Further indent sub-item text if not handled by ul padding */
}


.sidebar li a:hover,
.sidebar li a.active { /* Active link in TOC */
    background-color: var(--secondary-color);
    color: var(--surface-color);
}
.sidebar ul ul li a.active {
     background-color: var(--accent-color);
     color: var(--primary-color);
}


.sidebar .back-to-main-site-link {
    display: block;
    padding: 10px 15px;
    margin-top: 20px;
    background-color: var(--text-muted-color);
    color: var(--surface-color);
    text-decoration: none;
    border-radius: var(--border-radius);
    text-align: center;
    transition: background-color 0.2s ease;
}

.sidebar .back-to-main-site-link:hover {
    background-color: #5a6268;
}

/* === Main Content Area === */
.content-area {
    flex-grow: 1;
    padding: 30px 50px; /* Increased padding for better text flow */
    max-width: calc(100% - 400px); /* Adjust if sidebar width changes */
    overflow-y: auto;
}

.document-header {
    text-align: left; /* Align header to left for document feel */
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.document-header h1 {
    font-size: 2.6em; /* Larger title */
    color: var(--primary-color);
    margin-bottom: 8px;
    font-family: var(--font-family-sans-serif); /* Sans-serif for main title */
}

.document-header .subtitle {
    font-size: 1.3em;
    color: var(--text-muted-color);
    font-family: var(--font-family-sans-serif);
    margin-bottom: 10px;
}

.back-to-top-button {
    display: inline-block;
    padding: 8px 15px;
    background-color: var(--secondary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-family: var(--font-family-sans-serif);
    transition: background-color 0.2s ease;
}
.back-to-top-button:hover {
    background-color: var(--primary-color);
}


/* === Content Styling (Article, Sections) === */
.content-article {
    background-color: var(--surface-color);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 30px;
}

.content-article section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px dashed var(--border-color);
}
.content-article section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.content-article h2 { /* Section titles */
    font-size: 2em;
    color: var(--primary-color);
    margin-top: 10px; /* More space before a new major section */
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--accent-color);
    font-family: var(--font-family-sans-serif);
}

.content-article h3 { /* Sub-section titles */
    font-size: 1.6em;
    color: var(--secondary-color);
    margin-top: 20px;
    margin-bottom: 12px;
    font-family: var(--font-family-sans-serif);
}

.content-article h4 {
    font-size: 1.3em;
    color: var(--text-color);
    margin-top: 18px;
    margin-bottom: 10px;
    font-family: var(--font-family-sans-serif);
}

.content-article p {
    margin-bottom: 1em;
    font-size: 1.05em; /* Slightly larger paragraph text */
}

.content-article ul, .content-article ol {
    margin-bottom: 1em;
    padding-left: 30px; /* Standard indent for lists */
}
.content-article ul li, .content-article ol li {
    margin-bottom: 0.5em;
}

.content-article strong, .content-article b { /* For emphasized text like in original doc */
    font-weight: 600; /* Bolder than default if serif is used */
    color: #000;
}
.content-article .c10 { /* example of targeting a common class from the original doc for emphasis */
    font-weight: bold;
}


/* Table Styling */
.content-article table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.95em;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.content-article th, .content-article td {
    border: 1px solid var(--border-color);
    padding: 10px 12px; /* Adjust padding */
    text-align: left;
    vertical-align: top;
}

.content-article th {
    background-color: #f8f9fa; /* Light header for tables */
    font-weight: 600; /* Bolder headers */
    color: var(--primary-color);
    font-family: var(--font-family-sans-serif);
}
.content-article tr:nth-child(even) {
    background-color: #fcfdff; /* Subtle striping for rows */
}
.content-article tr:hover {
    background-color: #f1f3f5; /* Hover effect for rows */
}


/* === Footer === */
.document-footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
    font-size: 0.9em;
    color: var(--text-muted-color);
    font-family: var(--font-family-sans-serif);
}

/* === Responsive Design === */
@media (max-width: 992px) {
    .page-container {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: static; /* No longer sticky */
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
        max-height: 300px; /* Limit height for scrollable TOC on mobile */
    }
    .content-area {
        max-width: 100%;
        padding: 20px;
    }
    .document-header h1 {
        font-size: 2.2em;
    }
    .content-article h2 {
        font-size: 1.8em;
    }
    .content-article h3 {
        font-size: 1.5em;
    }
}

@media (max-width: 600px) {
    body {
        font-size: 15px;
    }
    .content-area {
        padding: 15px;
    }
    .document-header h1 {
        font-size: 1.9em;
    }
    .content-article h2 {
        font-size: 1.6em;
    }
     .content-article h3 {
        font-size: 1.4em;
    }
    .content-article table {
        font-size: 0.85em; /* Smaller table text on mobile */
    }
    .content-article th, .content-article td {
        padding: 8px;
    }
}