/*
 * Bodylet AI: the scheme control
 *
 * Three choices: follow the system, light, dark. Icons only, each with its
 * name for a screen reader and as a tooltip. Neutral on purpose: the lime
 * stays for what agents do.
 *
 *   <div class="bl-theme" role="radiogroup" aria-label="Theme" data-theme-choice hidden>
 *     <label class="bl-theme__option" title="System"><input type="radio" name="theme" value="system">
 *       <svg class="bl-icon" aria-hidden="true"><use href="icons/icons.svg#monitor"/></svg><span class="bl-sr-only">System</span></label>
 *     <label class="bl-theme__option" title="Light"> … value="light" … #sun … </label>
 *     <label class="bl-theme__option" title="Dark"> … value="dark" … #moon … </label>
 *   </div>
 *
 * The choice needs a script (it is kept in the browser and set as
 * data-bl-theme on <html>, see tokens/light.css), so the control starts
 * hidden and the script shows it. The dashboard draws the same control
 * (.dash-theme in its own stylesheet).
 */

.bl-theme {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--bl-border);
  border-radius: var(--bl-radius-sm);
  background: var(--bl-surface-1);
}

.bl-theme[hidden] {
  display: none;
}

.bl-theme__option {
  position: relative;
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.5rem;
  border-radius: var(--bl-radius-xs);
  color: var(--bl-text-3);
  cursor: pointer;
  transition: background-color var(--bl-dur-1) ease, color var(--bl-dur-1) ease;
}

.bl-theme__option:hover {
  color: var(--bl-text);
}

.bl-theme__option:has(input:checked) {
  background: var(--bl-surface-3);
  color: var(--bl-text);
}

.bl-theme__option:has(input:focus-visible) {
  outline: 2px solid var(--bl-accent);
  outline-offset: 1px;
}

.bl-theme__option input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.bl-theme__option .bl-icon {
  width: 0.9375rem;
  height: 0.9375rem;
}
