/* Nexus Advance — Dark & Light Mode (v2.1.0). Custom-built, no libraries.
   The mode lives on <html data-theme="dark|light">, set before first paint by
   the inline script from inc/dark-mode.php and toggled by assets/js/dark-mode.js.
   The cached HTML is identical for everyone — this file is purely presentational.

   IMPORTANT: --nexus-primary, --nexus-accent and --template-accent are NEVER
   overridden here. Brand and per-category accent colours are preserved in
   dark mode by design; only background / surface / text / border tokens move.
   Owner palette overrides (Customizer > Nexus: Dark & Light Mode) are printed
   AFTER this file in <style id="nexus-dark-vars"> and redefine --nexus-bg,
   --nexus-surface and --nexus-text under the same dark selector. */

/* ---------- Mode transition (disabled for reduced motion) ---------- */
body,.site-header,.mobile-navigation,.card,.main-navigation .sub-menu,.nexus-popup,.nexus-offcanvas,input,select,textarea,table,.site-footer{
  transition:background-color .25s ease,color .25s ease,border-color .25s ease;
}
@media (prefers-reduced-motion: reduce){
  body,.site-header,.mobile-navigation,.card,.main-navigation .sub-menu,.nexus-popup,.nexus-offcanvas,input,select,textarea,table,.site-footer{transition:none}
}

/* ---------- Toggle button (works in both modes) ---------- */
.nexus-mode-toggle{display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;padding:0;border-radius:50%;border:1px solid var(--nexus-border);background:transparent;color:var(--nexus-dark);cursor:pointer;flex:0 0 auto}
.nexus-mode-toggle:hover{border-color:var(--nexus-accent);color:var(--nexus-accent)}
.nexus-mode-toggle svg{width:20px;height:20px;display:block}
.nexus-mode-toggle .nexus-icon-sun{display:none}
.nexus-mode-toggle .nexus-icon-moon{display:block}
html[data-theme="dark"] .nexus-mode-toggle .nexus-icon-sun{display:block}
html[data-theme="dark"] .nexus-mode-toggle .nexus-icon-moon{display:none}
html[data-theme="dark"] .nexus-mode-toggle{color:var(--nexus-text)}
.main-navigation li.nexus-mode-toggle-item{display:flex;align-items:center}
.mobile-navigation li.nexus-mode-toggle-item{border-bottom:0;padding:.4rem 0}
/* Floating toggle: bottom-LEFT on purpose — the Nexus Translate pill and the
   back-to-top button both live bottom-right in this theme, so nothing overlaps. */
