/* THE SWITCH COMPONENT — page kit, C.58c.
 *
 * A checkbox whose meaning is in its own label, with room for one
 * sentence underneath when the label alone cannot carry it. The whole
 * row is a tap target of the site's own size, so a thumb hits the word
 * as reliably as the box.
 *
 * `kit-switch` belongs to the control and to nothing else. The class it
 * replaces (`check`) was worn by twenty-nine elements, about half of
 * them disclosure headers, which is how a checkbox and a folding panel
 * came to look alike; the kit-switch gate holds that no `<summary>`
 * anywhere carries this one.
 *
 * NOT ONE LENGTH IS WRITTEN HERE — see kit-choice.css.
 */

.kit-switch {
  margin-top: var(--rhythm-within);
  max-width: var(--measure);
}

.kit-switch-label {
  display: flex;
  align-items: center;
  gap: var(--gap-icon-label);
  min-height: var(--tap);
  cursor: pointer;
}

.kit-switch-label input {
  width: var(--s4);
  height: var(--s4);
  margin: 0;
  accent-color: var(--accent);
  flex: none;
  cursor: pointer;
}

.kit-switch-word {
  color: var(--ink);
}

/* The sentence belongs to the switch above it and to nothing else, so it
 * takes the within-rhythm from the control and the between-rhythm from
 * whatever comes next — the ratio page design law 1 asks for, stated
 * once here rather than per page. */
.kit-switch-note {
  margin-top: var(--rhythm-within);
}

/* TWO SWITCHES ARE ONE GROUP; A SWITCH WITH A SENTENCE ENDS ONE.
 * Page design law 1: a group is a header, its controls and at most ONE
 * help line. Plain switches under one heading are those controls and
 * belong close together; the moment one of them carries its own
 * sentence, that sentence is the group's one help line and the next
 * switch starts a new group. The first build spaced every pair the same
 * way, which read as four unrelated questions where there were two. */
.kit-switch + .kit-switch {
  margin-top: var(--rhythm-within);
}

.kit-switch:has(.kit-switch-note) + .kit-switch {
  margin-top: var(--rhythm-between);
}
