/* Rables core styles — stylesheet for the public site and the auth pages,
 * ported from the Rails app/assets/stylesheets/application.css (plan T28:
 * core layout/flash/forms/comments/pagination, not a line-by-line port).
 * Public accent color: #c04000. The admin area has its own scoped stylesheet
 * (admin.css, loaded by admin_layout.html); only the shared form/button base
 * used by the auth pages (bare layout) remains here.
 */

/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --spacing: 1rem;
    --border: #e5e7eb;
    --text: #111827;
    --text-light: #6b7280;
    --bg: #ffffff;
    --bg-hover: #f9fafb;
}

body {
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
        "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC",
        "Source Han Sans SC", "WenQuanYi Micro Hei", sans-serif;
    color: #111;
    line-height: 1.5;
    font-size: 16px;
    overflow-wrap: break-word;
}

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

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

ul {
    list-style: none;
}

/* Flash (public + admin; faded out by app.js after 5s) */
.flash {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    font-size: 14px;
}

.flash-notice {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.flash-alert {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Layout (public) */
.site-container {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 60px;
    max-width: 1000px;
    margin: 60px auto;
    padding: 0 20px;
}

/* The sidebar controller wrapper must not disturb the grid. */
.site-container > [data-controller~="sidebar"] {
    display: contents;
}

.main-content,
.limiter {
    min-width: 0;
    width: 100%;
}

/* Mobile Sidebar Toggle (Public) */
.site-container .mobile-menu-btn {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    width: 40px;
    height: 40px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    background: #fff;
    color: #111;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.site-container .mobile-menu-btn:hover {
    background-color: #f5f5f5;
}

.site-container .mobile-menu-btn i {
    font-size: 18px;
}

.site-container .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.site-container .sidebar-overlay.overlay-visible {
    display: block;
    opacity: 1;
}

.site-container .sidebar-header-content {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.site-container .sidebar-close-btn {
    display: none;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #111;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-size: 18px;
}

.site-container .sidebar-close-btn:hover {
    background-color: #f5f5f5;
}

/* Sidebar */
.sidebar-header h1 {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 1rem;
}

.site-description {
    color: #666;
    font-size: 0.9rem;
}

/* Navbar Search */
.navbar-search {
    margin-bottom: 1rem;
}

.search-form {
    display: flex;
}

.search-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    background-color: #fff;
    transition: border-color 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: #c04000;
}

.search-input::placeholder {
    color: #999;
}

.sidebar-nav li {
    margin-top: 0.5rem;
}

.sidebar-nav a {
    color: #555;
}

.sidebar-nav a:hover {
    color: #000;
    text-decoration: underline;
}

.sidebar-nav a.current {
    color: #c04000;
    font-weight: 700;
}

.social-links,
.sidebar-footer {
    margin-top: 2rem;
}

/* Newsletter Subscription Form */
.newsletter-subscription {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
}

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

.newsletter-email-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.newsletter-email-input:focus {
    outline: none;
    border-color: #c04000;
}

.newsletter-submit-btn {
    padding: 8px 16px;
    background-color: #c04000;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    font-family: inherit;
}

.newsletter-submit-btn:hover:not(:disabled) {
    background-color: #a03000;
}

.newsletter-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.newsletter-message {
    margin-top: 8px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    display: none;
    transition: opacity 0.3s ease;
}

.newsletter-message-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.newsletter-message-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Tag-page newsletter popover: the subscribe form hides behind the
 * "Newsletter" link next to the RSS link and opens as a small dialog. */
.tag-newsletter {
    position: relative;
    display: inline-block;
}

.tag-newsletter-dialog {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 6px;
    width: 300px;
    max-width: 90vw;
    padding: 1rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
}

.tag-newsletter-dialog .newsletter-subscription {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

/* Tag page / inline subscription forms */
.tag-subscription-form {
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.tag-subscription-inline {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
}

.subscription-tags-label {
    font-size: 0.875rem;
    color: #333;
}

.subscription-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-top: 0.25rem;
}

.subscription-tag-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

footer {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
}

.footer-content {
    width: 100%;
}

.footer-text {
    color: #666;
    font-size: 0.875rem;
    line-height: 1.5;
    display: block;
}

/* Article List - Twitter Card Style */
.article-list.timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    padding-left: 0;
}

.timeline-item {
    position: relative;
    padding: 14px 16px;
    border: 1px solid #e6ecf0;
    border-radius: 16px;
    background-color: #fff;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

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

.timeline-item:hover {
    background-color: #f7f9f9;
    border-color: #d7dee3;
}

.timeline-marker {
    display: none;
}

.timeline-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    gap: 8px;
    flex-wrap: wrap;
}

.timeline-date {
    font-size: 0.85rem;
    color: #c04000;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.timeline-date a {
    color: inherit;
    text-decoration: none;
}

.timeline-date a:hover {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 2px;
}

.timeline-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.post-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f1419;
    margin: 0 0 8px 0;
    line-height: 1.35;
}

.post-title a {
    color: inherit;
    text-decoration: none;
}

.post-title a:hover {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.article-list.timeline.is-home .post-title {
    font-size: 1.35rem;
}

.article-list.timeline.is-home .post-title a {
    color: #c04000;
}

.post-description {
    color: #0f1419;
    font-size: 1rem;
    line-height: 1.55;
}

.post-content {
    color: #0f1419;
    font-size: 1rem;
    line-height: 1.55;
    margin-top: 6px;
}

.post-content img,
.post-content video {
    max-width: 100%;
    height: auto;
    margin: 16px 0;
}

.tag {
    display: inline-block;
    background-color: #f0f0f0;
    color: #666;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    transition: background-color 0.2s;
}

.timeline-tags .tag {
    background: none;
    border: none;
    padding: 0;
    color: #1d9bf0;
    border-radius: 0;
    font-size: 0.9rem;
}

.timeline-tags .tag:hover {
    background: none;
    color: #1a8cd8;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.tag:hover {
    background-color: #e0e0e0;
    color: #333;
    text-decoration: none;
}

/* Comment Form */
.comment-form {
    padding: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fafafa;
}

.comment-form-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.comment-form-field {
    flex: 1;
    min-width: 0;
}

.comment-form-input,
.comment-form-textarea,
.comment-captcha-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.875rem;
    font-family: inherit;
}

.comment-form-textarea {
    resize: vertical;
}

.comment-form-captcha {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comment-form-cancel {
    padding: 0.5rem 1rem;
    background-color: #f0f0f0;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
}

/* Article page */
.article h1,
h2 {
    color: #c04000;
}

.article-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 0.25rem;
}

.article-header h2 {
    flex: 1;
    margin: 0;
    line-height: 1.25;
}

.article-meta {
    color: #777;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.article-meta .article-tags {
    margin-left: auto;
}

.article-meta .article-meta-divider {
    color: #ccc;
}

.article-meta .social-posts-label {
    color: #999;
}

.article-meta .social-post-link {
    color: #666;
    margin-right: 0.25rem;
}

.article-content {
    display: block;
    unicode-bidi: isolate;
    max-width: 800px;
}

/* html_archive posts/pages: the uploaded static site renders inside this
   sandboxed frame (see internal/httpd/archives.go). */
.archive-frame {
    display: block;
    width: 100%;
    max-width: 800px;
    height: 75vh;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
}

.article-content pre,
.post-content pre {
    background-color: #f6f8fa;
    padding: 16px;
    overflow-x: auto;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.45;
    margin: 16px 0;
}

.article-content pre code,
.post-content pre code {
    background-color: transparent;
    padding: 0;
    border: none;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    font-size: inherit;
    color: inherit;
}

.article-content code,
.post-content code {
    word-break: break-word;
}

.article-content :not(pre) > code,
.post-content :not(pre) > code {
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 0.92em;
    background-color: #f6f8fa;
    border: 1px solid #d0d7de;
    border-radius: 4px;
    padding: 0.15em 0.35em;
}

.article-content img,
.article-content video {
    max-width: 100%;
    height: auto;
}

.article-content a,
.post-content a,
.post-description a {
    color: #c04000;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.article-content a:hover,
.post-content a:hover,
.post-description a:hover {
    color: #a03000;
    text-decoration-thickness: 2px;
}

/* Source Reference (Article) */
.source-reference__quote {
    border: 0 solid #ccc;
    border-left-width: 0.3em;
    margin: 0 0 0.75rem 0.3em;
    padding-left: 0.6em;
}

/* Quote-tweet media embeds live in the source-reference block, outside
   .article-content, so they need the same width constraint. */
.source-reference__quote img,
.source-reference__quote video {
    max-width: 100%;
    height: auto;
}

/* Pagination (public, will_paginate markup) */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 40px;
    gap: 8px;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.pagination a,
.pagination em,
.pagination span {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #555;
    text-decoration: none;
}

.pagination a:hover {
    background-color: #f5f5f5;
    border-color: #ccc;
    color: #333;
}

.pagination .current {
    background-color: #c04000;
    color: #fff;
    border-color: #c04000;
    font-style: normal;
}

.pagination .disabled {
    color: #aaa;
    border-color: #eee;
    pointer-events: none;
}

/* Theme Toggle Button */
.theme-toggle {
    margin-top: 1rem;
}

.theme-toggle-btn {
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #555;
    padding: 0;
}

.theme-toggle-btn:hover {
    background-color: #f5f5f5;
    border-color: #999;
    color: #333;
}

.theme-toggle-btn i {
    font-size: 16px;
}

/* Share Menu */
.share-container {
    position: relative;
    display: inline-block;
}

.share-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: grey;
    border-radius: 4px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 24px;
    min-height: 24px;
    font-size: inherit;
    font-family: inherit;
}

.share-button:hover {
    color: #c04000;
    background-color: #f5f5f5;
}

.share-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 6px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 160px;
    z-index: 1000;
    overflow: hidden;
}

