/* ===== CSS VARIABLES ===== */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --text-primary: #1a1a1a;
    --text-secondary: #555555;
    --text-muted: #888888;
    --accent: #ff0000;
    --border: #e0e0e0;
    --card-bg: #ffffff;
    --card-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

body.dark-mode {
    --bg-primary: #1a1a1a;
    --bg-secondary: #252525;
    --text-primary: #e0e0e0;
    --text-secondary: #aaaaaa;
    --text-muted: #777777;
    --accent: #ff3333;
    --border: #333333;
    --card-bg: #222222;
    --card-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* ===== TYPOGRAPHY ===== */
body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* ===== ECHIDNA LAYOUT (Homepage) ===== */
.echidna-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 20px;
}

.echidna-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 32px;
    align-items: start;
}

.echidna-content {
    min-width: 0;
}

.echidna-sidebar {
    min-width: 0;
}

/* ===== LATEST STORIES HEADING ===== */
.latest-stories-heading {
    font-size: 28px;
    font-weight: 800;
    margin: 0 0 24px;
    color: var(--text-primary);
}


/* ===== STICKY SIDEBAR (flex layout to avoid grid sticky bugs) ===== */
@media (min-width: 901px) {
    .echidna-layout {
        display: flex !important;
        gap: 32px;
        align-items: flex-start;
    }
    .echidna-content {
        flex: 1;
        min-width: 0;
    }
    .echidna-sidebar {
        width: 340px;
        flex-shrink: 0;
        position: sticky;
        top: 109px;
        max-height: calc(100vh - 129px);
        overflow-y: auto;
    }
}

/* ===== ARTICLE GRID AND CARDS ===== */
.article-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 28px;
}

@media (max-width: 900px) {
    .article-grid {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }
}

@media (max-width: 600px) {
    .article-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.article-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.article-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transform: translateY(-1px);
}

/* Card body */
.article-card .card-body {
    padding: 20px;
}

/* Category badge on cards */
.card-category {
    display: inline-block;
    font-size: 0.7em;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--accent);
    margin-bottom: 8px;
}

/* Card title */
.article-card .card-title {
    font-size: 1.15em;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 8px;
}

.article-card .card-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.15s;
}

.article-card .card-title a:hover {
    color: var(--accent);
}

/* Card excerpt */
.article-card .card-excerpt {
    font-size: 0.88em;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Card excerpt link wrapper */
.article-card .card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Card meta (date) */
.article-card .card-meta {
    font-size: 0.78em;
    color: var(--text-muted);
}

/* ===== CARD IMAGES (base) ===== */
.card-image-link {
    display: block;
    overflow: hidden;
    line-height: 0;
}

.card-image {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.article-card:hover .card-image {
    transform: scale(1.03);
}

/* ===== SIDEBAR ===== */
/* ===== SIDEBAR FOOTER LINKS ===== */
.sidebar-footer-links {
    padding: 14px 20px;
    text-align: center;
    font-size: 0.82em;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
}
.sidebar-footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s;
}
.sidebar-footer-links a:hover {
    color: var(--accent);
}
.footer-link-sep {
    color: var(--border);
    margin: 0 10px;
    user-select: none;
}

.sidebar-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 24px;
}

.sidebar-card:last-child {
    margin-bottom: 0;
}

