/* AriseVida mobile navigation — closed-shell first-paint layer, v4.
 * Install as a render-blocking head stylesheet after existing page styles.
 * The tiny head marker opts in with JS available; the controller continues
 * to own the menu panel, routes, focus, and open/close interactions.
 * All geometry matches the currently approved floating header. */
@media (max-width: 767.98px) {
  html[data-avfn-shell] #header.header {
    box-sizing: border-box;
    position: sticky;
    top: max(8px, env(safe-area-inset-top, 0px));
    width: calc(100% - max(16px, env(safe-area-inset-left, 0px)) - max(16px, env(safe-area-inset-right, 0px)));
    margin: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
    min-height: 64px;
    border: 1px solid rgba(7, 94, 92, .16);
    border-radius: 8px;
    background: #fffcf5;
    color: #075e5c;
    box-shadow: 0 6px 18px rgba(19, 60, 53, .10), 0 1px 3px rgba(19, 60, 53, .06);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    transform: none;
    z-index: 100;
  }
  html[data-avfn-shell] body:not(.is-home):not([data-page="home"]) #header.header:not([data-avfn-portaled]) {
    margin-top: 12px;
  }
  html[data-avfn-shell] #header .header-inner {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 62px;
    padding: 8px 12px;
    margin: 0;
    max-width: none;
  }
  html[data-avfn-shell] #header .header-right { display: none !important; }
  html[data-avfn-shell] #header .brand {
    display: flex;
    align-items: center;
    align-self: stretch;
    flex: 0 1 140px;
    min-width: 0;
    min-height: 44px;
    margin: 0;
    padding: 0;
    opacity: 1;
    transform: none;
    transition: none;
    pointer-events: auto;
  }
  html[data-avfn-shell] #header .brand img {
    display: block;
    width: 140px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    filter: none;
  }
  /* Before enhancement the existing .is-scrolled class is authoritative.
     Once enhancement is ready, its data-avfn-transparent rules take over.
     The default interior surface is cream; the home top is never booted white. */
  html[data-avfn-shell]:not([data-av-floating-nav]) body:is(.is-home, [data-page="home"]):not(.home-menu-open) #header.header:not(.is-scrolled) {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    color: #fff;
  }
  html[data-avfn-shell]:not([data-av-floating-nav]) body:is(.is-home, [data-page="home"]):not(.home-menu-open) #header.header:not(.is-scrolled) .brand img {
    filter: brightness(0) invert(1);
  }
  html[data-avfn-shell] #header .mobile-toggle {
    position: relative;
    display: block;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    cursor: pointer;
  }
  /* Match the two eventual .avfn-bar children before JS replaces the
     original three spans. Do not alter the legacy open fallback shape. */
  html[data-avfn-shell]:not([data-av-floating-nav]) #header .mobile-toggle:not(.is-open) > span {
    display: block;
    position: absolute;
    left: 11px;
    top: 17px;
    width: 22px;
    height: 2px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 2px;
    background: currentColor;
    opacity: 1;
    transform: none;
    pointer-events: none;
  }
  html[data-avfn-shell]:not([data-av-floating-nav]) #header .mobile-toggle:not(.is-open) > span:nth-child(2) { top: 25px; }
  html[data-avfn-shell]:not([data-av-floating-nav]) #header .mobile-toggle:not(.is-open) > span:nth-child(n+3) { display: none; }
  html[data-avfn-shell]:not([data-av-floating-nav]) #header.header,
  html[data-avfn-shell]:not([data-av-floating-nav]) #header .brand img,
  html[data-avfn-shell]:not([data-av-floating-nav]) #header .mobile-toggle > span {
    transition: none;
  }
}
