/**
 * @file
 * Buttons.
 *
 * Old theme: `.get-ticket` and `.createanevent` were bespoke 1px-border pills
 * declared in four places with different padding, and Bootstrap's .btn-primary
 * was still loaded underneath at #007bff — a blue that appears nowhere in the
 * Mosman palette. One component now, three variants.
 */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xs);
  padding: 0.75rem var(--space-m);
  min-block-size: var(--input-height);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: var(--step--1);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition:
    background-color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-base) var(--ease-out);
}

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

.button svg {
  inline-size: 1rem;
  block-size: 1rem;
  flex: none;
}

/**
 * Primary — the single most important action on a page.
 *
 * The magenta glow used to sit at full strength all the time, which left the
 * button with nowhere to go on hover: only the fill changed, and a large soft
 * halo under a resting control reads as decoration rather than as affordance.
 * It now rests on a tight version of the same glow and opens out to the full
 * --shadow-accent under the pointer, so pressing it is something you can see.
 */
.button--primary {
  background: var(--accent-solid);
  border-color: var(--accent-solid);
  color: var(--me-white);
  box-shadow: 0 4px 14px -10px color-mix(in srgb, var(--me-magenta) 80%, transparent);
}

.button--primary:hover {
  background: var(--accent-solid-hover);
  border-color: var(--accent-solid-hover);
  color: var(--me-white);
  box-shadow: var(--shadow-accent);
}

/* Secondary — outlined, matches the old .createanevent pill. */
.button--secondary {
  background: transparent;
  border-color: var(--me-magenta);
  color: var(--me-magenta-300);
}

.button--secondary:hover {
  background: color-mix(in srgb, var(--me-magenta) 14%, transparent);
  color: var(--me-magenta-300);
}

/* Ghost — low-emphasis, sits on any surface. */
.button--ghost {
  background: var(--surface-2);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.button--ghost:hover {
  background: var(--surface-3);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.button--block {
  inline-size: 100%;
}

.button--small {
  padding: 0.45rem var(--space-s);
  min-block-size: 2.25rem;
  font-size: var(--step--2);
}

.button--large {
  padding: 0.95rem var(--space-l);
  font-size: var(--step-0);
}

.button[disabled],
.button[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.button[disabled]:active,
.button[aria-disabled="true"]:active {
  transform: none;
}

/* Text link styled as an action. */
.action-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3xs);
  color: var(--me-magenta-300);
  font-size: var(--step--1);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  text-decoration: none;
}

.action-link::after {
  content: "→";
  transition: translate var(--duration-fast) var(--ease-out);
}

.action-link:hover::after {
  translate: 3px 0;
}
