/* Site UI layer for the header and footer.
   Loaded after site.min.css (purged template CSS) in both masters, so the
   rules here are not purged. Keep this file small and layout-neutral. */

/* Keyboard focus is visible everywhere. */
:focus-visible {
  outline: 2px solid #377dff;
  outline-offset: 2px;
}

/* Header */
#header .navbar-topbar .nav-link {
  color: #677788;
}

#header .navbar-topbar .nav-link:hover,
#header .navbar-topbar .nav-link:focus-visible {
  color: #21325b;
}

#header .navbar-nav > .nav-item > .nav-link:not(.btn) {
  font-weight: 500;
}

#header .navbar-nav > .nav-item > .nav-link:not(.btn):hover,
#header .navbar-nav > .nav-item > .nav-link:not(.btn):focus-visible {
  color: #377dff;
}

/* Footer */
footer.bg-dark h5 {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6) !important;
}

footer.bg-dark .link-light {
  color: rgba(255, 255, 255, 0.8);
}

footer.bg-dark a.link-light:hover,
footer.bg-dark a.nav-link:hover,
footer.bg-dark a.link-light:focus-visible,
footer.bg-dark a.nav-link:focus-visible {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

footer.bg-dark .list-separator-light li + li::before {
  color: rgba(255, 255, 255, 0.3);
}

/* Mobile: the topbar links show inline instead of behind a second toggle. */
@media (max-width: 991.98px) {
  #header .navbar-topbar > nav > .navbar-toggler,
  #header .navbar-topbar .navbar-toggler-wrapper {
    display: none;
  }

  #header #topbarNavDropdown.collapse:not(.show) {
    display: block;
  }

  #header #topbarNavDropdown {
    position: static;
    width: auto;
    height: auto;
    inset: auto;
    overflow: visible;
    background: none;
    box-shadow: none;
  }

  #header .navbar-topbar .navbar-nav {
    flex-direction: row;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 0.25rem;
  }
}

/* Typography */
body {
  color: #55657a;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
.h1 {
  letter-spacing: -0.02em;
}

h2,
.h2,
h3,
.h3 {
  letter-spacing: -0.01em;
}

/* Links inside running text are underlined so they read as links. */
main p a:not(.btn),
main li a:not(.btn):not(.nav-link):not(.list-group-item) {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: rgba(55, 125, 255, 0.45);
}

main p a:not(.btn):hover,
main li a:not(.btn):not(.nav-link):not(.list-group-item):hover {
  text-decoration-color: currentColor;
}

/* Buttons */
.btn {
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: background-color 0.15s ease-in-out, border-color 0.15s ease-in-out,
    color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, transform 0.15s ease-in-out;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  box-shadow: 0 0.5rem 1rem rgba(55, 125, 255, 0.2);
}

.btn:active {
  transform: translateY(1px);
}

@media (prefers-reduced-motion: reduce) {
  .btn,
  .btn:active {
    transition: none;
    transform: none;
  }
}

/* Demo pages: sidebar, code blocks and the content column */

/* The example list is long, so keep it in view while the example scrolls. */
@media (min-width: 992px) {
  #navbarSettings {
    position: sticky;
    top: 6rem;
    max-height: calc(100vh - 7rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 0.25rem;
  }
}

/* On phones the list would push the example far down the page, so cap it. */
@media (max-width: 991.98px) {
  /* The list uses nav-tabs, which lays groups out in a row; stack them. */
  #navbarSettings {
    flex-direction: column;
    flex-wrap: nowrap;
    overflow-x: hidden;
    max-height: 45vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-bottom: 1px solid rgba(33, 50, 91, 0.08);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
  }
}

#navbarSettings > .nav-item {
  width: 100%;
}

#navbarSettings .nav-link {
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
  white-space: normal;
}

#navbarSettings .nav-link.active {
  font-weight: 600;
  color: #21325b;
}

/* Code samples */
pre.editordemocode {
  max-width: 100%;
  overflow-x: auto;
  font-size: 0.8125rem;
  line-height: 1.6;
  padding: 1rem 1.25rem;
  margin-bottom: 0;
  -webkit-overflow-scrolling: touch;
}

