/* Buttons: `.icon-button` (icon-only, used in result rows and the header) and `.button` with its variants, below. */

.icon-button {
  display: inline-grid;
  place-items: center;
  width: var(--size-control-sm);
  height: var(--size-control-sm);
  padding: 0;
  color: var(--color-text-muted);
  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.icon-button:hover:not(:disabled),
.icon-button:focus-visible {
  color: var(--color-accent);
  background: color-mix(in srgb, var(--color-accent) 10%, transparent);
}

.icon-button:disabled {
  color: var(--color-text-faint);
  cursor: not-allowed;
}

/* Buttons. `.button` is the site's one button, for a <button> or a link: a quiet outlined pill (the colour of the text,
   its outline --color-border-control, 3:1 like every control boundary) that fills faintly on hover; the accent is kept
   for the main action.
   Variants: `.button-primary` (the main action: filled), `.button-danger` (delete: red text and outline, filled on hover),
   `.button-danger-solid` (confirm a delete), `.button-danger-outline` (delete the account). Size: `.button-small`.
   They work anywhere, not only inside a dialog. The base states put their conditions in `:where()`, so they weigh
   the same as `.button` itself and beat it (they come later), while a variant (later still) beats them. Round and icon-only controls (deck, record, swap, play, star, `.icon-button`) are their own
   components. All of them are shown on /dev/styleguide in development. */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--size-control-sm);
  padding: var(--space-2) var(--space-5);
  color: var(--color-text);
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  line-height: var(--leading-tight);
  text-decoration: none;
  background: var(--color-surface);
  border: var(--border-width) solid var(--color-border-control);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition:
    color var(--duration-base),
    background-color var(--duration-base),
    border-color var(--duration-base),
    transform var(--duration-base);
}

.button:where(:hover:not(:disabled, [aria-busy='true'])) {
  background: color-mix(in srgb, var(--color-text) 6%, var(--color-surface));
  border-color: var(--color-text-muted);
}

.button:where(:active:not(:disabled)) {
  transform: translateY(1px);
}

.button:where(:disabled) {
  opacity: var(--opacity-disabled);
  cursor: not-allowed;
}

.button:where([aria-busy='true']) {
  opacity: var(--opacity-muted);
  cursor: progress;
}

.button-primary {
  color: var(--color-on-accent);
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.button-primary:hover:not(:disabled, [aria-busy='true']) {
  background: color-mix(in srgb, var(--color-accent) 85%, var(--color-text));
  border-color: color-mix(in srgb, var(--color-accent) 85%, var(--color-text));
}

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

.button-danger:hover:not(:disabled, [aria-busy='true']),
.button-danger-solid {
  color: var(--color-on-solid);
  background: var(--color-danger-solid);
  border-color: var(--color-danger);
}

.button-danger-outline {
  padding: var(--space-2) var(--space-4);
  color: var(--color-danger);
  background: transparent;
  border-color: var(--color-danger);
}

.button-danger-outline:hover:not(:disabled, [aria-busy='true']) {
  color: var(--color-surface);
  background: var(--color-danger);
  border-color: var(--color-danger);
}

.button-danger-outline:focus-visible {
  --focus-ring-color: var(--color-danger);
}

.button-small {
  min-height: auto;
  padding: var(--space-1) var(--space-4);
  font-size: var(--text-sm);
}
