/* political.wiki — encyclopedia article styles
   Palette:
     #ffffff  Page White
     #1a1a1a  Article Black
     #0055cc  Wiki Blue
     #f5f5f5  Infobox Gray
     #e8e8e8  Border Light
     #666666  Meta Gray
     #333333  Heading Dark
     #f0f7ff  Highlight Blue
*/

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

html {
    scroll-behavior: smooth;
}

body {
    background: #ffffff;
    color: #1a1a1a;
    font-family: "Source Serif 4", Merriweather, Georgia, serif;
    font-size: 1rem;
    line-height: 1.8;
    font-weight: 400;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: #f0f7ff;
    color: #1a1a1a;
}

a {
    color: #0055cc;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
}

a:hover {
    text-decoration-thickness: 2px;
}

/* ---------- Site header ---------- */
.site-header {
    border-bottom: 1px solid #e8e8e8;
    background: #ffffff;
    position: sticky;
    top: 0;
    z-index: 50;
}

.site-header-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 14px 32px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 24px;
}

.wordmark {
    font-family: "Inter", sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #1a1a1a;
    text-decoration: none;
}

.wordmark::before {
    content: "·";
    color: #0055cc;
    margin-right: 8px;
}

.topnav {
    display: flex;
    align-items: center;
    gap: 18px;
    font-family: "Inter", sans-serif;
    font-size: 0.82rem;
}

