/* N fixed cells, each on or off, sized for a register row; a tight gap because the cells are one object.
   On is an edge like a chip's, not a ground, which is the row's language; the second pixel is an inset
   shadow, since a border would grow the box and shuffle the strip. */
@layer theme, base, lotics, components, utilities;
@layer lotics.tokens, lotics.reset, lotics.components;

@layer lotics.components {
  .lotics-toggle-strip {
    display: flex;
    flex-direction: row;
    align-items: center;
    /* The register's glyph-grid gutter: one object, not chips. */
    gap: var(--lotics-register-cell-gap);
    /* Written by the component for both variants. */
    --lotics-toggle-strip-cell: var(--lotics-register-row);
  }

  .lotics-toggle-strip__cell {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: var(--lotics-toggle-strip-cell);
    height: var(--lotics-control-content-height);
    padding: 0;
    margin: 0;
    border-width: 1px;
    border-style: solid;
    border-color: var(--border);
    border-radius: var(--lotics-radius-control);
    background: var(--card);
    appearance: none;
    /* Setting a value is not acting. */
    cursor: default;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: background-color var(--lotics-duration-fast) var(--lotics-ease-standard);
  }

  .lotics-toggle-strip__cell:hover {
    background: var(--lotics-wash-selected);
  }

  .lotics-toggle-strip__cell:active {
    background: var(--lotics-wash-press);
  }

  .lotics-toggle-strip__cell[data-checked] {
    border-color: var(--primary);
    box-shadow: inset 0 0 0 1px var(--primary);
  }

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

  .lotics-toggle-strip__cell[data-disabled] {
    opacity: var(--lotics-disabled-opacity);
  }

  .lotics-toggle-strip__content {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    font-family: var(--font-sans);
    font-size: var(--lotics-text-xs);
    line-height: var(--lotics-leading-xs);
    letter-spacing: var(--lotics-tracking-xs);
    font-weight: var(--lotics-weight-medium);
    font-feature-settings: var(--lotics-font-features);
    color: var(--lotics-ink-muted);
    user-select: none;
  }

  /* On steps up in ink only: the edge already says which, and heavier weight would put a filter value at
     heading weight. */
  .lotics-toggle-strip__cell[data-checked] .lotics-toggle-strip__content {
    color: var(--lotics-ink-default);
  }

  /* A column of strips under one header naming the positions, so the square is the state; per-row letters
     were twenty-eight labels for four facts. */
  /* A register cell, so its whole band square is the target, not the label variant's 30 × 28 chip. */
  .lotics-toggle-strip__cell[data-variant="mark"] {
    height: var(--lotics-register-row);
    border-color: transparent;
    background: transparent;
    box-shadow: none;
  }

  /* The pointer deepens whatever the cell rests on, so the wash stays visible on today's tint. */
  .lotics-toggle-strip__cell[data-variant="mark"][data-current] {
    background: var(--lotics-wash-hover);
  }

  .lotics-toggle-strip__cell[data-variant="mark"]:hover {
    background: var(--lotics-wash-selected);
  }

  .lotics-toggle-strip__cell[data-variant="mark"]:active {
    background: var(--lotics-wash-press);
  }

  /* Half the cell, 20: §9's lone-affordance rung. */
  .lotics-toggle-strip__cell[data-variant="mark"] .lotics-toggle-strip__content {
    width: calc(var(--lotics-register-row) / 2);
    height: calc(var(--lotics-register-row) / 2);
    border-width: 1.5px;
    border-style: solid;
    border-color: var(--border);
    border-radius: var(--lotics-radius-control);
    background: transparent;
  }

  .lotics-toggle-strip__cell[data-variant="mark"][data-checked] .lotics-toggle-strip__content {
    border-color: transparent;
    background: var(--primary);
  }
}