.sidebar-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.sidebar-card-header h3,
.sidebar-card-title {
    font-size: 1em;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

/* Trending list */
.sidebar-trending {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-trending li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.sidebar-trending li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.sidebar-trending li:first-child {
    padding-top: 0;
}

.sidebar-trending a {
    display: flex;
    flex-direction: column;
    gap: 3px;
    text-decoration: none;
    color: var(--text-primary);
    transition: color 0.15s;
}

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

.trending-title {
    font-size: 0.88em;
    font-weight: 600;
    line-height: 1.3;
}

.trending-date {
    font-size: 0.75em;
    color: var(--text-muted);
}

.trending-empty {
    color: var(--text-muted);
    font-size: 0.85em;
}

/* Category badges in sidebar */
.sidebar-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sidebar-cat-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid;
    font-size: 0.8em;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.15s;
}

.sidebar-cat-badge:hover {
    opacity: 0.75;
}

.sidebar-cat-name {
    display: inline;
}

/* Newsletter form */
.sidebar-newsletter-text {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin: 0 0 12px;
    line-height: 1.4;
}

.newsletter-form {
    display: flex;
    gap: 8px;
}

.newsletter-form input[type="email"] {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85em;
    font-family: inherit;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.newsletter-form input[type="email"]::placeholder {
    color: var(--text-muted);
}

.newsletter-form button {
    padding: 10px 20px;
    background: var(--accent);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85em;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.15s;
}

.newsletter-form button:hover {
    opacity: 0.85;
}

/* Ad slot in sidebar */
.ad-slot-sidebar {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75em;
}

.ad-slot-sidebar p {
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ad-slot-sidebar span {
    display: block;
    padding: 32px 20px;
    background: var(--bg-secondary);
    border-radius: 6px;

/* ===== KO-FI SUPPORT CARD ===== */
.kofi-card {
    text-align: center;
    padding: 24px 20px !important;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-primary));
    border: 1px solid var(--border) !important;
}

.kofi-card-title {
    font-size: 1em;
    font-weight: 700;
    margin: 0 0 8px;
    color: #ff5e5b !important;
}

.kofi-card-message {
    font-size: 0.85em;
    color: var(--text-secondary);
    margin: 0 0 16px;
    line-height: 1.5;
}

.kofi-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: #ff5e5b;
    color: #fff !important;
    border-radius: 24px;
    font-weight: 600;
    font-size: 0.9em;
    text-decoration: none !important;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 2px 8px rgba(255,94,91,0.3);
}

.kofi-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255,94,91,0.4);
    color: #fff !important;
}

.kofi-icon {
    font-size: 1.2em;
}

/* spacer — prevents LiteSpeed CSS nesting bug */
.kofi-spacer { display: none; }
/* ===== KO-FI IN-ARTICLE BANNER ===== */
.kofi-banner {
    margin: 36px 0;
    padding: 28px 32px;
    background: var(--bg-secondary);
    border: 2px solid #ff5e5b;
    border-radius: 12px;
    text-align: center;
}

.kofi-banner-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.kofi-banner-message {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.95em;
    line-height: 1.7;
    color: var(--text-secondary);
    margin: 0;
    max-width: 600px;
}

.kofi-banner-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 28px;
    background: #ff5e5b;
    color: #fff !important;
    border-radius: 24px;
    font-weight: 600;
    font-size: 0.9em;
    text-decoration: none !important;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 2px 8px rgba(255,94,91,0.35);
}

