@import url('/assets/css/bomforge-brand.css?v=20261011t');

/* ============================================
   BOMAtlas Header
   Flat, minimal. Light atlas theme.

   THEMING CONTRACT — read before editing colours.

   This file is loaded by ~2,583 pages that do NOT share a body
   stylesheet. Some of those page families are still on the old dark
   theme (profile/company/* -> pages/profile.css, trade-schools/states/*
   -> county-page.css?v=20261011t + design-tokens.css?v=20261011t, state pages ->
   state-detail.css?v=20261011t). A hard-coded light header would put a white bar on
   top of a black page for ~1,446 of them.

   So every colour here is `var(--token, <dark fallback>)`:
     - Page defines the token  -> page wins (light or dark, its choice).
     - Page defines nothing    -> dark fallback, i.e. today's appearance.

   profile-core.css?v=20261011t supplies the LIGHT values, so the atlas-light header
   appears on exactly the pages whose body is also light. design-tokens.css?v=20261011t
   (dark) and warm-theme.css?v=20261011t (light) already supply their own. Nothing
   here needs to change when a page family is migrated — that family just
   starts defining the tokens.
   ============================================ */

.bomatlas-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3000;
  background: var(--bg-surface, #171510);
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
  height: 48px;
}

.bomatlas-header.scrolled {
  background: var(--header-scrolled-bg, rgba(19, 17, 13, 0.96));
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
}

.bomatlas-header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  height: 48px;
}

