/* HealthTeky desktop navbar: menu centred on the page, sized to fit (every page with the public/doctor/patient navbar).
   Loaded in <head> by healthstack.pwa.MobileAppMiddleware - unlike app.css, which comes last - so the bar is laid out
   correctly from the very first paint instead of jumping into place once the page has loaded. pwa/nav.js, inlined right
   after the navbar, sizes the menu straight away; until it has, the menu and the right side stay invisible for that
   instant (never longer than 1.5 s, even if the script failed). */
/* ─── Desktop navbar: menu centred on the page, sized to fit ───────────────────
   Three columns: brand | menu | contact + profile. The two outer columns share the
   leftover space equally (1fr each, never less than their content), so the menu's
   centre is the page's centre whatever the brand and the right side measure.
   pwa/nav.js (fitNav) then picks the menu's font size (13-19px) and spacing so the
   links exactly fill the room they have: fewer links, larger text; more, smaller.
   If even 13px can't sit at the page centre, the menu centres between brand and
   right side (.nav-offcenter); after that the icons go (.nav-noicons). Truncating a
   label stays the very last resort. */

/* The pieces of app.css's navbar rules that shape the bar, repeated here with stronger selectors (from <head> they must
   outrank the navbar templates' own <style> blocks) so nothing changes size when app.css arrives at the end of the page. */
@media (min-width: 992px) {
  html body .header-nav .main-nav li a .nav-ico,
  html body .header-nav .header-navbar-rht li a .nav-ico { display: inline-block; width: 1.15em; font-size: .9em; line-height: 1; text-align: center; opacity: .92; -ms-flex: 0 0 auto; flex: 0 0 auto; }
  html body .header-nav .main-menu-wrapper { display: -webkit-box; display: -ms-flexbox; display: flex; -ms-flex-align: stretch; align-items: stretch; }
  html body .header-nav .main-nav { -ms-flex-align: stretch; align-items: stretch; min-width: 0; }
  html body .header-nav .main-nav > li { display: -webkit-box; display: -ms-flexbox; display: flex; -ms-flex-align: stretch; align-items: stretch; min-width: 0; }
  /* "Login / Signup" in the list is for the phone menu only (the bar has its own button) - style.css hides it, but the
     rule above outranks that, so hide it again here */
  html body .header-nav .main-nav > li.login-link { display: none !important; }
  html body .header-nav .main-nav > li > a { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center;
    height: 100%; line-height: 1; white-space: nowrap; }
  html body .header-nav .main-nav > li > a > i { -ms-flex: 0 0 auto; flex: 0 0 auto; }
  html body .header-nav .main-nav > li > a > .nav-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
}
@media (min-width: 992px) and (max-width: 1399.98px) {
  html body .header-nav { padding-left: 18px; padding-right: 18px; }
}

@media (min-width: 992px) {
  html body .header-nav {
    display: grid !important;
    grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr);
    -webkit-box-align: center; -ms-flex-align: center; align-items: center;
    -webkit-column-gap: 20px; column-gap: 20px;
  }
  html body .header-nav.nav-offcenter { grid-template-columns: max-content minmax(0, 1fr) max-content; }
  html body .header-nav > .navbar-header { grid-column: 1; justify-self: start; min-width: 0; }
  html body .header-nav > .main-menu-wrapper { grid-column: 2; justify-self: center; align-self: stretch; min-width: 0; max-width: 100%; margin: 0 !important; }
  html body .header-nav > .header-navbar-rht { grid-column: 3; justify-self: end; margin: 0 !important; -ms-flex-wrap: nowrap; flex-wrap: nowrap; }
  /* the brand's old hard-coded gaps (52px + 20px) made the left side lopsided */
  html body .header-nav .navbar-header .logo { margin-right: 0 !important; width: auto !important; }
  html body .header-nav .navbar-header .logo h2 { margin-right: 0 !important; }
  /* even spacing: one gap between links, scaled with the font; per-link margins off */
  html body .header-nav .main-nav { -ms-flex: 0 0 auto; flex: 0 0 auto; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;
    gap: var(--nav-gap, 22px); margin: 0 !important; }
  html body .header-nav .main-nav > li { margin: 0 !important; -ms-flex: 0 0 auto; flex: 0 0 auto; }
  html body .header-nav .main-nav > li > a { font-size: var(--nav-fs, clamp(14px, 1.05vw, 18px)) !important; margin: 0 !important; }
  html body .header-nav .main-nav > li > a .nav-ico { margin-right: .42em; }
  html body .header-nav .main-nav a.nav-spacer { display: none !important; }
  /* while nav.js measures: the links animate size changes (transition: 0.4s), which would make it read stale widths */
  html body .header-nav.nav-measuring .main-nav,
  html body .header-nav.nav-measuring .main-nav *,
  html body .header-nav.nav-measuring .navbar-header *,
  html body .header-nav.nav-measuring .header-navbar-rht * { -webkit-transition: none !important; transition: none !important; }
  /* narrow laptops: a smaller brand, and the contact line (the signed-in person's own number) steps aside */
  html body .header-nav.nav-compact .navbar-header .logo h2 { font-size: 26px !important; }
  html body .header-nav.nav-compact .navbar-header .logo img { width: 34px !important; height: 34px !important; }
  html body .header-nav.nav-compact .header-navbar-rht .contact-item { display: none !important; }
  html body .header-nav.nav-noicons .main-nav .nav-ico { display: none !important; }
  /* last resort: the longest labels shorten with "…" rather than run into the right side */
  html body .header-nav.nav-squeeze .main-menu-wrapper { overflow: hidden; }
  html body .header-nav.nav-squeeze .main-nav { -ms-flex: 1 1 auto; flex: 1 1 auto; max-width: 100%; }
  html body .header-nav.nav-squeeze .main-nav > li { -ms-flex: 0 1 auto !important; flex: 0 1 auto !important; min-width: 0; }
}

/* hidden only until nav.js has sized the menu (it runs right after the navbar is parsed); shown after 1.5 s regardless */
@media (min-width: 992px) {
  html body .header-nav:not(.nav-fitted) > .main-menu-wrapper,
  html body .header-nav:not(.nav-fitted) > .header-navbar-rht { visibility: hidden; -webkit-animation: ht-nav-reveal 0s linear 1.5s forwards; animation: ht-nav-reveal 0s linear 1.5s forwards; }
}
@-webkit-keyframes ht-nav-reveal { to { visibility: visible; } }
@keyframes ht-nav-reveal { to { visibility: visible; } }