/*
  The header's language and colour-mode menus (src/components/site/SiteControls.tsx): quiet 44px buttons in the
  bar's link style, a small panel under each in the page's ground. In the phone sheet they sit as one row above
  the buttons and their panels open upward.
*/
.pt-ctls { display: inline-flex; align-items: center; gap: var(--s-1); }
.pt-ctl { position: relative; }
.pt-ctl__btn {
  display: inline-flex; align-items: center; gap: 6px; min-width: 44px; height: 44px; padding: 0 var(--s-2);
  border: 0; border-radius: var(--r-btn); background: none; color: var(--ink); font: 500 14px/1 var(--font-text); cursor: pointer;
  transition: background-color var(--dur, 150ms) var(--ease);
}
.pt-ctl__btn:hover, .pt-ctl__btn[aria-expanded="true"] { background: color-mix(in oklab, var(--ink) 7%, transparent); }
.pt-ctl__btn:focus-visible, .pt-ctl__item:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
.pt-ctl__btn svg { flex: none; }
/* the colour mode shows its icon in the bar; its name is read out from the button's label */
.pt-ctl + .pt-ctl .pt-ctl__value { display: none; }
.pt-ctl__menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 180px; display: grid; padding: var(--s-1);
  background: var(--bg); color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--r-md);
  box-shadow: 0 12px 32px -12px rgb(11 35 80 / 0.3);
}
.pt-ctl__menu[hidden] { display: none; }
.pt-ctl__item {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); min-height: 44px; padding: 0 var(--s-3);
  border: 0; border-radius: var(--r-sm); background: none; color: var(--ink); font: 400 var(--t-body)/1.2 var(--font-text);
  text-align: left; text-decoration: none; cursor: pointer;
}
.pt-ctl__item:hover { background: color-mix(in oklab, var(--ink) 7%, transparent); }
.pt-ctl__item:is([aria-current="true"], [aria-checked="true"]) { font-weight: 500; }
.pt-ctl__item:is([aria-current="true"], [aria-checked="true"])::after {
  content: ""; width: 12px; height: 12px; background: currentColor; flex: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m2 6.4 2.6 2.6L10 3.4' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='m2 6.4 2.6 2.6L10 3.4' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
/* the phone and tablet sheet: one row with both menus, panels opening upward, values shown */
@media (max-width: 1023px) {
  .nav.is-open .pt-ctls { order: 3; justify-content: center; gap: var(--s-4); }
  .nav.is-open .pt-ctl + .pt-ctl .pt-ctl__value { display: inline; }
  .nav.is-open .pt-ctl__menu { top: auto; bottom: calc(100% + 6px); right: auto; left: 50%; transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) { .pt-ctl__btn { transition: none; } }
