/* Language menu + multi-language typography for 12-13 Richmond Buildings */

/* The header uses paint containment, which would clip the dropdown */
header.header-critical { contain: none !important; }

.lm-wrap { display: flex; align-items: center; gap: 12px; }
.lm { position: relative; }
.lm-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 14px;
  background: transparent; color: rgba(255,255,255,.88);
  border: 1px solid rgba(255,255,255,.28); border-radius: 999px;
  font: 500 14px/1 "Figtree Variable", Figtree, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: .3px; cursor: pointer;
  transition: border-color .2s ease, color .2s ease;
}
.lm-btn:hover, .lm-btn[aria-expanded="true"] { border-color: hsl(41 98% 59%); color: #fff; }
.lm-btn:focus-visible { outline: 2px solid hsl(41 98% 59%); outline-offset: 3px; }
.lm-globe { flex: none; opacity: .85; }
.lm-chev { flex: none; opacity: .7; transition: transform .2s ease; }
.lm-btn[aria-expanded="true"] .lm-chev { transform: rotate(180deg); }

.lm-menu {
  position: absolute; top: calc(100% + 10px); inset-inline-end: 0; z-index: 60;
  min-width: 232px; margin: 0; padding: 6px; list-style: none;
  background: #111; border: 1px solid rgba(255,255,255,.12); border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0,0,0,.45);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
}
.lm-menu.lm-open { opacity: 1; visibility: visible; transform: none; transition: opacity .18s ease, transform .18s ease; }
.lm-item {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 10px 12px; border-radius: 8px; text-decoration: none;
  color: rgba(255,255,255,.9);
}
.lm-item:hover, .lm-item:focus-visible { background: rgba(255,255,255,.07); outline: none; }
.lm-item[aria-current="page"] { color: hsl(41 98% 59%); }
.lm-native { font: 500 15px/1.3 "Figtree Variable", Figtree, "PingFang SC", "Hiragino Sans", "Microsoft YaHei", "Yu Gothic", "Noto Sans SC", "Noto Sans JP", "Geeza Pro", "Noto Sans Arabic", "Segoe UI", sans-serif; letter-spacing: 0; }
.lm-en { font: 400 11px/1.3 "Figtree Variable", Figtree, sans-serif; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.45); }
.lm-item[aria-current="page"] .lm-en { color: hsl(41 98% 59% / .7); }

