/*
 * The whole row IS the switch — one control, so the `Switch` riding at its right
 * is a read-only indicator and never a second tab stop.
 *
 * Hover and press take the same two wash rungs a `Button` does: the selection
 * rung for hover, the press rung under the pointer. The right inset is one rung
 * tighter than the left because the track ends where its own edge does, while
 * the leading glyph needs air before it.
 */
@layer theme, base, lotics, components, utilities;
@layer lotics.tokens, lotics.reset, lotics.components;

@layer lotics.components {
  .lotics-switch-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--lotics-space-16);
    padding-block: var(--lotics-space-4);
    padding-left: var(--lotics-space-8);
    padding-right: var(--lotics-space-6);
    margin: 0;
    border: 0 solid var(--border);
    border-radius: var(--lotics-radius-control);
    background-color: transparent;
    appearance: none;
    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);
    color: var(--lotics-ink-default);
    /* A switch SETS A VALUE; the pointer is reserved for what acts. */
    cursor: default;
    user-select: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: background-color var(--lotics-duration-fast) var(--lotics-ease-standard);
  }

  .lotics-switch-row:not([data-disabled]):hover {
    background-color: var(--lotics-wash-selected);
  }

  .lotics-switch-row:not([data-disabled]):active {
    background-color: var(--lotics-wash-press);
  }

  .lotics-switch-row[data-disabled] {
    opacity: var(--lotics-disabled-opacity);
  }

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

  .lotics-switch-row__label {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex: 1;
    min-width: 0;
    gap: var(--lotics-space-8);
  }

  /* The CONTROL is the row's act and keeps its size — the label is what gives
     way, and a switch squeezed to a sliver is a target nobody can hit. */
  .lotics-switch-row__indicator {
    flex-shrink: 0;
  }
}
