/* ============================================================
   AssisteMatik — Language Switcher: pill UI
   UX POLISH (2026-10-24). Targets the Polylang 3.9 switcher rendered by
   header.php inside .tg-site-header__switcher (#pll-switcher). Renders the
   switcher as a horizontal Flexbox row of pill-shaped buttons that mirror
   correctly for both LTR and RTL. Loads LAST (see functions.php
   assistemekam_enqueue_switcher_pill, priority 99) so it overrides Polylang's
   default "pll-layout-vertical" layout.
   Brand accent = theme token --color-blue #0099FF.
   ============================================================ */

/* Container sits in the header nav row; center it vertically. */
.tg-site-header__switcher {
  display: flex;
  align-items: center;
}

/* Force a horizontal row regardless of Polylang's vertical-list default.
   flexbox mirrors the item order automatically when dir="rtl", so the row
   reads correctly in both Hebrew (RTL) and English (LTR). */
.tg-site-header__switcher .pll-switcher,
.tg-site-header__switcher .pll-switcher ul {
  display: flex;
  flex-flow: row wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tg-site-header__switcher .polylang-item,
.tg-site-header__switcher .lang-item {
  display: inline-flex;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* The pill (inactive state). currentColor keeps it readable on any header bg. */
.tg-site-header__switcher .polylang-item > a,
.tg-site-header__switcher .lang-item > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 7px 18px;
  border-radius: 20px;
  border: 1px solid currentColor;
  background-color: transparent;
  color: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  -webkit-transition: background-color .2s ease, color .2s ease,
    border-color .2s ease, box-shadow .2s ease, transform .12s ease;
  transition: background-color .2s ease, color .2s ease,
    border-color .2s ease, box-shadow .2s ease, transform .12s ease;
  cursor: pointer;
}

/* Hover + keyboard focus (identical in LTR/RTL — flexbox handles the mirroring). */
.tg-site-header__switcher .polylang-item > a:hover,
.tg-site-header__switcher .polylang-item > a:focus-visible,
.tg-site-header__switcher .lang-item > a:hover,
.tg-site-header__switcher .lang-item > a:focus-visible {
  background-color: rgba(0, 153, 255, 0.14);
  border-color: #0099FF;
  transform: translateY(-1px);
  outline: none;
}

/* Active (current language): distinct solid brand fill. */
.tg-site-header__switcher .polylang-item.current-lang > a,
.tg-site-header__switcher .lang-item.current-lang > a,
.tg-site-header__switcher .current-lang > a,
.tg-site-header__switcher .current-lang a {
  background-color: #0099FF;
  border-color: #0099FF;
  color: #ffffff;
  font-weight: 700;
}
.tg-site-header__switcher .polylang-item.current-lang > a:hover,
.tg-site-header__switcher .lang-item.current-lang > a:hover,
.tg-site-header__switcher .current-lang a:hover {
  background-color: #0080e6;
  border-color: #0080e6;
  color: #ffffff;
}

.tg-site-header__switcher .pll-switcher-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Tighter pills on small screens. */
@media (max-width: 768px) {
  .tg-site-header__switcher .polylang-item > a,
  .tg-site-header__switcher .lang-item > a {
    min-width: 56px;
    padding: 6px 12px;
    font-size: 0.8rem;
  }
}

/* Honor reduced-motion. */
@media (prefers-reduced-motion: reduce) {
  .tg-site-header__switcher .polylang-item > a,
  .tg-site-header__switcher .lang-item > a {
    -webkit-transition: none;
    transition: none;
  }
}