.kofi-banner-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255,94,91,0.5);
    color: #fff !important;
}

    text-decoration: none !important;    transition: transform 0.15s, box-shadow 0.15s;    box-shadow: 0 2px 8px rgba(255,94,91,0.35);}.kofi-banner-cta:hover {    transform: translateY(-1px);    box-shadow: 0 4px 16px rgba(255,94,91,0.5);    color: #fff !important;}
/* ===== CATEGORY PAGE GRID ===== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.cat-grid-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s, transform 0.2s;
}

.cat-grid-card:hover {
    box-shadow: var(--card-shadow);
    transform: translateY(-2px);
}

.cat-grid-card h3 {
    font-size: 0.95em;
    font-weight: 700;
    margin: 0;
}

.cat-grid-card p {
    font-size: 0.8em;
    color: var(--text-muted);
    margin: 0;
}

.cat-icon {
    font-size: 1.8em;
}
/* ===== AGGRESSIVE MOBILE FIXES ===== */

/* Prevent any horizontal scroll at root level */
html {
    overflow-x: clip;
    max-width: 100vw;
}
body {
    overflow-x: clip;
    max-width: 100vw;
}

/* Universal box-sizing */
*, *::before, *::after {
    box-sizing: border-box;
}

/* All images must stay within viewport */
img, video, iframe, embed, object {
    max-width: 100%;
    height: auto;
}

/* Grid protection */
.echidna-content,
.echidna-sidebar {
    min-width: 0;
    max-width: 100%;
}

/* Container must never overflow */
.echidna-container {
    width: 100%;
    max-width: 100vw;
    overflow-x: clip;
}

/* Sidebar cards: prevent overflow */
.sidebar-card,
.article-card .card-body {
    overflow-wrap: break-word;
    word-break: break-word;
}
.article-card .card-title,
.article-card .card-excerpt {
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Newsletter form: wrap on small screens */
.newsletter-form {
    flex-wrap: wrap;
    min-width: 0;
}
.newsletter-form input[type="email"] {
    min-width: 0;
    flex: 1 1 120px;
}


/* Mobile: switch back to grid */
@media (max-width: 900px) {
    .echidna-layout {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .echidna-sidebar {
        position: static;
        width: auto;
    }
}

/* ===== MOBILE BREAKPOINTS ===== */

/* Tablet and below */
@media (max-width: 900px) {
    .echidna-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .echidna-container {
        padding: 24px 16px;
    }
    .card-image {
        height: 140px;
    }
}

/* Phone */
@media (max-width: 600px) {
    .echidna-container {
        padding: 16px 12px;
    }
    .card-image {
        height: 120px;
    }
    .article-card .card-body {
        padding: 14px;
    }
    .sidebar-card {
        padding: 14px;
    }
    .latest-stories-heading {
        font-size: 22px;
        margin-bottom: 16px;
    }
    .article-card .card-title {
        font-size: 0.95em;
    }
    .article-card .card-excerpt {
        font-size: 0.82em;
    }
}

/* Small phone */
@media (max-width: 380px) {
    .echidna-container {
        padding: 12px 8px;
    }
    .card-image {
        height: 100px;
    }
    .article-card .card-body {
        padding: 10px;
    }
    .sidebar-card {
        padding: 12px;
    }
}
/* ===== HIDE ASTRA DEFAULTS (front page) ===== */
/* HOME CONTAINER: match archive width (Astra default 1240px) */
.home #primary { width: 100% !important; }
.home .ast-row { margin: 0 !important; }
.home .content-area { margin: 0 !important; }
.home article.page { padding: 0 !important; }
.home .entry-header, .home .entry-header .entry-title { display: none !important; }

/* ===== FOOTER ===== */
.site-footer {
    background: #1a1a1a !important;
    color: #999 !important;
    padding: 48px 0 24px !important;
    border-top: 3px solid var(--accent);
    margin-top: 60px;
}
.site-footer a { color: #999 !important; }
.site-footer a:hover { color: var(--accent) !important; }
.site-footer .ast-container { max-width: 1280px !important; padding: 0 20px !important; }

.footer-widget-area .widget { background: transparent; border: none; padding: 0; }
.footer-widget-area .widget-title { color: #fff !important; border-bottom: 1px solid #333; }

/* ===== CATEGORY PAGE ===== */
.category-header { margin: 20px 0; padding-bottom: 16px; border-bottom: 2px solid var(--accent); }
.category-header h1 { font-size: 2em; font-weight: 700; margin: 0; }
.category-desc { color: var(--text-secondary); margin-top: 6px; font-size: 0.95em; }

/* ===== INNER PAGES — DARK MODE FIX ===== */
/* Astra sets white backgrounds on articles/containers that break dark mode.
   Force dark backgrounds and proper text color on all inner pages. */

body.dark-mode article,
body.dark-mode .ast-article-single,
body.dark-mode .ast-article-post,
body.dark-mode .ast-article-inner,
body.dark-mode .entry-content,
body.dark-mode .ast-container,
body.dark-mode #primary,
body.dark-mode #secondary,
body.dark-mode .content-area,
body.dark-mode .site-main,
body.dark-mode .ast-row,
body.dark-mode .ast-col-sm-12,
body.dark-mode .comment-respond,
body.dark-mode .comments-area,
body.dark-mode .post-navigation,
body.dark-mode .ast-separate-container,
body.dark-mode .ast-plain-container,
body.dark-mode .ast-archive-description,
body.dark-mode .site-below-footer-wrap,
body.dark-mode .ast-mobile-header-content { 
    background: var(--bg-primary) !important;
}

/* Mobile hamburger menu inner containers */
body.dark-mode .ast-mobile-header-wrap,
body.dark-mode .ast-mobile-header-wrap .ast-main-header-wrap,
body.dark-mode .ast-mobile-header-wrap .main-header-bar-wrap,
body.dark-mode .ast-mobile-header-wrap .ast-primary-header-bar,
body.dark-mode .ast-mobile-header-wrap .site-primary-header-wrap,
body.dark-mode .ast-builder-menu-mobile,
body.dark-mode .ast-main-header-bar-alignment,
body.dark-mode .main-header-bar-navigation,
body.dark-mode .main-header-bar-navigation .main-navigation,
body.dark-mode .main-header-bar-navigation .main-navigation ul {
    background: var(--bg-primary) !important;
}

/* Hamburger toggle button */
body.dark-mode .menu-toggle,
body.dark-mode .ast-mobile-menu-trigger-minimal,
body.dark-mode .ast-mobile-header-wrap .ast-button-wrap .menu-toggle {
    background: transparent !important;
    color: var(--text-primary) !important;
}

/* Mobile nav dropdown — menu items and links */
body.dark-mode .ast-mobile-header-content .menu-item,
body.dark-mode .ast-mobile-header-content .page_item,
body.dark-mode .ast-mobile-header-content .menu-link,
body.dark-mode .ast-mobile-header-content a,
body.dark-mode .ast-mobile-header-content li,
body.dark-mode .ast-header-break-point .main-navigation ul .menu-item .menu-link,
body.dark-mode .ast-header-break-point .main-navigation ul li,
body.dark-mode .ast-header-break-point .main-navigation ul li a {
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
}
body.dark-mode .ast-mobile-header-content .current-menu-item > a,
body.dark-mode .ast-mobile-header-content .current-menu-item {
    background: var(--bg-secondary) !important;
    color: var(--accent) !important;
}

/* Fix text color on inner pages */
body.dark-mode article,
body.dark-mode .entry-content,
body.dark-mode .entry-content p,
body.dark-mode .entry-content li,
body.dark-mode .ast-excerpt-container,
body.dark-mode .ast-excerpt-container p,
body.dark-mode .read-more { 
    color: var(--text-primary) !important; 
}

/* Category page post listings */
body.dark-mode .ast-article-post .entry-title a { color: var(--text-primary) !important; }
body.dark-mode .ast-article-post .entry-title a:hover { color: var(--accent) !important; }

/* Post meta / breadcrumbs */
body.dark-mode .entry-meta,
body.dark-mode .entry-meta a,
body.dark-mode .ast-breadcrumbs-wrapper,
body.dark-mode .ast-breadcrumbs-wrapper a { 
    color: var(--text-muted) !important;
}

/* Comments area */
body.dark-mode .comment-respond label,
body.dark-mode .comments-title,
body.dark-mode .comment-reply-title { color: var(--text-primary) !important; }
body.dark-mode .comment-form-comment textarea,
body.dark-mode .comment-form-author input,
body.dark-mode .comment-form-email input,
body.dark-mode .comment-form-url input,
body.dark-mode textarea,
body.dark-mode input[type="text"],
body.dark-mode input[type="email"],
body.dark-mode input[type="url"] {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border) !important;
}

/* Archive/category description */
body.dark-mode .archive-description,
body.dark-mode .term-description { color: var(--text-secondary) !important; }
body.dark-mode .page-header { background: transparent !important; }

/* Archive post card metadata */
body.dark-mode .ast-article-post .posted-on,
body.dark-mode .ast-article-post .posted-by,
body.dark-mode .ast-article-post .ast-taxonomy-container { color: var(--text-muted) !important; }

/* Single post navigation */
body.dark-mode .post-navigation .nav-links a { color: var(--text-secondary) !important; }
body.dark-mode .post-navigation .nav-links a:hover { color: var(--accent) !important; }

/* ===== INNER PAGES — LIGHT MODE TWEAKS ===== */
/* Ensure good contrast in light mode too */
.category-page .entry-content p,
.archive .entry-content p,
.single .entry-content p,
.single .entry-content li {
    color: var(--text-primary);
}
.ast-article-post .entry-title a { color: var(--text-primary); }




/* ===== STICKY HEADER (fixed — parent wrappers all same height so sticky won't work) ===== */
#masthead {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--bg-primary) !important;
    border-bottom: 1px solid var(--border);
}
/* Push page content down so it doesn't hide behind the fixed header */
#page {
    padding-top: 85px;
}
body.dark-mode #masthead {
    background: var(--bg-primary) !important;
    border-bottom-color: var(--border);
}
/* ===== CENTER NAVIGATION ===== */
.ast-primary-header-bar {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}
.main-header-bar-navigation {
    flex: 1;
    display: flex;
    justify-content: center;
}
.main-navigation ul {
    justify-content: center !important;
}


/* ===== HIDE LOGIN IN NAV ===== */
.btn-login,
a[href*="wp-login"] {
    display: none !important;
}
li:has(> .btn-login),
li:has(> a[href*="wp-login"]) {
    display: none !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .echidna-container { padding: 24px 16px; }
    .latest-stories-heading { font-size: 24px; }
    .main-navigation a { padding: 4px 8px !important; font-size: 13px; }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}
.article-card { animation: fadeInUp 0.35s ease-out both; }
.article-card:nth-child(1) { animation-delay: 0.05s; }
.article-card:nth-child(2) { animation-delay: 0.1s; }
.article-card:nth-child(3) { animation-delay: 0.15s; }
.article-card:nth-child(4) { animation-delay: 0.2s; }
.article-card:nth-child(5) { animation-delay: 0.25s; }
.article-card:nth-child(6) { animation-delay: 0.3s; }

/* ===== UTILITY ===== */
/* Hide Astra skip link visually */
.ast-skip-link, .skip-link, .skip-to-content { display: none !important; }

/* Hide Astra credit in footer */
.site-footer a[href*="wpastra"],
.site-footer-below-section { display: none !important; }

/* Also hide the separator "|" before the credit */
.site-footer .ast-builder-footer-grid-columns + * { display: none !important; }

/* Clean up Astra's default page title on inner pages */
.page .entry-header { margin-bottom: 24px; }
.page .entry-header .entry-title { font-size: 2em; font-weight: 700; }

/* Ensure sidebar cards have proper spacing */
.echidna-sidebar > * { margin: 0; }

/* Make categories sidebar scroll if needed */
.sidebar-categories { max-height: none; overflow: visible; }



/* ===== DARK MODE: HEADER NAVIGATION ===== */
body.dark-mode .main-header-menu a,
body.dark-mode .main-header-menu .menu-link,
body.dark-mode .main-navigation ul li a,
body.dark-mode .ast-primary-header-bar .main-navigation a,
body.dark-mode #masthead .menu-item a,
body.dark-mode .main-header-menu .menu-link,
body.dark-mode a.menu-link {
    color: #cccccc !important;
}
body.dark-mode .main-header-menu a:hover,
body.dark-mode .main-header-menu .menu-link:hover,
body.dark-mode .main-navigation ul li a:hover,
body.dark-mode #masthead .menu-item a:hover {
    color: var(--accent) !important;
}
body.dark-mode .main-header-menu .current-menu-item > a,
body.dark-mode .main-navigation .current-menu-item > a,
body.dark-mode #masthead .current-menu-item > a {
    color: var(--accent) !important;
}
/* ===== DARK MODE: HEADER & BODY FIXES ===== */
body.dark-mode,
body.dark-mode .ast-primary-header-bar,
body.dark-mode .main-header-bar,
body.dark-mode .main-header-bar-wrap,
body.dark-mode .site-header,
body.dark-mode .site-below-footer-wrap,
body.dark-mode .ast-small-footer,
body.dark-mode .ast-builder-grid-row-container-inner,
body.dark-mode footer .ast-container,
body.dark-mode footer .ast-builder-footer-grid-columns {
    background: var(--bg-primary) !important;
}

