/* bcMeter light/dark mode — dark overrides for the Kale theme + WPBakery content.
   Scope: everything under html[data-theme="dark"]. Light mode = untouched defaults.
   Strategy: higher-specificity + !important to beat Kale and WPBakery's
   vc_shortcodes-custom-css (.vc_custom_*) inline !important rules. */

html[data-theme="dark"] {
	--bcm-bg:     #0e1013;
	--bcm-bg2:    #0a0c0f;
	--bcm-panel:  #15181c;
	--bcm-panel2: #1b1f24;
	--bcm-text:   #e7eaef;
	--bcm-muted:  #9aa4b2;
	--bcm-line:   rgba(255,255,255,.07);
	--bcm-accent: #5b9bff;
	color-scheme: dark;
}

/* ---- Base chrome ---- */
html[data-theme="dark"] body { background: var(--bcm-bg2); color: var(--bcm-text); }
html[data-theme="dark"] body.custom-background .main-wrapper,
html[data-theme="dark"] .main-wrapper { background: var(--bcm-bg) !important; box-shadow: none !important; }

/* Headings */
html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3,
html[data-theme="dark"] h4, html[data-theme="dark"] h5, html[data-theme="dark"] h6,
html[data-theme="dark"] .entry-title a, html[data-theme="dark"] .vc_custom_heading,
html[data-theme="dark"] .header-logo-text a, html[data-theme="dark"] .tagline p { color: var(--bcm-text) !important; }

/* Content links → accent; structural links handled below */
html[data-theme="dark"] a, html[data-theme="dark"] a:visited { color: var(--bcm-accent); }
html[data-theme="dark"] a:hover, html[data-theme="dark"] a:focus, html[data-theme="dark"] a:active { color: #8fbcff; }

/* ---- Header / navigation ---- */
html[data-theme="dark"] .navbar-default { border-color: var(--bcm-line); }
html[data-theme="dark"] .navbar-default .navbar-nav > li > a,
html[data-theme="dark"] .header-row-1 .widget_nav_menu .menu li a,
html[data-theme="dark"] .header-row-1-toggle { color: var(--bcm-text); }
html[data-theme="dark"] .navbar-default .navbar-nav > .open > a,
html[data-theme="dark"] .navbar-default .navbar-nav > .open > a:focus,
html[data-theme="dark"] .navbar-default .navbar-nav > .open > a:hover,
html[data-theme="dark"] .navbar-default .navbar-nav > li > a:hover,
html[data-theme="dark"] .navbar-default .navbar-nav > li > a:focus { background-color: var(--bcm-panel); color: var(--bcm-text); }
html[data-theme="dark"] .navbar-default .navbar-toggle .icon-bar { background-color: var(--bcm-text); }
html[data-theme="dark"] .navbar-default .navbar-toggle { border-color: var(--bcm-line); }
html[data-theme="dark"] .navbar-default .navbar-collapse { border-color: var(--bcm-line); }
html[data-theme="dark"] .dropdown-menu { background: var(--bcm-panel); border-color: var(--bcm-line); }
html[data-theme="dark"] .dropdown-menu > li > a { color: var(--bcm-text); }
html[data-theme="dark"] .dropdown-menu > .active > a,
html[data-theme="dark"] .dropdown-menu > li > a:hover { background: var(--bcm-panel2); color: var(--bcm-text); }

/* ---- Footer ---- */
html[data-theme="dark"] .footer, html[data-theme="dark"] .footer-widgets,
html[data-theme="dark"] .copyright, html[data-theme="dark"] .copyright-wrapper { background: var(--bcm-bg); color: var(--bcm-text); }
html[data-theme="dark"] .footer-widgets .widget-content p,
html[data-theme="dark"] .footer-widgets .widget.widget_text .textwidget,
html[data-theme="dark"] .footer a, html[data-theme="dark"] .copyright a { color: var(--bcm-text); }
html[data-theme="dark"] .footer a:hover, html[data-theme="dark"] .copyright a:hover { color: var(--bcm-accent); }

/* ---- Forms (Kale + WPForms) ---- */
html[data-theme="dark"] .form-control,
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="url"],
html[data-theme="dark"] input[type="tel"], html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="date"], html[data-theme="dark"] textarea,
html[data-theme="dark"] select,
html[data-theme="dark"] .wpforms-form input, html[data-theme="dark"] .wpforms-form textarea,
html[data-theme="dark"] .wpforms-form select {
	background-color: var(--bcm-panel2) !important; border-color: var(--bcm-line) !important; color: var(--bcm-text) !important;
}
html[data-theme="dark"] ::placeholder { color: var(--bcm-muted); opacity: 1; }
html[data-theme="dark"] .wpforms-form label, html[data-theme="dark"] .wpforms-field-label,
html[data-theme="dark"] .wpforms-form .wpforms-field-description { color: var(--bcm-text) !important; }

