@import "../../../scss/typo.mixins";
@import "../../../scss/breakpoints.mixins";

.radio {
  @extend %typo-18;

  position: relative;
  display: inline-flex;
  margin: 0 40px 0 0;
  line-height: 1; // used for vertical positioning
  user-select: none;
}

.radio__input {
  position: absolute;
  z-index: -1;
  opacity: 0;
}

.radio__indicator {
  display: flex;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-right: 20px;
  align-items: center;
  justify-content: center;
  background: $color-white;
  border: 1px solid $color-silver;
  border-radius: 50%;

  &::after {
    display: block;
    width: 6px;
    height: 6px;
    content: "";
    border: 1px solid #ccc;
    border-radius: 50%;
  }

  .radio__input:focus ~ &,
  .radio:hover .radio__input:not(:disabled) ~ & {
    border-color: $color-azure;

    &::after { // stylelint-disable-line
      background: $color-silver;
      border-color: $color-azure;
    }
  }

  .radio .radio__input:checked:not(:disabled) ~ &::after, // :not(:disabled) and .radio is used to give this more specifity than the :hover effect
  .radio__input:active:not(:disabled) ~ &::after {
    background: $color-azure;
    border-color: $color-azure;
  }
}

.radio__text {
  padding-top: 1px;
  color: $color-mineshaft;

  .radio__input:disabled ~ & {
    color: $color-dusty-gray;
  }
}
