/* Languages, built from the site's own parts. The menu item is a plain menu
   link (it inherits the menu's type, colour, spacing and hover line). The list
   is the Explore panel's own design, repeated value for value. Loaded on every
   page; English pages get it at the edge so their own files stay unchanged. */

/* the menu item on the inner pages stays where the menu is, on phones too */
html .site-nav a.vq-lang-link { display: inline-block; }
.vq-lang-link { white-space: nowrap; }
/* the Explore entry: the grid's own card, as a button that opens the list in place */
.command-grid .vq-lang-cmd {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; padding: 16px 18px;
  border: 1px solid transparent; border-radius: 14px; background: rgba(255,255,255,.5); transition: all .22s cubic-bezier(.16,1,.3,1);
  font: inherit; color: inherit; text-align: left; cursor: pointer; width: 100%;
}
.command-grid .vq-lang-cmd:hover { background: #fff; border-color: rgba(217,187,146,.65); transform: translateY(-2px); }
.command-grid .vq-lang-cmd b { text-transform: uppercase; }
.command-grid .vq-lang-cmd i { transition: transform .22s; }
.command-grid .vq-lang-cmd[aria-expanded="true"] i { transform: rotate(180deg); }
.command-shell { overflow-y: auto; }
.vq-lang-link[aria-expanded="true"] { color: var(--ink,#1E2024); }

/* the list: a small one-column dropdown on a solid surface, anchored under the
   menu item (on phones, under the header). Current, browser and English on top,
   a hairline, the rest in one quiet scrolling column. */
.vq-langs {
  position: fixed; top: 76px; right: 16px; z-index: 1600;
  width: 264px; max-width: calc(100vw - 32px); padding: 6px 0;
  background: #FAF7F5; border: 1px solid rgba(38,41,47,.12); border-radius: 14px;
  box-shadow: 0 18px 50px rgba(23,27,34,.16);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .2s, visibility 0s linear .2s, transform .26s cubic-bezier(.16,1,.3,1);
}
.vq-langs:focus { outline: none; }
.vq-langs.is-open, .vq-langs:target { opacity: 1; visibility: visible; transform: none; transition: opacity .2s, visibility 0s, transform .26s cubic-bezier(.16,1,.3,1); }
/* inside the Explore sheet on phones: in place, on the sheet's own surface */
.vq-langs.is-inline { position: static; grid-column: 1 / -1; width: 100%; max-width: none; display: none;
  margin-top: 8px; border-radius: 14px; background: rgba(255,255,255,.5); border: 1px solid transparent; box-shadow: none; transform: none; }
.vq-langs.is-inline.is-open { display: block; }
.vq-langs ul { list-style: none; margin: 0; padding: 0; }
.vq-langs__top { padding-bottom: 6px; margin-bottom: 6px; border-bottom: 1px solid rgba(38,41,47,.12); }
.vq-langs__rest {
  max-height: 260px; overflow-y: auto; overscroll-behavior: contain;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent);
          mask-image: linear-gradient(to bottom, #000 calc(100% - 24px), transparent);
}
.vq-langs a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; padding: 0 18px;
  font: 300 16px/1.2 "Spectral",Georgia,"Noto Serif","Hiragino Mincho ProN","Songti SC","Songti TC","AppleMyungjo",serif;
  font-feature-settings: "locl" 0;   /* one set of letterforms for every name in the list */
  color: var(--ink,#1E2024); text-decoration: none; letter-spacing: 0; text-transform: none; white-space: nowrap;
  transition: background .18s;
}
.vq-langs a::after { content: none !important; }
.vq-langs a:hover, .vq-langs a:focus-visible { background: rgba(217,187,146,.16); outline: none; }
.vq-langs a[aria-current="true"]::before {
  content: ""; order: 2; width: 6px; height: 6px; border-radius: 50%; background: var(--champ-deep,#C09A66); flex-shrink: 0;
}
@media (prefers-reduced-motion: reduce) { .vq-langs, .vq-langs.is-open { transition: none; } }

/* ---- type for each script: Spectral first for Latin letters (VQ, VeeCue),
        then the script's own serif; the sans stack gets the script's own sans ---- */
html:lang(el) { --serif: "Spectral", "Noto Serif", Georgia, "Times New Roman", serif; }
html:lang(ja) { --serif: "Spectral", "Hiragino Mincho ProN", "Yu Mincho", YuMincho, "Noto Serif JP", "Noto Serif CJK JP", serif;
                --sans: "Helvetica Neue", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif; }
html:lang(ko) { --serif: "Spectral", "AppleMyungjo", "Nanum Myeongjo", "Noto Serif KR", "Noto Serif CJK KR", serif;
                --sans: "Helvetica Neue", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif; }
html:lang(zh-Hans) { --serif: "Spectral", "Songti SC", STSong, "Noto Serif SC", "Noto Serif CJK SC", serif;
                     --sans: "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif; }
html:lang(zh-Hant) { --serif: "Spectral", "Songti TC", "Noto Serif TC", "Noto Serif CJK TC", PMingLiU, serif;
                     --sans: "Helvetica Neue", "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif; }
html:lang(th) { --serif: "Spectral", "Noto Serif Thai", Thonburi, Tahoma, serif;
                --sans: "Helvetica Neue", "Noto Sans Thai", Thonburi, Tahoma, sans-serif; }
html:lang(hi) { --serif: "Spectral", "Noto Serif Devanagari", "Kohinoor Devanagari", "Devanagari Sangam MN", serif;
                --sans: "Helvetica Neue", "Noto Sans Devanagari", "Kohinoor Devanagari", sans-serif; }
html:lang(bn) { --serif: "Spectral", "Noto Serif Bengali", "Kohinoor Bangla", "Bangla Sangam MN", serif;
                --sans: "Helvetica Neue", "Noto Sans Bengali", "Kohinoor Bangla", sans-serif; }

/* Scripts without capitals or italics: no fake slant, sensible line breaks. */
html:lang(ja) em, html:lang(ko) em, html:lang(zh-Hans) em, html:lang(zh-Hant) em,
html:lang(th) em, html:lang(hi) em, html:lang(bn) em { font-style: normal; }
html:lang(ja) :is(h1,h2,h3,p), html:lang(zh-Hans) :is(h1,h2,h3,p), html:lang(zh-Hant) :is(h1,h2,h3,p) { line-break: strict; }
html:lang(ko) :is(h1,h2,h3,p) { word-break: keep-all; }
