/* The language switcher (site/i18n.js, site/i18n/switcher.js).
 *
 * Four placings. In the header bar at desktop widths, where the main
 * navigation is, as a short code that opens a list. In the mobile menu below
 * those widths, as a row with every language in view, because the bar has no
 * room for it on a phone. In the partner sign-in's own bar, beside its Help
 * link. And in a corner on a page with none of these. Each language is named
 * in its own language. */

.lang-switch { position: relative; font-size: 14px; line-height: 1.2; }

.lang-switch__button {
  display: flex; align-items: center; gap: 4px; height: 100%;
  padding: 0 10px; border: 0; border-radius: 12px; background: transparent;
  color: #4a4a4a; font: inherit; font-weight: 500; letter-spacing: 0.02em; cursor: pointer;
}
.lang-switch__button:hover, .lang-switch__button[aria-expanded="true"] { color: #191919; }
.lang-switch__button:focus-visible { outline: 2px solid #191919; outline-offset: 2px; }
.lang-switch__button::after {
  content: ""; width: 6px; height: 6px; margin: -3px 0 0 2px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}
.lang-switch__button[aria-expanded="true"]::after { margin-top: 3px; transform: rotate(225deg); }

.lang-switch__list {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  display: flex; flex-direction: column; min-width: 168px; padding: 6px;
  border: 1px solid #e1e1e1; border-radius: 10px; background: #fff;
  box-shadow: 0 8px 24px rgba(25, 25, 25, 0.08);
}
.lang-switch__list[hidden] { display: none; }
.lang-switch__list a {
  padding: 8px 10px; border-radius: 6px; color: #4a4a4a; text-decoration: none; white-space: nowrap;
}
.lang-switch__list a:hover { background: #f4f4f4; color: #191919; }
.lang-switch__list a[aria-current] { color: #191919; font-weight: 600; }

/* The bar: desktop only, where the main navigation is (xl in the header). */
.lang-switch--bar { display: none; pointer-events: auto; }
@media (min-width: 1280px) {
  .lang-switch--bar { display: flex; align-items: center; height: 39px; }
}

/* The mobile menu: a row of its own, every language a tap away. */
.lang-switch--menu {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px;
  padding: 16px; border-bottom: 1px solid #e1e1e1;
  background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(6px);
}
@media (min-width: 768px) { .lang-switch--menu { padding: 16px 24px; } }
.lang-switch--menu .lang-switch__label { width: 100%; color: #7b7b7b; font-size: 13px; }
.lang-switch--menu a { color: #4a4a4a; text-decoration: none; padding: 4px 0; }
.lang-switch--menu a[aria-current] { color: #191919; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }

/* A page without the marketing header. */
.lang-switch--corner { position: fixed; top: 16px; right: 16px; z-index: 60; }
.lang-switch--corner .lang-switch__button { height: 36px; background: #fff; border: 1px solid #e1e1e1; }

/* The partner sign-in's bar (partner.css .auth-topbar, a space-between row):
 * the auto margin takes the free space, so the code sits beside Help on the
 * right rather than in the middle, in Help's size and colour. */
.auth-topbar > .lang-switch--topbar { display: flex; align-items: center; height: 100%; margin-left: auto; }
.lang-switch--topbar .lang-switch__button { padding: 0 4px; color: var(--muted, #4a4a4a); font-size: 13px; font-weight: 400; }
.lang-switch--topbar .lang-switch__button:hover,
.lang-switch--topbar .lang-switch__button[aria-expanded="true"] { color: var(--ink, #191919); }