/* Catch any stray white backgrounds at the bottom */
body.dark-mode .ast-builder-footer-grid-columns,
body.dark-mode .site-footer-section,
body.dark-mode .ast-footer-copyright,
body.dark-mode .site-below-footer-wrap[data-section="section-below-footer-builder"],
body.dark-mode .site-primary-footer-wrap[data-section="section-primary-footer-builder"] {
    background: #1a1a1a !important;
}

/* ===== DARK MODE HEADINGS ===== */
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6,
body.dark-mode .entry-content h1,
body.dark-mode .entry-content h2,
body.dark-mode .entry-content h3,
body.dark-mode .entry-content h4,
body.dark-mode .entry-content h5,
body.dark-mode .entry-content h6,
body.dark-mode .entry-title a {
    color: #e0e0e0 !important;
}
body.dark-mode .entry-content,
body.dark-mode .entry-content p {
    color: #cccccc;
}
body.dark-mode .entry-content a {
    color: #ff3333 !important;
}
body.dark-mode .entry-content a:hover {
    color: #ff6666 !important;
}
body.dark-mode hr {
    border-color: #333 !important;
}
body.dark-mode .ast-separate-container .ast-article-single {
    background-color: #1a1a1a !important;
}

/* ===== MOBILE TOGGLE VISIBILITY ===== */
/* On mobile, the toggle is inside the hamburger dropdown menu.
   Ensure it remains visible and tappable when the menu is open. */
