/* political.wiki - Styles
   Minimalist encyclopedia design with muted palette
   Font: Inter" (Google Fonts), weight: semibold (600)
   Colors: #FFFFFF, #1A1A1A, #3D3D3D, #8E8E93, #0645AD, #F5F5F5
*/

/* === Reset & Base === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.7;
    color: #3D3D3D;
    background-color: #FFFFFF;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === Mobile Top Bar === */
.mobile-toc-bar {
    display: none;
    position: sticky;
    top: 0;
    z-index: 100;
    background: #FFFFFF;
    border-bottom: 1px solid #E5E5E5;
    padding: 0.6rem 1rem;
    align-items: center;
    justify-content: space-between;
}

.mobile-toc-label {
    font-weight: 600;
    font-size: 0.95rem;
    color: #1A1A1A;
}

.mobile-toc-dropdown {
    position: relative;
}

.mobile-toc-dropdown summary {
    cursor: pointer;
    color: #0645AD;
    font-size: 0.875rem;
    font-weight: 500;
    list-style: none;
    padding: 0.25rem 0.5rem;
    border: 1px solid #E5E5E5;
    border-radius: 4px;
}

.mobile-toc-dropdown summary::-webkit-details-marker {
    display: none;
}

.mobile-toc-dropdown summary::after {
    content: ' \25BE';
}

.mobile-toc-nav {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: #FFFFFF;
    border: 1px solid #E5E5E5;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    min-width: 220px;
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0;
}

.mobile-toc-nav a {
    padding: 0.5rem 1rem;
    color: #0645AD;
    text-decoration: none;
    font-size: 0.875rem;
    line-height: 1.5;
}

.mobile-toc-nav a:hover {
    background: #F5F5F5;
}

/* === Page Layout === */
.page-wrapper {
    display: flex;
    max-width: 1040px;
    margin: 0 auto;
    min-height: 100vh;
}

/* === Sidebar === */
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    width: 240px;
    min-width: 240px;
    padding: 2rem 1.5rem 2rem 1rem;
    border-right: 1px solid #E5E5E5;
    overflow-y: auto;
}

.sidebar-header {
    margin-bottom: 1.5rem;
}

.site-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1A1A1A;
    text-decoration: none;
    letter-spacing: -0.01em;
}

.site-title:hover {
    color: #0645AD;
}

.toc-heading {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #8E8E93;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.75rem;
}

.toc-list {
    list-style: none;
    counter-reset: toc-counter;
}

.toc-list li {
    counter-increment: toc-counter;
    margin-bottom: 0.35rem;
}

.toc-list li a {
    display: block;
    padding: 0.25rem 0;
    font-size: 0.875rem;
    color: #0645AD;
    text-decoration: none;
    line-height: 1.4;
}

.toc-list li a:hover {
    text-decoration: underline;
}

.toc-list li a::before {
    content: counter(toc-counter) ". ";
    color: #8E8E93;
    font-size: 0.8rem;
}

/* === Main Content === */
.content {
    flex: 1;
    max-width: 720px;
    padding: 2.5rem 2rem 4rem 2.5rem;
}

/* === Page Header === */
.page-header {
    margin-bottom: 2.5rem;
}

.page-header h1 {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 600;
    color: #1A1A1A;
    line-height: 1.3;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    font-size: 0.95rem;
    color: #8E8E93;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.header-rule {
    border: none;
    border-top: 2px solid #1A1A1A;
    width: 100%;
}

/* === Entry Articles === */
.entry {
    margin-bottom: 0.5rem;
}

.entry-heading {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1A1A1A;
    line-height: 1.3;
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.entry-icon {
    flex-shrink: 0;
}

.entry-meta {
    font-size: 0.825rem;
    color: #8E8E93;
    font-style: italic;
    margin-bottom: 1rem;
}

.entry p {
    margin-bottom: 0.85rem;
}

.entry a {
    color: #0645AD;
    text-decoration: none;
}

.entry a:hover {
    text-decoration: underline;
}

/* === Dividers === */
.entry-divider {
    border: none;
    border-top: 1px solid #E5E5E5;
    margin: 2rem 0;
}

/* === Details / Collapsible Sections === */
.entry details {
    margin: 1rem 0;
    border: 1px solid #E5E5E5;
    border-radius: 4px;
    background: #FFFFFF;
}

.entry details[open] {
    background: #FAFAFA;
}

.entry details summary {
    cursor: pointer;
    padding: 0.7rem 1rem;
    font-weight: 500;
    font-size: 0.95rem;
    color: #1A1A1A;
    list-style: none;
    position: relative;
    padding-left: 1.75rem;
}

.entry details summary::-webkit-details-marker {
    display: none;
}

.entry details summary::before {
    content: '\25B6';
    position: absolute;
    left: 0.75rem;
    top: 0.75rem;
    font-size: 0.65rem;
    color: #8E8E93;
    transition: transform 0.15s ease;
}

.entry details[open] summary::before {
    transform: rotate(90deg);
}

.entry details > p,
.entry details > dl {
    padding: 0.5rem 1rem 1rem 1rem;
}

/* === Definition Lists === */
.definition-list {
    margin: 0;
}

.definition-list dt {
    font-weight: 600;
    color: #1A1A1A;
    font-size: 0.95rem;
    margin-top: 0.85rem;
    margin-bottom: 0.2rem;
    position: relative;
    padding-left: 0.85rem;
}

.definition-list dt::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5em;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #8E8E93;
}

.definition-list dt:first-child {
    margin-top: 0;
}

.definition-list dd {
    margin-left: 0.85rem;
    margin-bottom: 0.5rem;
    font-size: 0.925rem;
    line-height: 1.65;
    color: #3D3D3D;
}

.definition-list dd a {
    color: #0645AD;
    text-decoration: none;
}

.definition-list dd a:hover {
    text-decoration: underline;
}

/* === Footer === */
.site-footer {
    margin-top: 3rem;
    padding-bottom: 2rem;
}

.footer-rule {
    border: none;
    border-top: 1px solid #E5E5E5;
    margin-bottom: 1.25rem;
}

.footer-text {
    font-size: 0.85rem;
    color: #3D3D3D;
    margin-bottom: 0.25rem;
}

.footer-meta {
    font-size: 0.8rem;
    color: #8E8E93;
}

/* === Responsive: Tablet & Mobile === */
@media (max-width: 860px) {
    .sidebar {
        display: none;
    }

    .mobile-toc-bar {
        display: flex;
    }

    .page-wrapper {
        display: block;
    }

    .content {
        max-width: 720px;
        margin: 0 auto;
        padding: 1.5rem 1.25rem 3rem 1.25rem;
    }
}

@media (max-width: 480px) {
    .content {
        padding: 1.25rem 1rem 2.5rem 1rem;
    }

    .entry-heading {
        font-size: 1.3rem;
    }

    .page-header h1 {
        font-size: 1.4rem;
    }
}

/* === Print Styles === */
@media print {
    .sidebar,
    .mobile-toc-bar {
        display: none;
    }

    .content {
        max-width: 100%;
        padding: 0;
    }

    .entry details {
        border: none;
    }

    .entry details[open] {
        background: none;
    }
}