@media (max-width: 380px) {
  .lm-btn { padding: 0 11px; }
  .lm-cur { max-width: 74px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* Chinese (Simplified) */
html[lang^="zh"] body { font-family: "Figtree Variable", Figtree, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", sans-serif; }
html[lang^="zh"] .type-display, html[lang^="zh"] .type-h2, html[lang^="zh"] .font-display {
  font-family: "Playfair Display", "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", "SimSun", serif;
}

/* Japanese */
html[lang="ja"] body { font-family: "Figtree Variable", Figtree, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "YuGothic", "Meiryo", "Noto Sans JP", sans-serif; }
html[lang="ja"] .type-display, html[lang="ja"] .type-h2, html[lang="ja"] .font-display {
  font-family: "Playfair Display", "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", serif;
}
html[lang="ja"] { line-break: strict; }

/* Arabic */
html[lang="ar"] body { font-family: "Figtree Variable", Figtree, "Noto Sans Arabic", "Geeza Pro", "Segoe UI", Tahoma, sans-serif; }
html[lang="ar"] .type-display, html[lang="ar"] .type-h2, html[lang="ar"] .font-display {
  font-family: "Playfair Display", "Noto Naskh Arabic", "Amiri", "Geeza Pro", "Times New Roman", serif;
}
html[lang="ar"] body, html[lang="ar"] body * { letter-spacing: 0 !important; } /* spacing breaks Arabic letter joining */

/* CJK and Arabic need more line height than the Latin display sizes allow */
html[lang^="zh"] .type-display, html[lang="ja"] .type-display, html[lang="ar"] .type-display { line-height: 1.3; }
html[lang^="zh"] .type-h2, html[lang="ja"] .type-h2, html[lang="ar"] .type-h2 { line-height: 1.35; }
html[lang^="zh"] .type-label, html[lang="ja"] .type-label { letter-spacing: .08em; }

/* Right-to-left fixes */
[dir="rtl"] .text-left { text-align: right; }
[dir="rtl"] .ml-2 { margin-left: 0; margin-right: .5rem; }
[dir="rtl"] .mr-2 { margin-right: 0; margin-left: .5rem; }
[dir="rtl"] .lucide-external-link { transform: scaleX(-1); }
[dir="rtl"] svg { direction: ltr; } /* keep map labels and icons laid out as drawn */

/* ---- 23-language additions ---- */
/* Long menu: scrolls inside the dropdown so it always fits on screen */
.lm-menu { max-height: min(70vh, 560px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.lm-native { font-family: "Figtree Variable", Figtree, "PingFang SC", "PingFang TC", "Hiragino Sans", "Apple SD Gothic Neo", "Malgun Gothic", "Microsoft YaHei", "Microsoft JhengHei", "Noto Sans SC", "Noto Sans TC", "Noto Sans JP", "Noto Sans KR", "Noto Sans Thai", "Thonburi", "Leelawadee UI", "Geeza Pro", "Noto Sans Arabic", "Noto Sans Hebrew", "Arial Hebrew", "Segoe UI", sans-serif; }

/* Long translated words in the headline may wrap (English keeps its no-wrap) */
html:not([lang^="en"]) h1 .whitespace-nowrap { white-space: normal; }

/* Chinese (Traditional): Hong Kong / Taiwan fonts */
html[lang="zh-Hant"] body { font-family: "Figtree Variable", Figtree, "PingFang TC", "PingFang HK", "Microsoft JhengHei", "Noto Sans TC", "Noto Sans HK", sans-serif; }
html[lang="zh-Hant"] .type-display, html[lang="zh-Hant"] .type-h2, html[lang="zh-Hant"] .font-display {
  font-family: "Playfair Display", "Songti TC", "Noto Serif TC", "PMingLiU", "MingLiU", serif;
}

/* Korean */
html[lang="ko"] body { font-family: "Figtree Variable", Figtree, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif; word-break: keep-all; }
html[lang="ko"] .type-display, html[lang="ko"] .type-h2, html[lang="ko"] .font-display {
  font-family: "Playfair Display", "AppleMyungjo", "Nanum Myeongjo", "Noto Serif KR", "Batang", serif;
}

/* Thai */
html[lang="th"] body { font-family: "Figtree Variable", Figtree, "Thonburi", "Leelawadee UI", "Noto Sans Thai", "Tahoma", sans-serif; }
html[lang="th"] .type-display, html[lang="th"] .type-h2, html[lang="th"] .font-display {
  font-family: "Playfair Display", "Noto Serif Thai", "Thonburi", "Leelawadee UI", serif;
}
html[lang="th"] body, html[lang="th"] body * { letter-spacing: 0 !important; }

/* Hebrew */
html[lang="he"] body { font-family: "Figtree Variable", Figtree, "Arial Hebrew", "Noto Sans Hebrew", "Segoe UI", Arial, sans-serif; }
html[lang="he"] .type-display, html[lang="he"] .type-h2, html[lang="he"] .font-display {
  font-family: "Playfair Display", "Noto Serif Hebrew", "Times New Roman", serif;
}

/* Greek and Cyrillic: Playfair has Cyrillic; Greek falls back to a matching serif */
html[lang="el"] .type-display, html[lang="el"] .type-h2, html[lang="el"] .font-display {
  font-family: "Playfair Display", "Noto Serif", "Georgia", "Times New Roman", serif;
}
html[lang="el"] body, html[lang="ru"] body, html[lang="uk"] body { font-family: "Figtree Variable", Figtree, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif; }

/* Taller line height for scripts with tall glyphs */
html[lang="zh-Hant"] .type-display, html[lang="ko"] .type-display, html[lang="th"] .type-display { line-height: 1.3; }
html[lang="zh-Hant"] .type-h2, html[lang="ko"] .type-h2, html[lang="th"] .type-h2 { line-height: 1.35; }
html[lang="th"] .type-body, html[lang="th"] p { line-height: 1.75; }
.lm-menu { min-width: 272px; }
.lm-native, .lm-en { white-space: nowrap; }
@media (max-width: 380px) { .lm-menu { min-width: 0; width: calc(100vw - 32px); max-width: 300px; } }

/* ---- Language picker: full-screen overlay (replaces the dropdown) ---- */
/* The header's will-change would trap the fixed overlay inside the header bar */
header.header-critical { will-change: auto !important; }
.lm-menu { display: none !important; }
.lm-modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
  visibility: hidden; opacity: 0;
  transition: opacity .2s ease, visibility 0s linear .2s;
}
.lm-modal.lm-open { visibility: visible; opacity: 1; transition: opacity .2s ease; }
.lm-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.72); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.lm-panel {
  position: relative; display: flex; flex-direction: column;
  width: 100%; max-width: 680px; max-height: min(86vh, 760px); max-height: min(86dvh, 760px);
  background: #111; color: #fff;
  border: 1px solid rgba(255,255,255,.12); border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
  transform: translateY(8px) scale(.985); transition: transform .2s ease;
}
.lm-modal.lm-open .lm-panel { transform: none; }
.lm-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 20px 16px 24px; border-bottom: 1px solid rgba(255,255,255,.1);
}
.lm-title { margin: 0; font: 500 24px/1.2 "Playfair Display", Georgia, serif; letter-spacing: 0; color: #fff; }
.lm-close {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 999px; cursor: pointer;
  background: transparent; color: rgba(255,255,255,.8); border: 1px solid rgba(255,255,255,.25);
}
.lm-close:hover { color: #fff; border-color: hsl(41 98% 59%); }
.lm-close:focus-visible { outline: 2px solid hsl(41 98% 59%); outline-offset: 2px; }
.lm-grid {
  list-style: none; margin: 0; padding: 12px 12px 16px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 8px;
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.45) rgba(255,255,255,.06);
}
.lm-grid::-webkit-scrollbar { width: 10px; }
.lm-grid::-webkit-scrollbar-track { background: rgba(255,255,255,.06); border-radius: 10px; margin: 8px 0; }
.lm-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,.45); border-radius: 10px; border: 2px solid #111; }
.lm-grid .lm-item { padding: 14px 14px; border-radius: 10px; min-height: 52px; align-items: center; }
.lm-grid .lm-item[aria-current="page"] { background: hsl(41 98% 59% / .1); }
.lm-grid .lm-native { font-size: 16px; }
.lm-btn .lm-chev { display: none; }
@media (max-width: 560px) {
  .lm-modal { padding: 12px; align-items: flex-end; }
  .lm-panel { max-height: 88vh; max-height: 88dvh; border-radius: 16px 16px 12px 12px; }
  .lm-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .lm-modal, .lm-panel { transition: none; } }
/* While the picker is open, the header must not create a containing block */
html.lm-lock header.header-critical { transform: none !important; filter: none !important; transition: none !important; }
/* Fade at the bottom of the list so it is obvious there is more to scroll (iOS hides scrollbars) */
.lm-grid { padding-bottom: 36px; -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 36px), transparent); }
