/* theme-control.css - base styles of the shared theme control (F8d). Roles only, no placement and no
 * literal colors: every color is a var(--color-...) from theme.css. F8e/F8f place and size it. */

.theme-control__icon { flex: none; }

/* ---- Menu variant ---- */
.theme-control__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-input-border);
  border-radius: 999px;
  cursor: pointer;
}
.theme-control__trigger:hover { background: var(--color-accent-subtle); }
.theme-control__trigger:focus-visible,
.theme-control__item:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
}
/* small-screen breakpoint (Bootstrap xl): keep in sync with site.css */
@media (max-width: 1199.98px) {
  .theme-control__trigger { width: 44px; height: 44px; }
}

/* Only the icon matching the current choice is shown. */
.theme-control__trigger .theme-control__icon { display: none; }
.theme-control[data-current-choice="light"] .theme-control__trigger [data-theme-icon="sun"],
.theme-control[data-current-choice="dark"] .theme-control__trigger [data-theme-icon="moon"],
.theme-control[data-current-choice="system"] .theme-control__trigger [data-theme-icon="monitor"] {
  display: inline-block;
}

/* Visually hidden by default; a placement (F8f sidebar) can reveal it. */
.theme-control__trigger-text {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.theme-control__item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text);
}
.theme-control__item:hover,
.theme-control__item:focus { background: var(--color-accent-subtle); color: var(--color-text); }
.theme-control__item-label { flex: 1; text-align: left; }
.theme-control__check { visibility: hidden; }
.theme-control__item[aria-checked="true"] .theme-control__check { visibility: visible; }

/* ---- Row variant ---- */
.theme-control__fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.theme-control__legend { font-size: 0.875rem; color: var(--color-text-muted); margin-bottom: 8px; padding: 0; }
.theme-control__options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.theme-control__option { display: block; margin: 0; cursor: pointer; }
.theme-control__option-body {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 8px;
  color: var(--color-text);
  border: 1px solid var(--color-input-border);
  border-radius: 8px;
}
.theme-control__radio {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  opacity: 0;
}
.theme-control__radio:checked + .theme-control__option-body {
  background: var(--color-accent-subtle);
  color: var(--color-accent-text);
  outline: 1px solid var(--color-input-border);
}
.theme-control__radio:focus-visible + .theme-control__option-body {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 2px;
}