/* ---- WPBakery section backgrounds (override .vc_custom_* !important) ---- */
html[data-theme="dark"] .vc_custom_1600000000000,            /* hero #f7f9fc */
html[data-theme="dark"] .vc_custom_1600000000007 {           /* downloads #f9f9f9 */
	background-color: var(--bcm-bg) !important;
}
html[data-theme="dark"] .vc_custom_1600000000001,            /* spec card #ffffff */
html[data-theme="dark"] .vc_custom_1600000000003,            /* spec card #ffffff */
html[data-theme="dark"] .vc_custom_1764195530855,            /* source-available #EEEEEE */
html[data-theme="dark"] .vc_custom_1764195640846,
html[data-theme="dark"] .vc_custom_1764195666206 {
	background-color: var(--bcm-panel) !important; border-color: var(--bcm-line) !important;
}
html[data-theme="dark"] .vc_custom_1600000000002 {           /* highlighted card #f0f8ff */
	background-color: var(--bcm-panel2) !important; border-color: rgba(110,155,255,.26) !important;
}

/* Spec cards (jdt-berlin orientation): softer, less bold icons; quieter highlighted border.
   Unify the three Font Awesome icons to one muted tone in dark (the white broadcast-tower
   was the boldest). #specs scoping keeps social/footer icons untouched. */
html[data-theme="dark"] #specs .vc_icon_element-icon { color: #8097bd !important; }
/* General (both modes): tone down the one bright-blue card outline */
#specs .vc_custom_1600000000002 { border-color: rgba(33,150,243,.42) !important; }

/* Generic fallback for any other light inline/section background on WP pages */
html[data-theme="dark"] [style*="background-color: #fff"],
html[data-theme="dark"] [style*="background-color:#fff"],
html[data-theme="dark"] [style*="background-color: #ffffff"],
html[data-theme="dark"] [style*="background: #fff"] { background-color: var(--bcm-panel) !important; }

/* ---- Inline text colors used in the homepage content ---- */
html[data-theme="dark"] [style*="color: #444"],
html[data-theme="dark"] [style*="color:#444"],
html[data-theme="dark"] [style*="color: #545454"],
html[data-theme="dark"] [style*="color: #666"],
html[data-theme="dark"] [style*="color:#666"],
html[data-theme="dark"] [style*="color: #777"] { color: var(--bcm-muted) !important; }
html[data-theme="dark"] [style*="color: #000000"],
html[data-theme="dark"] [style*="color:#000000"],
html[data-theme="dark"] [style*="color: #000;"],
html[data-theme="dark"] [style*="color:#000;"] { color: var(--bcm-text) !important; }
/* (Deliberately NOT touching color:#fff / #ffffff — those sit on dark sections.) */

/* Borders / separators */
html[data-theme="dark"] [style*="border-top: 1px solid #ddd"],
html[data-theme="dark"] [style*="border-color:#e0e0e0"],
html[data-theme="dark"] .vc_separator .vc_sep_line { border-color: var(--bcm-line) !important; }

