/* Basic styling for blogmore */

:root {
    /* Light mode colors */
    --bg-color: #fff;
    --text-color: #333;
    --text-secondary: #666;
    --border-color: #eee;
    --border-color-light: #f0f0f0;
    --link-color: #0066cc;
    --link-hover-color: #0052a3;
    --link-visited-color: #551a8b;
    --hover-color: #0066cc;
    --hover-color-dark: #0052a3;
    --code-bg: #f5f5f5;
    --tag-bg: #f0f0f0;
    --tag-hover-bg: #e0e0e0;
    --category-bg: #e8f4f8;
    --category-hover-bg: #d0e8f2;
    --category-text: #0066cc;
    --blockquote-border: #ddd;
}

/* Dark mode colors - applied by system preference */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --bg-color: #1a1a1a;
        --text-color: #e0e0e0;
        --text-secondary: #a0a0a0;
        --border-color: #333;
        --border-color-light: #2a2a2a;
        --link-color: #6eb3ff;
        --link-hover-color: #8cc5ff;
        --link-visited-color: #b399ff;
        --hover-color: #6eb3ff;
        --hover-color-dark: #8cc5ff;
        --code-bg: #2a2a2a;
        --tag-bg: #2a2a2a;
        --tag-hover-bg: #333;
        --category-bg: #1a3a4a;
        --category-hover-bg: #2a4a5a;
        --category-text: #6eb3ff;
        --blockquote-border: #444;
    }
}

/* Manual theme overrides - these override system preference */
:root[data-theme="light"] {
    --bg-color: #fff;
    --text-color: #333;
    --text-secondary: #666;
    --border-color: #eee;
    --border-color-light: #f0f0f0;
    --link-color: #0066cc;
    --link-hover-color: #0052a3;
    --link-visited-color: #551a8b;
    --hover-color: #0066cc;
    --hover-color-dark: #0052a3;
    --code-bg: #f5f5f5;
    --tag-bg: #f0f0f0;
    --tag-hover-bg: #e0e0e0;
    --category-bg: #e8f4f8;
    --category-hover-bg: #d0e8f2;
    --category-text: #0066cc;
    --blockquote-border: #ddd;
}

