.avatar {
  position: relative;
  width: $avatar-size;
  height: $avatar-size;
  font-size: $h5-font-size;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: $font-weight-normal;
  color: $text-muted;
  text-align: center;
  text-transform: uppercase;
  vertical-align: bottom;
  user-select: none;
  background: $gray-200 no-repeat center/cover;
  border-radius: 50%;

  .icon {
    font-size: 1.25em;
  }

  .badge {
    position: absolute;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    box-shadow: 0 0 0 2px #fff;
  }

  @at-root a#{&} {
    cursor: pointer;
  }
}

@each $avatar-size, $size in $avatar-sizes {
  .avatar-#{$avatar-size} {
    width: $size;
    height: $size;
    font-size: $size / 2;
    line-height: $size;
  }
}


.avatar-list {
  display: inline-flex;
  padding: 0;
  margin: 0 0 -.5rem;

  .avatar {
    margin-bottom: .5rem;

    &:not(:last-child) {
      margin-right: .5rem;
    }
  }

  a.avatar {
    &:hover {
      z-index: 1;
    }
  }
}

.avatar-list-stacked {
  .avatar {
    margin-right: -.5rem !important;
    box-shadow: 0 0 0 2px #fff;

    @at-root .card-footer & {
      box-shadow: 0 0 0 2px $card-cap-bg;
    }
  }
}

.avatar-upload {
  width: 4rem;
  height: 4rem;
  border: 1px dashed $border-color;
  background: $form-check-input-bg;
  flex-direction: column;
  transition: .3s color, .3s background-color;

  svg {
    width: 1.5rem;
    height: 1.5rem;
    stroke-width: 1;
  }

  &:hover {
    border-color: $primary;
    color: $primary;
    text-decoration: none;
  }
}

.avatar-upload-text {
  font-size: $h6-font-size;
  line-height: 1;
  margin-top: .25rem;
}