/* Language control and mobile navigation.
   The original desktop design stays in its original stylesheets. */
.navigation-tools { align-items: center; gap: 1rem; }
.language-switcher { display: flex; align-items: center; gap: .25rem; direction: ltr; flex-shrink: 0; }
.language-switcher a.language-link {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.6rem; min-height: 2.6rem; padding: .3rem .6rem;
  border: 1px solid #d7dded; border-radius: .5rem;
  color: #3c54b1; background: #fff; font-size: .9rem;
  line-height: 1.4; font-weight: 600; text-decoration: none !important;
}
.language-switcher a.language-link:hover { background: #ecf0ff; color: #0f1b4b; }
.language-switcher a.language-link.is-active { background: #3c54b1; color: #fff; border-color: #3c54b1; }
.language-switcher a.language-link:focus-visible { outline: 3px solid #dd3554; outline-offset: 3px; }
.language-switcher a[lang="fa"] { font-family: Tahoma, Arial, sans-serif; }
html[dir="rtl"] body { font-family: Tahoma, Arial, sans-serif; line-height: 1.8; }
html[dir="rtl"] .modal-header .btn-close { margin-right: auto; margin-left: 0; }
html[dir="rtl"] blockquote figcaption { text-align: right; }
html[dir="rtl"] a[href^="mailto:"] { direction: ltr; unicode-bidi: isolate; }
html[dir="rtl"] table td[lang="ru"] { direction: ltr; text-align: left; }
.numeric-value { unicode-bidi: isolate; direction: ltr; }
.contact-map-fallback { margin-top: .75rem; }
.mobile-menu-toggle { display: none; }
.mobile-drawer {
  position: fixed; inset: 0 0 0 auto;
  width: min(360px, calc(100vw - 32px)); max-width: none;
  height: 100vh; height: 100dvh; max-height: none;
  margin: 0; padding: 0; border: 0; border-radius: 0;
  background: #fff; color: #0f1b4b;
  box-shadow: -12px 0 48px rgba(15, 27, 75, .16);
  overflow: auto; overscroll-behavior: contain;
  text-align: start;
}
.mobile-drawer[open] {
  display: flex; flex-direction: column;
  animation: mobile-drawer-enter .2s ease-out;
}
.mobile-drawer::backdrop { background: rgba(15, 27, 75, .45); }
.mobile-drawer-top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: max(1rem, env(safe-area-inset-top)) 1.25rem 1rem;
  border-bottom: 1px solid #e5e9f3;
}
.mobile-drawer-title { margin: 0; font-size: 1.25rem; font-weight: 700; }
.mobile-menu-close {
  display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0;
  border: 1px solid #d7dded; border-radius: .65rem;
  background: #fff; color: #0f1b4b; font: inherit; cursor: pointer;
}
.mobile-menu-close span { font-size: 2rem; line-height: 1; }
.mobile-menu-toggle:focus-visible, .mobile-menu-close:focus-visible {
  outline: 3px solid #dd3554; outline-offset: 3px;
}
.mobile-menu-close:hover { background: #ecf0ff; }
.mobile-drawer .navigation-tools {
  display: flex !important; flex-direction: column; align-items: stretch;
  gap: 1.75rem; width: 100%; max-width: none; margin: 0;
  padding: 1.25rem 1.25rem max(1.5rem, env(safe-area-inset-bottom));
}
.mobile-drawer .mod-menu { flex-direction: column; gap: .5rem; width: 100%; }
.mobile-drawer .mod-menu .nav-item a {
  display: block; min-height: 48px; padding: .75rem 1rem;
  border-radius: .65rem; color: #0f1b4b;
  font-size: 1.05rem; font-weight: 600; text-decoration: none !important;
}
.mobile-drawer .mod-menu .nav-item.active a,
.mobile-drawer .mod-menu .nav-item a:hover { background: #ecf0ff; color: #3c54b1; }
.mobile-menu-language-label {
  margin: 0 0 .75rem; color: #737a8c; font-size: .9rem; font-weight: 600;
}
.mobile-drawer .language-switcher { gap: .5rem; flex-wrap: nowrap; }
.mobile-drawer .language-switcher a.language-link {
  flex: 1; min-width: 0; min-height: 46px; padding: .6rem .4rem;
}
body.mobile-menu-open { overflow: hidden; }
html[dir="rtl"] .mobile-drawer {
  inset: 0 auto 0 0; box-shadow: 12px 0 48px rgba(15, 27, 75, .16);
}
html[dir="rtl"] .mobile-drawer[open] { animation-name: mobile-drawer-enter-rtl; }
@keyframes mobile-drawer-enter { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes mobile-drawer-enter-rtl { from { transform: translateX(-100%); } to { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) {
  .mobile-drawer[open] { animation: none !important; }
}
@media (max-width: 991.98px) {
  html.mobile-navigation-ready #navbar > .container-xxl {
    flex-wrap: nowrap; align-items: center; gap: .75rem;
  }
  html.mobile-navigation-ready #navbar .navigation-tools { display: none !important; }
  html.mobile-navigation-ready .mobile-menu-toggle {
    display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center;
    width: 46px; height: 46px; padding: 0; margin-inline-start: auto;
    border: 1px solid #d7dded; border-radius: .65rem;
    background: #fff; color: #3c54b1; cursor: pointer;
  }
  .mobile-menu-toggle:hover { background: #ecf0ff; }
  .mobile-menu-bars { display: flex; flex-direction: column; gap: 5px; width: 22px; }
  .mobile-menu-bars span { display: block; width: 22px; height: 2px; border-radius: 2px; background: currentColor; }
}
@media (max-width: 575.98px) {
  #navbar > .container-xxl { flex-wrap: wrap; gap: .5rem; }
  .navigation-tools { flex-wrap: wrap; justify-content: flex-end; gap: .25rem .65rem; }
  .language-switcher a.language-link { min-width: 2.3rem; min-height: 2.3rem; padding: .2rem .45rem; }
  .navigation-tools { max-width: 100%; margin-inline-start: auto; }
}