/* Logo: plain link, left-aligned */
.bomatlas-logo {
  color: var(--text-primary, #f5f2eb);
  text-decoration: none;
  font-weight: var(--header-logo-weight, 700);
  font-size: 17px;
  letter-spacing: var(--header-logo-tracking, -0.01em);
  margin: -10px auto -10px -8px;
  -webkit-font-smoothing: antialiased;
  /* Tap area without moving the layout: the wordmark alone is ~24px tall. */
  display: inline-flex;
  align-items: center;
  padding: 10px 8px;
  border: none;
  background: none;
  font-family: inherit;
  cursor: pointer;
}

/* On 848 pages the wordmark is a <button> (the dropdown variant carrying
   .bomatlas-nav-dropdown-trigger, a class no stylesheet ever styled). The rules
   above were written for the <a> and never reset the button, so Chrome painted
   its own buttonface fill and a 2px outset bevel behind the near-white label:
   rgb(245,245,245) on rgb(239,239,239), 1.05:1. Measured by pixel, not by eye —
   8,389 of the button's 10,400 pixels were UA grey. The site's own name was
   unreadable in its own header, in both themes. */
button.bomatlas-logo,
.bomatlas-nav-dropdown-trigger {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: none;
  padding: 10px 8px;
  margin: -10px -8px;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
@media (hover: hover) {
  .bomatlas-logo:hover {
    opacity: 0.85;
  }
}

.bomatlas-logo-accent {
  color: var(--color-info, var(--ink));
}

/* Nav: right-aligned flat links */
.bomatlas-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.bomatlas-nav-link {
  color: var(--text-secondary, #97948e);
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
  padding: 10px 12px;
  margin: -4px 0;
  border-radius: 2px;
  transition:
    color 0.2s cubic-bezier(0.16, 1, 0.3, 1),
    background 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  -webkit-font-smoothing: antialiased;
  position: relative;
}
@media (hover: hover) {
  .bomatlas-nav-link:hover {
    color: var(--text-primary, #f5f2eb);
    background: var(--header-hover-bg, rgba(255, 255, 255, 0.06));
  }
}

.bomatlas-nav-link.active {
  color: var(--text-primary, #f5f2eb);
  background: var(--header-active-bg, rgba(255, 255, 255, 0.08));
}

.bomatlas-nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 12px;
  right: 12px;
  height: 2px;
  background: var(--color-info, var(--ink));
  border-radius: 2px;
}

/* CTA link */
.bomatlas-nav-link-auth {
  color: #fffff8 !important;
  font-weight: 600;
  background: var(--color-info-fill, #77746e) !important;
  padding: 8px 14px;
  border-radius: 2px;
}
@media (hover: hover) {
  .bomatlas-nav-link-auth:hover {
    background: var(--color-info-fill-hover, #696661) !important;
  }
}

/* Sidebar toggle (map pages only) */
.bomatlas-sidebar-toggle {
  color: var(--text-secondary, #97948e);
  background: transparent;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
  font-family: inherit;
  font-weight: 500;
  font-size: 13px;
  padding: 5px 12px;
  border-radius: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition:
    color 0.15s,
    background 0.15s,
    border-color 0.15s;
  -webkit-font-smoothing: antialiased;
}
@media (hover: hover) {
  .bomatlas-sidebar-toggle:hover {
    background: var(--header-hover-bg, rgba(255, 255, 255, 0.06));
    border-color: var(--header-hover-border, rgba(255, 255, 255, 0.12));
    color: var(--text-primary, #f5f2eb);
  }
}

.bomatlas-sidebar-toggle.active {
  background: var(--header-accent-soft, var(--paper-2));
  border-color: var(--header-accent-border, var(--line-strong));
  color: var(--header-accent-ink, var(--ink));
}

.bomatlas-sidebar-toggle-icon {
  font-size: 15px;
  line-height: 1;
}

/* Hamburger */
.bomatlas-menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  border-radius: 2px;
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
}
@media (hover: hover) {
  .bomatlas-menu-toggle:hover {
    background: var(--header-hover-bg, rgba(255, 255, 255, 0.06));
  }
}

.bomatlas-menu-toggle-icon {
  width: 18px;
  height: 2px;
  background: var(--text-secondary, #97948e);
  position: relative;
  transition: background 0.15s;
}

.bomatlas-menu-toggle-icon::before,
.bomatlas-menu-toggle-icon::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 2px;
  background: var(--text-secondary, #97948e);
  left: 0;
  transition: transform 0.2s ease;
}

.bomatlas-menu-toggle-icon::before {
  top: -6px;
}
.bomatlas-menu-toggle-icon::after {
  top: 6px;
}

.bomatlas-menu-toggle.active .bomatlas-menu-toggle-icon {
  background: transparent;
}

.bomatlas-menu-toggle.active .bomatlas-menu-toggle-icon::before {
  transform: rotate(45deg) translate(4px, 4px);
}

.bomatlas-menu-toggle.active .bomatlas-menu-toggle-icon::after {
  transform: rotate(-45deg) translate(4px, -4px);
}

/* Auth: signed-in user dropdown (injected by JS) */
.bomatlas-user-dropdown {
  position: relative;
  margin-left: 4px;
}

.bomatlas-user-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  background: transparent;
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
  border-radius: 2px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary, #f5f2eb);
  transition: background 0.15s;
}
@media (hover: hover) {
  .bomatlas-user-trigger:hover {
    background: var(--header-hover-bg, rgba(255, 255, 255, 0.06));
  }
}

.bomatlas-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--color-info, var(--ink));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fffff8;
  flex-shrink: 0;
}

.bomatlas-user-name {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* User dropdown menu */
.bomatlas-nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: var(--bg-void, #0e0c08);
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
  border-radius: 2px;
  padding: 4px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all 0.15s ease;
  box-shadow: var(--header-menu-shadow, 0 8px 24px rgba(0, 0, 0, 0.4));
  z-index: 1001;
}
.bomatlas-user-dropdown.active .bomatlas-nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
@media (hover: hover) {
  .bomatlas-user-dropdown:hover .bomatlas-nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}

.bomatlas-nav-dropdown-header {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-muted, #66635e);
  border-bottom: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
  margin-bottom: 4px;
}

.bomatlas-user-email {
  font-size: 12px;
  color: var(--text-secondary, #97948e);
  word-break: break-all;
}

.bomatlas-tenant-badge {
  display: inline-block;
  background: var(--header-accent-soft, var(--paper-2));
  color: var(--header-accent-ink, var(--ink));
  padding: 2px 8px;
  border-radius: 2px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
}

.bomatlas-nav-dropdown-section {
  padding: 8px 12px 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted, #66635e);
}

.bomatlas-nav-dropdown-item {
  display: block;
  padding: 8px 12px;
  color: var(--text-secondary, #97948e);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition:
    color 0.15s,
    background 0.15s;
}
@media (hover: hover) {
  .bomatlas-nav-dropdown-item:hover {
    background: var(--header-hover-bg, rgba(255, 255, 255, 0.06));
    color: var(--text-primary, #f5f2eb);
  }
}

.bomatlas-nav-dropdown-divider {
  height: 1px;
  background: var(--border-subtle, rgba(255, 255, 255, 0.06));
  margin: 4px 0;
}

.bomatlas-logout-btn {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  color: var(--header-danger-ink, #ec4654);
}
@media (hover: hover) {
  .bomatlas-logout-btn:hover {
    background: var(--header-danger-soft, rgba(236, 70, 84, 0.1)) !important;
    color: var(--header-danger-ink, #ec4654) !important;
  }
}

/* ============================================
   Mobile: <= 768px
   ============================================ */
@media (max-width: 768px) {
  .bomatlas-header-container {
    padding: 0 16px;
  }

  .bomatlas-menu-toggle {
    display: flex;
  }

  .bomatlas-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 260px;
    height: 100vh;
    background: var(--header-drawer-bg, var(--bg-void, #0e0c08));
    padding: 72px 16px 24px;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    transition: right 0.25s ease;
    box-shadow: var(--header-drawer-shadow, -4px 0 24px rgba(0, 0, 0, 0.6));
    border-left: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
    z-index: 2000;
    overflow-y: auto;
  }

  .bomatlas-nav.active {
    right: 0;
  }

  .bomatlas-nav-link {
    font-size: 15px;
    padding: 10px 12px;
  }

  .bomatlas-sidebar-toggle {
    display: none;
  }

  body.nav-open::before {
    content: '';
    position: fixed;
    inset: 0;
    background: var(--header-scrim, rgba(0, 0, 0, 0.5));
    z-index: 1999;
    animation: fadeIn 0.3s ease;
  }

  body.nav-open {
    overflow: hidden;
  }

  @keyframes fadeIn {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }

  .bomatlas-user-dropdown .bomatlas-nav-dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    background: var(--header-submenu-bg, rgba(255, 255, 255, 0.03));
    border-left: 2px solid var(--color-info, var(--ink));
  }
}

@media (max-width: 480px) {
  .bomatlas-logo {
    font-size: 16px;
  }

  /* The drawer's only dismissal is the tap-to-close scrim beside it, so it
     cannot be allowed to cover the whole width. At width:100% the scrim had
     zero tappable area, the hamburger sat under the drawer (z-index auto vs
     2000), there is no close button inside, and Escape was not handled: once
     open, the six nav links were the only way out and every one of them
     leaves the page. Keeping a 64px gutter restores the door. */
  .bomatlas-nav {
    width: min(100%, calc(100vw - 64px));
  }

  .bomatlas-user-name {
    display: none;
  }
}

@media (max-width: 1024px) {
  .bomatlas-sidebar-toggle-text {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bomatlas-nav,
  .bomatlas-nav-link,
  .bomatlas-nav-dropdown-menu,
  .bomatlas-menu-toggle-icon::before,
  .bomatlas-menu-toggle-icon::after {
    transition: none;
  }
}

/* Theme toggle */
.ba-theme-toggle {
  appearance: none;
  border: 1px solid var(--border-subtle, rgba(26, 23, 19, 0.12));
  background: transparent;
  color: var(--text-primary, inherit);
  font-size: 15px;
  line-height: 1;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  margin-left: 10px;
  transition:
    border-color 0.15s,
    background 0.15s;
}
@media (hover: hover) {
  .ba-theme-toggle:hover {
    border-color: var(--color-info, var(--ink));
    background: var(--header-hover-bg, rgba(26, 23, 19, 0.05));
  }
}
