/* ============================================================
   Þingfréttir Ghost Theme — screen.css
   Custom theme for thingfrettir.is
   ============================================================ */

/* ----- Custom Properties ----- */
:root {
    --color-accent: #3d5a80;
    --color-accent-light: #f0f4f8;
    --color-bg: #ffffff;
    --color-text: #1a1a2e;
    --color-text-secondary: #555;
    --color-border: #ddd;
    --color-border-light: #eee;
    --color-bg-alt: #fafafa;
    --color-bg-card: #f8f9fa;
    --color-success: #2d7d2d;
    --color-danger: #c0392b;
    --font-display: 'Lora', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --content-width: 720px;
    --digest-width: 900px;
    --wide-width: 1200px;
}


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

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.65;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--color-accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 2px;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
    outline: none;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--color-accent);
    color: #fff;
    padding: 8px 16px;
    z-index: 100;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
}

.skip-link:focus-visible {
    top: 0;
}

img {
    max-width: 100%;
    height: auto;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-text);
}


/* ============================================================
   HEADER
   ============================================================ */
.site-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-border-light);
}

.site-header-inner {
    max-width: var(--wide-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-text);
    text-decoration: none;
}

.site-logo img {
    max-height: 40px;
    width: auto;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.site-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1.5rem;
}

.site-nav a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color 0.15s;
}

.site-nav a:hover {
    color: var(--color-accent);
    text-decoration: none;
}


/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    margin-top: 4rem;
    padding: 3rem 1.5rem 2.5rem;
    border-top: 2px solid var(--color-border);
    text-align: center;
}

.site-footer-inner {
    max-width: var(--content-width);
    margin: 0 auto;
}

.site-footer-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.3rem;
}

.site-footer-description {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin: 0 0 1.25rem;
}

.site-footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.site-footer-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color 0.15s;
}

.site-footer-links a:hover {
    color: var(--color-accent);
    text-decoration: none;
}

.site-footer-links .x-icon {
    width: 14px;
    height: 14px;
}

.site-footer-links .footer-sep {
    color: var(--color-border);
    font-size: 0.9rem;
}

.site-footer-copyright {
    font-size: 0.8rem;
    color: #767676;
    margin: 0;
}


/* ============================================================
   LANDING PAGE — Hero, Featured Card, Archive List
   ============================================================ */

/* ----- Hero ----- */
.site-hero {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 3rem 1.5rem 2.5rem;
    text-align: center;
    border-bottom: 3px solid var(--color-accent);
}

.site-hero-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 0.4rem;
    color: var(--color-text);
}

.site-hero-description {
    font-family: var(--font-body);
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* ----- Featured Card ----- */
.featured-card {
    max-width: var(--digest-width);
    margin: 2.5rem auto;
    padding: 0 1.5rem;
}

.featured-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
    background: var(--color-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s, transform 0.2s;
}

.featured-card-link:hover {
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.featured-card-image {
    margin: 0;
}

.featured-card-image img {
    width: 100%;
    display: block;
}

.featured-card-content {
    padding: 1.5rem 2rem 2rem;
}

.featured-card-meta {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-accent);
    margin-bottom: 0.5rem;
}

.historical-badge {
    display: inline-block;
    margin-right: 0.45rem;
    padding: 0.1rem 0.45rem;
    border: 1px solid #a28762;
    border-radius: 3px;
    background: #f6f1e8;
    color: #6c4f3d;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    vertical-align: middle;
}

.historical-badge-inline {
    margin-left: 0.45rem;
    margin-right: 0;
    position: relative;
    top: -1px;
}

.historical-context {
    margin: 0 0 0.45rem;
    color: #6f665e;
    font-size: 0.9rem;
}

.featured-card-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 0.6rem;
    line-height: 1.25;
    transition: color 0.15s;
}

.featured-card-link:hover .featured-card-title {
    color: var(--color-accent);
}

.featured-card-excerpt {
    font-size: 1rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin: 0 0 1rem;
}

.featured-card-cta {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-accent);
}

/* ----- Archive List ----- */
.archive-list {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 1.5rem 1rem;
}

.archive-list-heading {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border-light);
}

.archive-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.65rem 0.75rem;
    margin: 0 -0.75rem;
    border-bottom: 1px dotted var(--color-border);
    border-radius: 4px;
    color: inherit;
    text-decoration: none;
    transition: background-color 0.15s, color 0.15s;
}

.archive-item:hover {
    text-decoration: none;
    background-color: var(--color-accent-light);
}

.archive-item:hover .archive-item-title {
    color: var(--color-accent);
}

.archive-item-title {
    font-size: 1rem;
    font-weight: 500;
    transition: color 0.15s;
    margin-right: 1rem;
}

.archive-item-date {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}

.historical-banner {
    max-width: var(--digest-width);
    margin: 0 auto 1.25rem;
    padding: 0.75rem 1rem;
    border: 1px solid #d4c5ac;
    border-radius: 6px;
    background: #f6f1e8;
    color: #5a4b3f;
    font-size: 0.95rem;
    line-height: 1.35;
}

.historical-banner strong {
    color: #6c4f3d;
}


