/* Works on <a>, <button> and input[type=submit]. The width/margin resets
   undo the full-width defaults that forms.css gives every submit. */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: auto;
  margin-bottom: 0;
  min-height: 2.75rem;
  padding: 0 1.5em;

  font: inherit;
  font-size: 0.875em;
  font-weight: bold;
  text-align: center;
  text-decoration: none;

  color: var(--button-fg-color);
  background: var(--highlight-color);
  border: 0.0625rem solid transparent;
  border-radius: 0.5em;

  cursor: pointer;
  transition: 0.2s ease all;

  &:hover {
    color: var(--button-fg-color);
    text-decoration: none;
  }

  &:active {
    box-shadow:
      inset 0 0.125em 0.25em rgb(0 0 0 / 0.4),
      inset 0 0.25em 0.5em rgb(0 0 0 / 0.2);
  }
}

.button-secondary {
  color: var(--fg-color);
  background: var(--bg-color);
  border-color: var(--border-color);

  &:hover {
    color: var(--fg-color);
    background: var(--bg-highlight-color);
  }
}

.button-danger {
  color: var(--danger-color);

  &:hover {
    color: var(--danger-color);
  }
}

/* button_to wraps its button in a form, which forms.css stretches to 40em. */
form.button_to {
  display: inline-block;
  width: auto;
}
