/* Theme variables and tweaks for light vs dark modes */

/* Light theme (default) */
/* Theme variables and tweaks for light vs dark modes */

/* Light theme (default) */
:root,
:root[data-bs-theme="light"] {
  /* Core surfaces and text (from tokens) */
  --bs-body-bg: var(--map-surface, #ffffff);
  --bs-body-color: var(--map-text, #212529);
  --bs-heading-color: var(--map-text);
  --bs-link-color: var(--map-link, #0d6efd);
  --bs-link-hover-color: var(--map-link-hover, #0a58ca);

  /* Cards */
  --bs-card-bg: var(--map-surface);
  --bs-card-color: var(--map-text);
  --bs-card-border-color: color-mix(in srgb, var(--map-text) 12%, transparent);

  /* Buttons: inherit from Bootstrap + brand overrides (bss-overrides.css) */

  /* Accents */
  --hero-text-shadow: none;
}
/* Theme toggle button refinements */
#themeToggle.btn.btn-link {
  text-decoration: none;
  color: inherit;
  opacity: 0.85;
}
#themeToggle.btn.btn-link:hover,
#themeToggle.btn.btn-link:focus {
  opacity: 1;
  text-decoration: none;
}

/* Ensure the toggle stays visible over hero/overlays */
.theme-toggle-fixed {
  position: relative;
  z-index: 1050; /* above navbar bg/hero overlays */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9999px;
}
/* Icon color inherits; visibility aided by backdrop */
/* Icon inherits current color so we can control via utilities (e.g., text-white) */
#themeToggle.btn.btn-link .material-icons { color: currentColor; }
#themeToggle .material-icons {
  font-size: 20px;
  line-height: 1;
}

/* Themed backdrop for the round icon button */
:root[data-bs-theme="light"] .theme-toggle-fixed {
  background: rgba(255,255,255,0.9);
  border: 2px solid rgba(0,0,0,0.3);
}

:root[data-bs-theme="light"] #themeToggle .material-icons {
  color: #333333 !important;
}

:root[data-bs-theme="dark"] .theme-toggle-fixed {
  background: rgba(255,255,255,0.95);
  border: 2px solid rgba(255,255,255,0.8);
}

:root[data-bs-theme="dark"] #themeToggle .material-icons {
  color: #eb0029 !important;
}

/* Improve focus visibility */
#themeToggle:focus-visible {
  outline: 2px solid var(--bs-focus-ring-color, #86b7fe);
  outline-offset: 2px;
}

