/* The language menu at the end of every page's footer, which scripts/build-languages.py adds. It takes
   its color from the footer, so it fits every site, and opens upward, above the footer. */
/* The sites style every <details> as a FAQ entry, with a top border and padding: not this one. */
.languages { position: relative; display: inline-block; margin-left: 10px; vertical-align: middle; border: 0; padding: 0; }
footer nav:has(> .languages) { align-items: center; }
.languages summary {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; cursor: pointer; list-style: none;
  border: 1px solid rgba(255, 255, 255, .14); border-radius: 999px; color: inherit; user-select: none;
}
.languages summary::-webkit-details-marker { display: none; }
.languages summary:hover, .languages[open] summary { border-color: rgba(255, 255, 255, .3); color: #eef1f5; }
.languages summary:focus-visible { outline: 2px solid rgba(255, 255, 255, .5); outline-offset: 2px; }
.languages ul {
  position: absolute; right: 0; bottom: calc(100% + 8px); z-index: 20; margin: 0; padding: 6px; list-style: none;
  min-width: 200px; max-height: min(60vh, 440px); overflow-y: auto;
  background: #121620; border: 1px solid rgba(255, 255, 255, .14); border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .55);
}
.languages ul a { display: block; padding: 6px 10px; border-radius: 7px; color: #d7dde2; text-decoration: none; white-space: nowrap; }
.languages ul a:hover { background: rgba(255, 255, 255, .07); text-decoration: none; }
.languages ul a[aria-current] { color: #fff; font-weight: 650; }
/* Japanese has no spaces, so headings break between phrases rather than inside a word where the browser can. */
:lang(ja) :is(h1, h2, h3, .tagline, .sub) { word-break: auto-phrase; }