/* ===== THEME TOGGLE BUTTON ===== */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.3s;
    line-height: 0;
    flex-shrink: 0;
}
.theme-toggle:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--text-muted);
    transform: rotate(15deg);
}
.theme-toggle svg {
    display: block;
    width: 18px;
    height: 18px;
}
/* Wrapper list item */
.theme-toggle-item {
    display: flex;
    align-items: center;
}
/* Mobile: keep it inline in the menu */
.ast-mobile-header-content .theme-toggle {
    width: 36px;
    height: 36px;
    margin: 4px auto;
}/* ===== ARTICLE CARD IMAGES ===== */
.card-image-link {
    display: block;
    overflow: hidden;
    line-height: 0;
}
.card-image {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.article-card:hover .card-image {
    transform: scale(1.03);
}

/* ===== CARD IMAGE MOBILE SIZES ===== */
@media (max-width: 900px) {
    .card-image { height: 140px; }
}
@media (max-width: 600px) {
    .card-image { height: 120px; }
}
@media (max-width: 380px) {
    .card-image { height: 100px; }
}
/* ===== INFINITE SCROLL SENTINEL ===== */
.scroll-sentinel {
    grid-column: 1 / -1;
    width: 100%;
    height: 1px;
    overflow: hidden;
}
.scroll-sentinel.loading::after {
    content: '';
    display: block;
    width: 32px;
    height: 32px;
    margin: 24px auto;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Dark/light logo swap ── */
.ast-logo-title-inline .site-title { display: none; }
.custom-logo-dark { display: none; }
body.dark-mode .custom-logo-light { display: none; }
body.dark-mode .custom-logo-dark { display: inline-block !important; }
.custom-logo { max-width: 100%; height: auto; }

/* ===== SHARE BUTTONS ===== */
.share-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 40px 0 0;
    padding: 20px 0;
    border-top: 1px solid var(--border);
}
.share-label {
    font-size: 0.8em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-right: 8px;
}
.entry-content .share-buttons .share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 500;
    color: var(--text-primary) !important;
    text-decoration: none !important;
    background: var(--card-bg);
    transition: all 0.15s ease;
}
.entry-content .share-buttons .share-btn:hover {
    border-color: var(--accent) !important;
    color: var(--accent) !important;
    background: var(--card-bg) !important;
}
.entry-content .share-buttons .share-btn svg {
    flex-shrink: 0;
}
.entry-content .share-buttons .share-btn span {
    line-height: 1;
}
@media (max-width: 600px) {
    .entry-content .share-buttons .share-btn span {
        display: none;
    }
    .entry-content .share-buttons .share-btn {
        padding: 10px;
        justify-content: center;
        min-width: 42px;
    }
}