/* ----- Archive + Sidebar Layout ----- */
.archive-with-sidebar {
    max-width: var(--wide-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2.5rem;
    align-items: start;
}

.archive-with-sidebar .archive-list {
    max-width: none;
    padding: 0;
}

.sidebar-tweets {
    position: sticky;
    top: 1.5rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border-light);
    border-radius: 8px;
    padding: 1.25rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.sidebar-tweets-heading {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-border-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-tweets-heading a {
    color: var(--color-text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-tweets-heading a:hover {
    color: var(--color-accent);
}

.sidebar-tweets-heading .x-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.sidebar-tweets-loading {
    color: var(--color-text-secondary);
    font-size: 0.85rem;
    font-style: italic;
    margin: 0;
    padding: 1rem 0;
}

.sidebar-tweet-item {
    display: block;
    padding: 0.75rem;
    margin: 0 -0.25rem;
    border-left: 3px solid transparent;
    border-radius: 4px;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
}

.sidebar-tweet-item + .sidebar-tweet-item {
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--color-border-light);
}

.sidebar-tweet-item:hover {
    background-color: var(--color-accent-light);
    border-left-color: var(--color-accent);
    text-decoration: none;
}

.sidebar-tweet-text {
    font-size: 0.84rem;
    line-height: 1.5;
    color: var(--color-text);
    margin: 0 0 0.5rem;
}

.sidebar-tweet-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    color: #999;
    letter-spacing: 0.01em;
}

.sidebar-tweet-meta .sidebar-tweet-link {
    color: var(--color-accent);
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.15s;
}

.sidebar-tweet-item:hover .sidebar-tweet-link {
    opacity: 1;
}

.sidebar-tweets-more {
    display: block;
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--color-accent);
    background: none;
    border: 1px solid var(--color-border-light);
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
}

.sidebar-tweets-more:hover {
    background-color: var(--color-accent-light);
    border-color: var(--color-accent);
}

.sidebar-tweets-follow {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 1rem;
    padding: 0.55rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    text-decoration: none;
    border-top: 1px solid var(--color-border-light);
    transition: color 0.15s;
    padding-top: 1rem;
}

.sidebar-tweets-follow:hover {
    color: var(--color-accent);
    text-decoration: none;
}

.sidebar-tweets-follow .x-icon {
    width: 14px;
    height: 14px;
}


/* ============================================================
   POST FEED (tag, author pages)
   ============================================================ */
.post-feed {
    max-width: var(--content-width);
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.post-card {
    margin-bottom: 2.5rem;
}

.post-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.post-card-link:hover {
    text-decoration: none;
}

.post-card-link:hover .post-card-title {
    color: var(--color-accent);
}

.post-card-image {
    margin: 0 0 1rem;
    border-radius: 6px;
    overflow: hidden;
}

.post-card-image img {
    width: 100%;
    display: block;
}

.post-card-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-accent);
    margin-bottom: 0.3rem;
}

.post-card-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    transition: color 0.15s;
}

.post-card-excerpt {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    margin: 0 0 0.5rem;
    line-height: 1.5;
}

.post-card-meta {
    font-size: 0.8rem;
    color: #767676;
}


/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
    max-width: var(--content-width);
    margin: 2rem auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.pagination a {
    font-weight: 500;
}

.page-number {
    color: var(--color-text-secondary);
}


/* ============================================================
   POST (default template)
   ============================================================ */
.post {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.post-header {
    margin-bottom: 2rem;
    text-align: center;
}

.post-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--color-accent);
    margin-bottom: 0.5rem;
}

.post-title {
    font-size: 2.4rem;
    margin: 0 0 0.5rem;
    line-height: 1.2;
}

