.button,
.dropbutton__item:first-of-type > *,
.dropbutton__toggle {
  font-size: var(--gin-font-size-s);
  font-weight: var(--gin-font-weight-semibold);
  color: var(--gin-color-primary);
  background-color: transparent;
  box-shadow: none;
  transition: var(--gin-transition);

  @include mq(wide) {
    font-size: var(--gin-font-size);
  }

  &:hover {
    background-color: var(--gin-color-primary-hover);
  }

  &:active, &:focus {
    background-color: var(--gin-color-primary-active);
  }

  &:hover, &:active, &:focus {
    color: var(--gin-color-button-text);
  }
}

.button,
.button:not(:focus),
.form-actions .button,
.action-link--icon-trash.action-link {
  font-size: var(--gin-font-size-s);
  padding: calc(var(--gin-spacing-s) - 2px) var(--gin-spacing-m);
  border: 2px solid var(--gin-color-primary) !important;
  border-radius: var(--gin-border-m);
  box-shadow: 0 1px 2px var(--gin-color-primary-light);
  transition: var(--gin-transition);

  &:hover {
    background-color: var(--gin-color-primary-hover);
    border-color: var(--gin-color-primary-hover) !important;
  }

  &:active, &:focus {
    border-color: var(--gin-color-primary-active) !important;
  }

  &:hover, &:active, &:focus, &:hover:focus {
    color: var(--gin-color-button-text);
  }
}

.form-actions .button {
  margin-right: var(--gin-spacing-xs);
}

.button.button--small {
  font-size: var(--gin-font-size-xxs);
  padding: calc(var(--gin-spacing-xxs) + 2px) var(--gin-spacing-s);
  border-radius: var(--gin-border-s);
}

.button.button--extrasmall {
  font-size: var(--gin-font-size-xxs);
  padding: var(--gin-spacing-xxs) var(--gin-spacing-s);
  border-radius: var(--gin-border-s);
}

#edit-submit.form-submit,
.button--primary,
.button--primary:not(:focus),
.ief-entity-submit {
  background: var(--gin-color-primary);
  box-shadow: .1em .25em .5em var(--gin-color-primary-light);

  &:hover {
    background-color: var(--gin-color-primary-hover);
  }

  &:active, &:focus {
    background-color: var(--gin-color-primary-active);
  }

  &, &:hover, &:active, &:focus {
    color: var(--gin-color-button-text);
  }
}

a.button:hover,
a.button:active {
  color: var(--gin-color-button-text);
}

a.button--primary:hover,
a.button--primary:active,
a.button--primary:focus,
a.button--primary:focus:hover {
  .gin--dark-mode & {
    color: var(--gin-bg-app);
  }
}

.button.button:disabled, .button.button.is-disabled {
  &, &:hover, &:active, &:focus {
    color: var(--gin-color-disabled);
    background: transparent;
    border: 2px solid var(--gin-color-disabled-border) !important;
    box-shadow: none;
  }
}

.button.button--primary:disabled, .button.button--primary.is-disabled {
  &, &:hover, &:active, &:focus {
    color: var(--gin-color-disabled);
    background-color: var(--gin-color-disabled-bg);
  }
}

.action-link.action-link--icon-trash {
  line-height: 1;
  min-height: 2.5rem;
  box-sizing: border-box;

  &, &:hover, &:active, &:focus, &:focus:hover {
    border: 2px solid var(--gin-color-danger) !important;
  }
}

// Autocomplete field remove button
.multiple-fields-remove-button.button {
  border: 0 none !important;
  mask-image: icon('remove');
  mask-size: 16px 16px;
  mask-repeat: no-repeat;
  mask-position: center center;
}
