/* Shared Yelbrands menu. Scoped so a host site's header CSS cannot restyle it. */
@import url("yb-lockup.css");

#yb-menu {
  --yb-teal: #000000;
  --yb-orange: #C57119;
  --yb-ink: #000000;
  --yb-font: "Open Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  position: sticky;
  top: 0;
  z-index: 100;
  box-sizing: border-box;
  height: calc(76px + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  display: flex;
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid rgba(37, 90, 93, 0.12);
  font-family: var(--yb-font);
  line-height: 1.55;
  color: var(--yb-ink);
  -webkit-font-smoothing: antialiased;
}

#yb-menu *,
#yb-menu *::before,
#yb-menu *::after {
  box-sizing: border-box;
}

#yb-menu.is-scrolled {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
}

#yb-menu .yb-menu-bar {
  width: 100%;
}

#yb-menu a {
  color: inherit;
  font-family: var(--yb-font);
  text-decoration: none;
}

#yb-menu button {
  font-family: var(--yb-font);
  font-size: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

#yb-menu ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

#yb-menu img {
  display: block;
  max-width: none;
  object-fit: contain;
  background: transparent;
}

#yb-menu .yb-menu-desktop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(100% - 48px, 1280px);
  margin: 0 auto;
}

#yb-menu .yb-menu-phone {
  display: none;
}

#yb-menu .yb-menu-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

#yb-menu .yb-menu-nav > a {
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 550;
  color: var(--yb-teal);
  transition: color 0.2s, background 0.2s;
}

#yb-menu .yb-menu-nav > a:hover {
  color: var(--yb-orange);
  background: rgba(197, 113, 25, 0.08);
}

#yb-menu .yb-menu-nav > a[aria-current="page"] {
  color: var(--yb-orange);
  background: rgba(197, 113, 25, 0.12);
  font-weight: 650;
}

#yb-menu .yb-menu-portal {
  position: relative;
  display: flex;
  flex-direction: column;
}

#yb-menu .yb-menu-portal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border: 1.5px solid rgba(37, 90, 93, 0.35);
  border-radius: 999px;
  background: transparent;
  color: var(--yb-teal);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s;
}

#yb-menu .yb-menu-portal-btn:hover {
  border-color: var(--yb-teal);
  background: rgba(37, 90, 93, 0.04);
}

#yb-menu .yb-menu-portal-list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 10;
  min-width: 200px;
  padding: 6px;
  background: #fff;
  border: 1px solid rgba(37, 90, 93, 0.12);
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.12);
}

#yb-menu .yb-menu-portal-start .yb-menu-portal-list {
  left: 0;
  right: auto;
}

#yb-menu .yb-menu-portal-list[hidden] {
  display: none;
}

#yb-menu .yb-menu-portal-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 550;
  line-height: 1.2;
  color: var(--yb-teal);
}

#yb-menu .yb-menu-portal-list a:hover,
#yb-menu .yb-menu-portal-list a:focus-visible {
  color: var(--yb-orange);
  background: rgba(197, 113, 25, 0.08);
}

#yb-menu .yb-menu-sheet {
  display: none;
}

#yb-menu .yb-menu-sheet:not([hidden]) {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-height: 100dvh;
  padding:
    max(24px, env(safe-area-inset-top, 0px))
    max(28px, env(safe-area-inset-right, 0px))
    calc(96px + env(safe-area-inset-bottom, 0px))
    max(28px, env(safe-area-inset-left, 0px));
  overflow-y: auto;
  overscroll-behavior: none;
  background: #ffffff;
  font-family: var(--yb-font);
}

#yb-menu .yb-menu-close {
  align-self: flex-end;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--yb-ink);
}

#yb-menu .yb-menu-close:hover {
  background: rgba(37, 90, 93, 0.06);
}

#yb-menu .yb-menu-sheet-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 24px;
}

#yb-menu .yb-menu-sheet-nav > a {
  padding: 6px 0;
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--yb-ink);
}

#yb-menu .yb-menu-sheet-nav > a:hover,
#yb-menu .yb-menu-sheet-nav > a[aria-current="page"] {
  color: var(--yb-orange);
}

#yb-menu .yb-menu-sheet .yb-menu-portal {
  margin-top: 8px;
  align-items: flex-start;
}

#yb-menu .yb-menu-sheet .yb-menu-portal-list {
  position: static;
  width: 100%;
  min-width: 0;
  margin-top: 4px;
  box-shadow: none;
}

#yb-menu .yb-menu-sheet .yb-menu-portal-list a {
  font-size: 1rem;
}

#yb-menu .yb-menu-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  justify-self: start;
  border: 1px solid rgba(37, 90, 93, 0.12);
  border-radius: 12px;
  background: transparent;
}

#yb-menu .yb-menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--yb-teal);
}

#yb-menu .yb-menu-phone .yb-lockup { justify-self: center; }

html.yb-menu-open,
body.yb-menu-open {
  overflow: hidden;
  overscroll-behavior: none;
}

body.yb-menu-open {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
}

.yb-menu-back {
  margin: 0;
  padding: 14px 20px;
  background: #ffffff;
  border-bottom: 1px solid rgba(18, 52, 58, 0.12);
  font-family: "Open Sans", system-ui, sans-serif;
}

.yb-menu-back a {
  color: #12343a;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
}

.yb-menu-back a:hover {
  color: #c57119;
}

@media (max-width: 768px) {
  #yb-menu {
    height: calc(64px + env(safe-area-inset-top, 0px));
  }

  #yb-menu .yb-menu-desktop {
    display: none;
  }

  #yb-menu .yb-menu-phone {
    /* !important beats the inline display:none FOUC guard in menu markup */
    display: grid !important;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    width: min(100% - 32px, 1280px);
    margin: 0 auto;
    min-height: 64px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #yb-menu .yb-menu-nav > a,
  #yb-menu .yb-menu-portal-btn,
  #yb-menu .yb-menu-portal-list a {
    transition: none;
  }
}
