/*
       * Language switcher, shared by every page of the landing (L25).
       * A <details> element: it opens and closes without scripts (the pages
       * ship none). It relies on the color tokens both stylesheets define.
       */

.lang {
  position: relative;
  flex: none;
}

.lang summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding-inline: 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.lang summary::-webkit-details-marker {
  display: none;
}

.lang summary:hover,
.lang details[open] summary {
  border-color: var(--primary);
}

.lang summary .icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lang ul {
  position: absolute;
  inset-block-start: calc(100% + 8px);
  inset-inline-end: 0;
  z-index: 30;
  box-sizing: border-box;
  width: 260px;
  max-width: calc(100vw - 32px);
  max-height: min(60vh, 420px);
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 16px 40px -16px rgb(12 58 46 / 0.35);
}

.lang li,
.lang li + li {
  margin: 0;
}

.lang li a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
}

.lang li a:hover {
  background: var(--mint-soft);
}

.lang li a[aria-current='true'] {
  background: var(--mint-soft);
  color: var(--primary);
}

@media (max-width: 520px) {
  /* The list spans the header (its positioning context) instead of hanging from the button. */
  .lang {
    position: static;
  }

  .lang ul {
    inset-inline: 16px;
    inset-block-start: calc(100% + 4px);
    width: auto;
    max-width: none;
  }

  /* Only the globe on a narrow header; the name stays for assistive technology. */
  .lang summary {
    padding-inline: 12px;
  }

  .lang summary span {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }
}
