/* Buttons: the one component the app, the listening player and the static showcase share.
   Tokens only (tokens.css loads first). Primary (filled), secondary (outlined), danger, small,
   disabled and the link-styled button; 44px high; the label says the action. */

button, .button, .button-secondary, .button-danger, .button-danger-outline {
  font: inherit;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 2.75rem;
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-control);
  border: 2px solid var(--accent);
  background: var(--bg);
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
  line-height: 1.25;
  max-width: 100%;
  text-align: center;
}
.button, button.button { background: var(--accent); color: var(--on-accent); }
.button:visited, .button:hover, .button-danger:visited, .button-danger:hover { color: var(--on-accent); }
.button:hover, button.button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.button-secondary, .button-secondary:visited { background: var(--bg); color: var(--accent); }
.button-secondary:hover, button:hover { background: var(--accent-tint); color: var(--accent-hover); border-color: var(--accent-hover); text-decoration: none; }
.button-danger, .button-danger:visited { background: var(--err); border-color: var(--err); color: var(--on-accent); }
.button-danger:hover { background: var(--err-strong); border-color: var(--err-strong); }
/* Deleting is never styled like Keep or Save. The button that opens the delete confirmation is red
   text on the page color with a red border; the confirmation page's own button stays the filled
   `button-danger`. The label also says what is deleted, so color is not the only cue. */
.button-danger-outline, .button-danger-outline:visited { background: var(--bg); color: var(--err); border-color: var(--err); }
.button-danger-outline:hover, button.button-danger-outline:hover { background: var(--err-tint); color: var(--err-strong); border-color: var(--err-strong); }
.button-small { min-height: 2.25rem; padding: var(--space-1) var(--space-4); }
button[disabled], button[aria-disabled="true"], .button[aria-disabled="true"] { cursor: not-allowed; opacity: 1; background: var(--surface-2); border-color: var(--border-control); color: var(--ink-muted); }
.link-button {
  background: none; border: 0; padding: 0; min-height: var(--target-min); min-width: var(--target-min); color: var(--accent); font-weight: 400;
  text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; display: inline-flex; align-items: center;
}
.link-button:hover { background: none; color: var(--accent-hover); }
/* Pressed, and busy while its form is on its way (the one submit rule, app.js): pressed sits
   a pixel lower with an inner edge; busy keeps the disabled look above and adds a dashed
   outline, so the change is not color alone. */
button:active, .button:active { box-shadow: inset 0 2px 0 var(--border-control); }
button[aria-busy="true"], .button[aria-busy="true"] { cursor: progress; outline: 2px dashed var(--border-control); outline-offset: 2px; }

@media (prefers-reduced-motion: no-preference) {
  a, button, .button, .button-secondary, .button-danger { transition: color 120ms, background-color 120ms, border-color 120ms; }
  button:active, .button:active { transform: translateY(1px); }
}

@media (forced-colors: active) {
  button, .button, .button-secondary, .button-danger { border: 2px solid ButtonText; }
  .button, button.button { background: ButtonText; color: ButtonFace; forced-color-adjust: none; }
  .button:hover, button.button:hover { background: Highlight; color: HighlightText; border-color: Highlight; }
  button[disabled], button.button[disabled] { background: ButtonFace; color: GrayText; border-color: GrayText; }
  .button-danger-outline { border-color: ButtonText; color: ButtonText; }
  /* The red fill is dropped, so the filled danger button gets a thick double edge: it must not look like Save. */
  .button-danger { border: 4px double ButtonText; }
  button[aria-disabled="true"], .button[aria-disabled="true"] { background: ButtonFace; color: GrayText; border-color: GrayText; }
  button:active, .button:active { box-shadow: none; outline: 2px solid Highlight; }
  button[aria-busy="true"], .button[aria-busy="true"] { outline: 2px dashed GrayText; }
}