/* ---- WPBakery tabs (validation section) ---- */
html[data-theme="dark"] .vc_tta-tabs .vc_tta-tab > a { color: var(--bcm-text); }
html[data-theme="dark"] .vc_tta.vc_general .vc_tta-panel .vc_tta-panel-body,
html[data-theme="dark"] .vc_tta.vc_general .vc_tta-tabs-container { background-color: var(--bcm-panel); }
html[data-theme="dark"] .vc_tta-color-blue.vc_tta-style-modern .vc_tta-tab > a { background-color: var(--bcm-panel2); border-color: var(--bcm-line); }
/* Validation chart PNGs are white-background — keep them on a white card so they read intentionally */
html[data-theme="dark"] .vc_tta-panel-body img { background: #fff; border-radius: 6px; }

/* ---- Outline buttons need lighter text on dark ---- */
html[data-theme="dark"] .vc_general.vc_btn3-style-outline.vc_btn3-color-grey,
html[data-theme="dark"] .vc_general.vc_btn3-style-outline.vc_btn3-color-sky,
html[data-theme="dark"] .vc_general.vc_btn3-style-outline.vc_btn3-color-primary { color: var(--bcm-text) !important; }

/* TranslatePress language switcher (uses CSS custom props with light defaults) */
html[data-theme="dark"] .trp-language-switcher-container,
html[data-theme="dark"] .trp_language_switcher_shortcode { --bg:#15181c; --text:#e7eaef; --border-color:rgba(255,255,255,.16); --bg-hover:rgba(255,255,255,.06); --text-hover:#ffffff; }

/* ---- Visual-QA fixes (beat page-specific Customizer !important rules) ---- */
/* Plain headings inside WPBakery text columns: Customizer sets
   ".page-id-29 .wpb_text_column h2 { color:#1a1a1a !important }" (0,2,1).
   Raise specificity with .main-wrapper ancestor (0,3,1). */
html[data-theme="dark"] .main-wrapper .wpb_text_column h1,
html[data-theme="dark"] .main-wrapper .wpb_text_column h2,
html[data-theme="dark"] .main-wrapper .wpb_text_column h3,
html[data-theme="dark"] .main-wrapper .wpb_text_column h4,
html[data-theme="dark"] .main-wrapper .wpb_text_column h5,
html[data-theme="dark"] .main-wrapper .wpb_text_column h6 { color: var(--bcm-text) !important; }

/* Logo PNG carries baked-in white pixels — invert so it reads on dark.
   mix-blend-mode lighten drops the (now dark) background, leaving the mark. */
html[data-theme="dark"] .custom-logo,
html[data-theme="dark"] .header-logo-text img,
html[data-theme="dark"] .logo img { filter: invert(1) hue-rotate(180deg); mix-blend-mode: lighten; }

/* Active/current menu item keeps Kale's light #f3f3f3 highlight */
html[data-theme="dark"] .navbar-nav .current-menu-item > a,
html[data-theme="dark"] .navbar-nav .current-menu-ancestor > a,
html[data-theme="dark"] .navbar-nav .current_page_item > a,
html[data-theme="dark"] .navbar-nav .current-menu-parent > a { background-color: transparent !important; color: var(--bcm-text); }

/* Contact section has a light #f4f8fb background from custom CSS (id selector → high specificity) */
html[data-theme="dark"] #contact { background-color: var(--bcm-bg) !important; }
html[data-theme="dark"] #contact .vc_column-inner,
html[data-theme="dark"] .wpforms-container, html[data-theme="dark"] .wpforms-container-full { background: transparent !important; }
/* WPForms "render-modern" colours its fields via CSS custom properties — set those
   so the fields follow dark mode reliably (a direct background override does not win). */
/* WPForms "render-modern" styles fields with an ID-scoped (#wpforms-<id>) !important
   rule that class/attribute selectors cannot outrank — so the override must also be
   ID-scoped. Known forms: 418 (home contact), 369 (inquiry). Add new form IDs here. */
html[data-theme="dark"] #wpforms-418 .wpforms-field-medium,
html[data-theme="dark"] #wpforms-418 input,
html[data-theme="dark"] #wpforms-418 textarea,
html[data-theme="dark"] #wpforms-418 select,
html[data-theme="dark"] #wpforms-369 .wpforms-field-medium,
html[data-theme="dark"] #wpforms-369 input,
html[data-theme="dark"] #wpforms-369 textarea,
html[data-theme="dark"] #wpforms-369 select {
	background-color: #1b1f24 !important; color: #e7eaef !important; border-color: rgba(255,255,255,.18) !important;
}
html[data-theme="dark"] #wpforms-418, html[data-theme="dark"] #wpforms-369 {
	--wpforms-field-background-color: #1b1f24 !important;
	--wpforms-field-border-color: rgba(255,255,255,.18) !important;
	--wpforms-field-text-color: #e7eaef !important;
	--wpforms-label-color: #e7eaef !important;
	--wpforms-label-sublabel-color: #9aa4b2 !important;
}
html[data-theme="dark"] .bcm-contact-copy, html[data-theme="dark"] .bcm-contact-copy p,
html[data-theme="dark"] .bcm-contact-copy li, html[data-theme="dark"] .bcm-contact-kicker { color: var(--bcm-text); }
html[data-theme="dark"] .bcm-contact-list li::marker { color: var(--bcm-accent); }