.nexus-mode-toggle-float{position:fixed;left:18px;bottom:18px;z-index:9985;width:48px;height:48px;background:#fff;box-shadow:0 4px 18px rgba(16,24,40,.18)}
html[data-theme="dark"] .nexus-mode-toggle-float{background:var(--nexus-surface);box-shadow:0 4px 18px rgba(0,0,0,.5)}

/* ---------- Dark palette: reassign the theme's real tokens ---------- */
html[data-theme="dark"]{
  --nexus-bg:#0f1420;
  --nexus-surface:#171e2e;
  --nexus-surface-2:#1f2940;
  --nexus-text:#e8ecf4;
  --nexus-muted:#9aa7bd;
  --nexus-border:rgba(255,255,255,.09);
  --nexus-light:#1f2940; /* --nexus-light is the theme's alt-surface token (alt sections, FAQ heads, chips) */
  --shadow:0 10px 30px rgba(0,0,0,.45);
  --shadow-hover:0 18px 40px rgba(0,0,0,.55);
  color-scheme:dark;
}
html[data-theme="dark"] body{background:var(--nexus-bg);color:var(--nexus-text)}
html[data-theme="dark"] h1,html[data-theme="dark"] h2,html[data-theme="dark"] h3,html[data-theme="dark"] h4{color:var(--nexus-text)}

/* ---------- Header / navigation surfaces ---------- */
html[data-theme="dark"] .site-header{background:var(--nexus-surface);border-bottom-color:var(--nexus-border)}
html[data-theme="dark"] .site-header.header-transparent{background:transparent}
html[data-theme="dark"] .site-title{color:var(--nexus-text)}
html[data-theme="dark"] .main-navigation a{color:var(--nexus-text)}
html[data-theme="dark"] .site-header.header-transparent .main-navigation a,html[data-theme="dark"] .site-header.header-transparent .site-title{color:#fff}
html[data-theme="dark"] .menu-toggle span{background:var(--nexus-text)}
html[data-theme="dark"] .mobile-navigation{background:var(--nexus-surface);border-top-color:var(--nexus-border)}
html[data-theme="dark"] .mobile-navigation li{border-bottom-color:var(--nexus-border)}
html[data-theme="dark"] .main-navigation .sub-menu{background:var(--nexus-surface);border:1px solid var(--nexus-border)}
html[data-theme="dark"] .topbar{background:#0b0f18}

/* ---------- Content surfaces ---------- */
html[data-theme="dark"] .card{background:var(--nexus-surface);border-color:var(--nexus-border)}
html[data-theme="dark"] .card h3 a{color:var(--nexus-text)}
html[data-theme="dark"] .nexus-pricing{background:var(--nexus-surface);border-color:var(--nexus-border)}
html[data-theme="dark"] .nexus-acc-item{background:var(--nexus-surface);border-color:var(--nexus-border)}
html[data-theme="dark"] .home-cta{background:var(--nexus-surface-2)}
html[data-theme="dark"] .nexus-404-cats li{background:var(--nexus-surface-2)}
html[data-theme="dark"] .widget-title{color:var(--nexus-text)}

/* ---------- Forms ---------- */
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea{
  background:var(--nexus-surface-2);color:var(--nexus-text);border-color:var(--nexus-border);
}
html[data-theme="dark"] input::placeholder,html[data-theme="dark"] textarea::placeholder{color:var(--nexus-muted)}
html[data-theme="dark"] .nexus-booking,html[data-theme="dark"] .nexus-converter{background:var(--nexus-surface);border-color:var(--nexus-border)}
html[data-theme="dark"] .nexus-booking input,html[data-theme="dark"] .nexus-booking select,html[data-theme="dark"] .nexus-booking textarea,
html[data-theme="dark"] .nexus-converter input,html[data-theme="dark"] .nexus-converter select{background:var(--nexus-surface-2)}

/* ---------- Tables / code ---------- */
html[data-theme="dark"] table{background:var(--nexus-surface)}
html[data-theme="dark"] th,html[data-theme="dark"] td{border-color:var(--nexus-border)}
html[data-theme="dark"] .market-table th{background:var(--nexus-surface-2)}
html[data-theme="dark"] pre,html[data-theme="dark"] code{background:var(--nexus-surface-2);color:var(--nexus-text)}
html[data-theme="dark"] pre code{background:transparent}

/* ---------- Alerts keep their meaning, lose the pastel glare ---------- */
html[data-theme="dark"] .nexus-alert-info{background:rgba(59,110,246,.16)}
html[data-theme="dark"] .nexus-alert-success{background:rgba(18,128,92,.2)}
html[data-theme="dark"] .nexus-alert-danger{background:rgba(192,57,43,.2)}
html[data-theme="dark"] .nexus-alert-warning{background:rgba(183,121,31,.22)}

/* ---------- Business Engine / maps / search surfaces ---------- */
html[data-theme="dark"] .nexus-dynamic-meta{background:var(--nexus-surface-2)}
html[data-theme="dark"] .nexus-popular-chip{background:var(--nexus-surface-2);border-color:var(--nexus-border)}
html[data-theme="dark"] .nexus-map-fallback{background:var(--nexus-surface-2)}
html[data-theme="dark"] .nexus-loc-tab{background:var(--nexus-surface);color:var(--nexus-text);border-color:var(--nexus-border)}
html[data-theme="dark"] .nexus-loc-panel{background:var(--nexus-surface);border-color:var(--nexus-border)}
html[data-theme="dark"] .nexus-live-results{background:var(--nexus-surface);color:var(--nexus-text);border-color:var(--nexus-border)}

/* ---------- Overlays: off-canvas, popup, translate pill ---------- */
html[data-theme="dark"] .nexus-offcanvas{background:var(--nexus-surface);color:var(--nexus-text)}
html[data-theme="dark"] .nexus-popup{background:var(--nexus-surface);color:var(--nexus-text)}
html[data-theme="dark"] .nexus-lang-float{background:var(--nexus-surface)!important;border-color:var(--nexus-border)!important;color:var(--nexus-text)}
html[data-theme="dark"] .nexus-lightbox-close{background:var(--nexus-surface-2);color:var(--nexus-text)}

/* ---------- Footer (already dark in light mode; deepen + retint borders) ---------- */
html[data-theme="dark"] .site-footer{background:#0b0f18;color:#c3ccd9}
html[data-theme="dark"] .footer-badges,html[data-theme="dark"] .sub-footer{border-top-color:var(--nexus-border)}

/* ---------- WooCommerce notices ---------- */
html[data-theme="dark"] .woocommerce-message,html[data-theme="dark"] .woocommerce-info,html[data-theme="dark"] .woocommerce-error{
  background:var(--nexus-surface-2);color:var(--nexus-text);border-color:var(--nexus-border);
}

/* ---------- Coming Soon (standalone document, already dark by design) ----------
   The template calls wp_head(), so the pre-paint script, this stylesheet and
   any owner palette are already printed there. In LIGHT mode its fixed dark
   panel becomes a light panel so the chosen mode is respected; in dark mode
   the template's own styling already matches and needs no override. */
html[data-theme="light"] .nexus-coming-soon{background:#f1f4f9;color:#17202a}
html[data-theme="light"] .nexus-coming-soon .nexus-countdown span{background:rgba(16,24,40,.07)}
