.badge {
  text-decoration: none;
  font-size: $font-size-small;
  transition: $standard-transition;
  overflow: hidden;
  position: relative;

  img {
    width: 28px;
    height: 28px;
    object-fit: cover;
    flex-shrink: 0;
    position: absolute;
    left: 0.25rem;
  }

  span {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .organisation-logo {
    width: 28px;
    height: 28px;
  }

  .close {
    @extend %icon-font, .icon-cancel-circle ;

    color: $mediumgrey;
    margin-left: 0.5rem;
    font-size: 0 !important;
    opacity: 1;

    &:hover,
    &:hover:not(:disabled):not(.disabled) {
      opacity: 1;
    }

    &::before {
      font-size: 15px;
    }
  }
}

.badge-pill {
  border-radius: 1.125rem;
  padding: 0.25rem 0.75rem;
  height: 2.25rem;
  min-width: 4rem;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-weight: 400;
  transition: $standard-transition;
  line-height: 1.5;

  &[href] {
    &:hover {
      background-color: $darkblue;
    }
  }

  &.img-chip {
    padding: 0.25rem 0.75rem 0.25rem calc(0.75rem + 28px);
  }

  .organisation-logo {
    position: absolute;
    left: 0.25rem;
  }

  .pill-close {
    background-color: transparent;
    border: 0;
    color: $white;
    text-decoration: none;
  }
}

.badge-primary {
  background: $blue;
  font-size: $font-size-smallest;
  font-weight: normal;
  padding: 0.5rem;

  &[href] {
    &:hover {
      background-color: $innovationblue-dark;
    }
  }
}

.badge-primary-light {
  background-color: $lightblue;
  color: $mediumgrey;
  font-size: $font-size-small;
  border-radius: 2.25rem;
  align-items: center !important;
  margin-right: 0;

  &.remove-button {
    padding-right: 0.65rem;
  }

  &[href],
  &.remove-button {
    &:hover {
      background-color: $lightblue-dark;
    }
  }
}

.badge-secondary {
  background-color: $bodygrey;
  color: $black;

  &[href] {
    &:hover,
    &:focus {
      color: $black;
      background: $middlegrey !important;
      box-shadow: 0 4px 8px rgb(0 0 0 / 15%);
    }
  }
}

.badge-light {
  background-color: $white;
  color: $black;
  padding: 0.25rem 0.75rem;
  height: 2.25rem;
  min-width: 4rem;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition: $standard-transition;
  line-height: 1.25;

  &[href] {
    &:hover,
    &:focus {
      background-color: $bodygrey !important;
      box-shadow: 0 4px 8px rgb(0 0 0 / 15%);
    }
  }
}

.badge-outline-light {
  background-color: $white;
  border: 1px solid $lightbluemagenta;
  color: $mediumgrey;
  display: inline-flex;
  align-items: center;
  font-weight: normal;
  font-size: $font-size-small;
  padding: 0 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 13rem;
  line-height: 1.5;
  height: calc(2rem - 1px);

  &:hover,
  &:focus {
    color: $mediumgrey;
    background: $bodygrey !important;
  }

  &.active {
    border-color: $innovationblue;
    background-color: $lightblue-dark;
    box-shadow: 0 4px 8px rgb(0 0 0 / 15%);
  }

  .icon-clear {
    color: $black;
    font-size: 1.25rem;
    margin-left: 0.25rem;
  }
}
