@import url('https://fonts.googleapis.com/css2?family=Google+Sans:wght@400;500;700&family=Roboto:wght@300;400;500;700&family=Roboto+Mono:wght@400;500&display=swap');

/* ── Google Docs palette (light theme override) ── */
.light, html:not(.js) {
    --bg: #ffffff;
    --fg: #202124;

    --sidebar-bg: #f8f9fa;
    --sidebar-fg: #3c4043;
    --sidebar-non-existant: #9aa0a6;
    --sidebar-active: #1a73e8;
    --sidebar-spacer: #e8eaed;

    --scrollbar: #dadce0;

    --icons: #5f6368;
    --icons-hover: #1a73e8;

    --links: #1a73e8;

    --inline-code-color: #c2185b;

    --theme-popup-bg: #ffffff;
    --theme-popup-border: #dadce0;
    --theme-hover: #f1f3f4;

    --quote-bg: #e8f0fe;
    --quote-border: #1a73e8;

    --table-border-color: #e8eaed;
    --table-header-bg: #f1f3f4;
    --table-alternate-bg: #f8f9fa;

    --searchbar-border-color: #dadce0;
    --searchbar-bg: #f1f3f4;
    --searchbar-fg: #202124;
    --searchbar-shadow-color: rgba(26, 115, 232, 0.3);
    --searchresults-header-fg: #5f6368;
    --searchresults-border-color: #e8eaed;
    --searchresults-li-bg: #e8f0fe;
    --search-mark-bg: #fce8b2;

    --color-scheme: light;
}

/* ── Typography ── */
body {
    font-family: 'Roboto', 'Google Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Google Sans', 'Roboto', sans-serif;
    font-weight: 500;
    color: #202124;
    letter-spacing: -0.01em;
}

.light h1 { font-size: 2rem;   border-bottom: 1px solid #e8eaed; padding-bottom: 0.4rem; margin-bottom: 1.2rem; }
.light h2 { font-size: 1.4rem; border-bottom: 1px solid #f1f3f4; padding-bottom: 0.25rem; margin-top: 2rem; }
.light h3 { font-size: 1.15rem; margin-top: 1.5rem; }

/* ── Sidebar ── */
.light #sidebar {
    border-right: 1px solid #e8eaed;
    box-shadow: none;
}

.light .sidebar-scrollbox {
    padding: 8px 0;
}

.light .chapter li a {
    font-size: 0.875rem;
    padding: 4px 16px;
    border-radius: 0 24px 24px 0;
    margin-right: 8px;
    transition: background 0.15s ease, color 0.15s ease;
    color: #3c4043;
}

.light .chapter li a:hover {
    background: #f1f3f4;
    color: #1a73e8;
    text-decoration: none;
}

.light .chapter li a.active {
    background: #e8f0fe;
    color: #1a73e8;
    font-weight: 500;
}

.light .chapter li.chapter-item.expanded > a,
.light .chapter li.part-title {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #5f6368;
    padding: 12px 16px 4px;
}

/* ── Menu bar ── */
.light #menu-bar {
    border-bottom: 1px solid #e8eaed;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(60,64,67,0.1);
}

.light .menu-title {
    font-family: 'Google Sans', sans-serif;
    font-weight: 500;
    font-size: 1rem;
    color: #202124;
}

/* ── Content area ── */
.light .content main {
    max-width: 860px;
    padding: 24px 40px;
}

/* ── Links ── */
.light a {
    color: #1a73e8;
    text-decoration: none;
}

.light a:hover {
    text-decoration: underline;
    color: #1557b0;
}

/* ── Inline code ── */
.light code:not(.hljs) {
    background: #f1f3f4;
    color: #c2185b;
    border-radius: 4px;
    padding: 1px 6px;
    font-family: 'Roboto Mono', 'Source Code Pro', monospace;
    font-size: 0.85em;
}

/* ── Code blocks ── */
.light pre {
    background: #f8f9fa !important;
    border: 1px solid #e8eaed;
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: none;
}

.light pre code.hljs {
    background: transparent;
    font-family: 'Roboto Mono', 'Source Code Pro', monospace;
    font-size: 0.875em;
}

/* ── Blockquotes ── */
.light blockquote {
    background: #e8f0fe;
    border-left: 4px solid #1a73e8;
    border-radius: 0 8px 8px 0;
    padding: 12px 20px;
    color: #3c4043;
    margin: 1.5rem 0;
}

/* ── Tables ── */
.light table {
    border-collapse: collapse;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 0 1px #e8eaed;
}

.light table th {
    background: #f1f3f4;
    color: #3c4043;
    font-weight: 500;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 10px 16px;
    border: none;
    border-bottom: 1px solid #e8eaed;
}

.light table td {
    padding: 10px 16px;
    border: none;
    border-bottom: 1px solid #f1f3f4;
    font-size: 0.875rem;
}

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

.light table tr:hover td {
    background: #f8f9fa;
}

/* ── Search bar ── */
.light #searchbar {
    border-radius: 24px;
    border: 1px solid #dadce0;
    background: #f1f3f4;
    padding: 6px 16px;
    font-family: 'Roboto', sans-serif;
    font-size: 0.875rem;
    transition: box-shadow 0.2s ease, background 0.2s ease;
}

.light #searchbar:focus {
    background: #ffffff;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.3);
    outline: none;
    border-color: #1a73e8;
}

/* ── Scrollbar ── */
.light ::-webkit-scrollbar { width: 8px; height: 8px; }
.light ::-webkit-scrollbar-track { background: transparent; }
.light ::-webkit-scrollbar-thumb { background: #dadce0; border-radius: 4px; }
.light ::-webkit-scrollbar-thumb:hover { background: #bdc1c6; }