.post-meta {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.post-image {
    margin: 0 0 2rem;
    border-radius: 6px;
    overflow: hidden;
}

.post-image img {
    width: 100%;
    display: block;
}

.post-image figcaption {
    text-align: center;
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    margin-top: 0.5rem;
    font-style: italic;
}

.post-content {
    font-size: 1.05rem;
    line-height: 1.7;
}

.post-content h2 {
    font-size: 1.6rem;
    margin-top: 2.5rem;
}

.post-content h3 {
    font-size: 1.3rem;
    margin-top: 2rem;
}

.post-content p {
    margin: 0 0 1.3em;
}

.post-content blockquote {
    margin: 1.5em 0;
    padding: 0.8em 1.2em;
    border-left: 4px solid var(--color-accent);
    background: var(--color-bg-card);
    font-style: italic;
}

.post-content blockquote p:last-child {
    margin-bottom: 0;
}


/* ============================================================
   DIGEST POST (custom-digest template)
   ============================================================ */
.digest-post {
    max-width: var(--digest-width);
}


/* ----- Digest: Floating TOC ----- */
.digest-toc {
    display: none;
}

@media (min-width: 1200px) {
    .digest-toc {
        display: block;
        position: absolute;
        left: -170px;
        top: 0;
        width: 150px;
        height: 100%;
    }

    .digest-toc-inner {
        position: sticky;
        top: 2rem;
        max-height: calc(100vh - 4rem);
        overflow-y: auto;
    }

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

    .digest-toc-list li {
        margin: 0;
    }

    .digest-toc-list a {
        display: block;
        padding: 0.3rem 0 0.3rem 0.65rem;
        font-family: var(--font-body);
        font-size: 0.7rem;
        font-weight: 500;
        line-height: 1.35;
        color: var(--color-text-secondary);
        text-decoration: none;
        border-left: 2px solid transparent;
        transition: color 0.15s, border-color 0.15s;
    }

    .digest-toc-list a:hover {
        color: var(--color-accent);
        text-decoration: none;
    }

    .digest-toc-list a.active {
        color: var(--color-accent);
        border-left-color: var(--color-accent);
        font-weight: 600;
    }
}

.digest-header {
    max-width: var(--content-width);
    margin-left: auto;
    margin-right: auto;
}

.digest-feature-image {
    max-width: var(--digest-width);
}

.digest-content {
    position: relative;
    font-size: 1.05rem;
    line-height: 1.7;
}


/* ----- Digest: Section Dividers ----- */
/* (h1 headings are now styled as blue-line dividers via .digest-content h1) */


/* ----- Digest: Tables ----- */
.digest-content .wide-table {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1.5em 0;
    border-radius: 6px;
    border: 1px solid var(--color-border);
}

.digest-content .wide-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.digest-content .wide-table th,
.digest-content .wide-table td {
    border: 1px solid var(--color-border);
    padding: 0.55rem 0.75rem;
    text-align: left;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.digest-content .wide-table th {
    background: var(--color-accent);
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.digest-content .wide-table tr:nth-child(even) {
    background: var(--color-bg-alt);
}

.digest-content .wide-table tr:hover {
    background: var(--color-accent-light);
}

.digest-content .wide-table td:nth-child(2) {
    min-width: 200px;
}

/* Word-wrap for all digest tables (bare tables + wide-table) */
.digest-content td,
.digest-content th {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Table links */
.digest-content .wide-table a {
    color: var(--color-accent);
    font-weight: 500;
}


/* ----- Digest: Award Blockquotes ----- */
.digest-content div[style*="border-left:4px solid #3d5a80"],
.digest-content div[style*="border-left: 4px solid #3d5a80"] {
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* Award quote text styling */
.digest-content div[style*="border-left:4px"] p[style*="font-style:italic"],
.digest-content div[style*="border-left: 4px"] p[style*="font-style: italic"] {
    font-family: var(--font-display);
}


/* ----- Digest: Party Color Dots ----- */
.digest-content span[style*="border-radius:50%"],
.digest-content span[style*="border-radius: 50%"] {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8);
}


/* ----- Digest: Stat Numbers ----- */
.digest-content strong[style*="font-size:2em"],
.digest-content strong[style*="font-size: 2em"] {
    font-family: var(--font-display);
    color: var(--color-accent);
}

.digest-content strong[style*="font-size:1.8em"],
.digest-content strong[style*="font-size: 1.8em"] {
    font-family: var(--font-display);
    color: var(--color-accent);
}


/* ----- Digest: Stage Progress Bars ----- */
.digest-content span[style*="background:#3d5a80"],
.digest-content span[style*="background: #3d5a80"] {
    box-shadow: 0 1px 2px rgba(61, 90, 128, 0.3);
}


/* ----- Digest: Spotlight MP Image ----- */
.digest-content img[style*="border-radius:6px"],
.digest-content img[style*="border-radius: 6px"] {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}


/* ----- Digest: Section Dividers ----- */
/* h1 divider spacing is handled by .digest-content h1 above */

/* ----- Digest: Numbers/Data Zone ----- */
/* Wraps overview stats, submissions cards, and party voting charts
   in a tinted panel to visually separate data from editorial prose.
   Negative horizontal margin bleeds past .post padding (1.5rem)
   so the tinted band spans the full post container width. */
.digest-numbers {
    background: var(--color-accent-light);
    border-top: 1px solid var(--color-border-light);
    border-bottom: 1px solid var(--color-border-light);
    padding: 1.5rem 1.5rem 2rem;
    margin: 2rem -1.5rem;
}

/* Stats summary table — white card on tinted background */
.digest-numbers > table:has(strong[style*="font-size:2em"]),
.digest-numbers > table:has(strong[style*="font-size: 2em"]) {
    background: var(--color-bg);
    border-radius: 8px;
    padding: 1rem 0.5rem;
    margin: 1.5rem auto;
}

/* Grid lines inside the numbers zone — #eee is invisible against
   the #f0f4f8 tinted background, so darken them slightly. */
.digest-numbers svg line[style*="stroke:#eee"],
.digest-numbers svg line[style*="stroke: #eee"] {
    stroke: #d8dee6 !important;
}

/* ----- Digest: Stats Summary Band (Vikan í hnotskurn) ----- */
/* Fallback for stats table outside .digest-numbers (shouldn't happen,
   but keeps backward compatibility) */
.digest-content > table:has(strong[style*="font-size:2em"]),
.digest-content > table:has(strong[style*="font-size: 2em"]) {
    background: var(--color-accent-light);
    border-radius: 8px;
    padding: 1rem 0.5rem;
    margin: 1.5rem auto;
}

/* ----- Digest: Bare Tables (speeches-by-party, catchphrases, etc.) ----- */
/* Style bare tables (without .wide-table wrapper) to match the polished look.
   Uses :not(:has(strong[style*="font-size"])) to exclude stats summary tables. */
.digest-content > table:not(:has(strong[style*="font-size"])) {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin: 1.5em 0;
    border-radius: 6px;
    border: 1px solid var(--color-border);
    overflow: hidden;
}

.digest-content > table:not(:has(strong[style*="font-size"])) th {
    background: var(--color-accent);
    color: #fff;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.55rem 0.75rem;
    text-align: left;
    border: 1px solid var(--color-accent);
}

.digest-content > table:not(:has(strong[style*="font-size"])) td {
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--color-border);
}

.digest-content > table:not(:has(strong[style*="font-size"])) tr:nth-child(even) {
    background: var(--color-bg-alt);
}

.digest-content > table:not(:has(strong[style*="font-size"])) tr:hover {
    background: var(--color-accent-light);
}

/* Bloc label rows (Ríkisstjórn / Stjórnarandstaða) — override zebra/hover */
.digest-content > table td[colspan][style*="text-transform:uppercase"] {
    background: transparent !important;
    color: var(--color-accent) !important;
    border-bottom-color: var(--color-border) !important;
    border-top: none;
    border-left: none;
    border-right: none;
    padding: 1em 0.75rem 0.4rem !important;
}

/* ----- Digest: Generic content styling ----- */
.digest-content h1 {
    font-family: var(--font-body);
    font-size: 1.15rem;
    font-weight: 500;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: var(--color-accent);
    margin: 4em 0 2em;
    padding-top: 0.5em;
}
.digest-content h1::before {
    content: '';
    display: block;
    width: 80px;
    border-top: 3px solid var(--color-accent);
    margin: 0 auto 0.7em;
}
.digest-content h1:first-child {
    margin-top: 0;
}

.digest-content h2 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    margin-top: 2rem;
}

.digest-content h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
}

.digest-content p {
    margin: 0 0 1.2em;
}

.digest-content blockquote {
    margin: 1.5em 0;
    padding: 0.8em 1.2em;
    border-left: 4px solid var(--color-accent);
    background: var(--color-bg-card);
    border-radius: 4px;
    font-style: italic;
}

.digest-content blockquote p:last-child {
    margin-bottom: 0;
}

.digest-content em {
    font-family: var(--font-display);
}

/* Digest small/meta text */
.digest-content small {
    color: var(--color-text-secondary);
    font-size: 0.85em;
}

.digest-content svg [data-tooltip] {
    transition: fill-opacity 120ms ease, stroke 120ms ease;
    outline: none;
}

.digest-content svg [data-tooltip]:hover,
.digest-content svg [data-tooltip]:focus-visible {
    fill-opacity: 0.2 !important;
    stroke: var(--color-accent);
    stroke-width: 0.8;
}

.digest-content svg rect[data-vote-col].is-col-active {
    stroke: rgba(61, 90, 128, 0.6);
    stroke-width: 1.1;
}

.digest-content svg rect[data-vote-col][data-tooltip].is-col-active {
    fill-opacity: 0.24 !important;
}

/* SVG tooltip used for vote heatmap header hover labels */
.svg-tooltip {
    position: fixed;
    z-index: 9999;
    max-width: min(460px, calc(100vw - 24px));
    padding: 0.45rem 0.75rem;
    border-radius: 4px;
    border: 1px solid var(--color-border);
    background: var(--color-accent-light);
    color: var(--color-text);
    font-size: 0.82rem;
    line-height: 1.25;
    text-align: center;
    box-shadow: none;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-3px);
    transition: opacity 120ms ease, transform 120ms ease;
}

