/* The "Choose a style" questions (#208; web/src/style-step.ts builds the .ss-* markup), in a
   sheet of their own because two pages ask them: the home page (linked from web/site/index.html)
   and the app's Make screen (imported by web/src/styles.css, #213). Colours are the shared
   tokens (tokens.css).

   The questions are native radio groups drawn two ways from one markup: pills beside the
   question on a wide screen, one segmented row under it below 900 px. The inputs stay in the
   page for the keyboard and screen readers and are hidden from the eye. */
.ss-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}
.ss-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  min-width: 0;
  margin: 0;
  padding: 18px 22px;
  border: 0;
  border-bottom: 1px solid #eeeef2;
}
.ss-row:last-child {
  border-bottom: 0;
}
.ss-question {
  float: left; /* a legend takes part in its fieldset's flex row only when floated */
  width: 200px;
  padding: 0;
  font-size: 17px;
  font-weight: 700;
}
.ss-options {
  flex: 1 1 360px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ss-option {
  position: relative;
  cursor: pointer;
}
.ss-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.ss-option-text {
  display: block;
  padding: 8px 14px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 15px;
  white-space: nowrap;
}
/* The picked option is bold, and bold is wider. An unseen bold copy of the label (data-label,
   set by style-step.ts) holds every pill at that width, so picking one moves no other. */
.ss-option-text::after {
  content: attr(data-label);
  display: block;
  height: 0;
  overflow: hidden;
  visibility: hidden;
  font-weight: 700;
}
.ss-option input:checked + .ss-option-text {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
  font-weight: 700;
}
.ss-option input:focus-visible + .ss-option-text {
  outline: 2px solid var(--trace);
  outline-offset: 2px;
}
/* The voice row: a pill holds the voice's name and, at its right end, the ▶ that plays its
   sample. The ▶ lies over the radio that covers the pill, so pressing it plays and picks
   nothing; the pill's text keeps clear of it with padding. */
.ss-voice .ss-option-text {
  /* Tight on purpose: the six pills are one row in the app's Make screen at 1280, whose card
     is the narrower of the two (558 px for the pills; these come to 546). */
  padding-left: 10px;
  padding-right: 30px;
}
.ss-play {
  position: absolute;
  top: 50%;
  right: 4px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-top: -11px;
  padding: 0 0 0 1px; /* the triangle's weight is on its left */
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 9px;
  line-height: 1;
  cursor: pointer;
}
/* The target is the pill's full height around the small circle. */
.ss-play::before {
  content: "";
  position: absolute;
  inset: -7px -4px;
}
.ss-play:hover {
  background: var(--surface);
}
.ss-play:active {
  background: var(--surface-2);
}
.ss-play:focus-visible {
  outline: 2px solid var(--trace);
  outline-offset: 2px;
}
.ss-humor {
  cursor: pointer;
}
.ss-humor input {
  position: absolute;
  opacity: 0;
}
.ss-switch {
  display: flex;
  width: 52px;
  height: 30px;
  padding: 3px;
  border-radius: 999px;
  background: var(--line-2);
  transition: background 0.15s;
}
.ss-switch::after {
  content: "";
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s;
}
.ss-humor input:checked + .ss-switch,
.ss-login input:checked + .ss-switch {
  background: var(--ink);
}
.ss-humor input:checked + .ss-switch::after,
.ss-login input:checked + .ss-switch::after {
  transform: translateX(22px);
}
.ss-humor input:focus-visible + .ss-switch,
.ss-login input:focus-visible + .ss-switch {
  outline: 2px solid var(--trace);
  outline-offset: 2px;
}
@media (max-width: 900px) {
  .ss-row {
    padding: 14px 16px;
    gap: 10px;
  }
  /* Still floated: an unfloated legend sits on the fieldset's top edge, above its padding. */
  .ss-question {
    width: 100%;
    font-size: 15px;
  }
  .ss-humor .ss-question {
    width: auto;
    flex: 1;
  }
  /* One segmented row per question. */
  .ss-options {
    flex: 1 1 100%;
    flex-wrap: nowrap;
    gap: 0;
    height: 42px;
    padding: 3px;
    border: 1px solid var(--line-2);
    border-radius: 10px;
  }
  .ss-option {
    flex: 1 1 auto;
    min-width: 0;
  }
  .ss-option-text {
    display: grid;
    place-items: center;
    align-content: center; /* the label and its unseen bold copy, together in the middle */
    height: 100%;
    padding: 0 5px;
    border: 0;
    border-radius: 7px;
    font-size: 13px;
  }
  /* Six names, each with its ▶, do not fit one row: two rows of three in the same frame. */
  .ss-voices {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 36px;
    gap: 3px;
    height: auto;
  }
  .ss-voice .ss-option-text {
    justify-items: start;
    padding: 0 32px 0 10px;
  }
  .ss-play {
    right: 5px;
    width: 24px;
    height: 24px;
    margin-top: -12px;
    font-size: 10px;
  }
  .ss-play::before {
    inset: -6px; /* a 36 px square under a finger */
  }
}
@media (max-width: 420px) {
  .ss-row {
    padding-inline: 10px;
  }
  .ss-option-text {
    padding: 0 3px;
    font-size: 12px;
  }
  .ss-voice .ss-option-text {
    padding: 0 30px 0 8px;
  }
}
/* The row under the questions (docs/project/site-login-spec.md, decision 1): the page's make
   button(s) in .ss-buttons, and the "Use site login" switch (built by style-step.ts into
   .ss-login-slot) a small gap after the last of them (Sebastian, 2026-12-04: beside the button,
   not at the frame's edge). Where the row is too narrow the switch wraps under the buttons;
   under 600 px the row always stacks. */
.ss-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 20px;
  min-width: 0;
}
.ss-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  min-width: 0;
}
.ss-login {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.ss-login input {
  position: absolute;
  opacity: 0;
}
.ss-login .ss-switch {
  flex: none;
}
@media (max-width: 599px) {
  .ss-actions {
    flex-direction: column;
    align-items: flex-start;
  }
}
