/* BUSANHBANK - Language selector, multilingual fonts and right-to-left (Arabic) support */
.lang-switch { position: relative; display: inline-block; font-family: inherit; z-index: 120; }
.lang-switch > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .8rem; min-height: 38px; border: 1px solid #bcd7f7; border-radius: 999px; background: #fff; color: #0b2a5b; font-size: .8125rem; font-weight: 600; line-height: 1; white-space: nowrap; user-select: none; transition: border-color .15s, box-shadow .15s; }
.lang-switch > summary::-webkit-details-marker { display: none; }
.lang-switch > summary:hover, .lang-switch[open] > summary { border-color: #38a8f0; box-shadow: 0 0 0 3px rgba(56,168,240,.18); }
.lang-switch > summary:focus-visible { outline: 2px solid #38a8f0; outline-offset: 2px; }
.lang-flag { font-size: 1.05rem; line-height: 1; }
.lang-caret { width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform .15s; }
.lang-switch[open] .lang-caret { transform: rotate(225deg); }
.lang-menu { position: absolute; top: calc(100% + 8px); right: 0; margin: 0; padding: .4rem; list-style: none; min-width: 190px; max-height: 70vh; overflow-y: auto; background: #fff; border: 1px solid #cfe1fa; border-radius: 14px; box-shadow: 0 14px 40px rgba(11,42,91,.18); }
.lang-menu li { margin: 0; }
.lang-menu a { display: flex; align-items: center; gap: .65rem; padding: .6rem .75rem; border-radius: 9px; color: #0d1b36; text-decoration: none; font-size: .875rem; font-weight: 500; }
.lang-menu a:hover, .lang-menu a:focus-visible { background: #e3f3fd; color: #0b2a5b; outline: none; }
.lang-menu a.active { background: #e3f3fd; color: #0b2a5b; font-weight: 700; }
.lang-check { margin-inline-start: auto; color: #1d7fc4; font-weight: 700; }
.lang-float { position: fixed; top: 10px; right: 10px; z-index: 1000; }
[data-theme="dark"] .lang-switch > summary, [data-theme="dark"] .lang-menu { background: #0f1930; color: #e4ecf7; border-color: #223358; }
[data-theme="dark"] .lang-menu a { color: #e4ecf7; }
[data-theme="dark"] .lang-menu a:hover, [data-theme="dark"] .lang-menu a.active { background: #15213d; color: #7cc8f7; }

/* Fonts for non-Latin scripts */
html[lang="ko"] body { font-family: 'Noto Sans KR', 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif; }
html[lang="ja"] body { font-family: 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', Meiryo, sans-serif; }
html[lang="zh-CN"] body { font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif; }
html[lang="ar"] body { font-family: 'Noto Sans Arabic', Tahoma, 'Segoe UI', Arial, sans-serif; }
html[lang="ko"] .serif, html[lang="ja"] .serif, html[lang="zh-CN"] .serif, html[lang="ar"] .serif,
html[lang="ko"] h1, html[lang="ko"] h2, html[lang="ko"] h3, html[lang="ja"] h1, html[lang="ja"] h2, html[lang="ja"] h3,
html[lang="zh-CN"] h1, html[lang="zh-CN"] h2, html[lang="zh-CN"] h3, html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] h3 { font-family: inherit; letter-spacing: 0; }
html[lang="ar"] .nav-logo, html[lang="ar"] .sidebar-logo { letter-spacing: .08em; }
html[lang="ko"] body, html[lang="ja"] body, html[lang="zh-CN"] body { word-break: keep-all; overflow-wrap: anywhere; line-height: 1.7; }

/* Right-to-left (Arabic) */
html[dir="rtl"] body { text-align: right; }
html[dir="rtl"] .lang-menu { right: auto; left: 0; }
html[dir="rtl"] .lang-float { right: auto; left: 10px; }
html[dir="rtl"] .nav-inner, html[dir="rtl"] .util-inner, html[dir="rtl"] .dash-header-inner { direction: rtl; }
html[dir="rtl"] .dash-sidebar { left: auto; right: 0; border-right: 0; border-left: 1px solid var(--outline-variant); }
html[dir="rtl"] .dash-main { margin-left: 0; margin-right: var(--sidebar-width); }
html[dir="rtl"] .util-bar a { margin-left: 0; margin-right: 1.25rem; }
html[dir="rtl"] input[type="email"], html[dir="rtl"] input[type="tel"], html[dir="rtl"] input[type="number"],
html[dir="rtl"] input[type="password"], html[dir="rtl"] input[type="url"] { direction: ltr; text-align: right; }
@media (max-width: 1024px) {
  html[dir="rtl"] .dash-sidebar { transform: translateX(100%); }
  html[dir="rtl"] .dash-sidebar.open { transform: translateX(0); }
  html[dir="rtl"] .dash-main { margin-right: 0; }
}

/* Responsive selector */
@media (max-width: 768px) {
  .lang-switch > summary { padding: .4rem .6rem; min-height: 36px; }
  .lang-switch .lang-current { display: none; }
  .nav-actions .lang-switch { order: -1; }
  .lang-menu { min-width: 170px; }
}
@media (max-width: 380px) { .lang-float { top: 6px; right: 6px; } html[dir="rtl"] .lang-float { left: 6px; } }

/* Keep the selector visible and compact on phones and tablets */
@media (max-width: 768px) {
  .pub-nav .nav-actions { display: flex !important; align-items: center; gap: .4rem; }
  .pub-nav .nav-actions .theme-switch { display: none; }
  .pub-nav .nav-actions .lang-switch .lang-menu { right: 0; }
  html[dir="rtl"] .pub-nav .nav-actions { margin-left: .5rem; margin-right: 0; }
  html[dir="rtl"] .pub-nav .nav-actions .lang-switch .lang-menu { right: auto; left: 0; }
  .dash-header-right { gap: .4rem; flex-wrap: nowrap; }
  .dash-header-right .lang-switch > summary { padding: .35rem .5rem; min-height: 34px; }
  .dash-header-right .lang-menu { right: 0; }
  html[dir="rtl"] .dash-header-right .lang-menu { right: auto; left: 0; }
  .lang-menu { max-width: calc(100vw - 24px); }
}
@media (max-width: 400px) {
  .lang-switch > summary { padding: .35rem .45rem; }
  .lang-switch .lang-caret { display: none; }
}