.svg-tooltip.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.svg-tooltip.is-pinned {
    border-color: var(--color-accent);
}


/* ============================================================
   TAG / AUTHOR PAGES
   ============================================================ */
.tag-header,
.author-header {
    max-width: var(--content-width);
    margin: 2rem auto;
    padding: 0 1.5rem;
    text-align: center;
}

.tag-title,
.author-name {
    font-family: var(--font-display);
    font-size: 2rem;
    margin: 0 0 0.5rem;
}

.tag-description,
.author-bio {
    font-size: 1rem;
    color: var(--color-text-secondary);
    max-width: 500px;
    margin: 0 auto;
}

.author-image {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 1rem;
}


/* ============================================================
   ERROR PAGES
   ============================================================ */
.error-page {
    max-width: var(--content-width);
    margin: 4rem auto;
    padding: 0 1.5rem;
    text-align: center;
}

.error-code {
    font-family: var(--font-display);
    font-size: 6rem;
    font-weight: 700;
    color: var(--color-accent);
    margin: 0;
    line-height: 1;
}

.error-message {
    font-size: 1.3rem;
    color: var(--color-text-secondary);
    margin: 1rem 0;
}

.error-description {
    font-size: 1rem;
    color: var(--color-text-secondary);
    margin: 0 0 1.5rem;
}

.error-link {
    display: inline-block;
    font-weight: 600;
    color: var(--color-accent);
}


/* ============================================================
   GHOST PORTAL & MEMBERS (kg- cards)
   ============================================================ */
.kg-card {
    margin: 1.5em 0;
}

.kg-image-card img {
    max-width: 100%;
}

/* Width variants */
.kg-width-wide {
    max-width: var(--digest-width);
    margin-left: auto;
    margin-right: auto;
}

