/* navbar.css */

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;

  background: var(--mantle);
  border-bottom: 1px solid var(--surface);
}

.navbar-inner {
  width: var(--site-shell);

  margin: 0 auto;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;

  padding: 14px 0;
}

.navbar-primary {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.navbar-brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.navbar-brand img {
  display: block;
}

.navbar-brand:hover {
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}

.navbar-nav {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  min-width: 0;
}

.navbar-account {
  display: flex;
  justify-content: flex-end;
  flex: 0 1 190px;
  min-width: 72px;
}

.navbar-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: var(--sub);
  text-decoration: none;
  transition: color 0.15s ease;
}

.navbar-link:hover {
  color: var(--blue);
}

.account-link {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 180px;
  color: var(--sub);
  text-decoration: none;
}

.account-link:hover {
  color: var(--blue);
}

.account-link img {
  border-radius: 50%;
}

.account-link > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
}

@media (max-width: 760px) {
  .navbar-inner {
    width: min(94vw, 560px);
    gap: 12px;
  }

  .navbar-primary {
    gap: 8px;
    overflow: hidden;
  }

  .navbar-nav {
    white-space: nowrap;
    overflow: visible;
  }

  .navbar-account {
    flex-basis: auto;
  }

  .account-link > span:last-child {
    display: none;
  }
}

@media (max-width: 480px) {
  .navbar-inner {
    width: 96vw;
  }

  .navbar-brand {
    width: 40px;
    height: 40px;
  }

  .navbar-nav {
    gap: 7px;
    font-size: 0.82rem;
  }
}
