/* ================================================================
   BPAGE HEADER CONTRACT — Shared for Preview + Published
   ================================================================
   Every theme header_section.php wraps its output in .bpage-header-hero.
   This creates a sub-stacking-context so header z-index can't escape
   and fight the editor toolbar (z-index: 10) in preview mode.

   Contract classes:
     .bpage-header-hero   — wrapper around header + hero (REQUIRED)
     .bpage-header-nav    — the <header> element itself (informational)
     .bpage-header-fixed  — marker for themes with position:fixed (OPTIONAL)

   Z-index scale (within section stacking context):
     toolbar: 10  |  wrapper: 0  |  header: theme's own z-index (trapped in wrapper)
   ================================================================ */

.bpage-header-hero {
    position: relative;
    z-index: 0;  /* Creates stacking context — traps children below toolbar */
}

/* NOTE: .bpage-header-nav does NOT set z-index here.
   Each theme sets its own z-index (typically 1000) in its theme CSS file.
   Setting z-index: 5 here with specificity (0,1,0) was overriding theme values
   because this file loads AFTER theme CSS. The wrapper's z-index: 0 already
   ensures header z-index is resolved within the wrapper's stacking context,
   so headers can never escape above the toolbar (z-index: 10). */

/* ================================================================
   HEADER NAV TYPOGRAPHY SHIELD
   ================================================================
   Prevents global body { line-height: 1.6 } from k3.css from inflating
   theme header navbars. Sets a compact baseline that themes can still
   override with their own explicit values.

   Targets .bpage-header-nav (the <header> element in every theme) and
   common child text elements. Does NOT use * to avoid icon/SVG side effects.
   ================================================================ */

.bpage-header-nav {
    line-height: 1.2;
}

.bpage-header-nav a,
.bpage-header-nav span,
.bpage-header-nav p,
.bpage-header-nav li,
.bpage-header-nav h1,
.bpage-header-nav h2,
.bpage-header-nav h3,
.bpage-header-nav button,
.bpage-header-nav .btn,
.bpage-header-nav .nav-link {
    line-height: 1.2;
}

/* Neutralize k3.css global heading/p margin inside header navbars.
   k3.css sets h1/h2/h3 with specific font-size clamp() values, but
   theme CSS overrides those via class selectors (.prime-company-name etc.)
   which have higher specificity than k3.css element selectors.
   We only reset margin here — font-size is left to themes. */
.bpage-header-nav h1,
.bpage-header-nav h2,
.bpage-header-nav h3,
.bpage-header-nav p {
    margin: 0;
}
