/* The language link and the colour button, linked from every variant, so they
   must sit on all three palettes: take the colours from the surroundings
   instead of setting any, exactly as subscribe.css does. */
.controls { display: flex; align-items: center; gap: .4rem; flex-shrink: 0; }

.controls .lang,
.controls .theme {
  font: inherit;
  font-size: .78rem;
  line-height: 1;
  letter-spacing: .02em;
  color: inherit;
  background: transparent;
  text-decoration: none;
  text-transform: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .4rem .7rem;
  border: 1px solid color-mix(in srgb, currentColor 30%, transparent);
  border-radius: 99px;
  transition: background .2s, border-color .2s;
}
.controls .lang:hover,
.controls .theme:hover {
  background: color-mix(in srgb, currentColor 12%, transparent);
  border-color: color-mix(in srgb, currentColor 55%, transparent);
}
.controls :focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

/* Nothing in this button may move as it cycles. The icon box is a fixed size
   whichever of the three is drawn (the old version set width on an inline
   span, where it does nothing, so each glyph's own advance width decided), and
   it is 1em tall so it cannot make this pill taller than its neighbours. */
.controls .ico { display: inline-grid; place-items: center; width: 1.15em; height: 1em; }
.controls .ico svg {
  grid-area: 1 / 1; width: 100%; height: 100%;
  fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round;
}

/* The three words are stacked in one grid cell and only hidden, not removed,
   so the pill stays as wide as the longest of them and the row does not shift
   under the pointer. Both display:none and visibility:hidden keep what is not
   showing out of the accessibility tree. */
.controls .lbl { display: inline-grid; }
.controls .lbl > span { grid-area: 1 / 1; visibility: hidden; }

/* Which state is drawn is a property of the document, written by the inline
   script in <head> before the first paint. */
.controls .ico svg { display: none; }
:root[data-setting="system"] .controls .i-system,
:root[data-setting="light"] .controls .i-light,
:root[data-setting="dark"] .controls .i-dark { display: block; }
:root[data-setting="system"] .controls .l-system,
:root[data-setting="light"] .controls .l-light,
:root[data-setting="dark"] .controls .l-dark { visibility: visible; }

/* Read out, not shown: without it the button is announced as just "Day". */
.controls .vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Narrow screens keep the icons and drop the words. */
@media (max-width: 640px) {
  .controls .theme .lbl { display: none; }
  .controls .lang, .controls .theme { padding: .4rem .55rem; }
}

/* A slot whose children are laid out by the *grandparent* (bento's program
   cards are grid items): the wrapper has to exist for ui.js to replace it, and
   has to disappear for the layout. */
.slot-contents { display: contents; }