.kg-width-full {
    max-width: none;
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

/* Gallery */
.kg-gallery-container {
    display: flex;
    flex-direction: column;
    gap: 0.75em;
}

.kg-gallery-row {
    display: flex;
    gap: 0.75em;
}

.kg-gallery-image {
    flex: 1;
}

.kg-gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Bookmark card */
.kg-bookmark-card {
    border: 1px solid var(--color-border);
    border-radius: 6px;
    overflow: hidden;
}

.kg-bookmark-container {
    display: flex;
    text-decoration: none;
    color: inherit;
}

.kg-bookmark-container:hover {
    text-decoration: none;
}

.kg-bookmark-content {
    flex: 1;
    padding: 1rem;
}

.kg-bookmark-title {
    font-family: var(--font-display);
    font-weight: 600;
}

.kg-bookmark-description {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-top: 0.3rem;
}

.kg-bookmark-metadata {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

.kg-bookmark-icon {
    width: 16px;
    height: 16px;
}

.kg-bookmark-author,
.kg-bookmark-publisher {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

.kg-bookmark-author::after {
    content: "·";
    margin: 0 0.3rem;
}

.kg-bookmark-thumbnail {
    width: 200px;
    min-height: 100%;
}

.kg-bookmark-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* ============================================================
   SUBSCRIBE & NAVIGATION ADDITIONS
   ============================================================ */

/* ----- Nav Subscribe Button ----- */
.nav-subscribe {
    display: inline-block;
    background: var(--color-accent);
    color: #fff !important;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.4rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.15s, transform 0.15s;
    margin-left: 0.5rem;
}

.nav-subscribe:hover {
    background: #2c4a6e;
    text-decoration: none;
    transform: translateY(-1px);
}

/* ----- Language Toggle Flags ----- */
.lang-toggle {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.lang-flag {
    display: block;
    height: 16px;
    width: auto;
    border-radius: 2px;
    overflow: hidden;
    opacity: 0.35;
    transition: opacity 0.15s, height 0.15s;
}

.lang-flag svg {
    display: block;
    height: 100%;
    width: auto;
}

.lang-flag:hover {
    opacity: 0.7;
}

.lang-flag.active {
    opacity: 1;
    height: 20px;
}

/* ----- Hero Subscribe CTA ----- */
.hero-subscribe {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 1.2rem 1.5rem;
    text-align: center;
}

.hero-subscribe p {
    margin: 0 0 0.6rem;
    font-size: 0.95rem;
    color: var(--color-text-secondary);
}

/* ----- Shared Subscribe Button ----- */
.btn-subscribe {
    display: inline-block;
    background: var(--color-accent);
    color: #fff !important;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.55rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.15s, transform 0.15s;
}

.btn-subscribe:hover {
    background: #2c4a6e;
    text-decoration: none;
    transform: translateY(-1px);
}

/* ----- Post Subscribe CTA ----- */
.post-subscribe-cta {
    max-width: var(--content-width);
    margin: 3rem auto 2rem;
    padding: 2rem;
    text-align: center;
    border: 2px solid var(--color-accent);
    border-radius: 8px;
    background: var(--color-bg-card);
}

.post-subscribe-cta h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    margin: 0 0 0.4rem;
}

.post-subscribe-cta p {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    margin: 0 0 1rem;
}

/* ----- Digest Prev/Next Nav ----- */
.digest-nav {
    max-width: var(--digest-width);
    margin: 2rem auto 0;
    padding: 1.5rem 1.5rem 0;
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--color-border-light);
}

.digest-nav a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-accent);
    text-decoration: none;
    max-width: 45%;
}

.digest-nav a:hover {
    text-decoration: underline;
}

.digest-nav-next {
    margin-left: auto;
    text-align: right;
}

/* ----- Language Toggle ----- */
.post-lang-toggle {
    margin-top: 0.5rem;
}

.post-lang-toggle a {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-weight: 500;
}