/* ---- Inquiry page: custom bcm-inquiry-* component + #wpforms-369 (page-id-365) ---- */
html[data-theme="dark"] .page-id-365 .page-content,
html[data-theme="dark"] .page-id-365 .page-content h1,
html[data-theme="dark"] .page-id-365 .page-content h2,
html[data-theme="dark"] .page-id-365 .page-content h3,
html[data-theme="dark"] .page-id-365 .page-content h4 { color: var(--bcm-text); }
html[data-theme="dark"] .page-id-365 .bcm-inquiry-notice { background: var(--bcm-panel); border-left-color: #d9a82a; }
html[data-theme="dark"] .page-id-365 .bcm-inquiry-notice h2 { color: var(--bcm-text); }
html[data-theme="dark"] .page-id-365 .bcm-inquiry-notice p { color: var(--bcm-muted); }
html[data-theme="dark"] .page-id-365 .bcm-inquiry-badge { background: var(--bcm-panel2); border-color: rgba(217,168,42,.5); color: #e7c66b; }
html[data-theme="dark"] .page-id-365 .bcm-inquiry-sidebar { border-top-color: var(--bcm-line); }
html[data-theme="dark"] .page-id-365 .bcm-inquiry-sidebar p { color: var(--bcm-muted); }
html[data-theme="dark"] .page-id-365 .bcm-inquiry-facts li { border-bottom-color: var(--bcm-line); color: var(--bcm-text); }
html[data-theme="dark"] .page-id-365 .bcm-inquiry-facts strong { color: var(--bcm-text); }
html[data-theme="dark"] .page-id-365 .bcm-inquiry-facts span { background: rgba(91,155,255,.16); color: #8fbcff; }
html[data-theme="dark"] .page-id-365 .bcm-inquiry-form-panel { background: var(--bcm-panel); border-color: var(--bcm-line); box-shadow: none; }
html[data-theme="dark"] .page-id-365 .bcm-inquiry-form-panel > p { color: var(--bcm-muted); }
/* The three instrument cards below the form + legal block */
html[data-theme="dark"] .page-id-365 .bcm-inquiry-detail { background: var(--bcm-panel); border-color: var(--bcm-line); }
html[data-theme="dark"] .page-id-365 .bcm-inquiry-detail h3 { color: var(--bcm-text); }
html[data-theme="dark"] .page-id-365 .bcm-inquiry-detail p { color: var(--bcm-muted); }
html[data-theme="dark"] .page-id-365 .bcm-inquiry-legal { border-top-color: var(--bcm-line); color: var(--bcm-muted); }
html[data-theme="dark"] .page-id-365 .bcm-inquiry-legal h2 { color: var(--bcm-text); }
html[data-theme="dark"] .page-id-365 .bcm-inquiry-legal a { color: var(--bcm-accent); }
html[data-theme="dark"] .page-id-365 #wpforms-369 .wpforms-field-label,
html[data-theme="dark"] .page-id-365 #wpforms-369 legend.wpforms-field-label,
html[data-theme="dark"] .page-id-365 #wpforms-369 .wpforms-field-label-inline { color: var(--bcm-text) !important; }
html[data-theme="dark"] .page-id-365 #wpforms-369 input[type="text"],
html[data-theme="dark"] .page-id-365 #wpforms-369 input[type="email"],
html[data-theme="dark"] .page-id-365 #wpforms-369 input[type="tel"],
html[data-theme="dark"] .page-id-365 #wpforms-369 input[type="number"],
html[data-theme="dark"] .page-id-365 #wpforms-369 textarea,
html[data-theme="dark"] .page-id-365 #wpforms-369 input:focus,
html[data-theme="dark"] .page-id-365 #wpforms-369 textarea:focus { background: #1b1f24 !important; color: var(--bcm-text) !important; border-color: rgba(255,255,255,.18) !important; }
html[data-theme="dark"] .page-id-365 #wpforms-369 input:focus,
html[data-theme="dark"] .page-id-365 #wpforms-369 textarea:focus { border-color: var(--bcm-accent) !important; }
html[data-theme="dark"] .page-id-365 #wpforms-369 .wpforms-field-checkbox li,
html[data-theme="dark"] .page-id-365 #wpforms-369 .wpforms-field-radio li { background: var(--bcm-panel2); border-color: var(--bcm-line); }
html[data-theme="dark"] .page-id-365 #wpforms-369 .wpforms-field-gdpr-checkbox li { background: var(--bcm-panel); }

/* ================= Theme toggle button (both modes) ================= */
/* Borderless, styled to read like the uppercase nav links (no pill). */
.bcm-theme-toggle {
	display: inline-flex; align-items: center; gap: 7px;
	margin: 0 0 0 2px; padding: 8px 6px; min-height: 32px;
	font-family: 'Montserrat', sans-serif; font-size: 10px; font-weight: 700;
	letter-spacing: 1.5px; text-transform: uppercase;
	color: #000; background: none; border: 0; cursor: pointer;
	opacity: .65; transition: opacity .15s ease, color .15s ease;
}
.bcm-theme-toggle:hover, .bcm-theme-toggle:focus-visible { opacity: 1; color: #2196f3; }
.bcm-theme-toggle .bcm-tt-icon { display: inline-flex; align-items: center; line-height: 1; }
.bcm-theme-toggle .bcm-tt-icon svg { display: block; width: 13px; height: 13px; }
.navbar-nav > li.bcm-theme-toggle-li { display: flex; align-items: center; }

html[data-theme="dark"] .bcm-theme-toggle { color: var(--bcm-text); }
html[data-theme="dark"] .bcm-theme-toggle:hover, html[data-theme="dark"] .bcm-theme-toggle:focus-visible { color: var(--bcm-accent); }

/* Floating fallback (only used if the nav is not found) */
.bcm-theme-toggle.bcm-floating {
	position: fixed; left: 16px; bottom: 16px; z-index: 9998;
	padding: 9px 13px; border-radius: 999px; opacity: 1; background: rgba(0,0,0,.05);
}
html[data-theme="dark"] .bcm-theme-toggle.bcm-floating { background: var(--bcm-panel); }

/* Language switcher (header shortcode) — match the nav typography, quieter flag. */
.trp-shortcode-switcher .trp-language-item-name {
	font-family: 'Montserrat', sans-serif !important; font-size: 10px !important;
	letter-spacing: 1.2px !important; text-transform: uppercase !important; font-weight: 700 !important;
}
.trp-shortcode-switcher a { text-decoration: none !important; }
.trp-shortcode-switcher .trp-flag-image { box-shadow: none !important; border-radius: 2px; opacity: .9; }
html[data-theme="dark"] .trp-shortcode-switcher .trp-language-item-name,
html[data-theme="dark"] .trp-shortcode-switcher .trp-language-item,
html[data-theme="dark"] .trp-shortcode-switcher a { color: var(--bcm-text) !important; }
html[data-theme="dark"] .trp-shortcode-switcher .trp-language-item:hover { color: var(--bcm-accent) !important; }
/* Open dropdown panel (other languages) — was a white box with unreadable grey text */
html[data-theme="dark"] .trp-switcher-dropdown-list {
	background: var(--bcm-panel) !important; border: 1px solid var(--bcm-line) !important;
	box-shadow: 0 10px 28px rgba(0,0,0,.5) !important;
}
html[data-theme="dark"] .trp-switcher-dropdown-list .trp-language-item { background: transparent !important; color: var(--bcm-text) !important; }
html[data-theme="dark"] .trp-switcher-dropdown-list .trp-language-item:hover { background: var(--bcm-panel2) !important; color: var(--bcm-accent) !important; }
html[data-theme="dark"] .trp-shortcode-switcher .trp-current-language-item__wrapper { background: transparent !important; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
	.bcm-theme-toggle { transition: none; }
}