.topnav a {
    color: #333333;
    text-decoration: none;
    padding-bottom: 2px;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.topnav a:hover {
    color: #0055cc;
    border-bottom-color: #0055cc;
}

.topnav-sep {
    width: 1px;
    height: 14px;
    background: #e8e8e8;
}

.topnav-search,
.topnav-account {
    color: #666666 !important;
}

/* ---------- TOC sidebar ---------- */
.toc {
    position: fixed;
    left: 24px;
    top: 100px;
    width: 220px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    padding: 8px 4px 16px 4px;
    font-family: "Inter", sans-serif;
    font-size: 0.85rem;
    color: #333333;
    border-left: 1px solid #e8e8e8;
}

.toc-title {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: #666666;
    padding: 0 12px 10px 12px;
    margin-bottom: 6px;
    border-bottom: 1px solid #e8e8e8;
}

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

.toc-list > li {
    margin: 2px 0;
}

.toc-list ol {
    padding-left: 14px;
    margin: 2px 0 6px 0;
    border-left: 1px dotted #e8e8e8;
}

.toc-link {
    display: block;
    padding: 4px 12px;
    color: #333333;
    text-decoration: none;
    border-radius: 2px;
    line-height: 1.4;
    transition: background 0.15s ease, color 0.15s ease;
}

.toc-link:hover {
    color: #0055cc;
    background: #fafafa;
}

.toc-link.active {
    background: #f0f7ff;
    color: #0055cc;
    font-weight: 500;
    box-shadow: inset 2px 0 0 #0055cc;
}

.toc-sub {
    font-size: 0.8rem;
    color: #666666;
    padding-left: 18px;
}

/* Hide TOC scrollbar nicely */
.toc::-webkit-scrollbar {
    width: 6px;
}
.toc::-webkit-scrollbar-thumb {
    background: #e8e8e8;
    border-radius: 3px;
}

/* ---------- Article ---------- */
.article {
    max-width: 680px;
    margin: 0 auto;
    padding: 56px 32px 96px 32px;
}

.article-meta {
    font-family: "Inter", sans-serif;
    font-size: 0.78rem;
    color: #666666;
    letter-spacing: 0.04em;
    margin-bottom: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.wordmark-small {
    font-weight: 600;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.72rem;
}

.meta-sep {
    color: #e8e8e8;
}

.article-title {
    font-family: "Merriweather", Georgia, serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 3.5vw, 2.5rem);
    line-height: 1.2;
    color: #1a1a1a;
    letter-spacing: -0.01em;
    margin-bottom: 12px;
}

.article-lede {
    font-family: "Source Serif 4", Georgia, serif;
    font-size: 1.05rem;
    color: #333333;
    line-height: 1.7;
    margin-bottom: 32px;
    padding-bottom: 18px;
    border-bottom: 1px solid #e8e8e8;
}

.article-lede em {
    font-style: italic;
    color: #1a1a1a;
}

.meta-line {
    display: block;
    margin-top: 6px;
    font-family: "Inter", sans-serif;
    font-size: 0.8rem;
    color: #666666;
}

.meta-line a {
    color: #0055cc;
}

/* ---------- Infobox ---------- */
.infobox {
    float: right;
    width: 280px;
    border: 1px solid #e8e8e8;
    background: #f5f5f5;
    padding: 16px;
    margin: 0 0 16px 24px;
    font-family: "Inter", sans-serif;
    font-size: 0.82rem;
    line-height: 1.5;
    color: #333333;
}

.infobox-title {
    font-family: "Merriweather", Georgia, serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: #1a1a1a;
    text-align: center;
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid #e8e8e8;
    letter-spacing: 0.02em;
}

.infobox-grid {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 8px 12px;
}

.infobox-label {
    font-weight: 600;
    color: #666666;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    align-self: start;
    padding-top: 1px;
}

.infobox-value {
    color: #1a1a1a;
}

.infobox-value a {
    color: #0055cc;
}

/* ---------- Sections & headings ---------- */
.article-section {
    margin-top: 36px;
    scroll-margin-top: 80px;
}

.section-heading {
    position: relative;
    font-family: "Merriweather", Georgia, serif;
    color: #333333;
    font-weight: 700;
    line-height: 1.3;
    padding-bottom: 8px;
    margin-bottom: 18px;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    align-items: baseline;
    gap: 10px;
}

h2.section-heading {
    font-size: 1.6rem;
    margin-top: 8px;
}

.section-heading-sub {
    font-size: 1.2rem !important;
    border-bottom: none;
    padding-bottom: 4px;
    margin-top: 22px;
    margin-bottom: 12px;
    color: #1a1a1a;
}

.anchor {
    position: absolute;
    left: -22px;
    top: 50%;
    transform: translateY(-50%);
    color: #0055cc;
    text-decoration: none;
    font-family: "Inter", sans-serif;
    font-weight: 400;
    font-size: 0.95em;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.section-heading:hover .anchor {
    opacity: 1;
}

.anchor:hover {
    text-decoration: underline;
}

.edit-pencil {
    margin-left: auto;
    color: #666666;
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.2s ease, color 0.2s ease;
    display: inline-flex;
    align-items: center;
}

.section-heading:hover .edit-pencil {
    opacity: 1;
}

.edit-pencil:hover {
    color: #0055cc;
}

/* ---------- Body content ---------- */
.article-section p {
    margin-bottom: 16px;
    color: #1a1a1a;
}

.article-section p strong {
    color: #1a1a1a;
    font-weight: 700;
}

.article-section em {
    font-style: italic;
}

.xref {
    color: #0055cc;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
}

.xref:hover {
    background: #f0f7ff;
    text-decoration-thickness: 2px;
}

/* ---------- Footnote superscripts ---------- */
.footnote {
    font-size: 0.7em;
    line-height: 1;
    vertical-align: super;
    margin-left: 2px;
}

.footnote a {
    color: #0055cc;
    text-decoration: none;
    padding: 0 2px;
    border-radius: 2px;
}

.footnote a::before {
    content: "";
}

.footnote a:hover {
    background: #f0f7ff;
    text-decoration: underline;
}

/* ---------- Pull quote ---------- */
.pullquote {
    border-left: 4px solid #0055cc;
    padding: 10px 0 10px 20px;
    margin: 24px 0;
    font-family: "Merriweather", Georgia, serif;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #333333;
    font-style: italic;
}

.pullquote cite {
    display: block;
    margin-top: 10px;
    font-family: "Inter", sans-serif;
    font-size: 0.8rem;
    font-style: normal;
    color: #666666;
    letter-spacing: 0.02em;
}

.pullquote cite em {
    font-style: italic;
}

/* ---------- Comparison table ---------- */
.compare-table {
    width: 100%;
    border-collapse: collapse;
    margin: 22px 0 8px 0;
    font-family: "Inter", sans-serif;
    font-size: 0.85rem;
    border: 1px solid #e8e8e8;
}

.compare-table thead {
    background: #f5f5f5;
}

.compare-table th {
    text-align: left;
    font-weight: 600;
    color: #333333;
    padding: 10px 12px;
    border-bottom: 1px solid #e8e8e8;
    letter-spacing: 0.02em;
}

.compare-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e8e8e8;
    color: #1a1a1a;
}

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

.compare-table tbody tr:hover {
    background: #f0f7ff;
}

/* ---------- References ---------- */
.references .reflist {
    list-style: decimal;
    padding-left: 24px;
    font-size: 0.92rem;
    color: #333333;
    line-height: 1.7;
}

.references .reflist li {
    padding-left: 6px;
    margin-bottom: 8px;
    text-indent: -2px;
}

.references .reflist li::marker {
    color: #666666;
    font-family: "Inter", sans-serif;
    font-size: 0.85rem;
}

.references .reflist a {
    color: #0055cc;
}

/* ---------- Related ---------- */
.related-grid {
    list-style: none;
    padding: 0;
    margin: 8px 0 0 0;
    columns: 3;
    column-gap: 24px;
    font-family: "Inter", sans-serif;
    font-size: 0.88rem;
    line-height: 1.9;
}

.related-grid li {
    break-inside: avoid;
    padding-left: 14px;
    position: relative;
}

.related-grid li::before {
    content: "›";
    position: absolute;
    left: 0;
    color: #0055cc;
    font-weight: 600;
}

.related-grid a {
    color: #0055cc;
    text-decoration: none;
}

.related-grid a:hover {
    text-decoration: underline;
}

/* ---------- Article footer ---------- */
.article-footer {
    margin-top: 56px;
    padding-top: 20px;
    border-top: 1px solid #e8e8e8;
    font-family: "Inter", sans-serif;
}

.footer-meta {
    font-size: 0.8rem;
    color: #666666;
    margin-bottom: 18px;
}

.footer-meta a {
    color: #0055cc;
    text-decoration: none;
}

.footer-meta a:hover {
    text-decoration: underline;
}

.footer-wordmark {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: #1a1a1a;
    font-weight: 600;
    text-align: left;
}

/* ---------- Section anchor target highlight ---------- */
.article-section:target {
    background: #f0f7ff;
    transition: background 1.5s ease;
}

.article-section:target .section-heading {
    border-bottom-color: #0055cc;
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .toc {
        position: static;
        width: auto;
        max-width: 680px;
        margin: 24px auto 0 auto;
        padding: 16px 32px;
        max-height: none;
        border-left: none;
        border-top: 1px solid #e8e8e8;
        border-bottom: 1px solid #e8e8e8;
        background: #f5f5f5;
    }

    .toc-title {
        padding-left: 0;
    }

    .article {
        padding-top: 32px;
    }
}

@media (max-width: 720px) {
    .site-header-inner {
        padding: 12px 20px;
        gap: 12px;
        flex-wrap: wrap;
    }

    .topnav {
        gap: 12px;
        font-size: 0.78rem;
    }

    .article {
        padding: 28px 20px 64px 20px;
    }

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

    .related-grid {
        columns: 2;
    }

    h2.section-heading {
        font-size: 1.4rem;
    }

    .anchor {
        display: none;
    }
}

@media (max-width: 480px) {
    .related-grid {
        columns: 1;
    }

    .topnav-search,
    .topnav-account {
        display: none;
    }
}
