/* ═══════════════════════════════════════════════════════════
   SIMPLE MIND PRODUCTS — LANGUAGE SWITCHER
   Same component/behaviour as the Simple Mind services site,
   restyled with this site's own design tokens.
   RTL adjustments live in css/rtl.css.
═══════════════════════════════════════════════════════════ */
.sm-lang-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  z-index: 1000000;
}

.sm-lang-btn {
  display: inline-flex;
  position: relative;
  z-index: 1000001;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  min-width: 38px;
  padding: 0;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(12,27,51,.10);
  transition: border-color .15s, box-shadow .15s;
}
.sm-lang-btn:hover { border-color: var(--blue); box-shadow: 0 2px 8px rgba(0,106,242,.18); }
.sm-lang-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.sm-lang-toggle.open .sm-lang-btn { border-color: var(--blue); }

.sm-lang-flag { display: inline-flex; pointer-events: none; }
.sm-lang-label { display: none; }
.sm-lang-chevron { display: none; }

.sm-flag {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  display: block;
  transform: none !important;
  pointer-events: none;
}
.sm-lang-flag .sm-flag { width: 34px; height: 34px; }
.sm-lang-item-flag { display: inline-flex; flex-shrink: 0; }
.sm-lang-item-flag .sm-flag { width: 24px; height: 24px; }

.sm-lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  inset-inline-end: 0;
  width: 210px;
  max-width: calc(100vw - 24px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px -20px rgba(12,27,51,.35);
  z-index: 1000002;
  overflow: hidden;
  padding: 6px 0;
}
/* Opacity is deliberately NOT animated — see accessibility widget's
   "pause animations" option, which can freeze an opacity keyframe at 0%. */
.sm-lang-toggle.open .sm-lang-dropdown {
  display: block;
  opacity: 1;
  animation: smDropIn .18s ease;
}
@keyframes smDropIn { from { transform: translateY(-6px) scale(.98); } }
@media (prefers-reduced-motion: reduce) {
  .sm-lang-toggle.open .sm-lang-dropdown { animation: none; }
}

.nav, .nav-row, .nav-cta { overflow: visible; }

.sm-lang-list { list-style: none; padding: 0; margin: 0; }
.sm-lang-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  cursor: pointer;
  transition: background .12s;
  font-size: .9rem;
  white-space: nowrap;
  font-family: var(--font-body);
}
.sm-lang-item:hover { background: var(--bg); }
.sm-lang-item:focus { outline: none; box-shadow: inset 3px 0 0 var(--blue); }
.sm-lang-item.active { background: #E6F1FF; }
.sm-lang-item-native { font-weight: 500; color: var(--ink); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sm-lang-check { color: var(--blue); font-weight: 700; flex-shrink: 0; visibility: hidden; }
.sm-lang-item.active .sm-lang-check { visibility: visible; }

@media (max-width: 640px) {
  .sm-lang-dropdown { width: 200px; }
}

/* Accessibility widget always on top */
#uw-root, #uw-toggle, #uw-panel, #uw-dict-popup, #uw-sr-tooltip, .uw-tooltip-bubble { z-index: 2147483647 !important; }
