/* BR TOP NAV V1-R1 — BAR ALIGNMENT + MOBILE FACEBOOK
   Keeps V1 menu content/order. Fixes:
   1) desktop nav background must wrap menu content instead of stretching,
   2) mobile Facebook row is left-aligned with visible label.
*/

@media (min-width: 901px) {
  html body.siteBody header.top .wrap.nav {
    flex-wrap: nowrap !important;
    gap: 14px !important;
  }

  html body.siteBody header.top #site-primary-nav {
    flex: 0 0 auto !important;
    width: max-content !important;
    max-width: none !important;
    min-width: 0;
    margin-left: auto !important;
    display: flex;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    align-items: center;
    gap: 2px !important;
    white-space: nowrap;
  }

  html body.siteBody header.top #site-primary-nav > a {
    flex: 0 0 auto;
    padding-left: 7px !important;
    padding-right: 7px !important;
    font-size: 12.5px !important;
    white-space: nowrap;
  }

  html body.siteBody header.top #site-primary-nav > a.navFacebook {
    width: 34px;
    min-width: 34px;
    height: 34px;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center !important;
    border-radius: 999px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 0 !important;
    line-height: 1;
  }

  html body.siteBody header.top #site-primary-nav .navFacebookGlyph {
    display: inline-block;
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
    transform: translateY(1px);
  }

  html body.siteBody header.top #site-primary-nav .navFacebookLabel {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }
}

/* If the complete row becomes tight, Facebook is the first optional item. */
@media (min-width: 901px) and (max-width: 1080px) {
  html body.siteBody header.top #site-primary-nav > a {
    padding-left: 5px !important;
    padding-right: 5px !important;
    font-size: 12px !important;
  }

  html body.siteBody header.top #site-primary-nav > a.navFacebook {
    display: none !important;
  }
}

/* Mobile/hamburger — preserve existing menu mechanics; only Facebook alignment. */
@media (max-width: 900px) {
  html body.siteBody.mobileNavEnhanced header.top
  .wrap.nav #site-primary-nav > a.navFacebook {
    display: flex !important;
    width: 100% !important;
    max-width: none !important;
    align-items: center !important;
    justify-content: flex-start !important;
    text-align: left !important;
    gap: 10px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  html body.siteBody.mobileNavEnhanced header.top
  .wrap.nav #site-primary-nav .navFacebookGlyph {
    position: static !important;
    display: inline-flex !important;
    flex: 0 0 28px;
    align-items: center;
    justify-content: center;
    width: 28px !important;
    height: 28px !important;
    margin: 0 !important;
    border-radius: 999px;
    background: #1877f2;
    color: #fff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 19px !important;
    font-weight: 900;
    line-height: 1;
    transform: none !important;
  }

  html body.siteBody.mobileNavEnhanced header.top
  .wrap.nav #site-primary-nav .navFacebookLabel {
    position: static !important;
    display: inline !important;
    width: auto !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    clip: auto !important;
    white-space: normal !important;
    border: 0 !important;
    text-align: left !important;
  }
}
