/* ============================================================================
 * layout/header.css — fixed translucent global header
 * ============================================================================
 * Depends on: core/tokens.css
 * Authoritative source: ForceX_Header_Style_Directive.md
 *
 * Position is `fixed`, not `sticky`. The header must stay anchored to the
 * viewport while page content scrolls behind it — that's what the
 * backdrop-filter blur is for. (Sticky also fights with `overflow-x: hidden`
 * on html/body in some browser configurations; fixed sidesteps that.)
 *
 * Pages must use .page-container-top (defined in layout/containers.css) to
 * account for the fixed header's height when laying out their content.
 *
 * Scroll-state behavior: include /assets/js/components/fx-header-scroll.js
 * which toggles .fx-header--scrolled past 10px scroll for the slightly
 * darker/blurrier scrolled appearance.
 * ========================================================================== */

.fx-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: var(--z-header);
  height: var(--header-height);
  border-bottom: 1px solid var(--header-border);
  background: var(--header-bg);
  backdrop-filter: blur(var(--header-blur)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--header-blur)) saturate(140%);
  transition:
    background var(--header-transition),
    border-color var(--header-transition),
    backdrop-filter var(--header-transition);
}
@media (max-width: 600px) {
  .fx-header { height: var(--header-height-mobile); }
}

.fx-header--scrolled {
  background: var(--header-bg-scrolled);
  border-bottom-color: var(--header-border-strong);
  backdrop-filter: blur(var(--header-blur-scrolled)) saturate(145%);
  -webkit-backdrop-filter: blur(var(--header-blur-scrolled)) saturate(145%);
}

.fx-header__inner {
  max-width: var(--container-app);
  height: 100%;
  margin: 0 auto;
  padding: 0 var(--page-padding-x-desktop);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-6);
}
@media (max-width: 600px) {
  .fx-header__inner { padding: 0 var(--space-4); gap: var(--space-4); }
}

.fx-header__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  text-decoration: none;
  /* Drive inline brand SVG's currentColor from theme text token */
  color: var(--text);
}
.fx-header__brand img,
.fx-header__brand svg.fx-brand-svg {
  height: 28px;
  width: auto;
  display: block;
}
.fx-header__brand-sub {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--muted);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
@media (max-width: 600px) {
  .fx-header__brand-sub { display: none; }
}

.fx-header__nav {
  display: inline-flex;
  align-items: center;
  gap: var(--space-5);
  justify-self: center;
}
@media (max-width: 800px) {
  .fx-header__nav { display: none; }
}

.fx-header__actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  justify-self: end;
}

.fx-header__link {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: 1;
  color: var(--text);
  text-decoration: none;
  opacity: 0.9;
  transition: opacity var(--header-transition), color var(--header-transition);
}
.fx-header__link:hover { opacity: 1; text-decoration: none; }

.fx-header__badge {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--accent-lt);
  padding: 4px 11px;
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: var(--radius-sm);
  background: var(--accent-bg);
  line-height: 1.2;
}
