/* ============================================================
   lang-toggle.css — UA / RU / EN language switcher
   Segmented button group in the site header.
   Uses design-system tokens from tokens.css.
   ============================================================ */

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 16px;
  flex-shrink: 0;
}

.lang-toggle button {
  background: none;
  border: 1px solid rgba(26, 22, 20, 0.18);
  color: var(--ds-ink-muted);
  padding: 6px 10px;
  font-family: var(--ds-font-mono);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  line-height: 1;
  cursor: pointer;
  border-radius: var(--ds-radius-xs);
  transition: color 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
  /* Explicit hit area so small text stays comfortable on touch */
  min-height: 32px;
  min-width: 36px;
}

.lang-toggle button:hover {
  color: var(--ds-ink);
  border-color: var(--ds-ink);
}

.lang-toggle button.is-active {
  background: var(--ds-ink);
  color: var(--ds-bone);
  border-color: var(--ds-ink);
}

/* Focus-visible ring — WCAG AA 3:1 contrast minimum */
.lang-toggle button:focus-visible {
  outline: 2px solid var(--ds-oxblood);
  outline-offset: 2px;
}

/* ---- Mobile: hide in header when burger menu is collapsed ----
   The toggle is re-shown inside the open mobile nav overlay so it
   remains accessible without a separate duplicate DOM element.
   Strategy: when viewport <= 700px, hide .lang-toggle in the header
   baseline flow, then show it injected into the open nav via JS
   (app.js clones it), OR simply keep it visible but compact.

   Per spec: "hide on burger menu, but show inside the open mobile nav".
   We keep it in the header always (visible, compact), and also render
   a clone inside the open nav overlay. The JS in app.js handles the
   clone injection. The CSS below makes the header version visually
   compact on small screens and ensures the nav-clone version is shown.
   ---------------------------------------------------------------- */
@media (max-width: 700px) {
  /* Keep visible in header but reduce padding so it fits beside burger */
  .lang-toggle {
    gap: 3px;
    margin-left: 10px;
  }

  .lang-toggle button {
    padding: 5px 7px;
    font-size: 0.55rem;
    min-height: 28px;
    min-width: 30px;
  }

  /* Inside open mobile nav — larger, more breathable */
  .nav.open .lang-toggle {
    gap: 6px;
    margin: 20px 0 0;
    justify-content: center;
  }

  .nav.open .lang-toggle button {
    padding: 8px 14px;
    font-size: 0.65rem;
    min-height: 36px;
    min-width: 44px;
  }
}

/* Honour reduced-motion — already handled globally by tokens.css
   setting all --ds-dur-* to 0ms, which the transition above respects. */
@media (prefers-reduced-motion: reduce) {
  .lang-toggle button {
    transition: none;
  }
}
