/* Reserve the live fixed header when the browser scrolls to focused content. */
html {
  scroll-padding-top: var(--header-focus-offset, 0px);
}

/* The skip destination is programmatic, not an interactive visible control. */
#main-content:focus {
  outline: none;
}

/* Use the same outer inset for the logo and the Give call to action. */
#navbar .navbar-expand-lg {
  --navbar-edge-space: 1rem;
}

#navbar .navbar-expand-lg > .navbar-brand {
  margin-left: var(--navbar-edge-space);
}

#navbar .nav-item-give {
  margin-left: .75rem;
  margin-right: var(--navbar-edge-space);
}

#navbar .navbar-nav .nav-link.nav-give {
  padding: .5rem 1rem;
  border: 0;
  border-radius: 0;
  background: #1d4481;
  color: #fff;
  line-height: 1.75;
  white-space: nowrap;
}

#navbar .navbar-nav .nav-link.nav-give:hover,
#navbar .navbar-nav .nav-link.nav-give:focus {
  background: #173766;
  color: #fff;
}

/* Native disclosures retain the existing navigation-link presentation. */
#navbar button.dropdown-toggle {
  border: 0;
  border-radius: 0;
  background: transparent;
  font-family: inherit;
  line-height: 1.75;
  text-align: left;
  text-transform: inherit;
  cursor: pointer;
}

#navbar button.dropdown-toggle.active {
  padding: .5rem 1rem;
  background: #1d4481;
  color: #fff !important;
  font-weight: 700;
}

/* Keep navigation labels readable within the viewport. */
#navbar .dropdown-menu {
  max-width: calc(100vw - 2rem);
  /* Make links focusable immediately while the visual opening animation runs. */
  transition-property: opacity, transform;
}

/* A closed menu must leave the tab order immediately, even during a fade. */
#navbar .dropdown-menu:not(.show) {
  visibility: hidden;
  transition: none;
}

#navbar .dropdown-menu .dropdown-item {
  white-space: normal !important;
  overflow-wrap: anywhere;
  transition-property: color, background-color, box-shadow;
}

@media (min-width: 992px) {
  #navbar .dropdown-menu {
    width: 20rem;
  }
}

@media (max-width: 991.98px) {
  #navbar .nav-item-give {
    margin: .5rem var(--navbar-edge-space) 1rem;
  }

  #navbar button.dropdown-toggle {
    width: 100%;
  }

  #navbar .navbar-expand-lg > .navbar-brand {
    min-width: 0;
    flex: 1 1 0 !important;
    background-size: contain;
  }

  #navbar .navbar-toggle-wrap {
    flex-shrink: 0;
  }

  #navbar .navbar-collapse {
    max-height: var(--mobile-menu-max-height, calc(100vh - 5rem));
    overflow-y: auto;
    overscroll-behavior-y: contain;
  }

  #navbar .dropdown-menu {
    display: none;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    transform: none;
  }

  #navbar .dropdown-menu.show {
    display: block;
  }
}