.post-lang-toggle a:hover {
    color: var(--color-accent);
    text-decoration: underline;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .site-header-inner {
        flex-direction: column;
        gap: 0.5rem;
    }

    .site-nav ul {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    /* Hide hero + subscribe on mobile — navbar logo is sufficient */
    .site-hero,
    .hero-subscribe {
        display: none;
    }

    /* Tighter featured card margin */
    .featured-card {
        padding: 0 1rem;
        margin: 1.2rem auto;
    }

    .featured-card-content {
        padding: 1rem 1rem 1.2rem;
    }

    .featured-card-title {
        font-size: 1.4rem;
    }

    .featured-card-excerpt {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }

    .archive-list {
        padding: 0 1rem 1rem;
    }

    .archive-with-sidebar {
        grid-template-columns: 1fr;
        padding: 0 1rem;
        gap: 1.5rem;
    }

    .sidebar-tweets {
        position: static;
        border-radius: 6px;
        padding: 1rem;
    }

    .post-title {
        font-size: 1.8rem;
    }

    .post-card-title {
        font-size: 1.3rem;
    }

    /* Prevent any digest content from overflowing the viewport.
       Use clip (not hidden) so .wide-table's overflow-x:auto still works. */
    .digest-post {
        padding-left: 1rem;
        padding-right: 1rem;
        overflow-x: clip;
    }

    /* Stats summary tables (bare tables with big stat numbers):
       convert multi-cell rows into a 2×2 grid.
       Scoped via :has() so regular data tables keep normal table layout. */
    .digest-content > table:has(strong[style*="font-size:2em"]),
    .digest-content > table:has(strong[style*="font-size: 2em"]),
    .digest-content > table:has(strong[style*="font-size:1.8em"]),
    .digest-content > table:has(strong[style*="font-size: 1.8em"]) {
        width: 100%;
    }

    .digest-content > table:has(strong[style*="font-size:2em"]) tr,
    .digest-content > table:has(strong[style*="font-size: 2em"]) tr,
    .digest-content > table:has(strong[style*="font-size:1.8em"]) tr,
    .digest-content > table:has(strong[style*="font-size: 1.8em"]) tr {
        display: flex;
        flex-wrap: wrap;
    }

    .digest-content > table:has(strong[style*="font-size:2em"]) td,
    .digest-content > table:has(strong[style*="font-size: 2em"]) td,
    .digest-content > table:has(strong[style*="font-size:1.8em"]) td,
    .digest-content > table:has(strong[style*="font-size: 1.8em"]) td {
        flex: 1 1 45%;
        min-width: 0;
        padding: 8px 4px !important;
    }

    .digest-content > table strong[style*="font-size:2em"],
    .digest-content > table strong[style*="font-size: 2em"] {
        font-size: 1.5em !important;
    }

    .digest-content > table strong[style*="font-size:1.8em"],
    .digest-content > table strong[style*="font-size: 1.8em"] {
        font-size: 1.4em !important;
    }

    /* Regular bare tables — allow horizontal scroll on mobile.
       Keep display:table so they fill width; override overflow:hidden
       from desktop border-radius clipping. */
    .digest-content > table:not(:has(strong[style*="font-size"])) {
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }

    .digest-content .wide-table {
        margin-left: -1rem;
        margin-right: -1rem;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    /* Wide tables — keep full width at medium sizes, allow natural sizing at small */
    .digest-content .wide-table table {
        min-width: 0;
    }

    /* Allow headers to wrap on mobile instead of forcing nowrap */
    .digest-content .wide-table th {
        white-space: normal;
    }

    /* Remove the 200px min-width on mobile — let columns snap to content */
    .digest-content .wide-table td:nth-child(2) {
        min-width: 0;
    }

    .digest-content h1 {
        font-size: 1.5rem;
    }

    /* Bare tables — responsive on mobile */
    .digest-content > table:not(:has(strong[style*="font-size"])) {
        font-size: 0.85rem;
    }

    .digest-content > table:not(:has(strong[style*="font-size"])) th,
    .digest-content > table:not(:has(strong[style*="font-size"])) td {
        padding: 0.4rem 0.5rem;
    }

    .digest-content img[style*="float:left"],
    .digest-content img[style*="float: left"] {
        float: none !important;
        display: block;
        margin: 0 auto 1em !important;
    }

    /* Subscribe & nav additions responsive */
    .nav-subscribe {
        margin-left: 0;
        margin-top: 0.3rem;
        font-size: 0.8rem;
        padding: 0.3rem 0.8rem;
    }

    .digest-nav {
        flex-direction: column;
        gap: 0.75rem;
    }

    .digest-nav a {
        max-width: 100%;
    }

    .digest-nav-next {
        text-align: left;
    }

    .post-subscribe-cta {
        margin-left: 1rem;
        margin-right: 1rem;
        padding: 1.5rem 1rem;
    }
}

@media (max-width: 480px) {
    .post-title {
        font-size: 1.5rem;
    }

    .post-meta {
        flex-direction: column;
        gap: 0.3rem;
    }

    .digest-content .wide-table table {
        font-size: 0.8rem;
        width: auto;
    }

    .digest-content .wide-table th,
    .digest-content .wide-table td {
        padding: 0.4rem 0.5rem;
    }
}


/* ============================================================
   ARTICLE TEMPLATE (long-form articles, tributes, profiles)
   ============================================================ */
.article-post {
    max-width: var(--digest-width);
}

.article-header {
    max-width: var(--content-width);
    margin-left: auto;
    margin-right: auto;
}

.article-feature-image {
    max-width: var(--digest-width);
}

.article-content {
    position: relative;
    font-size: 1.05rem;
    line-height: 1.8;
}

.article-content h2 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 600;
    margin: 3em 0 1em;
    color: var(--color-text);
}

.article-content h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 2em 0 0.8em;
    color: var(--color-text);
}

.article-content p {
    margin: 0 0 1.3em;
}

.article-content em {
    font-family: var(--font-display);
}

/* ----- Article: Pull Quotes ----- */
.pull-quote {
    margin: 1.8em 0;
    padding: 1em 1.4em;
    border-left: 4px solid var(--color-accent);
    background: var(--color-bg-card);
    border-radius: 4px;
    font-style: italic;
}

.pull-quote p {
    margin: 0 0 0.5em;
}

.pull-quote p:last-child {
    margin-bottom: 0;
}

.pull-quote .attribution {
    font-style: normal;
    font-size: 0.88em;
    color: var(--color-text-secondary);
}

/* ----- Article: Floating TOC ----- */
.article-toc {
    display: none;
}

@media (min-width: 1200px) {
    .article-toc {
        display: block;
        position: absolute;
        left: -170px;
        top: 0;
        width: 150px;
        height: 100%;
    }

    .article-toc-inner {
        position: sticky;
        top: 2rem;
        max-height: calc(100vh - 4rem);
        overflow-y: auto;
    }

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

    .article-toc-list li {
        margin: 0;
    }

    .article-toc-list a {
        display: block;
        padding: 0.3rem 0 0.3rem 0.65rem;
        font-family: var(--font-body);
        font-size: 0.7rem;
        font-weight: 500;
        line-height: 1.35;
        color: var(--color-text-secondary);
        text-decoration: none;
        border-left: 2px solid transparent;
        transition: color 0.15s, border-color 0.15s;
    }

    .article-toc-list a:hover {
        color: var(--color-accent);
        text-decoration: none;
    }

    .article-toc-list a.active {
        color: var(--color-accent);
        border-left-color: var(--color-accent);
        font-weight: 600;
    }
}


