/* On is the inverse ground with a tick, off the outline; an option's own colour belongs to `Status`, never
   the control (`option_toggles.tsx`). */
@layer theme, base, lotics, components, utilities;
@layer lotics.tokens, lotics.reset, lotics.components;

@layer lotics.components {
  .lotics-option-toggles {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    min-width: 0;
    margin: 0;
    gap: var(--lotics-space-8);
  }

  .lotics-option-toggles[data-disabled] {
    opacity: var(--lotics-disabled-opacity);
  }

  /* The control content rung: inside a fact grid the field is 40 and seats 28. */
  .lotics-option-toggles__chip {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-shrink: 0;
    justify-content: center;
    gap: var(--lotics-space-6);
    min-height: var(--lotics-control-content-height);
    margin: 0;
    padding-block: var(--lotics-space-4);
    padding-inline: var(--lotics-space-8);
    border-width: 1px;
    border-style: solid;
    border-color: var(--border);
    border-radius: var(--lotics-radius-control);
    background: var(--card);
    appearance: none;
    background-image: none;
    /* A chip sets a value, not an act. */
    cursor: default;
    touch-action: manipulation;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition:
      background-color var(--lotics-duration-fast) var(--lotics-ease-standard),
      border-color var(--lotics-duration-fast) var(--lotics-ease-standard);
  }

  .lotics-option-toggles__chip:hover {
    background: var(--lotics-wash-selected);
  }

  .lotics-option-toggles__chip:active {
    background: var(--lotics-wash-press);
  }

  .lotics-option-toggles__chip:focus-visible {
    outline: var(--lotics-ring-width) solid var(--ring);
    outline-offset: 0;
  }

  /* The kit's one filled "chosen" (`Button variant="primary"`), lifted on hover like it. No grey wash,
     which would read as turning it off. */
  .lotics-option-toggles__chip[data-checked] {
    border-color: var(--primary);
    background: var(--primary);
  }

  .lotics-option-toggles__chip[data-checked]:hover {
    background: color-mix(in srgb, var(--primary-foreground) var(--lotics-on-solid-hover), var(--primary));
  }

  .lotics-option-toggles__chip[data-checked]:active {
    background: color-mix(in srgb, var(--primary-foreground) var(--lotics-on-solid-press), var(--primary));
  }

  .lotics-option-toggles__mark {
    display: flex;
    flex-shrink: 0;
  }

  .lotics-option-toggles__label {
    min-width: 0;
    font-family: var(--font-sans);
    font-size: var(--lotics-text-sm);
    line-height: var(--lotics-leading-sm);
    letter-spacing: var(--lotics-tracking-sm);
    font-weight: var(--lotics-weight-regular);
    font-feature-settings: var(--lotics-font-features);
    color: var(--lotics-ink-muted);
  }

  .lotics-option-toggles__chip:hover .lotics-option-toggles__label {
    color: var(--lotics-ink-default);
  }

  .lotics-option-toggles__label[data-checked],
  .lotics-option-toggles__chip:hover .lotics-option-toggles__label[data-checked] {
    color: var(--lotics-ink-on-inverse);
    /* Medium, as `Tabs` and `ChoiceStrip`; semibold would be a third signal and is the heading weight. */
    font-weight: var(--lotics-weight-medium);
  }
}
