* {
    box-sizing: border-box;
}

body {
    font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.75;
    margin: 0;
    padding: 0;
    color: #374151;
    background-color: #ffffff;
    font-size: 16px;
    padding-top: 60px;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 200;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.header-left {
    display: flex;
    align-items: center;
}


.header h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    cursor: pointer;
}

.header h1:hover {
    color: #3b82f6;
}

.hamburger-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #374151;
    padding: 8px;
    display: block;
}

.nav-menu {
    position: fixed;
    top: 60px;
    right: 0;
    width: 320px;
    height: calc(100vh - 60px);
    background: white;
    border-left: 1px solid #e5e7eb;
    padding: 24px;
    overflow-y: auto;
    z-index: 160;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.nav-menu.open {
    transform: translateX(0);
}

.nav-overlay {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
    display: none;
}

.nav-overlay.open {
    display: block;
}

.nav-group {
    margin-bottom: 24px;
}

.nav-group h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.nav-group a {
    display: block;
    padding: 10px 0;
    color: #374151;
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
    cursor: pointer;
}

.nav-group a:hover {
    color: #1d4ed8;
}

.nav-group a.active {
    color: #1d4ed8;
    font-weight: 500;
}

/* Layout container */
.layout {
    display: flex;
    min-height: calc(100vh - 60px);
}

/* TOC Sidebar */
.toc-sidebar {
    position: fixed;
    left: 0;
    top: 60px;
    width: 280px;
    height: calc(100vh - 60px);
    background-color: #f9fafb;
    border-right: 1px solid #e5e7eb;
    padding: 24px 16px;
    overflow-y: auto;
    z-index: 100;
}

.toc-sidebar h3 {
    margin: 0 0 16px 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toc-sidebar .toc-controls {
    display: flex;
    gap: 4px;
}

.toc-sidebar .toc-control-btn {
    background: none;
    border: none;
    font-size: 0.75rem;
    color: #6b7280;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 2px;
}

.toc-sidebar .toc-control-btn:hover {
    color: #374151;
    background-color: #f3f4f6;
}

.toc-sidebar ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.toc-sidebar .toc-item {
    margin: 0;
    padding: 0;
}

.toc-sidebar .toc-link {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    color: #6b7280;
    text-decoration: none;
    font-size: 0.875rem;
    border-radius: 4px;
    cursor: pointer;
}

.toc-sidebar .toc-link:hover {
    background-color: #e5e7eb;
    color: #374151;
}

.toc-sidebar .toc-link.active {
    background-color: #dbeafe;
    color: #1d4ed8;
    font-weight: 500;
}

.toc-sidebar .toc-item-toggle {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #6b7280;
}

.toc-sidebar .toc-item-toggle:hover {
    color: #374151;
}

.toc-sidebar .toc-item-toggle.expanded {
    transform: rotate(90deg);
}

.toc-sidebar .toc-item-toggle.no-children {
    visibility: hidden;
}

.toc-sidebar .toc-children {
    padding-left: 22px;
    overflow: hidden;
}

.toc-sidebar .toc-children.collapsed {
    max-height: 0;
}

.toc-sidebar .toc-children.expanded {
    max-height: 1000px;
}

.toc-level-1 {
    font-weight: 600;
    font-size: 0.9rem;
}

.toc-level-2 {
    font-size: 0.875rem;
}

.toc-level-3 {
    font-size: 0.825rem;
    color: #6b7280;
}

.toc-level-4,
.toc-level-5,
.toc-level-6 {
    font-size: 0.8rem;
    color: #9ca3af;
}

/* Main content area */
.main-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 32px 48px;
    width: 100%;
}

/* Content wrapper */
.content-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

/* Content wrapper with TOC sidebar visible */
.layout.toc-visible .content-wrapper {
    margin-left: 280px;
}

/* Typography - Hugging Face style */
h1 {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 2rem 0;
    color: #111827;
}

h2 {
    font-size: 1.875rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 3rem 0 1.5rem 0;
    color: #111827;
    scroll-margin-top: 20px;
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 2.5rem 0 1rem 0;
    color: #111827;
    scroll-margin-top: 20px;
}

h4 {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.5;
    margin: 2rem 0 1rem 0;
    color: #111827;
    scroll-margin-top: 20px;
}

h5, h6 {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.5;
    margin: 1.5rem 0 1rem 0;
    color: #111827;
    scroll-margin-top: 20px;
}

p {
    margin: 0 0 1.5rem 0;
    color: #374151;
}

strong {
    font-weight: 600;
    color: #111827;
}

em {
    font-style: italic;
}

a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

a:hover {
    text-decoration: underline;
}

code {
    background-color: #f3f4f6;
    color: #374151;
    padding: 0.125rem 0.375rem;
    border-radius: 0.375rem;
    font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
    font-size: 0.875em;
}

pre {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    font-size: 0.875rem;
}

ul, ol {
    margin: 0 0 1.5rem 0;
    padding-left: 1.5rem;
}

li {
    margin: 0.5rem 0;
}

blockquote {
    border-left: 4px solid #e5e7eb;
    margin: 1.5rem 0;
    padding-left: 1.5rem;
    color: #6b7280;
    font-style: italic;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    max-width: 100%;
}

table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.5rem 0;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
}

th, td {
    border-bottom: 1px solid #e5e7eb;
    padding: 0.75rem 1rem;
    text-align: left;
    vertical-align: top;
}

th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #374151;
}

tr:last-child td {
    border-bottom: none;
}

hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 3rem 0;
}

img, iframe {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
}

iframe {
    border: 1px solid #e5e7eb;
}

input[type="checkbox"] {
    margin-right: 0.5rem;
    transform: scale(1.1);
}

/* Custom styled boxes */
div[style*="border: 2px solid black"] {
    border: 1px solid #e5e7eb !important;
    border-radius: 0.75rem !important;
    background-color: #f9fafb !important;
    padding: 1.5rem !important;
    margin: 2rem 0 !important;
}

#loading {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
    font-size: 1.125rem;
}

#landing-page {
    display: none;
}

/* Landing page styles */
.intro {
    font-size: 1.125rem;
    color: #6b7280;
    margin-bottom: 3rem;
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.documents-grid {
    max-width: 1200px;
    margin: 0 auto;
}

.year-section {
    margin-bottom: 3rem;
}

.year-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.document-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.document-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    transform: translateY(-1px);
}

.document-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 1rem 0;
    line-height: 1.4;
}

.document-card p {
    color: #6b7280;
    margin: 0 0 1rem 0;
    line-height: 1.6;
}

.document-meta {
    font-size: 0.875rem;
    color: #9ca3af;
    font-style: italic;
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 100;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: #2563eb;
    transform: translateY(-2px);
}

/* Footnotes styling */
.footnote {
    margin-bottom: 1rem;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #6b7280;
    border-bottom: 1px solid #f3f4f6;
}

.footnote:last-child {
    border-bottom: none;
}

.footnote-ref {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875em;
    vertical-align: super;
    line-height: 0;
}

.footnote-ref:hover {
    text-decoration: underline;
}

.footnote-backref {
    color: #3b82f6;
    text-decoration: none;
    margin-left: 0.5rem;
    font-weight: 500;
}

.footnote-backref:hover {
    text-decoration: underline;
}

/* Mobile responsiveness */
@media (max-width: 1024px) {
    .content-wrapper {
        margin-left: 0;
    }
    
    .toc-sidebar {
        display: none;
    }
    
    .main-content {
        padding: 16px;
    }
}
