/* G1 First Gate — language toggle only. Existing header/mobile/navigation unchanged. */
.header .impact-lang-switcher {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  z-index: 10006; display: inline-flex; align-items: center; gap: 2px;
  padding: 3px; border: 1px solid rgba(255,255,255,.38);
  border-radius: 24px; background: rgba(8,34,43,.55);
  font-family: "DM Sans", Arial, sans-serif; line-height: 1;
}
.header .impact-lang-switcher button {
  appearance: none; -webkit-appearance: none;
  border: 0; border-radius: 18px; background: transparent; color: #fff;
  font: 700 12px/1 "DM Sans", Arial, sans-serif;
  cursor: pointer; padding: 8px 9px; min-height: 30px;
}
.header .impact-lang-switcher button.is-active {
  background: #fff; color: #065968;
}
.header .impact-lang-switcher button:focus-visible {
  outline: 2px solid #00dbc5; outline-offset: 2px;
}
.header .impact-lang-switcher button:disabled { cursor: wait; }
.header.scrolled-up .impact-lang-switcher {
  background: #eef7f8; border-color: #cbdcde;
}
.header.scrolled-up .impact-lang-switcher button { color: #005667; }
.header.scrolled-up .impact-lang-switcher button.is-active { background: #067e91; color: #fff; }
.header .impact-lang-status:not(:empty) {
  position: absolute; right: 0; top: calc(100% + 4px);
  min-width: 180px; padding: 7px 9px; background: #fff; color: #a22;
  font: 12px/1.4 Arial,sans-serif; border-radius: 6px;
}
@media (max-width: 900px) {
  .header .impact-lang-switcher { right: 0; top: 50%; }
  .header .impact-lang-switcher button { font-size: 11px; padding: 7px 7px; min-height: 30px; }
}
@media (max-width: 360px) {
  .header .impact-lang-switcher { gap: 0; padding: 2px; }
  .header .impact-lang-switcher button { padding: 6px 6px; font-size: 10px; }
}

/* H.8 UX — modal-local TH/EN switch next to existing sticky close X.
   Isolated and scoped; no changes to approved page.css or home-responsive.css. */
#impactEventModal .impact-event-modal__close-rail .impact-event-modal__lang-switcher {
  position: absolute;
  top: 20px;
  right: 78px;
  z-index: 9;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 24px;
  background: #050505;
  pointer-events: auto;
  font-family: "DM Sans", Arial, sans-serif;
  line-height: 1;
}
#impactEventModal .impact-event-modal__lang-switcher button {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 38px;
  padding: 7px 10px;
  border: 0;
  border-radius: 20px;
  background: transparent;
  color: #fff;
  font: 800 12px/1 "DM Sans", Arial, sans-serif;
  cursor: pointer;
}
#impactEventModal .impact-event-modal__lang-switcher button.is-active {
  background: #fff;
  color: #050505;
}
#impactEventModal .impact-event-modal__lang-switcher button:focus-visible {
  outline: 3px solid #00dbc5;
  outline-offset: 2px;
}
#impactEventModal .impact-event-modal__lang-switcher button:disabled {
  cursor: wait;
}
#impactEventModal .impact-event-modal__lang-status:not(:empty) {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: max-content;
  max-width: 210px;
  padding: 7px 9px;
  border: 1px solid #fff;
  background: #050505;
  color: #fff;
  font: 12px/1.4 Arial, sans-serif;
  white-space: normal;
}
/* Reserve space for the controls instead of overlaying the existing status. */
#impactEventModal .impact-event-modal__top { padding-right: 200px; }
@media (max-width: 720px) {
  #impactEventModal .impact-event-modal__close-rail .impact-event-modal__lang-switcher {
    top: 28px;
    right: 74px;
  }
  #impactEventModal .impact-event-modal__top { padding-right: 0; }
}

/* H.10 review adjustment — Thai Header navigation uses the same font as Prefooter.
   Scoped to the Thai locale; leave English, logo, language buttons and icons unchanged.
   Font already loaded by index.html (Google Fonts: Mitr 300/400/500/600). */
html[lang="th"] .header .menu {
  font-family: 'Mitr', sans-serif;
}
