/* Colours for light and dark. Without a choice the system setting decides,
   the toggle sets data-theme on <html>. */

:root {
  color-scheme: light;
  --bg: #fff;
  --fg: #000;
  --text: #333;
  --link: #555;
  --muted: #777;
  --line: #eee;
  --border: #aaa;
  --highlight: #ddd;
  --selected-bg: #ddd;
  --selected-fg: #555;
  --card: #fff;
  --shadow: rgba(0, 0, 0, 0.25);
  --warn: #a33;
  --logo-filter: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #161616;
    --fg: #e8e8e8;
    --text: #d6d6d6;
    --link: #b5b5b5;
    --muted: #8a8a8a;
    --line: #2a2a2a;
    --border: #555;
    --highlight: #3a3a3a;
    --selected-bg: #5a5a5a;
    --selected-fg: #fff;
    --card: #222;
    --shadow: rgba(0, 0, 0, 0.7);
    --warn: #e07070;
    --logo-filter: invert(1);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #161616;
  --fg: #e8e8e8;
  --text: #d6d6d6;
  --link: #b5b5b5;
  --muted: #8a8a8a;
  --line: #2a2a2a;
  --border: #555;
  --highlight: #3a3a3a;
  --selected-bg: #5a5a5a;
  --selected-fg: #fff;
  --card: #222;
  --shadow: rgba(0, 0, 0, 0.7);
  --warn: #e07070;
  --logo-filter: invert(1);
}

/* the background sits on <html>, so the logo behind the content stays visible */
html {
  background-color: var(--bg);
  color: var(--fg);
}

/* zoom and theme controls */
.prefs {
  position: fixed;
  top: 10px;
  right: 2%;
  z-index: 10;
  display: flex;
  gap: 2px;
}

.prefs button {
  padding: 6px;
  border: 0;
  background: none;
  color: var(--muted);
  line-height: 0;
  cursor: pointer;
}

.prefs button:hover {
  color: var(--fg);
  background-color: var(--highlight);
}

/* a search filters the list: search text, x and magnifier on one surface */
.prefs button.activ,
.prefs .search-term {
  color: var(--selected-fg);
  background-color: var(--selected-bg);
}

.prefs .search-term {
  display: flex;
  align-items: center;
  margin-right: -2px;
}

.prefs .search-term[hidden] {
  display: none;
}

.prefs .search-term button {
  color: inherit;
}

.prefs [data-search-edit] {
  max-width: 40vw;
  overflow: hidden;
  padding: 6px 4px 6px 10px;
  font: inherit;
  font-size: 15px;
  line-height: 20px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.prefs [data-search-clear] svg {
  width: 14px;
  height: 14px;
}

.prefs svg {
  width: 20px;
  height: 20px;
}
