/*
 * .button inside Seq — the one file that overrides a gem component, and only for label
 * wrapping (docs/plans/seq-narrow-viewports.md § 5) and the 44px hit area of .button--sm on
 * a coarse pointer. Since § 1 of docs/plans/seq-redesign.md the gem paints .button--filled
 * and .button--outline as shipped: the grey repaint of the retired concept is gone, and a
 * page has at most one .button--filled (rule 2 of § The composition system). A disabled
 * button is drawn at half opacity; the gem has no disabled state. No view uses .button--grey,
 * so the hairline it had here is gone (2026-09-24).
 */

/* The gem's .button is white-space: nowrap, so a long label ("Open the runs index with filter
   sample=S-04") ran past a 390px viewport. Inside Seq a label wraps, in balanced, centred lines.
   The gem's size steps fix the height (32/48/64px) and set .button__label to line-height 1, so a
   wrapped label would fill the box edge to edge with its lines touching: each size's height
   becomes its minimum, with block padding that fits inside it, and the label gets a line
   height. A one-line button measures as the gem draws it. The size rules repeat .button to
   outrank a component's own min-block-size (_copy.css's 24px on a .seq-copy button). */
.button {
  white-space: normal;
  text-wrap: balance;
  text-align: center;
}
.button__label {
  line-height: 1.25;
}
.button.button--sm {
  height: auto;
  min-height: var(--spacing-32);
  padding-block: var(--spacing-4);
}
.button.button--md {
  height: auto;
  min-height: var(--spacing-48);
  padding-block: var(--spacing-12);
}
.button.button--lg {
  height: auto;
  min-height: 64px;
  padding-block: var(--spacing-16);
}

/* ---------- Touch: a 44px hit area for .button--sm on a coarse pointer ----------
   The small button is 32px tall (docs/plans/seq-narrow-viewports.md § 5); a finger needs 44
   (WCAG 2.5.5). A transparent ::before inset by half the shortfall extends the hit area to at
   least 44 by 44 without moving or repainting the button, so a mouse and a finger see the
   same button. It works on a <button> and an <a>, not on an <input type="submit">, which draws
   no pseudo-element: a small submit in a view is a <button> (form.button, not form.submit).
   The --md and --lg steps are 48 and 64px and need nothing. Where two small buttons would
   then share a strip of hit area (buttons stacked less than 12px apart), the gap of the
   component that stacks them grows under the same query. */
/* A disabled button (the runs index's "Compare selected" until two runs of one sample are
   checked) is drawn at half opacity; the gem has no disabled state. */
.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (pointer: coarse) {
  .button.button--sm {
    position: relative;
  }
  .button.button--sm::before {
    content: "";
    position: absolute;
    inset: min(0px, calc((100% - 44px) / 2));
  }
}
