/* ==========================================================================
   MOBILE NAVIGATION — hamburger panel for the header Element (below 900px)

   The header is a GeneratePress Element stored in the database, so nothing
   here may depend on editing that markup. assets/js/nav-mobile.js injects the
   toggle button, adds .hd-nav-panel to the existing .gb-element-hdr002 wrapper
   and flags <html class="hd-nav-js"> before first paint.

   Every rule that restyles the header sits inside the max-width query, so the
   900px-and-up header is untouched. Kept out of style.css deliberately.
   ========================================================================== */

/* The injected button never shows on the desktop header. */
.theheidout-header .hd-nav-toggle{display:none;}

@media(max-width:899.98px){

  /* ---- the bar: logo, Order Online, toggle — one row, no wrapping ---- */
  .hd-nav-js .theheidout-header{flex-wrap:nowrap;gap:0.75rem;}

  /* The logo block carries an inline width:144px from the Element, which beats
     the stylesheet and costs ~145px of bar height. Scoped override. */
  .hd-nav-js .theheidout-header .hd-logo img{height:48px !important;width:auto !important;}
  /* The combined Heid Out + Fisher Peak logo is portrait (0.65:1); at 48px it
     shrinks to a 31px sliver, so the main header gives it 64px. The beer-page
     header keeps the round Fisher Peak seal at 48px. */
  .hd-nav-js .theheidout-header .hd-logo img.wp-image-504{height:64px !important;}

  /* Order Online rides in the bar — see layout() in nav-mobile.js. It and the
     toggle share one 48px control height so the bar reads as a single rail. */
  .hd-nav-js .theheidout-header .gb-text-hdr004{
    margin-left:auto;min-height:48px;align-items:center;
    padding:0 1rem;font-size:1rem;line-height:1;white-space:nowrap;
  }

  /* ---- toggle button ---- */
  .hd-nav-js .theheidout-header .hd-nav-toggle{
    display:inline-flex;align-items:center;gap:0.5rem;flex:0 0 auto;
    /* 48px matches the Order Online button beside it so the bar reads as
       one system; still clears the 44px touch-target floor. */
    min-height:48px;min-width:48px;margin:0;padding:0.5rem 0.8rem;
    border:1px solid var(--hd-hairline,rgba(172,132,88,0.30));border-radius:0;
    background:transparent;color:var(--hd-paper,#F5F3F0);
    font-family:var(--hd-font-display,'Bebas Neue','Oswald',sans-serif);
    font-size:1.05rem;line-height:1;letter-spacing:0.12em;text-transform:uppercase;
    cursor:pointer;-webkit-appearance:none;appearance:none;
    transition:color .25s ease,border-color .25s ease;
  }
  .hd-nav-js .theheidout-header .hd-nav-toggle:hover,
  .hd-nav-js .theheidout-header .hd-nav-toggle[aria-expanded="true"]{
    color:var(--hd-gold-bright,#c79e6e);border-color:var(--hd-gold-bright,#c79e6e);
  }
  .hd-nav-js .theheidout-header .hd-nav-toggle:focus-visible{
    outline:2px solid var(--hd-gold-bright,#c79e6e);outline-offset:2px;
  }
  .hd-nav-js .theheidout-header .hd-nav-toggle-text{display:block;padding-top:0.12em;}

  /* authored icon: three strokes that fold into a close mark */
  .hd-nav-js .theheidout-header .hd-nav-icon{display:block;width:24px;height:24px;overflow:visible;}
  .hd-nav-js .theheidout-header .hd-nav-stroke{
    stroke:currentColor;stroke-width:2;stroke-linecap:square;
    transform-box:view-box;transform-origin:center;
    transition:transform .3s cubic-bezier(.4,0,.2,1),opacity .2s ease;
  }
  .hd-nav-js .theheidout-header.hd-nav-open .hd-nav-stroke-1{transform:translateY(6px) rotate(45deg);}
  .hd-nav-js .theheidout-header.hd-nav-open .hd-nav-stroke-2{opacity:0;transform:scaleX(0);}
  .hd-nav-js .theheidout-header.hd-nav-open .hd-nav-stroke-3{transform:translateY(-6px) rotate(-45deg);}

  /* ---- panel: full-width sheet under the bar, out of flow so the sticky
     header never grows and page content never jumps ---- */
  .hd-nav-js .theheidout-header .hd-nav-panel{
    position:absolute;top:100%;left:0;right:0;
    display:none;flex-direction:column;align-items:stretch;gap:0;
    width:100%;margin:0;padding:0;
    background:var(--hd-navy-2,#0b2944);
    border-top:1px solid var(--hd-hairline,rgba(172,132,88,0.30));
    box-shadow:0 18px 40px rgba(0,0,0,0.45);
    max-height:calc(100vh - var(--hd-nav-bar-h,88px));
    overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;
  }
  .hd-nav-js .theheidout-header.hd-nav-open .hd-nav-panel{
    display:flex;animation:hd-nav-drop .28s cubic-bezier(.4,0,.2,1) both;
  }
  .hd-nav-js .theheidout-header .hd-nav-panel > nav{width:100%;}

  /* "Purveyors of Happiness" strip: nav-mobile.js moves .hd-slogan out of the
     collapsed panel into the header, where it wraps onto its own full-width
     row under logo / Order Online / Menu. The panel's top:100% then sits
     under the strip, and --hd-nav-bar-h includes it. */
  .hd-nav-js .theheidout-header:has(> .hd-slogan){flex-wrap:wrap;row-gap:0.55rem;}
  .hd-nav-js .theheidout-header > .hd-slogan{
    order:10;flex:0 0 100%;justify-content:center;justify-self:auto;gap:0.5rem;
    margin:0;padding-top:0.55rem;border-top:1px solid var(--hd-hairline,rgba(172,132,88,0.30));
  }
  .hd-nav-js .theheidout-header > .hd-slogan .gb-shape svg{height:1.55rem !important;}
  .hd-nav-js .theheidout-header > .hd-slogan .gb-text{
    font-size:0.72rem !important;letter-spacing:0.24em !important;padding-bottom:0.3rem !important;border-bottom:0 !important;
  }

  /* ---- menu inside the panel: stacked rows, 48px tall ---- */
  .hd-nav-js .theheidout-header .hd-nav-panel .gb-menu{
    display:block;width:100%;gap:0;margin:0;padding:0.25rem 0 0.5rem;
  }
  .hd-nav-js .theheidout-header .hd-nav-panel .gb-menu-item{
    display:block;width:100%;position:static;margin:0;
    border-top:1px solid rgba(255,255,255,0.07);
  }
  .hd-nav-js .theheidout-header .hd-nav-panel .gb-menu > .gb-menu-item:first-child{border-top:0;}
  .hd-nav-js .theheidout-header .hd-nav-panel .gb-menu .gb-menu-link{
    display:flex;align-items:center;width:100%;min-height:48px;
    padding:0.7rem clamp(1.25rem,4vw,3rem);
    font-size:1.25rem;letter-spacing:0.12em;
  }
  .hd-nav-js .theheidout-header .hd-nav-panel .gb-menu .gb-menu-link:focus-visible{
    outline:2px solid var(--hd-gold-bright,#c79e6e);outline-offset:-2px;
  }

  /* ---- sub-menus expand inline. The desktop reveal is hover-only, which is
     unreachable on touch, so inside the panel they are always open and GB's
     nested chevron control (a role=button inside the <a>) is removed. ---- */
  .hd-nav-js .theheidout-header .hd-nav-panel .gb-submenu-toggle{display:none;}
  .hd-nav-js .theheidout-header .hd-nav-panel .gb-menu .sub-menu{
    display:block;position:static;opacity:1;visibility:visible;
    transform:none;transition:none;box-shadow:none;
    width:100%;min-width:0;margin:0;padding:0;
    background:var(--hd-navy,#061B2F);
    border-top:1px solid rgba(255,255,255,0.07);
  }
  .hd-nav-js .theheidout-header .hd-nav-panel .gb-menu .sub-menu .gb-menu-item{
    border-top:1px solid rgba(255,255,255,0.05);
  }
  .hd-nav-js .theheidout-header .hd-nav-panel .gb-menu .sub-menu .gb-menu-item:first-child{border-top:0;}
  .hd-nav-js .theheidout-header .hd-nav-panel .gb-menu .sub-menu .gb-menu-link{
    min-height:44px;font-size:1.05rem;
    padding-left:calc(clamp(1.25rem,4vw,3rem) + 1.15rem);
    color:rgba(255,255,255,0.80) !important;
  }
  .hd-nav-js .theheidout-header .hd-nav-panel .gb-menu .sub-menu .gb-menu-link:hover,
  .hd-nav-js .theheidout-header .hd-nav-panel .gb-menu .sub-menu .gb-menu-link:focus{
    color:var(--hd-gold-bright,#c79e6e) !important;
  }

  /* ---- fit mode: the panel fills the viewport under the bar and the rows
     divide that height between them, so the menu never scrolls inside itself.
     nav-mobile.js adds .hd-nav-fit only when the share stays at or above the
     44px touch target; on short viewports (landscape phones) the class is left
     off and the panel keeps the capped, scrolling behaviour above.

     --hd-row-span / --hd-sub-span are written per item by fit() in the script:
     a top-level item's share is the number of rows it owns, itself plus its
     children, so one 7-child sub-menu does not get the same slice as a bare
     link. ---- */
  .hd-nav-js .theheidout-header.hd-nav-fit .hd-nav-panel{
    height:calc(100vh - var(--hd-nav-bar-h,88px));
    height:calc(100dvh - var(--hd-nav-bar-h,88px));
    max-height:none;overflow:hidden;
  }
  .hd-nav-js .theheidout-header.hd-nav-fit .hd-nav-panel > nav{
    display:flex;flex:1 1 auto;min-height:0;
  }
  .hd-nav-js .theheidout-header.hd-nav-fit .hd-nav-panel .gb-menu{
    display:flex;flex-direction:column;flex:1 1 auto;min-height:0;padding:0;
  }
  .hd-nav-js .theheidout-header.hd-nav-fit .hd-nav-panel .gb-menu > .gb-menu-item{
    display:flex;flex-direction:column;flex:var(--hd-row-span,1) 1 0;min-height:0;
  }
  .hd-nav-js .theheidout-header.hd-nav-fit .hd-nav-panel .gb-menu .gb-menu-link{
    flex:1 1 0;min-height:0;padding-top:0;padding-bottom:0;
  }
  .hd-nav-js .theheidout-header.hd-nav-fit .hd-nav-panel .gb-menu .sub-menu{
    display:flex;flex-direction:column;flex:var(--hd-sub-span,1) 1 0;min-height:0;
  }
  .hd-nav-js .theheidout-header.hd-nav-fit .hd-nav-panel .gb-menu .sub-menu .gb-menu-item{
    display:flex;flex-direction:column;flex:1 1 0;min-height:0;
  }
  .hd-nav-js .theheidout-header.hd-nav-fit .hd-nav-panel .gb-menu .sub-menu .gb-menu-link{
    flex:1 1 0;min-height:0;padding-top:0;padding-bottom:0;
  }
}

@keyframes hd-nav-drop{
  from{opacity:0;transform:translateY(-8px);}
  to{opacity:1;transform:none;}
}

@media(prefers-reduced-motion:reduce){
  .hd-nav-js .theheidout-header .hd-nav-stroke{transition:none;}
  .hd-nav-js .theheidout-header .hd-nav-toggle{transition:none;}
  .hd-nav-js .theheidout-header.hd-nav-open .hd-nav-panel{animation:none;}
}
