/* The signed-in person at the foot of the navbar, and the menu it opens. */
.user-menu {
  width: 100%;
}

.user-menu--trigger {
  width: 100%;
  padding: .5rem;
  justify-content: flex-start;
  gap: 1rem;
  border-radius: var(--radius-md);
  background-color: transparent;
  outline: none;
  box-shadow: none;
  cursor: pointer;

  &:hover,
  &[data-active="true"] {
    background-color: var(--surface-highlighted);
  }

  .intials--text[data-size="md"] {
    font-size: var(--rem-11);
  }
}

.user-menu--name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--rem-14);
  font-variation-settings: 'wght' var(--text-medium);
  color: var(--text-action-neutral);
  transition: opacity 0.2s linear, width 0.2s linear;
}

.navbar[data-open="false"] .user-menu--trigger {
  gap: 0;

  .user-menu--name {
    opacity: 0;
    width: 0;
  }
}

@media screen and (max-width: 768px) {
  .navbar:not([data-open="true"]) .user-menu--trigger {
    gap: 0;

    .user-menu--name {
      opacity: 0;
      width: 0;
    }
  }
}

/* On a phone the navbar is a row along the bottom, so the menu is the avatar alone. */
@media screen and (max-width: 576px) {
  .user-menu {
    width: fit-content;
    padding-right: .5rem;
  }

  .navbar .user-menu--trigger .user-menu--name {
    display: none;
  }
}

/* A button, unlike the link above it, so it needs the pointer and the left alignment. */
.user-menu--log-out {
  cursor: pointer;
  text-align: left;
}
