/* ── Legacy-alias bridge ───────────────────────────────────────────────────
   Hub-convergence dark-safety layer (NovaHerald / Reach, business-red skin).

   The logged-in /app pages were authored against a bespoke palette of legacy
   variables (--bg / --fg / --text / --muted / --border / --bg-elevated /
   --brand …) plus inline `var(--bg, #fff)` light-only fallbacks. theme.css
   only ever defined those legacy names for the LIGHT theme — so when a page is
   served dark (the new logged-in default), every legacy reference fell through
   to its light-colored fallback and rendered light-on-light (unreadable).

   This file RE-POINTS each legacy alias onto the canonical --lf-* token so the
   existing inline-styled content inherits the theme safely in BOTH light and
   dark. Load it AFTER leadfuel-design-tokens.css (which defines --lf-*) and
   AFTER theme.css (so this wins for the aliases). No markup changes required.

   Mirrors the bridge shipped in hub-ds/base.html for the same reason. */

:root,
html[data-theme="light"],
html[data-theme="dark"] {
  /* surfaces */
  --bg:            var(--lf-bg);
  --bg-elevated:   var(--lf-surface);
  --bg-subtle:     var(--lf-bg-soft);
  --bg-soft:       var(--lf-bg-soft);
  /* ink + text hierarchy */
  --fg:            var(--lf-ink);
  --text:          var(--lf-ink);
  --text-muted:    var(--lf-muted);
  --text-faint:    var(--lf-muted-soft);
  --muted:         var(--lf-muted);
  /* lines + borders */
  --border:        var(--lf-border);
  --border-strong: var(--lf-border);
  /* brand */
  --brand:         var(--lf-accent);
  --brand-hover:   var(--lf-accent-hover);
  --shadow:        var(--lf-shadow);
}

/* The old floating bottom-right toggle (#lf-theme-toggle, injected by
   theme.js) is superseded by the inline toggle that now lives in the .lf-nav.
   Hide the floater so we don't ship two theme switches on one page. The nav
   button reuses the same id, but it is a <button> inside .lf-nav, so scope the
   hide to the fixed floater that theme.js appends straight to <body>. */
body > #lf-theme-toggle { display: none !important; }

/* The brand wordmark prefix ("lead") uses --text; with the bridge above it now
   tracks --lf-ink and flips correctly in dark. Drop the theme.css light-only
   logo-darkening filter so the CSS wordmark stays its intended color in dark. */
html[data-theme="dark"] .logo-img { filter: none; }

/* intake.css ships dark hardcoded fallbacks for the bespoke hamburger menu;
   that menu is removed from the converged logged-in pages, but if any legacy
   page still renders one, keep it readable against the bridged surfaces. */
.hamburger-menu {
  background: var(--lf-surface) !important;
  border: 1px solid var(--lf-border) !important;
  color: var(--lf-ink) !important;
}
.hamburger-menu a,
.hamburger-menu button,
.hamburger-menu .menu-item { color: var(--lf-ink) !important; }
.hamburger-menu a:hover,
.hamburger-menu button:hover,
.hamburger-menu .menu-item:hover { background: var(--lf-bg-soft) !important; }

/* ── .lf-nav chrome not carried by the kit ─────────────────────────────────
   leadfuel-ui.css ships the base .lf-nav / .lf-nav-toggle / .lf-nav-burger /
   .lf-nav-drop. The remaining pieces (account name + its dropdown, the mobile
   drawer, the admin chip, the burger glyph) live in the hub's console.css,
   which this spoke does not vendor. Replicate them here, built only on --lf-*
   tokens, so the converged nav renders complete and theme-flips cleanly. */

/* Brand sub-label sitting next to the wordmark in the nav. */
.lf-nav-brand .brand-sub {
  font-size: var(--lf-fs-xs); color: var(--lf-muted);
  border-left: 1px solid var(--lf-border);
  padding-left: var(--lf-space-3);
  font-weight: var(--lf-fw-semibold); letter-spacing: 0.04em; text-transform: uppercase;
}
.lf-nav-brand .brand-sub .brand-sub-pre  { color: var(--lf-ink); font-weight: var(--lf-fw-bold); }
.lf-nav-brand .brand-sub .brand-sub-post { color: var(--lf-accent); font-weight: var(--lf-fw-bold); }

/* Account name (acts as a button that toggles the account dropdown). */
.lf-nav-account {
  font-size: var(--lf-fs-sm); font-weight: var(--lf-fw-semibold);
  color: var(--lf-ink-soft); cursor: pointer;
  display: inline-flex; align-items: center; gap: var(--lf-space-2);
  padding: var(--lf-space-1) var(--lf-space-2); border-radius: var(--lf-radius-sm);
  white-space: nowrap;
}
.lf-nav-account:hover { color: var(--lf-ink); background: var(--lf-bg-soft); }
.lf-nav-admin-chip { font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase; }

/* Burger glyph + open state. */
.lf-nav-burger-icon { display: inline-flex; line-height: 1; }
.lf-nav-burger.open { color: var(--lf-ink); }

/* Desktop account dropdown (Settings / Admin / Sign out). */
.lf-nav-account-menu {
  position: fixed; top: 58px; right: max(var(--lf-space-6), calc((100vw - 1080px) / 2 + var(--lf-space-6)));
  min-width: 190px; background: var(--lf-surface); border: 1px solid var(--lf-border);
  border-radius: var(--lf-radius); box-shadow: var(--lf-shadow-lg);
  padding: var(--lf-space-2); z-index: var(--lf-z-modal);
  display: flex; flex-direction: column; gap: 2px;
}
.lf-nav-account-menu[hidden] { display: none; }
.lf-nav-account-menu a,
.lf-nav-account-menu button {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  font: inherit; font-size: var(--lf-fs-sm); color: var(--lf-ink); cursor: pointer;
  padding: 8px 12px; border-radius: var(--lf-radius-sm); text-decoration: none;
}
.lf-nav-account-menu a:hover,
.lf-nav-account-menu button:hover { background: var(--lf-bg-soft); color: var(--lf-accent); }

/* Mobile drawer (collapses section links + account actions under the burger). */
.lf-nav-drawer {
  border-top: 1px solid var(--lf-border); background: var(--lf-surface);
  padding: var(--lf-space-3) var(--lf-space-6) var(--lf-space-5);
  display: flex; flex-direction: column; gap: 2px;
}
.lf-nav-drawer[hidden] { display: none; }
.lf-nav-drawer a,
.lf-nav-drawer button {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  font: inherit; font-size: var(--lf-fs-md); color: var(--lf-ink-soft); cursor: pointer;
  text-decoration: none; padding: 10px 4px; border-radius: var(--lf-radius-sm);
}
.lf-nav-drawer a:hover,
.lf-nav-drawer button:hover { color: var(--lf-accent); }
.lf-nav-drawer a.active { color: var(--lf-accent); font-weight: var(--lf-fw-bold); }
.lf-nav-drawer-section {
  font-size: var(--lf-fs-xs); font-weight: var(--lf-fw-bold); letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--lf-muted-soft);
  margin: var(--lf-space-3) 0 var(--lf-space-1);
}
/* Drawer only exists on mobile; hide its content on wide viewports where the
   inline links show instead. (The burger itself is already hidden >860px by
   the kit.) */
@media (min-width: 861px) { .lf-nav-drawer { display: none !important; } }