/* ============================================================
   DARK MODE (auto — follows OS preference)
   ============================================================ */
@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --color-accent: #6b9ac4;
        --color-accent-light: #1e2a3a;
        --color-bg: #1a1a2e;
        --color-text: #e8e8f0;
        --color-text-secondary: #a0a0b0;
        --color-border: #2e2e42;
        --color-border-light: #252538;
        --color-bg-alt: #1e1e32;
        --color-bg-card: #22223a;
        --color-success: #4caf6e;
        --color-danger: #e57373;
    }

    /* Hardcoded grays → use custom property */
    .site-footer-copyright {
        color: var(--color-text-secondary);
    }

    .post-card-meta {
        color: var(--color-text-secondary);
    }

    .sidebar-tweet-meta {
        color: var(--color-text-secondary);
    }

    /* Button hover — lighter blue for dark bg */
    .nav-subscribe:hover {
        background: #4a7aaa;
    }

    .btn-subscribe:hover {
        background: #4a7aaa;
    }

    /* Box shadows — stronger on dark backgrounds */
    .featured-card-link {
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    }

    .featured-card-link:hover {
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    }

    .sidebar-tweets {
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    }

    .digest-content div[style*="border-left:4px solid #3d5a80"],
    .digest-content div[style*="border-left: 4px solid #3d5a80"] {
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    }

    .digest-content img[style*="border-radius:6px"],
    .digest-content img[style*="border-radius: 6px"] {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }

    /* Award quote boxes — override inline background and translation text color */
    .digest-content div[style*="border-left:4px solid #3d5a80"],
    .digest-content div[style*="border-left: 4px solid #3d5a80"] {
        background: var(--color-bg-card) !important;
    }

    .digest-content div[style*="border-left:4px"] p[style*="color:#777"],
    .digest-content div[style*="border-left: 4px"] p[style*="color:#777"],
    .digest-content div[style*="border-left:4px"] p[style*="color: #777"],
    .digest-content div[style*="border-left: 4px"] p[style*="color: #777"] {
        color: var(--color-text-secondary) !important;
    }

    /* Pull-quote boxes (article template) — shadow for depth on dark bg */
    .pull-quote {
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    }

    /* Article feature image — same inversion as digest headers */
    .article-feature-image img {
        filter: invert(0.88) hue-rotate(180deg);
    }

    /* Bare table bloc labels — use dark-mode accent */
    .digest-content > table td[colspan][style*="text-transform:uppercase"] {
        color: var(--color-accent) !important;
        border-bottom-color: var(--color-border) !important;
    }

    /* Bare table zebra striping — dark mode override */
    .digest-content > table:not(:has(strong[style*="font-size"])) tr:nth-child(even) {
        background: var(--color-bg-alt);
    }

    .digest-content > table:not(:has(strong[style*="font-size"])) tr:hover {
        background: var(--color-accent-light);
    }

    /* Party color dots — dark ring instead of white */
    .digest-content span[style*="border-radius:50%"],
    .digest-content span[style*="border-radius: 50%"] {
        box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.4);
    }

    /* Generated header images — invert light palette to dark.
       The headers use #fafafa bg / #1a1a1a text / #3d5a80 accent.
       invert() flips light↔dark; hue-rotate(180deg) restores original
       hues (blue accent, green/red deltas) that invert shifted by 180°. */
    .featured-card-image img,
    .digest-feature-image img,
    .post-image img {
        filter: invert(0.88) hue-rotate(180deg);
    }

    /* Listing thumbnails — gentle dim only */
    .post-card-image img {
        filter: brightness(0.85) contrast(1.1);
    }

    /* ── SVG chart dark-mode overrides ───────────────────────────
       Charts use inline styles (Ghost strips <style> blocks), so
       we override hardcoded light-theme fills/strokes from the
       theme CSS using !important on specificity selectors.
       ──────────────────────────────────────────────────────────── */

    /* Primary text: #1a1a2e → light */
    .digest-content svg text[style*="fill:#1a1a2e"],
    .digest-content svg text[style*="fill: #1a1a2e"] {
        fill: var(--color-text) !important;
    }

    /* Secondary text: #555 → muted light */
    .digest-content svg text[style*="fill:#555"],
    .digest-content svg text[style*="fill: #555"] {
        fill: var(--color-text-secondary) !important;
    }

    /* Grid lines: #eee stroke → subtle dark lines */
    .digest-content svg line[style*="stroke:#eee"],
    .digest-content svg line[style*="stroke: #eee"] {
        stroke: var(--color-border) !important;
    }

    /* Grid polygons (radar rings): #eee stroke */
    .digest-content svg polygon[style*="stroke:#eee"],
    .digest-content svg polygon[style*="stroke: #eee"] {
        stroke: var(--color-border) !important;
    }

    /* Donut center hole and white backgrounds: #fff → dark bg */
    .digest-content svg circle[style*="fill:#fff"],
    .digest-content svg circle[style*="fill: #fff"] {
        fill: var(--color-bg) !important;
    }

    /* Gauge/progress background rects: #eee fill → dark card bg */
    .digest-content svg rect[style*="fill:#eee"],
    .digest-content svg rect[style*="fill: #eee"] {
        fill: var(--color-border) !important;
    }

    /* Heatmap empty cells: #f5f5f5 → dark bg-alt */
    .digest-content svg rect[style*="fill:#f5f5f5"],
    .digest-content svg rect[style*="fill: #f5f5f5"] {
        fill: var(--color-bg-alt) !important;
    }

    /* Absent vote cells: #ddd, #ccc → dark muted */
    .digest-content svg rect[style*="fill:#ddd"],
    .digest-content svg rect[style*="fill: #ddd"] {
        fill: #3a3a50 !important;
    }

    .digest-content svg rect[style*="fill:#ccc"],
    .digest-content svg rect[style*="fill: #ccc"] {
        fill: #3a3a50 !important;
    }

    .digest-content svg rect[style*="fill:#e8e8e8"],
    .digest-content svg rect[style*="fill: #e8e8e8"] {
        fill: #33334a !important;
    }

    /* Heatmap dissent borders: #000 → bright accent for visibility */
    .digest-content svg rect[style*="stroke:#000"],
    .digest-content svg rect[style*="stroke: #000"] {
        stroke: #ffd700 !important;
    }

    /* Sparkline area fills — keep same colors but on dark bg they look fine */
    /* No override needed — translucent fills work on both themes */

    /* Submissions card backgrounds: #ffffff → dark card bg */
    .digest-content svg rect[style*="fill:#ffffff"],
    .digest-content svg rect[style*="fill: #ffffff"] {
        fill: var(--color-bg-card) !important;
    }

    /* Submissions card borders: #cdd5de → dark border */
    .digest-content svg rect[style*="stroke:#cdd5de"],
    .digest-content svg rect[style*="stroke: #cdd5de"] {
        stroke: var(--color-border) !important;
    }

    /* Submissions card icons: light blue → slightly brighter for dark bg */
    .digest-content svg text[style*="fill:#a8c4e0"],
    .digest-content svg text[style*="fill: #a8c4e0"] {
        fill: var(--color-accent) !important;
    }

    /* Chart title/accent text: #3d5a80 → lighter blue for dark bg */
    .digest-content svg text[style*="fill:#3d5a80"],
    .digest-content svg text[style*="fill: #3d5a80"] {
        fill: var(--color-accent) !important;
    }

    /* Accent axis lines: #3d5a80 stroke → lighter */
    .digest-content svg line[style*="stroke:#3d5a80"],
    .digest-content svg line[style*="stroke: #3d5a80"] {
        stroke: var(--color-accent) !important;
    }

    /* Axis tick strokes: #555 → muted light */
    .digest-content svg line[style*="stroke:#555"],
    .digest-content svg line[style*="stroke: #555"] {
        stroke: var(--color-text-secondary) !important;
    }

    /* Numbers zone — darker panel on dark background */
    .digest-numbers {
        background: var(--color-bg-alt);
        border-color: var(--color-border);
    }

    .digest-numbers > table:has(strong[style*="font-size:2em"]),
    .digest-numbers > table:has(strong[style*="font-size: 2em"]) {
        background: var(--color-bg);
    }

    /* ── Article SVG chart dark-mode overrides ─────────────────────
       Mirrors the digest SVG overrides above for charts embedded in
       .article-content (custom-article.hbs — used by spotlights).
       ──────────────────────────────────────────────────────────── */

    /* Primary text: #1a1a2e → light */
    .article-content svg text[style*="fill:#1a1a2e"],
    .article-content svg text[style*="fill: #1a1a2e"] {
        fill: var(--color-text) !important;
    }

    /* Secondary text: #555 → muted light */
    .article-content svg text[style*="fill:#555"],
    .article-content svg text[style*="fill: #555"] {
        fill: var(--color-text-secondary) !important;
    }

    /* Grid lines: #eee → dark border */
    .article-content svg line[style*="stroke:#eee"],
    .article-content svg line[style*="stroke: #eee"] {
        stroke: var(--color-border) !important;
    }

    /* Accent bars: #3d5a80 → lighter blue */
    .article-content svg rect[style*="fill:#3d5a80"],
    .article-content svg rect[style*="fill: #3d5a80"] {
        fill: var(--color-accent) !important;
    }

    /* Accent text: #3d5a80 → lighter blue */
    .article-content svg text[style*="fill:#3d5a80"],
    .article-content svg text[style*="fill: #3d5a80"] {
        fill: var(--color-accent) !important;
    }

    /* Axis/annotation lines: #555 stroke → muted light */
    .article-content svg line[style*="stroke:#555"],
    .article-content svg line[style*="stroke: #555"] {
        stroke: var(--color-text-secondary) !important;
    }
}


/* ============================================================
   PRINT
   ============================================================ */
@media print {
    .site-header,
    .site-footer,
    .site-nav,
    .nav-subscribe,
    .hero-subscribe,
    .post-subscribe-cta,
    .digest-nav,
    .post-lang-toggle,
    .sidebar-tweets,
    .digest-toc,
    .article-toc {
        display: none;
    }

    .post,
    .digest-post,
    .article-post {
        max-width: none;
        padding: 0;
    }

    .digest-content .wide-table {
        overflow: visible;
    }

    a {
        color: inherit;
        text-decoration: underline;
    }
}
