/* SchemeCheck — navbar language switcher dropdown.
 * Reuses the design tokens defined on each page (--green, --green-light,
 * --slate, --border, --white). Falls back gracefully if a token is absent. */

.lang-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 500;
}

.lang-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 10px;
  font: inherit;
  color: var(--slate, #475569);
  background: transparent;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.lang-switch-btn:hover,
.lang-switch.is-open .lang-switch-btn {
  color: var(--green, #0d7c4a);
  border-color: var(--green, #0d7c4a);
  background: var(--green-light, #e8f5ed);
}
.lang-switch-caret {
  font-size: 10px;
  line-height: 1;
  transition: transform 0.2s;
}
.lang-switch.is-open .lang-switch-caret { transform: rotate(180deg); }

.lang-switch-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: auto;
  z-index: 1000;
  margin: 0;
  padding: 6px;
  list-style: none;
  min-width: 160px;
  max-height: 60vh;
  overflow-y: auto;
  background: var(--white, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
}
.lang-switch-menu[hidden] { display: none; }

.lang-switch-item {
  padding: 10px 12px;
  min-height: 44px;            /* touch target */
  display: flex;
  align-items: center;
  border-radius: 8px;
  color: var(--ink, #0f172a);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}
.lang-switch-item:hover {
  color: var(--green, #0d7c4a);
  background: var(--green-light, #e8f5ed);
}
.lang-switch-item.is-active {
  color: var(--green, #0d7c4a);
  font-weight: 700;
  background: var(--green-light, #e8f5ed);
}

/* RTL: anchor the menu to the left and right-align its text. */
[dir="rtl"] .lang-switch-menu { right: auto; left: 0; text-align: right; }
[dir="rtl"] .lang-switch-btn { flex-direction: row-reverse; }

/* Mobile */
@media (max-width: 720px) {
  .lang-switch-menu { right: 0; min-width: 150px; }
  [dir="rtl"] .lang-switch-menu { left: 0; right: auto; }
}
