@use "../global/fonts";
@use "../global/variables/colours";

button {
  &%block,
  &.block {
    background-color: transparent;
    border: none;
    font-size: 1em;
    padding: 0;
  }
}

button,
input[type="submit"] {
  &.button {
    appearance: none;
  }
}

%button,
.button {
  display: inline-block;
  padding: 0.5em 1.25em;
  border: 0.125em solid colours.$black;
  border-radius: 0.25em;
  background-color: colours.$black;
  color: colours.$white;
  font-family: fonts.$font;
  font-weight: 700;
  text-decoration: none;
  white-space: normal;
  cursor: pointer;
  transition: 300ms ease all;

  .knockout & {
    background-color: colours.$white;
    border-color: colours.$white;
    color: currentcolor;
  }

  &:hover,
  &:focus {
    color: colours.$white;
    text-decoration: none;
    background-color: rgba(colours.$black, 0.5);
    border-color: rgba(colours.$black, 0.5);

    .knockout & {
      background-color: rgba(colours.$white, 0.5);
      border-color: rgba(colours.$white, 0.5);
      color: currentcolor;
    }
  }

  &.outline {
    border-color: colours.$black;
    background-color: transparent;
    color: colours.$black;

    &:hover,
    &:focus {
      background-color: colours.$black;
      color: colours.$white;
    }

    .knockout & {
      @media screen {
        border-color: colours.$white;
        color: colours.$white;

        &:hover,
        &:focus {
          background-color: colours.$white;
          color: colours.$black;
        }
      }
    }
  }

  &.wide {
    padding-right: 3em;
    padding-left: 3em;
  }

  &.thin {
    padding-top: 0.5em;
    padding-bottom: 0.5em;
  }

  &.full {
    display: block;
    width: 100%;
    padding-right: 0.625em;
    padding-left: 0.625em;
    text-align: center;
  }

  &.small { font-size: 1em; }
  &.smaller { font-size: 0.875em; }
  &.big { font-size: 1.25em; }
  &.bigger { font-size: 1.5em; }
}

.button-wrap {
  margin: 1.5em -0.25em -0.25em;

  .button {
    margin: 0.25em;
  }
}
