/* Language switcher (Telegram-style) + footer social icons */

.nav-trailing {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.lang-switcher {
  position: relative;
}

.lang-switcher__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.42rem 0.65rem;
  min-height: 2.25rem;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--page-elevated);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    color 0.15s ease,
    background-color 0.15s ease;
}

.lang-switcher__btn:hover {
  border-color: rgba(38, 187, 252, 0.45);
  color: var(--brand);
  text-decoration: none;
}

.lang-switcher__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.lang-switcher__icon svg {
  width: 1.05rem;
  height: 1.05rem;
}

.lang-switcher__code {
  min-width: 1.25rem;
  text-align: center;
  line-height: 1;
}

.lang-switcher__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: auto;
  min-width: min(240px, calc(100vw - 2rem));
  max-height: min(360px, 70vh);
  overflow-y: auto;
  margin: 0;
  padding: 0.35rem 0;
  list-style: none;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
  z-index: 200;
}

html[dir="rtl"] .lang-switcher__menu {
  right: auto;
  left: 0;
}

.lang-switcher__option {
  display: block;
  width: 100%;
  padding: 0.5rem 1rem;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.875rem;
  text-align: inherit;
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.12s ease;
}

.lang-switcher__option:hover {
  background: #f1f5f9;
}

.lang-switcher__option.is-active {
  color: var(--brand);
  font-weight: 700;
  background: rgba(38, 187, 252, 0.08);
}

.footer-social-wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}

.footer-social-label {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.footer-social {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--page-elevated);
  color: var(--text-muted);
  text-decoration: none;
  transition:
    border-color 0.15s ease,
    color 0.15s ease,
    background-color 0.15s ease,
    transform 0.15s ease;
}

.social-link:hover {
  border-color: var(--brand);
  color: var(--brand);
  text-decoration: none;
  transform: translateY(-1px);
}

.social-link svg {
  width: 1.15rem;
  height: 1.15rem;
}

@media (max-width: 768px) {
  .nav-inner.is-open .nav-trailing {
    width: 100%;
    margin-left: 0;
    padding-top: 0.5rem;
    justify-content: flex-end;
    border-top: 1px solid var(--border-strong);
    margin-top: 0.5rem;
  }
}

html[lang="ar"] body {
  font-family: "Noto Sans Arabic", "ABeeZee", system-ui, -apple-system, sans-serif;
}

html[lang^="zh"] body {
  font-family: "Noto Sans SC", "ABeeZee", system-ui, -apple-system, "PingFang SC", sans-serif;
}
