.hap-topbar {
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--hap-spacing-md);
  border-block-end: var(--hap-border-width-sm) solid
    var(--hap-color-divider-on-light);
  background-color: var(--hap-color-surface-brand-default);
  box-shadow: var(--hap-shadow-first-level-x) var(--hap-shadow-first-level-y)
    var(--hap-shadow-first-level-blur) 0px var(--hap-shadow-first-level-color);
}

.hap-topbar-nav {
  display: inline-flex;
  gap: var(--hap-spacing-md);
}

ul.hap-topbar-nav,
ol.hap-topbar-nav {
  list-style: none;
  padding: 0;
  margin: 0;

  li {
    /* Important, because otherwise the ::after for underlining will take a an additional line-height */
    display: flex;
    padding: 0;
    margin: 0;
  }
}

.hap-topbar-nav-item {
  font-family: var(--hap-typography-font-family-body);
  font-size: var(--hap-typography-font-size-bodytext-standard);
  font-weight: var(--hap-typography-font-weight-regular);
  letter-spacing: var(--hap-typography-letter-spacing-md);
  line-height: var(--hap-typography-line-height-bodytext-standard-singleline);
  text-decoration: none;
  color: var(--hap-color-text-brand-on-light);
  padding-inline: var(--hap-spacing-xs);
  border-radius: var(--hap-radius-minimal);

  &::after {
    display: block;
    content: "";
    block-size: var(--hap-border-width-md);
    border-radius: var(--hap-border-width-md);
    background-color: transparent;
    transition: all 150ms linear;
  }

  &:hover::after {
    background-color: var(--hap-color-text-brand-on-light);
  }

  &:active::after {
    background-color: transparent;
  }

  &:focus-visible {
    outline: var(--hap-border-width-md) solid
      var(--hap-color-border-focused-default);
  }
}

.hap-topbar-nav-item:where(
  :not(.hap-topbar-nav-item--current, :hover, :active, :focus-visible)
) {
  opacity: var(--hap-opacity-inactive);
}

.hap-topbar-nav-item--current::after {
  background-color: var(--hap-color-text-brand-on-light);
}

.hap-topbar-nav-item--disabled {
  opacity: var(--hap-opacity-disabled);
  pointer-events: none;
}
