html.dark:root {
    --primary-blue: #60a5fa;      
    --primary-blue-dark: #3b82f6; 
    --secondary-grey: #4b5563;    
    --secondary-grey-dark: #6b7280; 
    --text-dark: #f3f4f6;         
    --text-light: #d1d5db;        
    --background-light: #1f2937;  
    --background-white: #374151;  
    --shadow-light: rgba(255, 255, 255, 0.1);
    --shadow-medium: rgba(255, 255, 255, 0.2);
}

html.dark:root body {
    font-family: 'Inter', sans-serif;
    overflow-x: hidden; 
    /*background-color: var(--background-light) !important;
    color: var(--text-dark) !important;*/
}

html.dark:root article {
    background-color: var(--background-light) !important;
}

html.dark:root .article-content p {
    margin-bottom: 1.5rem;
    color: var(--text-light) !important;
}

html.dark:root .article-content a {
    color: var(--primary-blue) !important;
    font-weight: 700;
    text-decoration: underline;
    transition: color 0.2s;
}
html.dark:root .article-content a:hover {
    color: var(--primary-blue-dark) !important;
}

html.dark:root .article-header h1,
html.dark:root page-header h1,
html.dark:root .article-content h2,
html.dark:root .article-content h3 {
    color: var(--primary-blue-dark) !important;
}

/*html.dark:root header {
    box-shadow: none !important;
}*/

html.dark:root .article-content li {
    color: var(--text-dark) !important;
}

html.dark:root article h1 {
    color: var(--text-dark) !important;
}

html.dark:root article {
    border-top-color: var(--text-dark) !important;
}

html.dark:root article h2 {
    border-color: var(--text-dark) !important;
}

html.dark:root .series-sidebar {
    border-color: var(--primary-blue) !important;
    background-color: var(--background-light) !important;
}

html.dark:root .series-sidebar h3 {
    color: var(--text-light) !important;
    border-color: var(--secondary-grey-dark) !important;
}

html.dark:root .series-sidebar li .font-bold.text-secondary-brown {
    color: var(--primary-blue-dark) !important;
}

html.dark:root .series-sidebar li .text-primary-leaf {
    color: var(--primary-blue) !important;
}

html.dark:root .highlight-stat {
    background-color: var(--background-white) !important;
    color: var(--primary-blue) !important;
    padding: 1rem 1.5rem;
    border-left: 5px solid var(--primary-blue) !important;
    font-weight: 800;
    font-size: 1.25rem;
    margin: 2rem 0;
    border-radius: 6px;
    box-shadow: 0 2px 4px var(--shadow-light) !important;
}

html.dark:root .highlight-stat-text {
    color: var(--primary-blue) !important;
    font-weight: bold;
    font-size: 2.25rem;
}

html.dark:root .highlight-stat2 {
    color: var(--primary-blue) !important;
    font-weight: bold;
    font-size: 1.125rem;
}

html.dark:root .highlight-stat2-larger {
    color: var(--primary-blue-darker) !important;
    font-weight: bold;
    font-size: 1.25rem;
}

html.dark:root .keyword {
    font-weight: 700;
    color: var(--primary-blue-dark) !important;
}

html.dark:root .article-content table {
    width: 100% !important;
    display: table;
    table-layout: auto;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling for iPhone/iPad */
    margin: 2rem 0;
    border-collapse: collapse;
    font-size: 1rem;
    /* Uses the dark background from your CSS variables */
    background-color: transparent; 
    min-width: 100%;
    /*border: 1px solid var(--text-dark);*/
}

html.dark:root .article-content th {
    /* Uses the dark accent/grey for headers */
    background-color: var(--background-light); 
    color: var(--primary-blue);
    font-weight: 800;
    text-align: left;
    padding: 12px 16px;
    border-bottom: 2px solid var(--primary-blue);
    border-right: 1px solid transparent;
}

html.dark:root .article-content td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--text-light);
    border-right: 1px solid transparent;
    /* Uses light text for readability on dark background */
    color: var(--color-white); 
    vertical-align: top;
}

/* Zebra striping: Subtle dark grey for alternating rows */
html.dark:root .article-content tr:nth-child(even) {
    background-color: transparent; 
}

html.dark:root page-header {
    /*color: var(--secondary-grey) !important;*/
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    font-size: 2.0rem;
    font-weight: 700;
    text-align: center;
    display: block;
}

html.dark:root .next-in-series-box {
    background-color: var(--background-white) !important;
    border-color: var(--primary-blue) !important;
}

html.dark:root .call-to-action-highlight {
    color: var(--primary-blue) !important;
}

html.dark:root .unpublished-blog-link span {
    color: var(--secondary-grey) !important; 
    transition: none !important; 
}

html.dark:root .unpublished-blog-link:hover span {
    color: var(--shadow-light) !important;
}

html.dark:root .unpublished-blog-link:hover div {
    background-color: transparent !important;
}

@media (max-width: 1023px) {
    html.dark:root .mobile-series-nav {
        display: block;
        background-color: var(--background-white) !important;
        border: 2px solid var(--primary-blue) !important;
        padding: 1.5rem;
        margin-top: 2rem;
    }

    html.dark:root .mobile-series-nav h3 {
        color: var(--text-dark) !important;
        font-weight: 800;
        border-bottom: 2px solid var(--secondary-grey) !important;
    }
}