.share-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    color: #333;
    text-decoration: none;
    font-size: 13px;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.share-menu-item:last-child {
    border-bottom: none;
}

.share-menu-item:hover {
    background-color: #f5f5f5;
    color: #c04000;
}

.share-menu-item i {
    width: 16px;
    text-align: center;
    font-size: 14px;
}

/* Minimal text-glyph icons standing in for the Font Awesome classes the
 * ported controllers toggle (Rails loads FA from a CDN; the Go rewrite stays
 * self-contained). */
.fas,
.fab,
.fa {
    display: inline-block;
    font-style: normal;
}

.fa-moon::before { content: "\263E"; }
.fa-sun::before { content: "\2600"; }
.fa-bars::before { content: "\2630"; }
.fa-times::before { content: "\00D7"; }
.fa-check::before { content: "\2713"; }
.fa-link::before { content: "\1F517"; }
.fa-share-alt::before { content: "\2197"; }
.fa-spinner::before { content: "\25CC"; }
.fa-envelope::before { content: "\2709"; }

/* Admin sidebar icons are inline SVG (see _admin.html); the text glyphs
 * above remain for the public sidebar, share menu and JS loading states. */

.fa-spin {
    animation: fa-spin 1s linear infinite;
}

@keyframes fa-spin {
    to { transform: rotate(360deg); }
}

