/* ui/Segmented - one choice out of a few options in one row, 36px tall.
   The chosen option is ink text on white with the 2px ink border, the
   others white with the 1px line in muted ink (docs/design-system.md,
   Components). The options sit 8px apart, each its own box, so the chosen
   one's thicker border never shifts its neighbours. */

.segmented-choice {
  display: inline-flex;
  gap: var(--space-2);
}

.segmented-choice__option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  min-width: 72px;
  padding: 0 calc(var(--space-4) - var(--border-width));
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: var(--weight-regular);
  color: var(--color-text-muted);
  background: var(--color-bg-surface);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition:
    border-color var(--duration-fast) var(--ease-default),
    color var(--duration-fast) var(--ease-default);
}

.segmented-choice__option:hover:not(:disabled):not([aria-checked="true"]) {
  color: var(--color-text);
  border-color: var(--color-text-muted);
}

.segmented-choice__option[aria-checked="true"] {
  padding: 0 calc(var(--space-4) - 2px);
  color: var(--color-text);
  border: 2px solid var(--color-text);
}

.segmented-choice__option:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 2px;
}

.segmented-choice--disabled .segmented-choice__option {
  cursor: not-allowed;
  opacity: 0.5;
}