/* Dark theme */
:root[data-bs-theme="dark"] {
  --bs-body-bg: var(--map-surface, #0b0b0b);
  --bs-body-color: var(--map-text, #e9ecef);
  --bs-heading-color: var(--map-text);
  --bs-link-color: var(--map-link, #66b2ff);
  --bs-link-hover-color: var(--map-link-hover, #99ccff);

  --bs-card-bg: var(--map-surface-alt);
  --bs-card-color: var(--map-text);
  --bs-card-border-color: color-mix(in srgb, var(--map-text) 10%, transparent);

  /* Buttons: inherit from Bootstrap + brand overrides (bss-overrides.css) */

  --hero-text-shadow: 0 2px 12px rgba(0,0,0,0.8);
}

/* Apply colors consistently */
body {
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
  font-family: var(--font-body, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif);
  font-weight: var(--font-weight-body, 400);
  line-height: var(--font-lineheight-body, 1.55);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--bs-heading-color);
  font-family: var(--font-heading, var(--font-body, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif));
  font-weight: var(--font-weight-heading, 700);
  line-height: var(--font-lineheight-heading, 1.1);
  letter-spacing: var(--font-letterspacing-heading, .005em);
}

/* Adobe Fonts helpers -> map to tokenized families */
.tk-zuume, .tk-zuume-wide {
  font-family: var(--font-heading, var(--font-body, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif)) !important;
  font-weight: var(--font-weight-heading, 700);
}
.tk-industry {
  font-family: var(--font-body, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif) !important;
  font-weight: var(--font-weight-body, 400);
}

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

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

/* Navbar adapts to theme */
.navbar.gradient-navbar {
  background: linear-gradient(90deg, rgba(0,0,0,0.82), rgba(0,0,0,0.52));
  position: relative;
  z-index: 1040; /* ensure navbar stays above hero content */
}

.navbar .navbar-brand img {
  height: 40px;
  width: auto;
}

.navbar .btn.btn-primary.btn-sm { padding: .375rem .75rem; }
.navbar .btn.btn-outline-light.btn-sm { padding: .375rem .75rem; }

/* Navbar button theme adjustments */
/* Default: Light mode over hero - dark buttons with light text */
:root[data-bs-theme="light"] .navbar .btn-outline-light {
  --bs-btn-color: rgba(0, 0, 0, 0.85);
  --bs-btn-border-color: rgba(0, 0, 0, 0.3);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: rgba(0, 0, 0, 0.8);
  --bs-btn-hover-border-color: rgba(0, 0, 0, 0.8);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #000;
  --bs-btn-active-border-color: #000;
}

/* Dark mode: white buttons on dark navbar */
:root[data-bs-theme="dark"] .navbar .btn-outline-light {
  --bs-btn-color: rgba(255, 255, 255, 0.9);
  --bs-btn-border-color: rgba(255, 255, 255, 0.5);
  --bs-btn-hover-color: #000;
  --bs-btn-hover-bg: rgba(255, 255, 255, 0.95);
  --bs-btn-hover-border-color: rgba(255, 255, 255, 0.95);
  --bs-btn-active-color: #000;
  --bs-btn-active-bg: #fff;
  --bs-btn-active-border-color: #fff;
}

/* When navbar becomes solid (scrolled), use white outline in light mode too */
:root[data-bs-theme="light"] .navbar.navbar-solid .btn-outline-light {
  --bs-btn-color: rgba(255, 255, 255, 0.9);
  --bs-btn-border-color: rgba(255, 255, 255, 0.5);
  --bs-btn-hover-color: #000;
  --bs-btn-hover-bg: rgba(255, 255, 255, 0.95);
  --bs-btn-hover-border-color: rgba(255, 255, 255, 0.95);
  --bs-btn-active-color: #000;
  --bs-btn-active-bg: #fff;
  --bs-btn-active-border-color: #fff;
}

/* Space between brand, theme toggle, and burger */
.navbar .theme-toggle-fixed { margin-left: auto; }
@media (min-width: 992px) {
  .navbar .theme-toggle-fixed { margin-left: .75rem; margin-right: .75rem; }
}
@media (max-width: 991.98px) {
  .navbar .navbar-collapse { gap: .5rem; }
}

/* Solid navbar when scrolled */
.navbar.navbar-solid {
  background: color-mix(in srgb, #000 90%, transparent) !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  backdrop-filter: saturate(140%) blur(6px);
}

/* Hero and sections that rely on text contrast */
.header-text-main {
  text-shadow: var(--hero-text-shadow);
}

/* Hero helpers */
hr.hero-divider {
  border-color: rgba(255,255,255,0.4);
  opacity: 1;
}
:root[data-bs-theme="light"] hr.hero-divider {
  border-color: rgba(255,255,255,0.5);
}
:root[data-bs-theme="dark"] hr.hero-divider {
  border-color: rgba(255,255,255,0.35);
}

.hero-cta {
  gap: .75rem;
}
.hero-cta .btn {
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Hero: overlay to ensure text contrast across images */
.hero-section .carousel-item { position: relative; }
.hero-section .carousel-item::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0; /* above image (often z:-1) but below content */
  pointer-events: none;
  /* vignette + top gradient using tokens for subtle brand hint */
  background: radial-gradient(120% 100% at 50% 0%, rgba(0,0,0,0.45), rgba(0,0,0,0.65) 70%),
              linear-gradient(to bottom, rgba(0,0,0,0.35), transparent 40%);
}

/* Utility for elements that must flip specifically */
.theme-invert-light {
  display: none !important;
}
:root[data-bs-theme="dark"] .theme-invert-dark { display: none !important; }
:root[data-bs-theme="dark"] .theme-invert-light { display: inline-flex !important; }

/* Logo theming - DISABLED for now (always show light logos) */
.logo--dark {
  display: none !important;
}
.logo--light {
  display: inline-block !important;
}

/* Logo container for partner logos that need neutral backgrounds */
.logo-container {
  background: #ffffff;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
:root[data-bs-theme="dark"] .logo-container {
  background: #1e2630;
}

/* Buttons that used white text explicitly */
.btn-primary { color: var(--bs-btn-color, #fff); }

/* Optional: smooth color transition for small elements */
* {
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}
