/* HT Lazy Globe Switcher — live. Tiny CSS; no Google assets until click. */
.ht-lang {
  position: relative;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-inline-start: 4px;
  font-family: "Libre Franklin", Helvetica, Arial, sans-serif;
  z-index: 40;
}
.ht-lang *,
.ht-lang *::before,
.ht-lang *::after { box-sizing: border-box; }

.ht-lang__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 0;
  margin: 0;
  border: 1px solid #121212;
  border-radius: 0;
  background: #fff;
  color: #121212;
  cursor: pointer;
  line-height: 1;
  -webkit-appearance: none;
  appearance: none;
}
.ht-lang__btn:hover { background: #f5efe2; }
.ht-lang__btn:focus-visible {
  outline: 2px solid #b00020;
  outline-offset: 2px;
}
.ht-lang__btn[aria-expanded="true"] {
  background: #121212;
  color: #fff;
}
.ht-lang__icon {
  width: 18px;
  height: 18px;
  display: block;
  pointer-events: none;
}
.ht-lang__code {
  display: none;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.ht-lang__menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-start: 0;
  inset-inline-end: auto;
  min-width: 220px;
  max-height: min(70vh, 420px);
  overflow: auto;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: #fff;
  border: 1px solid #121212;
  box-shadow: 0 10px 24px rgba(0,0,0,.14);
  text-align: start;
  z-index: 1002;
}
.ht-lang.is-open .ht-lang__menu { display: block; }
.ht-lang .ht-lang__menu {
  background: #ffffff !important;
  background-color: #ffffff !important;
  color: #121212 !important;
  opacity: 1 !important;
  z-index: 10050 !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
.ht-lang .ht-lang__item {
  background: #ffffff !important;
  color: #121212 !important;
  opacity: 1 !important;
}
.ht-lang .ht-lang__item:hover,
.ht-lang .ht-lang__item:focus-visible {
  background: #f5efe2 !important;
}

.ht-lang__item {
  display: block;
  width: 100%;
  padding: 10px 16px;
  border: 0;
  background: transparent;
  color: #121212;
  font: 500 14px/1.3 "Libre Franklin", Helvetica, Arial, sans-serif;
  text-align: start;
  cursor: pointer;
}
.ht-lang__item:hover,
.ht-lang__item:focus-visible {
  background: #f5efe2;
  outline: none;
}
.ht-lang__item[aria-checked="true"] {
  font-weight: 700;
  background: #f7f5f0;
}
.ht-lang__item[aria-checked="true"]::after {
  content: " ✓";
  color: #b00020;
}

.ht-lang__status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* Hidden Google Translate host + chrome (banner / tooltip / iframe frame) */
#ht-google-translate-element,
.goog-te-banner-frame,
.goog-te-balloon-frame,
#goog-gt-tt,
.goog-tooltip,
.goog-tooltip:hover,
.goog-text-highlight {
  display: none !important;
}
body { top: 0 !important; }
.skiptranslate,
.goog-te-gadget,
.goog-te-combo {
  display: none !important;
  height: 0 !important;
  overflow: hidden !important;
}
iframe.goog-te-banner-frame { display: none !important; height: 0 !important; visibility: hidden !important; }
.goog-te-spinner-pos { display: none !important; }

/* Late-night lobby (dark) mode — match ht-lobby-btn contrast */
html.ht-lobby .ht-lang__btn {
  background: transparent !important;
  border-color: #d4a537 !important;
  color: #d4a537 !important;
  box-shadow: 0 0 14px rgba(212,165,55,.25);
}
html.ht-lobby .ht-lang__btn:hover {
  background: rgba(212,165,55,.12) !important;
}
html.ht-lobby .ht-lang__btn[aria-expanded="true"] {
  background: #d4a537 !important;
  color: #0b1740 !important;
  border-color: #d4a537 !important;
}
html.ht-lobby .ht-lang__btn:focus-visible {
  outline: 2px solid #d4a537;
  outline-offset: 2px;
}
html.ht-lobby .ht-lang__menu {
  background: #0b1740 !important;
  border-color: rgba(203,211,232,.45) !important;
  box-shadow: 0 12px 28px rgba(0,0,0,.45);
}
html.ht-lobby .ht-lang__item {
  color: #f1e7d0 !important;
}
html.ht-lobby .ht-lang__item:hover,
html.ht-lobby .ht-lang__item:focus-visible {
  background: rgba(212,165,55,.12) !important;
}
html.ht-lobby .ht-lang__item[aria-checked="true"] {
  background: rgba(212,165,55,.18) !important;
}
html.ht-lobby .ht-lang__item[aria-checked="true"]::after {
  color: #d4a537;
}

/* RTL tweaks when Arabic is active */
html[dir="rtl"] .ht-lang__menu {
  inset-inline-start: auto;
  inset-inline-end: 0;
}
html[dir="rtl"] .tht-nav,
html[dir="rtl"] .tht-nav-list {
  direction: rtl;
}
html[dir="rtl"] .ht-body,
html[dir="rtl"] .entry-content,
html[dir="rtl"] article.ht-article,
html[dir="rtl"] .ht-article {
  direction: rtl;
  text-align: start;
}
html[dir="rtl"] .tht-mast {
  direction: rtl;
}
/* Keep brand readable; avoid float/overlap glitches in RTL */
html[dir="rtl"] img,
html[dir="rtl"] video,
html[dir="rtl"] iframe {
  max-width: 100%;
}

/* Sit sensibly in the section nav (desktop + mobile) */
.tht-nav .ht-lang,
.tht-nav-list .ht-lang {
  flex: 0 0 auto;
  align-self: center;
}
@media (max-width: 900px) {
  .tht-nav .ht-lang__btn,
  .tht-nav-list .ht-lang__btn,
  nav.tht-nav > .ht-lang .ht-lang__btn {
    width: 36px;
    height: 36px;
  }
  .ht-lang .ht-lang__menu {
    position: fixed !important;
    top: auto !important;
    bottom: 12px !important;
    left: 12px !important;
    right: 12px !important;
    inset-inline: 12px !important;
    min-width: 0 !important;
    max-height: 55vh !important;
    z-index: 10050 !important;
    background: #ffffff !important;
    box-shadow: 0 12px 40px rgba(0,0,0,.28) !important;
  }
}

/* When mounted in the top tools wrap next to lobby/search */
.tht-tools-wrap .ht-lang__btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
}

@media print {
  .ht-lang { display: none !important; }
}

/* When globe is a direct child of nav.tht-nav (mobile-safe mount) */
nav.tht-nav > .ht-lang {
  position: absolute;
  top: 8px;
  inset-inline-end: 12px;
  z-index: 5;
}
nav.tht-nav {
  position: relative;
}
@media (min-width: 901px) {
  /* On desktop, if mounted on nav root, tuck into the row near the end of links */
  nav.tht-nav > .ht-lang {
    position: static;
    inset-inline-end: auto;
    margin-inline-start: 6px;
    align-self: center;
  }
  nav.tht-nav:has(> .ht-lang) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
  }
  nav.tht-nav:has(> .ht-lang) > .tht-nav-list {
    flex: 1 1 auto;
  }
  nav.tht-nav:has(> .ht-lang) > .tht-nav-toggle {
    display: none; /* theme already hides toggle on desktop via its own CSS; belt+suspenders */
  }
}
