/* Language picker in the homepage and pricing footers and on the signed-out
   pages: the current code (or name) and a chevron, opening a small menu of
   language names. Signed-in users pick theirs on the account page. */

.locale-picker {
  margin-left: auto;
  font-size: 12px;
}

.locale-menu {
  position: relative;
}

.locale-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border: 1px solid currentcolor;
  border-color: color-mix(in srgb, currentcolor 30%, transparent);
  border-radius: 6px;
  font-weight: 700;
  letter-spacing: .5px;
  line-height: 1;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.locale-toggle::-webkit-details-marker {
  display: none;
}

.locale-toggle:hover,
.locale-toggle:focus-visible,
.locale-menu[open] .locale-toggle {
  border-color: currentcolor;
}

.locale-toggle svg:last-child {
  transition: transform .15s;
}

.locale-menu[open] .locale-toggle svg:last-child {
  transform: rotate(180deg);
}

.locale-list {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  min-width: 170px;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid #e0e5ef;
  border-radius: 10px;
  background: #fff;
  color: #172440;
  box-shadow: 0 16px 40px rgb(5 10 30 / 25%);
}

.locale-list form {
  margin: 0;
}

.locale-picker .locale-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  margin: 0;
  padding: 9px 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  box-shadow: none;
  color: inherit;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.locale-picker .locale-option small {
  color: #727e94;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .5px;
}

.locale-picker .locale-option:hover,
.locale-picker .locale-option:focus-visible {
  background: #eef2fd;
}

.locale-picker .locale-option[aria-current="true"] {
  color: #3657d4;
}

.locale-picker .locale-option[aria-current="true"] small {
  color: inherit;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* In the homepage and pricing footers it sits at the very bottom of the page,
   so the menu opens upward. The footer's small capitals don't suit it. */
.home-footer .locale-picker {
  margin-left: 0;
  color: #c7cfe2;
  letter-spacing: normal;
}

.home-footer .locale-picker .locale-list {
  top: auto;
  bottom: calc(100% + 6px);
}

/* On phones the signed-out top bar is tight: the code and chevron are enough. */
@media (max-width: 700px) {
  .auth-brand .locale-toggle {
    padding: 6px 7px;
  }

  .auth-brand .locale-toggle svg:first-child {
    display: none;
  }
}