:root[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --text-secondary: #a0a0a0;
    --border-color: #333;
    --border-color-light: #2a2a2a;
    --link-color: #6eb3ff;
    --link-hover-color: #8cc5ff;
    --link-visited-color: #b399ff;
    --hover-color: #6eb3ff;
    --hover-color-dark: #8cc5ff;
    --code-bg: #2a2a2a;
    --tag-bg: #2a2a2a;
    --tag-hover-bg: #333;
    --category-bg: #1a3a4a;
    --category-hover-bg: #2a4a5a;
    --category-text: #6eb3ff;
    --blockquote-border: #444;
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    color: var(--text-color);
    background: var(--bg-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Site container with sidebar layout */
.site-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar styles */
.sidebar {
    width: 280px;
    background: var(--bg-color);
    border-right: 2px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 30px 20px;
    z-index: 100;
}

/* Hide scrollbar for sidebar but keep functionality */
.sidebar::-webkit-scrollbar {
    display: none;
}

.sidebar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.sidebar-header {
    text-align: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo {
    margin-bottom: 10px;
}

.sidebar-logo a {
    display: block;
}

.sidebar-logo img {
    max-width: 140px;
    max-height: 140px;
    width: auto;
    height: auto;
    border-radius: 50%;
}

.sidebar-title {
    text-align: center;
}

.sidebar-title h1 {
    font-size: 1.8em;
    margin: 0 0 10px 0;
    color: var(--text-color);
}

.sidebar-title h1 a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.sidebar-title h1 a:hover {
    color: var(--link-hover-color);
}

.sidebar-subtitle {
    font-size: 0.95em;
    color: var(--text-secondary);
    margin: 0;
    font-weight: normal;
}

/* Sidebar pages section - no title, just links with separator below */
.sidebar-pages {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-section {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-section:last-child {
    border-bottom: none;
}

.sidebar-section h2 {
    font-size: 1.2em;
    margin: 0 0 15px 0;
    color: var(--text-color);
}

.sidebar-links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-links li {
    margin-bottom: 5px;
}

.sidebar-links a {
    color: var(--link-color);
    text-decoration: none;
    display: block;
    transition: color 0.2s ease;
}

.sidebar-links a:hover {
    color: var(--link-hover-color);
}

.sidebar-socials {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.sidebar-socials a {
    color: var(--link-color);
    font-size: 1.8em;
    transition: color 0.2s ease, transform 0.2s ease;
    display: inline-block;
    text-decoration: none;
}

.sidebar-socials a i {
    color: inherit;
}

.sidebar-socials a:hover {
    color: var(--link-hover-color);
    transform: scale(1.1);
}

/* Main wrapper - offset by sidebar width */
.main-wrapper {
    flex: 1;
    margin-left: 280px;
    max-width: calc(100vw - 280px - 40px);
    width: 100%;
    padding: 20px;
}

/* Optimal width for main content when there's enough space */
@media (min-width: 1120px) {
    .main-wrapper {
        max-width: 800px;
    }
}

/* When no sidebar, use original layout */
.site-container:not(:has(.sidebar)) .main-wrapper {
    margin-left: auto;
    margin-right: auto;
    max-width: 800px;
}

/* Mobile layout */
@media (max-width: 768px) {
    .site-container {
        flex-direction: column;
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 2px solid var(--border-color);
        padding: 20px;
        order: -1;
    }

    .sidebar-content {
        gap: 20px;
    }

    .sidebar-logo {
        padding-bottom: 15px;
    }

    .sidebar-logo img {
        max-width: 140px;
        max-height: 140px;
    }

    .sidebar-pages {
        padding-bottom: 12px;
    }

    .sidebar-section {
        padding-bottom: 12px;
    }

    .sidebar-section h2 {
        font-size: 1em;
        margin-bottom: 10px;
    }

    .sidebar-links li {
        display: inline-block;
        margin-right: 15px;
        margin-bottom: 5px;
    }

    .sidebar-socials {
        gap: 12px;
    }

    .sidebar-socials a {
        font-size: 1.5em;
    }

    .main-wrapper {
        margin-left: 0;
        max-width: 100%;
        padding: 15px;
    }
}

/* General link styles for content */
a {
    color: var(--link-color);
    text-decoration: underline;
}

a:hover {
    color: var(--link-hover-color);
}

a:visited {
    color: var(--link-visited-color);
}

header {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 40px;
}

header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    margin: 0;
    font-size: 1.8em;
    line-height: 1;
}

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

header ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 0;
    padding: 0;
}

header ul a {
    color: var(--text-secondary);
    text-decoration: none;
}

header ul a:hover {
    color: var(--text-color);
}

main {
    min-height: 60vh;
}

article.post {
    margin-bottom: 60px;
}

.post-header {
    margin-bottom: 30px;
}

.post-header h1 {
    margin: 0 0 10px 0;
    font-size: 2.2em;
    line-height: 1.2;
}

.post-header time {
    color: var(--text-secondary);
    font-size: 0.9em;
}

.category {
    margin-top: 10px;
}

.category-link {
    display: inline-block;
    background: var(--category-bg);
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 0.9em;
    text-decoration: none;
    color: var(--category-text);
    font-weight: 600;
}

.category-link:hover {
    background: var(--category-hover-bg);
    color: var(--hover-color-dark);
}

.tags {
    margin-top: 10px;
}

.tag {
    display: inline-block;
    background: var(--tag-bg);
    padding: 4px 12px;
    margin-right: 8px;
    border-radius: 4px;
    font-size: 0.85em;
    text-decoration: none;
    color: var(--text-secondary);
}

.tag:hover {
    background: var(--tag-hover-bg);
    color: var(--text-color);
}

/* Post navigation (previous/next links) */
.post-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin: 30px 0;
    padding: 15px 0;
}

.post-navigation-top {
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 30px;
    padding-bottom: 20px;
}

.post-navigation-bottom {
    border-top: 1px solid var(--border-color);
    margin-top: 30px;
    padding-top: 20px;
}

.post-nav-link {
    display: inline-flex;
    align-items: center;
    padding: 10px 18px;
    background: var(--tag-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.9em;
    transition: all 0.2s ease;
    max-width: 45%;
}

.post-nav-link:hover {
    background: var(--tag-hover-bg);
    border-color: var(--hover-color);
    color: var(--hover-color);
    transform: translateY(-1px);
}

.post-nav-prev {
    margin-right: auto;
}

.post-nav-next {
    margin-left: auto;
}

.post-nav-label {
    font-weight: 500;
}

.post-nav-spacer {
    flex: 0 0 auto;
}

/* Responsive adjustments for post navigation */
@media (max-width: 768px) {
    .post-navigation {
        gap: 10px;
    }
    
    .post-nav-link {
        padding: 8px 14px;
        font-size: 0.85em;
        max-width: 48%;
    }
}

.post-content {
    font-size: 1.05em;
}

.post-content h1,
.post-content h2,
.post-content h3 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.post-content code {
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}

.post-content pre {
    background: var(--code-bg);
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
}

.post-content pre code {
    background: none;
    padding: 0;
}

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

/* Images with #centre on the end of the URL get centred. */
img[src*="#centre"] {
    display: block;
    margin: auto;
}

.post-content blockquote {
    border-left: 4px solid var(--blockquote-border);
    margin: 0;
    padding-left: 20px;
    color: var(--text-secondary);
}

/* GitHub-style admonitions */
.post-content .admonition {
    margin: 1.5em 0;
    padding: 0;
    border-left: 4px solid;
    border-radius: 4px;
    background-color: var(--code-bg);
}

.post-content .admonition-title {
    padding: 8px 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.post-content .admonition-content {
    padding: 8px 12px 12px 12px;
}

.post-content .admonition-content > *:first-child {
    margin-top: 0;
}

.post-content .admonition-content > *:last-child {
    margin-bottom: 0;
}

/* Note admonition - blue */
.post-content .admonition-note {
    border-left-color: #0969da;
}

.post-content .admonition-note .admonition-title {
    color: #0969da;
}

/* Tip admonition - green */
.post-content .admonition-tip {
    border-left-color: #1a7f37;
}

.post-content .admonition-tip .admonition-title {
    color: #1a7f37;
}

/* Important admonition - purple */
.post-content .admonition-important {
    border-left-color: #8250df;
}

.post-content .admonition-important .admonition-title {
    color: #8250df;
}

/* Warning admonition - orange */
.post-content .admonition-warning {
    border-left-color: #9a6700;
}

.post-content .admonition-warning .admonition-title {
    color: #9a6700;
}

/* Caution admonition - red */
.post-content .admonition-caution {
    border-left-color: #d1242f;
}

.post-content .admonition-caution .admonition-title {
    color: #d1242f;
}

/* Dark mode adjustments for admonitions */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .post-content .admonition-note .admonition-title {
        color: #58a6ff;
    }

    :root:not([data-theme]) .post-content .admonition-tip .admonition-title {
        color: #3fb950;
    }

    :root:not([data-theme]) .post-content .admonition-important .admonition-title {
        color: #a371f7;
    }

    :root:not([data-theme]) .post-content .admonition-warning .admonition-title {
        color: #d29922;
    }

    :root:not([data-theme]) .post-content .admonition-caution .admonition-title {
        color: #f85149;
    }
}

:root[data-theme="dark"] .post-content .admonition-note .admonition-title {
    color: #58a6ff;
}

:root[data-theme="dark"] .post-content .admonition-tip .admonition-title {
    color: #3fb950;
}

:root[data-theme="dark"] .post-content .admonition-important .admonition-title {
    color: #a371f7;
}

:root[data-theme="dark"] .post-content .admonition-warning .admonition-title {
    color: #d29922;
}

:root[data-theme="dark"] .post-content .admonition-caution .admonition-title {
    color: #f85149;
}

.post-summary {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

.post-summary:last-child {
    border-bottom: none;
}

.post-summary h2 {
    margin: 0 0 10px 0;
    font-size: 1.6em;
}

.post-summary h2 a {
    color: var(--text-color);
    text-decoration: none;
}

.post-summary h2 a:hover {
    color: var(--hover-color);
}

.post-summary time {
    color: var(--text-secondary);
    font-size: 0.9em;
}

.post-list {
    list-style: none;
    padding: 0;
}

.post-list li {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color-light);
}

.post-list li:last-child {
    border-bottom: none;
}

.post-list time {
    display: inline-block;
    min-width: 100px;
    color: var(--text-secondary);
    font-size: 0.9em;
}

.post-list a {
    color: var(--text-color);
    text-decoration: none;
}

.post-list a:hover {
    color: var(--hover-color);
}

footer {
    margin-top: 60px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9em;
}

footer a {
    color: var(--text-secondary);
}

footer a:hover {
    color: var(--text-color);
}

@media (max-width: 768px) {
    .site-container {
        flex-direction: column;
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 2px solid var(--border-color);
        padding: 20px;
        order: -1;
    }

    .sidebar-content {
        gap: 20px;
    }

    .sidebar-logo {
        padding-bottom: 15px;
    }

    .sidebar-logo img {
        max-width: 140px;
        max-height: 140px;
    }

    .sidebar-pages {
        padding-bottom: 12px;
    }

    .sidebar-section {
        padding-bottom: 12px;
    }

    .sidebar-section h2 {
        font-size: 1em;
        margin-bottom: 10px;
    }

    .sidebar-links li {
        display: inline-block;
        margin-right: 15px;
        margin-bottom: 5px;
    }

    .sidebar-socials {
        gap: 12px;
    }

    .sidebar-socials a {
        font-size: 1.5em;
    }

    .main-wrapper {
        margin-left: 0;
        max-width: 100%;
        padding: 15px;
    }

    header nav {
        flex-direction: column;
        gap: 15px;
    }

    .post-header h1 {
        font-size: 1.8em;
    }
}

/* Theme toggle button */
.theme-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.theme-toggle:hover {
    opacity: 1;
    background: var(--tag-bg);
}

.theme-toggle:focus {
    outline: 2px solid var(--hover-color);
    outline-offset: 2px;
    opacity: 1;
}

/* Icons for theme toggle */
.theme-toggle .icon {
    font-size: 1em;
    line-height: 1;
}

/* Hide the text label */
.theme-toggle .theme-label {
    display: none;
}

/* Hide appropriate icon based on theme */
/* By default (light mode), show dark icon (moon) to indicate "switch to dark" */
.theme-toggle .light-icon {
    display: none;
}

.theme-toggle .dark-icon {
    display: inline;
}

/* In dark mode, show light icon (sun) to indicate "switch to light" */
[data-theme="dark"] .theme-toggle .light-icon {
    display: inline;
}

[data-theme="dark"] .theme-toggle .dark-icon {
    display: none;
}

/* When system prefers dark and no manual override, show light icon */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .theme-toggle .light-icon {
        display: inline;
    }
    
    :root:not([data-theme]) .theme-toggle .dark-icon {
        display: none;
    }
}

/* ==========================================================================
   Syntax Highlighting
   ========================================================================== */

/* Light theme syntax highlighting (default style) */
.highlight { 
    background: var(--code-bg); 
    border-radius: 5px;
    padding: 15px;
    overflow-x: auto;
}

.highlight pre { 
    margin: 0;
    line-height: 125%; 
}

.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #3D7B7B; font-style: italic } /* Comment */
.highlight .err { border: 1px solid #FF0000 } /* Error */
.highlight .k { color: #008000; font-weight: bold } /* Keyword */
.highlight .o { color: #666666 } /* Operator */
.highlight .ch { color: #3D7B7B; font-style: italic } /* Comment.Hashbang */
.highlight .cm { color: #3D7B7B; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #9C6500 } /* Comment.Preproc */
.highlight .cpf { color: #3D7B7B; font-style: italic } /* Comment.PreprocFile */
.highlight .c1 { color: #3D7B7B; font-style: italic } /* Comment.Single */
.highlight .cs { color: #3D7B7B; font-style: italic } /* Comment.Special */
.highlight .gd { color: #A00000 } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
.highlight .gr { color: #E40000 } /* Generic.Error */
.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.highlight .gi { color: #008400 } /* Generic.Inserted */
.highlight .go { color: #717171 } /* Generic.Output */
.highlight .gp { color: #000080; font-weight: bold } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.highlight .gt { color: #0044DD } /* Generic.Traceback */
.highlight .kc { color: #008000; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #008000 } /* Keyword.Pseudo */
.highlight .kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #B00040 } /* Keyword.Type */
.highlight .m { color: #666666 } /* Literal.Number */
.highlight .s { color: #BA2121 } /* Literal.String */
.highlight .na { color: #687822 } /* Name.Attribute */
.highlight .nb { color: #008000 } /* Name.Builtin */
.highlight .nc { color: #0000FF; font-weight: bold } /* Name.Class */
.highlight .no { color: #880000 } /* Name.Constant */
.highlight .nd { color: #AA22FF } /* Name.Decorator */
.highlight .ni { color: #717171; font-weight: bold } /* Name.Entity */
.highlight .ne { color: #CB3F38; font-weight: bold } /* Name.Exception */
.highlight .nf { color: #0000FF } /* Name.Function */
.highlight .nl { color: #767600 } /* Name.Label */
.highlight .nn { color: #0000FF; font-weight: bold } /* Name.Namespace */
.highlight .nt { color: #008000; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #19177C } /* Name.Variable */
.highlight .ow { color: #AA22FF; font-weight: bold } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .mb { color: #666666 } /* Literal.Number.Bin */
.highlight .mf { color: #666666 } /* Literal.Number.Float */
.highlight .mh { color: #666666 } /* Literal.Number.Hex */
.highlight .mi { color: #666666 } /* Literal.Number.Integer */
.highlight .mo { color: #666666 } /* Literal.Number.Oct */
.highlight .sa { color: #BA2121 } /* Literal.String.Affix */
.highlight .sb { color: #BA2121 } /* Literal.String.Backtick */
.highlight .sc { color: #BA2121 } /* Literal.String.Char */
.highlight .dl { color: #BA2121 } /* Literal.String.Delimiter */
.highlight .sd { color: #BA2121; font-style: italic } /* Literal.String.Doc */
.highlight .s2 { color: #BA2121 } /* Literal.String.Double */
.highlight .se { color: #AA5D1F; font-weight: bold } /* Literal.String.Escape */
.highlight .sh { color: #BA2121 } /* Literal.String.Heredoc */
.highlight .si { color: #A45A77; font-weight: bold } /* Literal.String.Interpol */
.highlight .sx { color: #008000 } /* Literal.String.Other */
.highlight .sr { color: #A45A77 } /* Literal.String.Regex */
.highlight .s1 { color: #BA2121 } /* Literal.String.Single */
.highlight .ss { color: #19177C } /* Literal.String.Symbol */
.highlight .bp { color: #008000 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #0000FF } /* Name.Function.Magic */
.highlight .vc { color: #19177C } /* Name.Variable.Class */
.highlight .vg { color: #19177C } /* Name.Variable.Global */
.highlight .vi { color: #19177C } /* Name.Variable.Instance */
.highlight .vm { color: #19177C } /* Name.Variable.Magic */
.highlight .il { color: #666666 } /* Literal.Number.Integer.Long */

/* Dark theme syntax highlighting */
/* Applied when system prefers dark mode */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) .highlight { 
        background: #272822; 
        color: #f8f8f2;
    }
    :root:not([data-theme]) .highlight .hll { background-color: #49483e }
    :root:not([data-theme]) .highlight .c { color: #959077 } /* Comment */
    :root:not([data-theme]) .highlight .err { color: #ed007e; background-color: #1e0010 } /* Error */
    :root:not([data-theme]) .highlight .k { color: #66d9ef } /* Keyword */
    :root:not([data-theme]) .highlight .l { color: #ae81ff } /* Literal */
    :root:not([data-theme]) .highlight .n { color: #f8f8f2 } /* Name */
    :root:not([data-theme]) .highlight .o { color: #ff4689 } /* Operator */
    :root:not([data-theme]) .highlight .p { color: #f8f8f2 } /* Punctuation */
    :root:not([data-theme]) .highlight .ch { color: #959077 } /* Comment.Hashbang */
    :root:not([data-theme]) .highlight .cm { color: #959077 } /* Comment.Multiline */
    :root:not([data-theme]) .highlight .cp { color: #959077 } /* Comment.Preproc */
    :root:not([data-theme]) .highlight .cpf { color: #959077 } /* Comment.PreprocFile */
    :root:not([data-theme]) .highlight .c1 { color: #959077 } /* Comment.Single */
    :root:not([data-theme]) .highlight .cs { color: #959077 } /* Comment.Special */
    :root:not([data-theme]) .highlight .gd { color: #ff4689 } /* Generic.Deleted */
    :root:not([data-theme]) .highlight .ge { color: #f8f8f2; font-style: italic } /* Generic.Emph */
    :root:not([data-theme]) .highlight .gi { color: #a6e22e } /* Generic.Inserted */
    :root:not([data-theme]) .highlight .go { color: #66d9ef } /* Generic.Output */
    :root:not([data-theme]) .highlight .gp { color: #ff4689; font-weight: bold } /* Generic.Prompt */
    :root:not([data-theme]) .highlight .gs { color: #f8f8f2; font-weight: bold } /* Generic.Strong */
    :root:not([data-theme]) .highlight .gu { color: #959077 } /* Generic.Subheading */
    :root:not([data-theme]) .highlight .kc { color: #66d9ef } /* Keyword.Constant */
    :root:not([data-theme]) .highlight .kd { color: #66d9ef } /* Keyword.Declaration */
    :root:not([data-theme]) .highlight .kn { color: #ff4689 } /* Keyword.Namespace */
    :root:not([data-theme]) .highlight .kp { color: #66d9ef } /* Keyword.Pseudo */
    :root:not([data-theme]) .highlight .kr { color: #66d9ef } /* Keyword.Reserved */
    :root:not([data-theme]) .highlight .kt { color: #66d9ef } /* Keyword.Type */
    :root:not([data-theme]) .highlight .m { color: #ae81ff } /* Literal.Number */
    :root:not([data-theme]) .highlight .s { color: #e6db74 } /* Literal.String */
    :root:not([data-theme]) .highlight .na { color: #a6e22e } /* Name.Attribute */
    :root:not([data-theme]) .highlight .nb { color: #f8f8f2 } /* Name.Builtin */
    :root:not([data-theme]) .highlight .nc { color: #a6e22e } /* Name.Class */
    :root:not([data-theme]) .highlight .no { color: #66d9ef } /* Name.Constant */
    :root:not([data-theme]) .highlight .nd { color: #a6e22e } /* Name.Decorator */
    :root:not([data-theme]) .highlight .ne { color: #a6e22e } /* Name.Exception */
    :root:not([data-theme]) .highlight .nf { color: #a6e22e } /* Name.Function */
    :root:not([data-theme]) .highlight .nn { color: #f8f8f2 } /* Name.Namespace */
    :root:not([data-theme]) .highlight .nx { color: #a6e22e } /* Name.Other */
    :root:not([data-theme]) .highlight .nt { color: #ff4689 } /* Name.Tag */
    :root:not([data-theme]) .highlight .nv { color: #f8f8f2 } /* Name.Variable */
    :root:not([data-theme]) .highlight .ow { color: #ff4689 } /* Operator.Word */
    :root:not([data-theme]) .highlight .w { color: #f8f8f2 } /* Text.Whitespace */
    :root:not([data-theme]) .highlight .mb { color: #ae81ff } /* Literal.Number.Bin */
    :root:not([data-theme]) .highlight .mf { color: #ae81ff } /* Literal.Number.Float */
    :root:not([data-theme]) .highlight .mh { color: #ae81ff } /* Literal.Number.Hex */
    :root:not([data-theme]) .highlight .mi { color: #ae81ff } /* Literal.Number.Integer */
    :root:not([data-theme]) .highlight .mo { color: #ae81ff } /* Literal.Number.Oct */
    :root:not([data-theme]) .highlight .sa { color: #e6db74 } /* Literal.String.Affix */
    :root:not([data-theme]) .highlight .sb { color: #e6db74 } /* Literal.String.Backtick */
    :root:not([data-theme]) .highlight .sc { color: #e6db74 } /* Literal.String.Char */
    :root:not([data-theme]) .highlight .dl { color: #e6db74 } /* Literal.String.Delimiter */
    :root:not([data-theme]) .highlight .sd { color: #e6db74 } /* Literal.String.Doc */
    :root:not([data-theme]) .highlight .s2 { color: #e6db74 } /* Literal.String.Double */
    :root:not([data-theme]) .highlight .se { color: #ae81ff } /* Literal.String.Escape */
    :root:not([data-theme]) .highlight .sh { color: #e6db74 } /* Literal.String.Heredoc */
    :root:not([data-theme]) .highlight .si { color: #e6db74 } /* Literal.String.Interpol */
    :root:not([data-theme]) .highlight .sx { color: #e6db74 } /* Literal.String.Other */
    :root:not([data-theme]) .highlight .sr { color: #e6db74 } /* Literal.String.Regex */
    :root:not([data-theme]) .highlight .s1 { color: #e6db74 } /* Literal.String.Single */
    :root:not([data-theme]) .highlight .ss { color: #e6db74 } /* Literal.String.Symbol */
    :root:not([data-theme]) .highlight .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
    :root:not([data-theme]) .highlight .fm { color: #a6e22e } /* Name.Function.Magic */
    :root:not([data-theme]) .highlight .vc { color: #f8f8f2 } /* Name.Variable.Class */
    :root:not([data-theme]) .highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */
    :root:not([data-theme]) .highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */
    :root:not([data-theme]) .highlight .vm { color: #f8f8f2 } /* Name.Variable.Magic */
    :root:not([data-theme]) .highlight .il { color: #ae81ff } /* Literal.Number.Integer.Long */
}

/* Dark theme syntax highlighting when manually set */
:root[data-theme="dark"] .highlight { 
    background: #272822; 
    color: #f8f8f2;
}
:root[data-theme="dark"] .highlight .hll { background-color: #49483e }
:root[data-theme="dark"] .highlight .c { color: #959077 } /* Comment */
:root[data-theme="dark"] .highlight .err { color: #ed007e; background-color: #1e0010 } /* Error */
:root[data-theme="dark"] .highlight .k { color: #66d9ef } /* Keyword */
:root[data-theme="dark"] .highlight .l { color: #ae81ff } /* Literal */
:root[data-theme="dark"] .highlight .n { color: #f8f8f2 } /* Name */
:root[data-theme="dark"] .highlight .o { color: #ff4689 } /* Operator */
:root[data-theme="dark"] .highlight .p { color: #f8f8f2 } /* Punctuation */
:root[data-theme="dark"] .highlight .ch { color: #959077 } /* Comment.Hashbang */
:root[data-theme="dark"] .highlight .cm { color: #959077 } /* Comment.Multiline */
:root[data-theme="dark"] .highlight .cp { color: #959077 } /* Comment.Preproc */
:root[data-theme="dark"] .highlight .cpf { color: #959077 } /* Comment.PreprocFile */
:root[data-theme="dark"] .highlight .c1 { color: #959077 } /* Comment.Single */
:root[data-theme="dark"] .highlight .cs { color: #959077 } /* Comment.Special */
:root[data-theme="dark"] .highlight .gd { color: #ff4689 } /* Generic.Deleted */
:root[data-theme="dark"] .highlight .ge { color: #f8f8f2; font-style: italic } /* Generic.Emph */
:root[data-theme="dark"] .highlight .gi { color: #a6e22e } /* Generic.Inserted */
:root[data-theme="dark"] .highlight .go { color: #66d9ef } /* Generic.Output */
:root[data-theme="dark"] .highlight .gp { color: #ff4689; font-weight: bold } /* Generic.Prompt */
:root[data-theme="dark"] .highlight .gs { color: #f8f8f2; font-weight: bold } /* Generic.Strong */
:root[data-theme="dark"] .highlight .gu { color: #959077 } /* Generic.Subheading */
:root[data-theme="dark"] .highlight .kc { color: #66d9ef } /* Keyword.Constant */
:root[data-theme="dark"] .highlight .kd { color: #66d9ef } /* Keyword.Declaration */
:root[data-theme="dark"] .highlight .kn { color: #ff4689 } /* Keyword.Namespace */
:root[data-theme="dark"] .highlight .kp { color: #66d9ef } /* Keyword.Pseudo */
:root[data-theme="dark"] .highlight .kr { color: #66d9ef } /* Keyword.Reserved */
:root[data-theme="dark"] .highlight .kt { color: #66d9ef } /* Keyword.Type */
:root[data-theme="dark"] .highlight .m { color: #ae81ff } /* Literal.Number */
:root[data-theme="dark"] .highlight .s { color: #e6db74 } /* Literal.String */
:root[data-theme="dark"] .highlight .na { color: #a6e22e } /* Name.Attribute */
:root[data-theme="dark"] .highlight .nb { color: #f8f8f2 } /* Name.Builtin */
:root[data-theme="dark"] .highlight .nc { color: #a6e22e } /* Name.Class */
:root[data-theme="dark"] .highlight .no { color: #66d9ef } /* Name.Constant */
:root[data-theme="dark"] .highlight .nd { color: #a6e22e } /* Name.Decorator */
:root[data-theme="dark"] .highlight .ne { color: #a6e22e } /* Name.Exception */
:root[data-theme="dark"] .highlight .nf { color: #a6e22e } /* Name.Function */
:root[data-theme="dark"] .highlight .nn { color: #f8f8f2 } /* Name.Namespace */
:root[data-theme="dark"] .highlight .nx { color: #a6e22e } /* Name.Other */
:root[data-theme="dark"] .highlight .nt { color: #ff4689 } /* Name.Tag */
:root[data-theme="dark"] .highlight .nv { color: #f8f8f2 } /* Name.Variable */
:root[data-theme="dark"] .highlight .ow { color: #ff4689 } /* Operator.Word */
:root[data-theme="dark"] .highlight .w { color: #f8f8f2 } /* Text.Whitespace */
:root[data-theme="dark"] .highlight .mb { color: #ae81ff } /* Literal.Number.Bin */
:root[data-theme="dark"] .highlight .mf { color: #ae81ff } /* Literal.Number.Float */
:root[data-theme="dark"] .highlight .mh { color: #ae81ff } /* Literal.Number.Hex */
:root[data-theme="dark"] .highlight .mi { color: #ae81ff } /* Literal.Number.Integer */
:root[data-theme="dark"] .highlight .mo { color: #ae81ff } /* Literal.Number.Oct */
:root[data-theme="dark"] .highlight .sa { color: #e6db74 } /* Literal.String.Affix */
:root[data-theme="dark"] .highlight .sb { color: #e6db74 } /* Literal.String.Backtick */
:root[data-theme="dark"] .highlight .sc { color: #e6db74 } /* Literal.String.Char */
:root[data-theme="dark"] .highlight .dl { color: #e6db74 } /* Literal.String.Delimiter */
:root[data-theme="dark"] .highlight .sd { color: #e6db74 } /* Literal.String.Doc */
:root[data-theme="dark"] .highlight .s2 { color: #e6db74 } /* Literal.String.Double */
:root[data-theme="dark"] .highlight .se { color: #ae81ff } /* Literal.String.Escape */
:root[data-theme="dark"] .highlight .sh { color: #e6db74 } /* Literal.String.Heredoc */
:root[data-theme="dark"] .highlight .si { color: #e6db74 } /* Literal.String.Interpol */
:root[data-theme="dark"] .highlight .sx { color: #e6db74 } /* Literal.String.Other */
:root[data-theme="dark"] .highlight .sr { color: #e6db74 } /* Literal.String.Regex */
:root[data-theme="dark"] .highlight .s1 { color: #e6db74 } /* Literal.String.Single */
:root[data-theme="dark"] .highlight .ss { color: #e6db74 } /* Literal.String.Symbol */
:root[data-theme="dark"] .highlight .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */
:root[data-theme="dark"] .highlight .fm { color: #a6e22e } /* Name.Function.Magic */
:root[data-theme="dark"] .highlight .vc { color: #f8f8f2 } /* Name.Variable.Class */
:root[data-theme="dark"] .highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */
:root[data-theme="dark"] .highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */
:root[data-theme="dark"] .highlight .vm { color: #f8f8f2 } /* Name.Variable.Magic */
:root[data-theme="dark"] .highlight .il { color: #ae81ff } /* Literal.Number.Integer.Long */

/* Tags page styles */
.tags-page h1 {
    margin-bottom: 30px;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: baseline;
    justify-content: flex-start;
    line-height: 2;
    margin: 30px 0;
}

.tag-cloud-item {
    display: inline-block;
    text-decoration: none;
    color: var(--link-color);
    transition: color 0.2s ease, transform 0.2s ease;
}

.tag-cloud-item:hover {
    color: var(--link-hover-color);
    transform: scale(1.05);
}

.tag-cloud-item .tag-count {
    font-size: 0.7em;
    color: var(--text-secondary);
    margin-left: 2px;
}

/* Archive page styles */
.archive h1 {
    margin-bottom: 40px;
}

.archive-year {
    margin-bottom: 40px;
}

.archive-year > h2 {
    margin-bottom: 20px;
    font-size: 1.8em;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.archive-year > h2 a {
    color: var(--text-color);
    text-decoration: none;
}

.archive-year > h2 a:hover {
    color: var(--hover-color);
}

.archive-month {
    margin-bottom: 30px;
    margin-left: 20px;
}

.archive-month > h3 {
    margin-bottom: 15px;
    font-size: 1.4em;
}

.archive-month > h3 a {
    color: var(--text-color);
    text-decoration: none;
}

.archive-month > h3 a:hover {
    color: var(--hover-color);
}

.archive-post-list {
    list-style: none;
    padding: 0;
    margin: 0 0 0 20px;
}

.archive-post-list li {
    margin-bottom: 12px;
    line-height: 1.6;
}

.archive-post-list .post-title {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
}

.archive-post-list .post-title:hover {
    color: var(--hover-color);
    text-decoration: underline;
}

.archive-post-list .archive-metadata {
    margin-left: 8px;
}

.archive-post-list .category-link {
    display: inline-block;
    background: var(--category-bg);
    padding: 2px 10px;
    border-radius: 3px;
    font-size: 0.85em;
    text-decoration: none;
    color: var(--category-text);
    font-weight: 600;
}

.archive-post-list .category-link:hover {
    background: var(--category-hover-bg);
    color: var(--hover-color-dark);
}

.archive-post-list .tag {
    display: inline-block;
    background: var(--tag-bg);
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.8em;
    text-decoration: none;
    color: var(--text-secondary);
}

.archive-post-list .tag:hover {
    background: var(--tag-hover-bg);
    color: var(--text-color);
}
