/* Language switcher dropdown, 2026-11 look (shared by ToolsPivot, DocuPivot, PicsPivot).
   Loaded after custom.css / tp-site.css. Every rule is scoped to .lang-switch-dropdown. */
.lang-switch-dropdown {
  --ls-brand: #fa4c10;
  --ls-ink: #1f1a17;
  --ls-ink-strong: #c2410c;
  --ls-muted: #6b625d;
  --ls-line: #e8ded8;
  --ls-hover: #fff7f3;
  --ls-active: #ffeee6;
}

/* Panel (desktop) */
@media (min-width: 768px) {
  .navbar-nav > li > .dropdown-menu.lang-switch-dropdown,
  .lang-switch-dropdown.dropdown-menu {
    min-width: 248px;
    margin-top: 8px !important;
    padding: 6px !important;
    background: #fff !important;
    border: 1px solid var(--ls-line) !important;
    border-radius: 14px !important;
    box-shadow: 0 18px 40px -16px rgba(80, 40, 20, .28), 0 2px 6px rgba(80, 40, 20, .06) !important;
    left: auto !important;
    right: 0 !important;
    inset-inline-start: auto !important;
    inset-inline-end: 0 !important;
    overflow: hidden;
  }
  .open > .lang-switch-dropdown {
    animation: ls-in .16s ease-out both;
  }
}
@keyframes ls-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .open > .lang-switch-dropdown { animation: none; }
}

/* Rows */
.lang-switch-dropdown > li {
  border: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: none !important;
}
.lang-switch-dropdown > li + li { margin-top: 2px !important; }
.navbar-nav .lang-switch-dropdown > li > a,
.lang-switch-dropdown > li > a {
  display: flex !important;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 8px 12px !important;
  border: 0 !important;
  border-radius: 10px;
  background: transparent !important;
  color: var(--ls-ink) !important;
  font: 500 15px/1.3 "Open Sans", system-ui, -apple-system, "Segoe UI", sans-serif !important;
  text-align: start;
  white-space: nowrap;
  text-decoration: none !important;
  transition: background-color .15s ease, color .15s ease;
}
.navbar-nav .lang-switch-dropdown > li > a:hover,
.lang-switch-dropdown > li > a:hover {
  background: var(--ls-hover) !important;
  color: var(--ls-ink-strong) !important;
}
.lang-switch-dropdown > li > a:focus-visible {
  outline: 2px solid var(--ls-brand) !important;
  outline-offset: -2px;
}
.navbar-nav .lang-switch-dropdown > li.is-current > a,
.lang-switch-dropdown > li.is-current > a {
  background: var(--ls-active) !important;
  color: var(--ls-ink-strong) !important;
  font-weight: 600 !important;
}

/* Flag */
.lang-switch-dropdown .lang-flag {
  width: 24px !important;
  height: 18px !important;
  object-fit: cover;
  flex: none;
  border-radius: 4px !important;
  box-shadow: 0 0 0 1px rgba(31, 26, 23, .1) !important;
}
.lang-switch-dropdown .lang-flag-fallback {
  width: 24px;
  flex: none;
  text-align: center;
  color: var(--ls-brand);
}

/* Name and code chip */
.lang-switch-dropdown .lang-label {
  flex: 1 1 auto;
  min-width: 0;
  color: inherit !important;
}
.lang-switch-dropdown .lang-code {
  flex: none;
  min-width: 30px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #f4eeea;
  color: var(--ls-muted);
  font: 600 11px/1.4 "Open Sans", system-ui, sans-serif;
  letter-spacing: .04em;
  text-align: center;
}
.lang-switch-dropdown > li.is-current .lang-code {
  background: var(--ls-ink-strong);
  color: #fff;
}

/* Phone menu (collapsed navbar): same rows, inline in the menu */
@media (max-width: 767px) {
  #myNavbar .lang-switch-dropdown {
    padding: 4px 16px 8px !important;
    padding-inline-start: 46px !important; /* flag lines up with the menu text (link padding 58px) */
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }
  #myNavbar .lang-switch-dropdown > li > a {
    padding: 8px 12px !important;
  }
  /* RTL menu links keep a 15px right padding (the 58px is on the left), so the list hugs the right edge */
  [dir="rtl"] #myNavbar .lang-switch-dropdown {
    padding-inline-start: 4px !important;
  }
}
