/* The attendee portal's brand bar. Figma 516:5528. */

.portal-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0 1.5rem;
  min-height: 3.25rem;
  background: var(--wa-color-brand-fill-loud);
  color: var(--wa-color-brand-on-loud);
}

.portal-header__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: inherit;
  text-decoration: none;
  font-family: var(--wa-font-family-heading);
  font-weight: var(--wa-font-weight-heading);
  font-size: 1.125rem;
}

.portal-header__nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.portal-header__nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  border-radius: 0.375rem;
  color: inherit;
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
}

/* brand-40, matching the admin topbar. NOT --wa-color-brand-fill-normal, which
   resolves to brand-90 (#d9e4eb) and put white text on a near-white pill at
   1.29:1 against a 4.5:1 requirement. The design-token test passes either way —
   it checks that a token RESOLVES, never that the result can be read. */
.portal-header__nav-link:hover,
.portal-header__nav-link:focus-visible {
  background: var(--wa-color-brand-40);
}

.portal-header__nav-link--current {
  background: var(--wa-color-brand-40);
}

.portal-header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-inline-start: auto;
}

.portal-header__avatar-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.portal-header__profile-menu {
  padding: 0.75rem;
  min-width: 14rem;
}

.portal-header__profile-name {
  margin: 0;
  font-weight: 600;
}

.portal-header__profile-email {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  color: var(--wa-color-text-quiet);
  overflow-wrap: anywhere;
}

.portal-header__locale {
  margin: 0;
}

.portal-header__locale-select {
  max-inline-size: 7.5rem;
  font-size: 0.875rem;
  color: inherit;
  background: transparent;
  border: 0;
}

.portal-header__locale-select option {
  color: var(--wa-color-text-normal);
}

@media (max-width: 40rem) {
  .portal-header {
    gap: 0.75rem;
    padding: 0 0.75rem;
  }

  .portal-header__brand-name {
    display: none;
  }

  /* The avatar + selector must fit inside the bar — narrow phones overflowed
     by ~10px without a hard cap on the native select. */
  .portal-header__locale-select {
    max-inline-size: 3.5rem;
    padding-inline: 0;
  }

  .portal-header__actions {
    gap: 0.25rem;
  }
}

/* Off-screen until focused. The project's .visually-hidden helper has no focus
   escape, so a skip link built on it can never be reached — which is why this
   is spelled out rather than reusing it. */
.portal__skip-link {
  position: absolute;
  inset-inline-start: -9999px;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--wa-color-surface-default);
  color: var(--wa-color-text-link);
}

.portal__skip-link:focus {
  inset-inline-start: 0.5rem;
  top: 0.5rem;
}
