/* ============================================================
   B2 → AITYKE OVERRIDES — DARK MODE
   Activated when <html data-theme="dark"> is set
   (toggled by aityke-chrome.js).
   ============================================================ */

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

/* B2 dark-mode-friendly token bridge */
html[data-theme="dark"] :root,
html[data-theme="dark"] {
    --b2color:        #d4845a !important;
    --b2lightcolor:   rgba(212, 132, 90, 0.22) !important;
    --b2light:        rgba(212, 132, 90, 0.06) !important;
}

/* Header */
html[data-theme="dark"] .site-header,
html[data-theme="dark"] .site-header-in,
html[data-theme="dark"] .header-banner,
html[data-theme="dark"] .header {
    background: var(--header-bg) !important;
    color: var(--header-fg) !important;
    box-shadow: 0 1px 0 rgba(255,255,255,0.04), var(--elev-2) !important;
}

/* Surfaces */
html[data-theme="dark"] .b2-content .content-area,
html[data-theme="dark"] .b2-single-content .content-area,
html[data-theme="dark"] .widget,
html[data-theme="dark"] .post-list-item,
html[data-theme="dark"] article.post,
html[data-theme="dark"] .comment-list li.comment,
html[data-theme="dark"] .comment-respond,
html[data-theme="dark"] .b2-popup,
html[data-theme="dark"] .b2-modal {
    background: var(--surface-1) !important;
    border-color: var(--color-border) !important;
    color: var(--color-text) !important;
}

/* Text inside content */
html[data-theme="dark"] .entry-content,
html[data-theme="dark"] .entry-content p,
html[data-theme="dark"] .entry-content li,
html[data-theme="dark"] .b2-content p,
html[data-theme="dark"] .b2-content li,
html[data-theme="dark"] .comment-content,
html[data-theme="dark"] .widget ul li,
html[data-theme="dark"] .widget ul li a {
    color: var(--color-text-2) !important;
}
html[data-theme="dark"] .entry-title,
html[data-theme="dark"] .post-title,
html[data-theme="dark"] .post-list-title,
html[data-theme="dark"] .entry-title a,
html[data-theme="dark"] .post-title a,
html[data-theme="dark"] .post-list-title a,
html[data-theme="dark"] .card-title,
html[data-theme="dark"] .modal-title {
    color: var(--color-text) !important;
}

/* Inputs */
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="password"],
html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] input[type="url"],
html[data-theme="dark"] input[type="tel"],
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
    background: var(--surface-2) !important;
    color: var(--color-text) !important;
    border-color: var(--color-border) !important;
}

/* Pagination & code */
html[data-theme="dark"] .page-numbers,
html[data-theme="dark"] .pagination a,
html[data-theme="dark"] .pagination span,
html[data-theme="dark"] .b2-pagination a,
html[data-theme="dark"] .b2-pagination span,
html[data-theme="dark"] .nav-links a,
html[data-theme="dark"] .nav-links span {
    background: var(--surface-2) !important;
    color: var(--color-text-2) !important;
    border-color: var(--color-border) !important;
}

html[data-theme="dark"] .entry-content code,
html[data-theme="dark"] .b2-content code {
    background: var(--surface-sunken) !important;
    color: var(--orange-300) !important;
}

/* Footer */
html[data-theme="dark"] .site-footer,
html[data-theme="dark"] .site-footer-nav,
html[data-theme="dark"] .aityke-footer,
html[data-theme="dark"] #bigTriangleColor {
    background: var(--surface-2) !important;
    color: var(--color-text-2) !important;
    border-color: var(--color-border) !important;
}
html[data-theme="dark"] .mobile-footer-menu,
html[data-theme="dark"] #mobile-footer-menu,
html[data-theme="dark"] #post-po-box .po-post-in {
    background: var(--surface-1) !important;
    border-color: var(--color-border) !important;
    color: var(--color-text) !important;
}

/* B2 page-bg image — dim further */
html[data-theme="dark"] .b2-page-bg img { opacity: 0.18; }
