/**
 * Button — per-variant colour and interactive states (hover / active /
 * focus-visible / disabled) for Primary, Secondary and Gold. Layout, geometry
 * and typography are Tailwind utilities in button.twig. Tokens only; no raw
 * values. Selectors stay scoped to .button and nesting never exceeds one level.
 *
 * .is-hover / .is-active / .is-focus mirror the pseudo-classes so the states
 * can be shown statically in Storybook (passed via modifier_class); they are
 * not schema props.
 */

.button {
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    color 150ms ease;
}

.button:focus-visible,
.button.is-focus {
  outline: 2px solid var(--ink-primary);
  outline-offset: 2px;
}

.button__label {
  overflow-wrap: anywhere;
}

/* --------------------------------------------------------------- Primary */
.button--primary {
  @apply bg-brand-primary border-brand-primary text-neutral-0;
}

.button--primary:hover:not([disabled], [aria-disabled='true']),
.button--primary.is-hover {
  @apply bg-brand-primary-hover border-brand-primary-hover;
}

.button--primary:active:not([disabled], [aria-disabled='true']),
.button--primary.is-active {
  @apply bg-brand-navy border-brand-navy;
}

/* ------------------------------------------------------------- Secondary */

/* No visible border in Figma (301:182) — border colour tracks bg so border-2
   stays invisible. */
.button--secondary {
  @apply bg-neutral-50 border-neutral-50 text-neutral-850;
}

.button--secondary:hover:not([disabled], [aria-disabled='true']),
.button--secondary.is-hover {
  @apply bg-neutral-0 border-neutral-0 text-neutral-850;
}

.button--secondary:active:not([disabled], [aria-disabled='true']),
.button--secondary.is-active {
  @apply bg-neutral-100 border-neutral-100 text-neutral-850;
}

/* ------------------------------------------------------------------ Gold */
.button--gold {
  @apply bg-brand-gold border-brand-gold text-brand-navy;
}

.button--gold:hover:not([disabled], [aria-disabled='true']),
.button--gold.is-hover {
  @apply bg-brand-gold-hover border-brand-gold-hover text-brand-navy;
}

.button--gold:active:not([disabled], [aria-disabled='true']),
.button--gold.is-active {
  @apply bg-brand-gold-active border-brand-gold-active text-brand-navy;
}

/* ------------------------------------------------------------- Light Grey */

/* Low-emphasis variant: neutral-50 fill, dark text, no visible border. */
.button--light-grey {
  @apply bg-neutral-50 border-neutral-50 text-neutral-850;
}

.button--light-grey:hover:not([disabled], [aria-disabled='true']),
.button--light-grey.is-hover {
  @apply bg-neutral-100 border-neutral-100 text-neutral-850;
}

.button--light-grey:active:not([disabled], [aria-disabled='true']),
.button--light-grey.is-active {
  @apply bg-neutral-200 border-neutral-200 text-neutral-850;
}

/* ----------------------------------------------------------------- White */

/* Solid white fill, border tracks bg (invisible). Text same as light-grey. */
.button--white {
  @apply bg-neutral-0 border-neutral-0 text-neutral-850;
}

.button--white:hover:not([disabled], [aria-disabled='true']),
.button--white.is-hover {
  @apply bg-neutral-50 border-neutral-50 text-neutral-850;
}

.button--white:active:not([disabled], [aria-disabled='true']),
.button--white.is-active {
  @apply bg-neutral-100 border-neutral-100 text-neutral-850;
}

/* --------------------------------------------------------------- Outline */

/* Transparent background. Border and text both use currentcolor — set the
   colour via modifier_class on the button (e.g. text-white on dark surfaces,
   text-brand-navy on light ones). One variant works on any background. */
.button--outline {
  background: transparent;
  border-color: currentcolor;
}

.button--outline:hover:not([disabled], [aria-disabled='true']),
.button--outline.is-hover {
  background: color-mix(in srgb, currentcolor 10%, transparent);
  border-color: currentcolor;
}

.button--outline:active:not([disabled], [aria-disabled='true']),
.button--outline.is-active {
  background: color-mix(in srgb, currentcolor 20%, transparent);
  border-color: currentcolor;
}

/* Focus ring also tracks the current colour so it stays visible on any surface. */
.button--outline:focus-visible,
.button--outline.is-focus {
  outline-color: currentcolor;
}

/* --------------------------------------------------------- Outline White */

/* Same transparent/currentcolor mechanism as Outline, fixed to white border
   and text — for use on photos, video, or brand-colour surfaces where the
   caller shouldn't have to remember a modifier_class. */
.button--outline-white {
  @apply text-neutral-0;

  background: transparent;
  border-color: currentcolor;
}

.button--outline-white:hover:not([disabled], [aria-disabled='true']),
.button--outline-white.is-hover {
  background: color-mix(in srgb, currentcolor 10%, transparent);
  border-color: currentcolor;
}

.button--outline-white:active:not([disabled], [aria-disabled='true']),
.button--outline-white.is-active {
  background: color-mix(in srgb, currentcolor 20%, transparent);
  border-color: currentcolor;
}

.button--outline-white:focus-visible,
.button--outline-white.is-focus {
  outline-color: currentcolor;
}

/* --------------------------------------------------------- Outline Grey */

/* White fill, card border (#d5dadc), ink-primary text. Matches Figma "Link"
   (node 6638:283) — use on white/light surfaces where a visible but
   low-emphasis border is required. */
.button--outline-grey {
  @apply bg-neutral-0 border-border-card text-ink-primary;
}

.button--outline-grey:hover:not([disabled], [aria-disabled='true']),
.button--outline-grey.is-hover {
  @apply bg-neutral-50 border-border-card;
}

.button--outline-grey:active:not([disabled], [aria-disabled='true']),
.button--outline-grey.is-active {
  @apply bg-neutral-100 border-border-card;
}

/* -------------------------------------------------------------- Disabled */
.button[disabled],
.button[aria-disabled='true'] {
  @apply bg-neutral-100 border-neutral-100 text-text-disabled cursor-not-allowed;
}
