/*
 * SM92 v1.4.16 — Smooth, layout-stable mobile header.
 * Only the existing Gutenberg header is animated: NO markup replacement and
 * NO additional navigation. Desktop and the native mobile overlay are intact.
 *
 * Critical: the WP template-part wrapper keeps its EXPANDED layout height even
 * when the visual header is compact. Therefore the document never jumps up or
 * down when the sticky state changes (including when returning to the top).
 */
@media (max-width: 820px) {
  .wp-site-blocks > .wp-block-template-part:has(.site-header),
  .sm92-mobile-sticky-wrapper {
    position: sticky !important;
    top: 0;
    z-index: 999 !important;
    min-height: var(--sm92-header-reserved-height, auto);
    /* The transparent, reserved space must not block links beneath it. */
    pointer-events: none;
  }
  body.admin-bar .wp-site-blocks > .wp-block-template-part:has(.site-header),
  body.admin-bar .sm92-mobile-sticky-wrapper {
    top: var(--wp-admin--admin-bar--height, 46px) !important;
  }

  .site-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 999 !important;
    background: #081a35 !important;
    pointer-events: auto;
    box-shadow: none;
    transition: box-shadow .38s cubic-bezier(.22, 1, .36, 1);
  }
  .site-header.sm92-is-compact {
    box-shadow: 0 5px 18px rgba(2,12,28,.18),
                0 1px 0 rgba(255,255,255,.09) !important;
  }

  /* The preheader can smoothly collapse because neither height nor padding
     is swapped between auto and zero, and its inner row is never display:none. */
  .site-header .sm92-preheader {
    min-height: 0 !important;
    max-height: var(--sm92-preheader-natural-height, 160px);
    overflow: hidden;
    border-bottom: 0 !important;
    box-shadow: inset 0 -1px rgba(255,255,255,.14);
    opacity: 1;
    transition:
      max-height .38s cubic-bezier(.22, 1, .36, 1),
      opacity .28s ease,
      box-shadow .25s ease;
  }
  .site-header.sm92-is-compact .sm92-preheader {
    max-height: 0 !important;
    min-height: 0 !important;
    opacity: 0;
    box-shadow: none;
    pointer-events: none;
  }
  /* Keep the inner content at its natural height: animating min-height here
     would produce the 1-frame snap seen in the previous version. */

  /* Animate the actual row height; the outer wrapper independently reserves
     the original space, so the hero, ticker and page content never move. */
  .site-header .sm92-header-inner,
  .site-header .header-inner {
    height: var(--sm92-expanded-row-height, 77px) !important;
    min-height: 52px !important;
    max-height: none !important;
    box-sizing: border-box !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    transition: height .38s cubic-bezier(.22, 1, .36, 1);
  }
  .site-header.sm92-is-compact .sm92-header-inner,
  .site-header.sm92-is-compact .header-inner {
    height: 52px !important;
    min-height: 52px !important;
    max-height: 52px !important;
  }

  .site-header .sm92-brand-wp,
  .site-header .brand {
    gap: 12px;
    min-width: 0;
    transition: gap .38s cubic-bezier(.22, 1, .36, 1);
  }
  .site-header.sm92-is-compact .sm92-brand-wp,
  .site-header.sm92-is-compact .brand {
    flex: 0 1 auto !important;
    min-width: 0 !important;
    gap: 0 !important;
    margin: 0 !important;
  }

  /* Shrink rather than display:none: the brand slides gently into place. */
  .site-header .sm92-brand-wp .wp-block-site-logo {
    flex: 0 0 auto !important;
    width: var(--sm92-expanded-logo-width, 54px) !important;
    max-width: var(--sm92-expanded-logo-width, 54px) !important;
    min-width: 0 !important;
    overflow: hidden;
    opacity: 1;
    transition:
      width .38s cubic-bezier(.22, 1, .36, 1),
      max-width .38s cubic-bezier(.22, 1, .36, 1),
      opacity .25s ease;
  }
  .site-header.sm92-is-compact .sm92-brand-wp .wp-block-site-logo {
    width: 0 !important;
    max-width: 0 !important;
    opacity: 0;
    pointer-events: none;
  }

  .site-header .brand-bottom,
  .site-header .brand small {
    overflow: hidden;
    max-height: 28px;
    opacity: 1;
    transition:
      max-height .38s cubic-bezier(.22, 1, .36, 1),
      margin-top .38s cubic-bezier(.22, 1, .36, 1),
      opacity .20s ease;
  }
  .site-header.sm92-is-compact .brand-bottom,
  .site-header.sm92-is-compact .brand small {
    max-height: 0 !important;
    margin-top: 0 !important;
    opacity: 0;
    pointer-events: none;
  }
  .site-header .brand-lines {
    min-width: 0;
    transition: margin .38s cubic-bezier(.22, 1, .36, 1);
  }
  .site-header.sm92-is-compact .brand-lines {
    margin: 0 !important;
  }
  .site-header .brand-top,
  .site-header .brand b {
    transition:
      font-size .38s cubic-bezier(.22, 1, .36, 1),
      line-height .38s ease,
      letter-spacing .38s ease;
  }
  .site-header.sm92-is-compact .brand-top,
  .site-header.sm92-is-compact .brand b {
    font-family: 'Barlow Condensed', Impact, sans-serif !important;
    font-size: clamp(18px, 5.3vw, 22px) !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    letter-spacing: .015em !important;
    margin: 0 !important;
    color: #fff !important;
    white-space: nowrap !important;
  }
  .site-header.sm92-is-compact .brand-top strong,
  .site-header.sm92-is-compact .brand b strong { color: #f6cb44 !important; }

  /* Nav is already 44px at the expanded size; keep it stable to avoid snaps. */
  .site-header .sm92-navigation {
    flex: 0 0 44px !important;
    min-width: 44px !important;
    width: 44px !important;
    margin-left: auto !important;
    align-self: center !important;
    justify-content: flex-end !important;
  }
  .site-header .sm92-navigation .wp-block-navigation__responsive-container-open {
    width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
  }

  /* Avoid animated menu-control positions during any internal measurement. */
  .site-header.sm92-sticky-no-motion,
  .site-header.sm92-sticky-no-motion * { transition: none !important; }
}

@media (min-width: 601px) and (max-width: 820px) {
  body.admin-bar .wp-site-blocks > .wp-block-template-part:has(.site-header),
  body.admin-bar .sm92-mobile-sticky-wrapper { top: var(--wp-admin--admin-bar--height, 32px) !important; }
  body.admin-bar .site-header { top: 32px !important; }
}
@media (max-width: 600px) {
  body.admin-bar .site-header { top: 46px !important; }
}
@media (prefers-reduced-motion: reduce) {
  .site-header,
  .site-header .sm92-preheader,
  .site-header .sm92-header-inner,
  .site-header .header-inner,
  .site-header .sm92-brand-wp,
  .site-header .brand,
  .site-header .wp-block-site-logo,
  .site-header .brand-bottom,
  .site-header .brand small,
  .site-header .brand b,
  .site-header .brand-top,
  .site-header .brand-lines { transition: none !important; }
}
