/* monopole.wiki - Encyclopedia / Scholarly Layout */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: #faf8f4;
    font-family: 'Source Sans 3', sans-serif;
    color: #3a3a4e;
    line-height: 1.7;
}

/* Extended palette */
:root {
    --wiki-title: #1a1a1e;
    --wiki-link: #3a6a9a;
    --wiki-caption: #8a8a8e;
    --wiki-infobox-bg: #f0ede6;
}

.page-wrapper {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

/* Sidebar */
#sidebar {
    position: sticky;
    top: 0;
    width: 220px;
    min-width: 220px;
    height: 100vh;
    padding: 40px 20px 40px 24px;
    border-right: 1px solid #d4d0c8;
    background: #f4f2ee;
    overflow-y: auto;
}

.toc-title {
    font-family: 'Spectral', serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: #2a2a2e;
    margin-bottom: 16px;
    letter-spacing: 0em;
}

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

.toc-list li {
    margin-bottom: 8px;
}

.toc-link {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.8rem;
    font-weight: 400;
    color: #6a6a6e;
    text-decoration: none;
    padding: 2px 0;
    display: block;
    border-left: 2px solid transparent;
    padding-left: 10px;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.toc-link:hover {
    color: #3a3a4e;
}

.toc-link.active {
    color: #2a2a2e;
    border-left-color: #3a3a4e;
    font-weight: 600;
}

/* Main Article */
#article {
    flex: 1;
    max-width: 720px;
    padding: 40px 48px 80px;
}

.article-header {
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid #d4d0c8;
}

.article-title {
    font-family: 'Spectral', serif;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 600;
    color: #2a2a2e;
    line-height: 1.2;
    letter-spacing: 0em;
}

.article-subtitle {
    font-family: 'Source Sans 3', sans-serif;
    font-size: clamp(0.9rem, 1.5vw, 1.05rem);
    font-weight: 400;
    color: #6a6a6e;
    margin-top: 6px;
    font-style: italic;
}

/* Infobox */
.infobox {
    float: right;
    width: 260px;
    margin: 0 0 20px 30px;
    border: 1px solid #c4c0b8;
    background: #f4f2ee;
    font-size: 0.85rem;
}

.infobox-header {
    background: #e8e4dc;
    padding: 8px 12px;
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 600;
    color: #2a2a2e;
    text-align: center;
    font-size: 0.9rem;
}

.infobox-diagram {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #d4d0c8;
    background: #faf8f4;
}

.infobox-diagram svg {
    width: 180px;
    height: auto;
}

.infobox-table {
    width: 100%;
    border-collapse: collapse;
}

.infobox-table tr {
    border-bottom: 1px solid #e8e4dc;
}

.infobox-table tr:nth-child(even) {
    background: #f4f2ee;
}

.infobox-table tr:nth-child(odd) {
    background: #faf8f4;
}

.infobox-table th {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 600;
    color: #3a3a4e;
    text-align: left;
    padding: 6px 10px;
    width: 40%;
    font-size: 0.8rem;
    vertical-align: top;
}

.infobox-table td {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    color: #6a6a6e;
    padding: 6px 10px;
    font-size: 0.8rem;
}

/* Article Sections */
.article-section {
    margin-bottom: 36px;
}

.article-section h2 {
    font-family: 'Spectral', serif;
    font-size: clamp(1.3rem, 2.5vw, 1.8rem);
    font-weight: 600;
    color: #2a2a2e;
    letter-spacing: 0em;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #d4d0c8;
    margin-bottom: 16px;
}

.article-section p {
    font-family: 'Source Sans 3', sans-serif;
    font-size: clamp(0.9rem, 1.5vw, 1.05rem);
    font-weight: 400;
    color: #3a3a4e;
    line-height: 1.7;
    margin-bottom: 12px;
}

/* Sidenotes */
.sidenote {
    color: #6a6a6e;
    cursor: pointer;
    font-size: 0.8em;
    vertical-align: super;
    position: relative;
    text-decoration: none;
    border-bottom: 1px dotted #c4c0b8;
}

.sidenote:hover {
    color: #3a3a4e;
}

.sidenote-tooltip {
    position: absolute;
    background: #f4f2ee;
    border: 1px solid #c4c0b8;
    padding: 10px 14px;
    max-width: 280px;
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.8rem;
    color: #6a6a6e;
    line-height: 1.5;
    box-shadow: 0 2px 8px rgba(42, 42, 46, 0.08);
    z-index: 100;
    display: none;
    pointer-events: none;
}

.sidenote-tooltip.show {
    display: block;
}

/* Equations */
.equation-block {
    margin: 16px 0;
    padding: 12px 20px;
    background: #f4f2ee;
    border-left: 3px solid #d4d0c8;
    display: flex;
    align-items: center;
    gap: 16px;
}

.equation {
    font-family: 'Space Mono', monospace;
    font-size: 1rem;
    font-weight: 400;
    color: #2a2a2e;
}

.equation-note {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.8rem;
    color: #6a6a6e;
    font-style: italic;
}

/* Timeline */
.timeline-list {
    margin: 16px 0;
}

.timeline-item {
    display: flex;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #e8e4dc;
}

.timeline-year {
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    font-weight: 400;
    color: #6a6a6e;
    min-width: 50px;
}

.timeline-desc {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.9rem;
    color: #3a3a4e;
    line-height: 1.6;
}

/* Bibliography */
.bibliography {
    padding-left: 20px;
}

.bibliography li {
    font-family: 'Source Sans 3', sans-serif;
    font-size: 0.85rem;
    color: #6a6a6e;
    margin-bottom: 8px;
    line-height: 1.5;
}

.bibliography li em {
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .page-wrapper {
        flex-direction: column;
    }

    #sidebar {
        position: static;
        width: 100%;
        min-width: auto;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #d4d0c8;
        padding: 20px;
    }

    #article {
        padding: 20px;
    }

    .infobox {
        float: none;
        width: 100%;
        margin: 0 0 20px 0;
    }

    .equation-block {
        flex-direction: column;
        gap: 8px;
    }
}
