/* Shared top bar for every page, the About page included.
   Self-contained: values are hard-coded and every selector is namespaced so the
   About page's own inline styles and variables cannot leak in or out. */

.site-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid #c9d0d9;
  background: #ffffff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.55;
}

.site-bar *,
.site-bar *::before,
.site-bar *::after {
  box-sizing: border-box;
}

.site-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  width: 100%;
  max-width: 1080px;
  min-height: 60px;
  margin: 0 auto;
  padding: 0.5rem 1.25rem;
}

.site-bar__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  color: #1c2430;
  font-size: 1rem;
  font-weight: 650;
  text-decoration: none;
}

.site-bar__brand img {
  display: block;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.site-bar__id {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.site-bar__social {
  display: flex;
  gap: 0.1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-bar__social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  color: #1c2430;
}

.site-bar__social a:hover {
  color: #164a90;
  background: #e8f0fb;
}

.site-bar__social svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.site-bar__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-bar__links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  color: #545f6d;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}

.site-bar__links a:hover {
  color: #1c2430;
  background: #e8f0fb;
}

.site-bar__links a[aria-current="page"] {
  color: #164a90;
  background: #e8f0fb;
}

.site-bar a:focus-visible {
  outline: 3px solid #1d5fb8;
  outline-offset: 3px;
}

/* Phones: one 48px row (photo and links); the name stays for screen readers. */
@media (max-width: 600px) {
  .site-bar__inner {
    flex-wrap: nowrap;
    min-height: 48px;
    padding: 0.25rem 1rem;
  }

  .site-bar__brand {
    min-height: 40px;
  }

  .site-bar__name {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .site-bar__links {
    gap: 0;
  }

  .site-bar__links a {
    min-height: 36px;
    padding-inline: 0.3rem;
    font-size: 0.75rem;
  }

  /* "Imaging projects" becomes "Imaging" so the links fit on one row. */
  .site-bar__long {
    display: none;
  }

  .site-bar__id {
    flex: none;
    gap: 0.25rem;
  }

  /* Never a second row: the links scroll sideways inside the bar. */
  .site-bar__inner > nav {
    min-width: 0;
  }

  .site-bar__links {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .site-bar__links a {
    white-space: nowrap;
  }

  .site-bar__brand img {
    width: 28px;
    height: 28px;
  }

  .site-bar__social a {
    width: 24px;
    height: 28px;
  }

  .site-bar__social svg {
    width: 14px;
    height: 14px;
  }
}

/* Very narrow phones (under 380px): tighter links so the bar stays on one row. */
@media (max-width: 379px) {
  .site-bar__inner {
    padding-inline: 0.6rem;
  }

  .site-bar__links {
    gap: 0;
  }

  .site-bar__links a {
    padding-inline: 0.35rem;
    font-size: 0.75rem;
  }

  .site-bar__social a {
    width: 26px;
  }
}

/* Tools sub-navigation: second row of the pinned bar on every tools page. */
.site-subnav {
  border-top: 1px solid #e3e7ec;
  background: #f7f8fa;
}

.site-subnav__links {
  display: flex;
  gap: 0.25rem;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0.3rem 1.25rem;
  overflow-x: auto;
  list-style: none;
  scrollbar-width: none;
}

.site-subnav__links a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  color: #545f6d;
  font-size: 0.875rem;
  white-space: nowrap;
  text-decoration: none;
}

.nav-beta {
  margin-left: 0.35rem;
  padding: 0 0.3rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.site-subnav__links a:hover {
  color: #1c2430;
  background: #e8f0fb;
}

.site-subnav__links a[aria-current="page"],
.site-subnav__links a[aria-current="location"] {
  color: #ffffff;
  background: #164a90;
}

.site-subnav a:focus-visible {
  outline: 3px solid #1d5fb8;
  outline-offset: -3px;
}

@media (max-width: 600px) {
  .site-subnav__links {
    padding: 0.25rem 0.75rem;
  }

  .site-subnav__links a {
    min-height: 30px;
    padding-inline: 0.55rem;
    font-size: 0.8125rem;
  }
}

