/* Header layering */
header {
  position: relative;
  z-index: 3000;
}

.site-header-logo {
    height: 40px;
}

.site-header-slogan {
    font-size: 0.8em;
    color: white;
}

header .navbar {
  position: relative;
  z-index: 3000;
}

header .dropdown-menu {
  position: absolute;
  z-index: 3100;
  max-width: calc(100vw - 1rem);
}

/* Keep main content in a lower stacking context */
main {
  position: relative;
  z-index: 1;
}

/* Allow nav items to shrink/wrap within flex row */
header .navbar-nav,
header .navbar-nav .nav-item,
header .navbar-nav .nav-link {
  min-width: 0;
}

/* Account menu: prevent page widening */
.account-menu .dropdown-menu {
  max-width: min(90vw, 22rem);
  right: 0;
  left: auto;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.account-menu .dropdown-menu .dropdown-item,
.account-menu .dropdown-menu .dropdown-item-text {
  white-space: normal;
}

/* Account menu trigger: prevent long usernames from widening layout */
.account-menu {
  max-width: min(60vw, 14rem);
  min-width: 0;
  flex: 0 1 auto;
}

.account-menu > .nav-link {
  display: block;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}