/* Phone/tablet header: full logo initially, compact menu after the hero. Desktop unchanged. */
.jg-mobile-actions { display: none; }
@media (max-width: 960px) {
  html.jg-mobile-header-ready { scroll-padding-top: calc(var(--jg-mobile-stack-height, 176px) + 12px); scroll-padding-bottom: 16px; }
  [data-jg-mobile-header] {
    position: sticky !important;
    top: var(--jg-mobile-admin-offset, 0px) !important;
    z-index: 90;
    box-sizing: border-box;
    margin: 0;
    padding: env(safe-area-inset-top, 0px) 0 0 !important;
    border: 0;
    background: #fff;
    box-shadow: 0 4px 18px #00164012;
  }
  .site-header[data-jg-mobile-header] {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 78px auto;
    min-height: 0;
    gap: 0;
  }
  .site-header[data-jg-mobile-header] > .brand { grid-area: 1 / 1; height: 64px; margin-left: max(20px, env(safe-area-inset-left)); }
  .site-header[data-jg-mobile-header] > .mobile-menu { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 16px); left: calc(100% - max(14px, env(safe-area-inset-right)) - 46px); margin: 0; }
  .site-header[data-jg-mobile-header] > :is(.header-actions, .mobile-header-phone) { display: none; }
  [data-jg-mobile-header] .jg-mobile-actions {
    grid-area: 2 / 1 / auto / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    margin: 0;
    padding: 0;
    gap: 0;
  }
  [data-jg-mobile-header] .jg-mobile-actions > a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    padding: 8px max(20px, env(safe-area-inset-left), env(safe-area-inset-right));
    border: 0;
    border-radius: 0;
    color: #00215e;
    line-height: 1.15;
    text-decoration: none !important;
    transform: none;
    box-shadow: none;
  }
  [data-jg-mobile-header] .jg-mobile-actions__quote {
    min-height: 40px;
    background: #e9f8fe;
    font-family: var(--font-jims-display, Arial), Arial, sans-serif;
    font-size: 17px;
    font-weight: 900;
    font-style: italic;
    letter-spacing: .01em;
    text-transform: uppercase;
  }
  .jg-mobile-actions__arrow { display: grid; place-items: center; box-sizing: border-box; flex: 0 0 23px; width: 23px; height: 23px; padding: 0; border-radius: 50%; background: #00215e; color: #fff; }
  .jg-mobile-actions__arrow svg { display: block; width: 16px; height: 16px; }
  [data-jg-mobile-header] .jg-mobile-actions > .jg-mobile-actions__call { min-height: 58px; padding-block: 7px; background: #00adef; font-family: Arial, sans-serif; text-transform: none; font-style: normal; }
  .jg-mobile-actions__phone { display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; border-radius: 50%; background: #fff; color: #00215e; }
  .jg-mobile-actions__phone svg { display: block; width: 20px; height: 20px; }
  .jg-mobile-actions__call-copy { display: grid; gap: 2px; text-align: left; }
  .jg-mobile-actions__call-copy > span { font: 700 13px/1.1 Arial, sans-serif; }
  .jg-mobile-actions__call-copy > strong { font: 900 25px/1.05 Arial, sans-serif; letter-spacing: .01em; }
  [data-jg-mobile-header] .jg-mobile-actions > a:hover { filter: brightness(.97); }
  [data-jg-mobile-header] .jg-mobile-actions > a:focus-visible { outline: 3px solid #00215e; outline-offset: -5px; }

  /* Preserve the native WordPress menu and its own overlay controller. */
  body.jimsglass-presentation.wp-theme-jims-wp .wp-site-blocks > header.wp-block-template-part[data-jg-mobile-header] > .wp-block-group { box-sizing: border-box; height: 78px; margin: 0 !important; padding: 0 !important; }
  header.wp-block-template-part[data-jg-mobile-header] .wp-block-group.alignwide { box-sizing: border-box; width: 100%; height: 78px; min-height: 0; padding: 0 max(18px, env(safe-area-inset-left)) !important; margin: 0; }
  header.wp-block-template-part[data-jg-mobile-header] .custom-logo { width: auto; height: 64px; }
  header.wp-block-template-part[data-jg-mobile-header] .wp-block-navigation__responsive-container-open { display: flex !important; align-items: center; justify-content: center; width: 46px; height: 46px; color: #00215e; }
  header.wp-block-template-part[data-jg-mobile-header] .wp-block-navigation__responsive-container:not(.is-menu-open) { display: none !important; }

  [data-jg-mobile-header].jg-mobile-header--compact { margin-bottom: 32px; background: #00215e; }
  .site-header[data-jg-mobile-header].jg-mobile-header--compact { grid-template-rows: 46px auto; }
  [data-jg-mobile-header] > .brand,
  header.wp-block-template-part[data-jg-mobile-header] .jims-net-header-logo { opacity: 1; visibility: visible; transform-origin: left center; }
  [data-jg-mobile-header].jg-mobile-header--compact > .brand,
  header.wp-block-template-part[data-jg-mobile-header].jg-mobile-header--compact .jims-net-header-logo { opacity: 0; visibility: hidden; transform: translateY(-5px) scale(.92); pointer-events: none; }
  .site-header[data-jg-mobile-header].jg-mobile-header--compact > .mobile-menu { top: env(safe-area-inset-top, 0px); left: max(14px, env(safe-area-inset-left)); color: #fff; }
  body.jimsglass-presentation.wp-theme-jims-wp .wp-site-blocks > header.wp-block-template-part[data-jg-mobile-header].jg-mobile-header--compact > .wp-block-group,
  header.wp-block-template-part[data-jg-mobile-header].jg-mobile-header--compact .wp-block-group.alignwide { height: 46px; }
  header.wp-block-template-part[data-jg-mobile-header].jg-mobile-header--compact nav.jims-glass-menu { margin: 0; }
  header.wp-block-template-part[data-jg-mobile-header].jg-mobile-header--compact .wp-block-navigation__responsive-container-open { color: #fff; transform: translateX(calc(-100vw + 2 * max(18px, env(safe-area-inset-left)) + 46px)); }

  /* The row and its compensating margin share one easing curve: content never
     shifts as the sticky stack shrinks. Enable after initial state is measured. */
  [data-jg-mobile-header].jg-mobile-header--animate {
    transition: grid-template-rows 280ms cubic-bezier(.22, 1, .36, 1), margin-bottom 280ms cubic-bezier(.22, 1, .36, 1), background-color 200ms ease;
  }
  [data-jg-mobile-header].jg-mobile-header--animate > .brand,
  header.wp-block-template-part[data-jg-mobile-header].jg-mobile-header--animate .jims-net-header-logo {
    transition: opacity 160ms ease, visibility 160ms, transform 280ms cubic-bezier(.22, 1, .36, 1);
  }
  .site-header[data-jg-mobile-header].jg-mobile-header--animate > .mobile-menu {
    transition: top 280ms cubic-bezier(.22, 1, .36, 1), left 280ms cubic-bezier(.22, 1, .36, 1), color 200ms ease;
  }
  body.jimsglass-presentation.wp-theme-jims-wp .wp-site-blocks > header.wp-block-template-part[data-jg-mobile-header].jg-mobile-header--animate > .wp-block-group,
  header.wp-block-template-part[data-jg-mobile-header].jg-mobile-header--animate .wp-block-group.alignwide {
    transition: height 280ms cubic-bezier(.22, 1, .36, 1);
  }
  header.wp-block-template-part[data-jg-mobile-header].jg-mobile-header--animate .wp-block-navigation__responsive-container-open {
    transition: transform 280ms cubic-bezier(.22, 1, .36, 1), color 200ms ease;
  }

  /* The bottom bar and its reserved space are replaced only after successful setup. */
  .jg-mobile-header-ready :is(.glass-service-mobile-cta, .legacy-service-mobile-cta, .service-hub-mobile-cta) { display: none !important; }
  .jg-mobile-header-ready .glass-service-page { padding-bottom: 0; }
}
@media (prefers-reduced-motion: reduce) {
  [data-jg-mobile-header].jg-mobile-header--animate,
  [data-jg-mobile-header].jg-mobile-header--animate > :is(.brand, .mobile-menu),
  body.jimsglass-presentation.wp-theme-jims-wp .wp-site-blocks > header.wp-block-template-part[data-jg-mobile-header].jg-mobile-header--animate > .wp-block-group,
  header.wp-block-template-part[data-jg-mobile-header].jg-mobile-header--animate :is(.jims-net-header-logo, .wp-block-group.alignwide, .wp-block-navigation__responsive-container-open) {
    transition: none !important;
  }
}
