/*
 * The language picker at the top right of every page: the page's language
 * with its flag; opens a list of the languages with a link to the same page
 * in each. Shared by the homepage (home.css) and the plain pages (style.css).
 */
.lang {
  position: relative;
  margin-left: auto;
  font:
    600 15px/1.2 Figtree,
    'Segoe UI',
    system-ui,
    sans-serif;
}
.lang summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--raised, var(--paper));
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.lang summary::-webkit-details-marker {
  display: none;
}
.lang summary::after {
  content: '';
  width: 6px;
  height: 6px;
  margin: -3px 2px 0 2px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.6;
  transition: transform 0.15s;
}
.lang[open] summary::after {
  margin-top: 3px;
  transform: rotate(-135deg);
}
.lang summary:hover {
  border-color: var(--sea);
}
.lang summary:focus-visible,
.lang-menu a:focus-visible {
  outline: 3px solid var(--sea);
  outline-offset: 2px;
}
.lang img {
  width: 20px;
  height: 15px;
  flex: none;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(27, 42, 65, 0.12);
}
.lang-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  min-width: 190px;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--raised, var(--paper));
  box-shadow: 0 18px 40px rgba(27, 42, 65, 0.16);
}
.lang-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  color: var(--ink);
  text-decoration: none;
}
.lang-menu a:hover {
  background: var(--sunken, var(--line));
}
.lang-menu a[aria-current]::after {
  content: '✓';
  margin-left: auto;
  padding-left: 12px;
  color: var(--aurora, var(--sea));
}

/* The homepage's header: the picker beside the logo on narrow screens, the
   menu on a row of its own below. */
.top .lang {
  order: 2;
}
@media (max-width: 1060px) {
  .top .lang {
    order: 1;
  }
  .top nav {
    order: 3;
    flex-basis: 100%;
  }
}
/* The plain pages' menu: the picker at the end of the row. */
main > nav .lang {
  align-self: center;
}