.inline-svg-icon {
    width: 1em;
    height: 1em;
    display: inline-block;
    vertical-align: -0.12em;
}

.inline-svg-icon.is-loading {
    animation: fa-spin 1s linear infinite;
}

h1 {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 1rem 0;
}

h4 {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

/* Buttons (shared base: auth pages on the bare layout; admin refines these
 * under .admin-body in admin.css). */
button,
input[type="submit"],
.btn {
    padding: 0.5rem 1rem;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    color: var(--text);
}

button:hover,
input[type="submit"]:hover,
.btn:hover {
    background: var(--bg-hover);
}

button[type="submit"],
input[type="submit"] {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

button[type="submit"]:hover,
input[type="submit"]:hover {
    opacity: 0.9;
}

/* The admin input[type="submit"] rule above would otherwise override the
 * public subscription button (equal-ish specificity, later in the file). */
input[type="submit"].newsletter-submit-btn {
    padding: 8px 16px;
    background-color: #c04000;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    font-family: inherit;
}

input[type="submit"].newsletter-submit-btn:hover:not(:disabled) {
    background-color: #a03000;
}

input[type="submit"].newsletter-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Forms */
.field {
    margin-bottom: 0.5rem;
}

.field label {
    font-size: 13px;
    color: var(--text);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
input[type="datetime-local"],
textarea,
select {
    width: 100%;
    padding: 0.375rem 0.5rem;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: inherit;
}

input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--text);
    outline-offset: -1px;
}

/* Keep the public sidebar/search inputs on their own styles. */
.sidebar .search-input,
.navbar-search .search-input {
    outline: none;
}

textarea {
    min-height: 60px;
    resize: vertical;
}

.field small,
.help-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 11px;
    color: var(--text-light);
    line-height: 1.4;
}

