/**
 * TP Translate — Language Switcher Styles
 * EN | TH toggle in nav bar.
 * Namespace: .tp-lang-switch*
 */

/* ── Desktop: absolute position with nav padding to prevent overlap ── */

body nav.tp-nav .tp-nav-inner {
  position: relative !important;
  padding: 0 100px 0 24px !important;
}

body .tp-lang-switch {
  display: inline-flex !important;
  align-items: center !important;
  gap: 2px !important;
  position: absolute !important;
  right: 24px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  padding-left: 20px !important;
  border-left: 2px solid #c5a065 !important;
  white-space: nowrap !important;
  z-index: 1001 !important;
}

/* ── Individual items (links + active span) ── */

body .tp-lang-switch__item {
  display: inline-block !important;
  padding: 4px 8px !important;
  font-family: "Inter", sans-serif !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em !important;
  text-decoration: none !important;
  border-radius: 4px !important;
  transition:
    background 0.15s ease,
    color 0.15s ease !important;
  line-height: 1 !important;
}

/* Inactive (clickable link) */
body a.tp-lang-switch__item {
  color: #8a9a8e !important;
  background: transparent !important;
  cursor: pointer !important;
}

body a.tp-lang-switch__item:hover {
  color: #3a5a40 !important;
  background: #f7f9f4 !important;
}

body a.tp-lang-switch__item:focus-visible {
  outline: 2px solid #c5a065 !important;
  outline-offset: 1px !important;
}

/* Active (current language) */
body .tp-lang-switch__item--active {
  color: #f7f9f4 !important;
  background: #3a5a40 !important;
  cursor: default !important;
}

/* ── Mobile ── */

@media (max-width: 768px) {
  /* Undo desktop nav padding */
  body nav.tp-nav .tp-nav-inner {
    padding: 0 24px !important;
  }

  /* The <li> wrapper: sits at the bottom just above mobile footer */
  body .tp-menu > li.tp-mobile-lang-wrap {
    margin-top: auto !important;
    padding: 20px 24px !important;
    text-align: center !important;
    border-top: 1px solid rgba(197, 160, 101, 0.1) !important;
    /* Match the mobile menu entrance animation */
    opacity: 1 !important;
    transform: none !important;
    height: auto !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Reset switcher to inline inside the <li> */
  body .tp-lang-switch {
    position: static !important;
    transform: none !important;
    border-left: none !important;
    padding-left: 0 !important;
    justify-content: center !important;
  }

  body .tp-lang-switch__item {
    font-size: 13px !important;
    padding: 6px 14px !important;
    color: rgba(247, 249, 244, 0.7) !important;
  }

  body a.tp-lang-switch__item:hover {
    color: #f7f9f4 !important;
    background: rgba(247, 249, 244, 0.1) !important;
  }

  body .tp-lang-switch__item--active {
    color: #f7f9f4 !important;
    background: rgba(197, 160, 101, 0.3) !important;
  }

  /* Footer loses its auto margin since lang-wrap takes that role */
  body .tp-menu > li.tp-mobile-footer {
    margin-top: 0 !important;
  }
}

/* ── Desktop: hide the mobile-only <li> wrapper ── */

@media (min-width: 769px) {
  body .tp-menu > li.tp-mobile-lang-wrap {
    display: none !important;
  }
}

/* ── Reduced motion ── */

@media (prefers-reduced-motion: reduce) {
  body .tp-lang-switch__item {
    transition: none !important;
  }
}

/* ── Print: hide ── */

@media print {
  body .tp-lang-switch {
    display: none !important;
  }
}