/* Form Errors */
.form-errors {
    padding: 1rem;
    margin-bottom: 1.5rem;
    background: #fee;
    border: 1px solid #fca;
    border-radius: 4px;
    color: #991b1b;
}

.form-errors strong {
    display: block;
    margin-bottom: 0.5rem;
}

.form-errors ul {
    margin: 0;
    padding-left: 1.25rem;
    list-style: disc;
}

.form-errors li {
    margin: 0.25rem 0;
}

input:disabled,
textarea:disabled,
select:disabled {
    background: var(--bg-hover);
    color: var(--text-light);
    cursor: not-allowed;
}

/* Password toggle */
.password-toggle-wrapper {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.password-toggle-wrapper input {
    flex: 1;
}

.password-toggle-wrapper .password-toggle-btn {
    flex-shrink: 0;
    width: auto;
}

/* Mobile Layout */
@media (max-width: 768px) {
    body {
        font-size: 17px;
    }

    .site-container {
        grid-template-columns: 1fr;
        gap: 16px;
        margin: 0 auto;
        width: 100%;
        padding: 3.5rem 16px 24px;
    }

    .site-container .mobile-menu-btn {
        display: flex;
    }

    .site-container .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        background: #fff;
        border-right: 1px solid #e5e7eb;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
        padding: 0 0 16px;
        text-align: left;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
    }

    .site-container .sidebar.sidebar-open {
        transform: translateX(0);
    }

    .site-container .sidebar-header {
        padding: 1rem;
        border-bottom: 1px solid #e5e7eb;
    }

    .site-container .sidebar-close-btn {
        display: flex;
    }

    .sidebar-header h1 {
        font-size: 1.45rem;
        line-height: 1.2;
        margin-bottom: 0.35rem;
    }

    .navbar-search {
        margin-bottom: 0.75rem;
        padding: 0 1rem;
    }

    .sidebar-nav {
        padding: 0.5rem 0;
    }

    .sidebar-nav .nav-link {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.5rem 1rem;
        font-size: 0.95rem;
        color: #555;
        text-decoration: none;
        transition: background-color 0.15s, color 0.15s;
    }

    .sidebar-nav .nav-link:hover {
        background-color: #f5f5f5;
        color: #111;
    }

    .social-links {
        margin-top: 0.75rem;
        display: flex;
        align-items: center;
        gap: 10px;
        flex-wrap: nowrap;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .sidebar-footer {
        margin-top: 1rem;
        border-top: 1px solid #e5e7eb;
        padding: 0.75rem 1rem 0;
    }

    .comment-form-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .comment-form-captcha {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .share-menu {
        right: auto;
        left: 0;
        max-width: 90vw;
    }
}

@media (max-width: 480px) {
    .site-container .mobile-menu-btn {
        top: 0.5rem;
        left: 0.5rem;
        width: 36px;
        height: 36px;
    }

    .site-container .sidebar {
        width: 100%;
        max-width: 320px;
    }
}

/* Dark Mode (core subset; toggled via [data-theme] on <html>) */
[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #f5f5f5;
    --text-secondary: #d0d0d0;
    --border-color: #333;
    --hover-bg: #2a2a2a;
    --accent-color: #ff6b35;
}

[data-theme="dark"] body {
    background-color: var(--bg-color);
    color: var(--text-color);
}

[data-theme="dark"] p,
[data-theme="dark"] span,
[data-theme="dark"] div,
[data-theme="dark"] li,
[data-theme="dark"] td,
[data-theme="dark"] th,
[data-theme="dark"] label,
[data-theme="dark"] strong,
[data-theme="dark"] em,
[data-theme="dark"] b,
[data-theme="dark"] i {
    color: inherit;
}

[data-theme="dark"] .search-input {
    background-color: #2a2a2a;
    border-color: var(--border-color);
    color: var(--text-color);
}

[data-theme="dark"] .search-input::placeholder {
    color: var(--text-secondary);
}

[data-theme="dark"] .site-container .mobile-menu-btn {
    background-color: #2a2a2a;
    border-color: var(--border-color);
    color: var(--text-color);
}

[data-theme="dark"] .sidebar-header h1,
[data-theme="dark"] .sidebar-header h1 a {
    color: var(--text-color);
}

[data-theme="dark"] .site-description,
[data-theme="dark"] .sidebar-nav a {
    color: var(--text-secondary);
}

[data-theme="dark"] .sidebar-nav a:hover {
    color: var(--text-color);
}

[data-theme="dark"] .timeline-item {
    background-color: #242424;
    border-color: var(--border-color);
}

[data-theme="dark"] .timeline-item:hover {
    background-color: var(--hover-bg);
    border-color: #444;
}

[data-theme="dark"] .post-title,
[data-theme="dark"] .post-description,
[data-theme="dark"] .post-content {
    color: var(--text-color);
}

[data-theme="dark"] .tag {
    background-color: #2a2a2a;
    color: var(--text-secondary);
}

[data-theme="dark"] .comment-form {
    background: #222;
    border-color: var(--border-color);
}

[data-theme="dark"] .archive-frame {
    border-color: var(--border-color);
    background: var(--bg-color);
}

[data-theme="dark"] .comment-form-input,
[data-theme="dark"] .comment-form-textarea,
[data-theme="dark"] .comment-captcha-input {
    background-color: #2a2a2a;
    border-color: var(--border-color);
    color: var(--text-color);
}

[data-theme="dark"] .newsletter-email-input {
    background-color: #2a2a2a;
    border-color: var(--border-color);
    color: var(--text-color);
}

[data-theme="dark"] .theme-toggle-btn {
    border-color: var(--border-color);
    color: var(--text-secondary);
}

[data-theme="dark"] .theme-toggle-btn:hover {
    background-color: var(--hover-bg);
    color: var(--text-color);
}

[data-theme="dark"] .share-button {
    color: var(--text-secondary);
}

[data-theme="dark"] .share-button:hover {
    background-color: var(--hover-bg);
    color: var(--accent-color);
}

[data-theme="dark"] .share-menu {
    background-color: #2a2a2a;
    border-color: var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .tag-newsletter-dialog {
    background-color: #2a2a2a;
    border-color: var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .share-menu-item {
    color: var(--text-color);
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .share-menu-item:hover {
    background-color: var(--hover-bg);
    color: var(--accent-color);
}

[data-theme="dark"] .flash-notice {
    background-color: #14532d;
    border-color: #166534;
    color: #dcfce7;
}

[data-theme="dark"] .flash-alert {
    background-color: #7f1d1d;
    border-color: #991b1b;
    color: #fee2e2;
}

@media (max-width: 768px) {
    [data-theme="dark"] .site-container .sidebar {
        background: #1a1a1a;
        border-right-color: var(--border-color);
    }

    [data-theme="dark"] .site-container .sidebar-close-btn {
        color: var(--text-color);
    }
}
