@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@500;700&family=Noto+Sans+SC:wght@500;700&family=Noto+Sans+Thai:wght@500;700&display=swap');

/* Accessible flag-based locale picker shared by every public navigation bar. */
.gt-locale-picker {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  z-index: 1080;
}

.gt-locale-picker .gt-lang-btn {
  width: 48px;
  min-width: 48px;
  height: 38px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 7px;
  cursor: pointer;
}

.gt-locale-trigger-flag,
.gt-locale-option-flag {
  display: block;
  width: 26px;
  height: 18px;
  flex: 0 0 26px;
  border-radius: 4px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(127, 140, 161, .35), 0 3px 8px rgba(0, 0, 0, .18);
}

.gt-locale-caret {
  width: 0;
  height: 0;
  border-right: 3.5px solid transparent;
  border-left: 3.5px solid transparent;
  border-top: 5px solid currentColor;
  opacity: .7;
  transition: transform .18s ease;
}

.gt-locale-picker[data-open="true"] .gt-locale-caret { transform: rotate(180deg); }

.gt-locale-menu {
  position: fixed;
  z-index: 2000;
  top: var(--gt-locale-menu-top, 58px);
  right: var(--gt-locale-menu-right, 16px);
  width: 252px;
  max-height: min(452px, calc(100vh - 90px));
  margin: 0;
  padding: 8px;
  overflow: auto;
  list-style: none;
  border: 1px solid color-mix(in srgb, var(--gt-border, rgba(127, 140, 161, .25)) 82%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--gt-surface, #151a22) 94%, transparent);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .34), 0 4px 14px rgba(0, 0, 0, .2);
  backdrop-filter: blur(18px) saturate(135%);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-7px) scale(.98);
  transform-origin: top right;
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
}

.gt-locale-menu[data-open="true"] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.gt-locale-option {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 46px;
  gap: 12px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: var(--gt-text, #f4f7fb);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 750;
  line-height: 1.2;
  transition: color .14s ease, border-color .14s ease, background .14s ease, transform .14s ease;
}

.gt-locale-option:hover,
.gt-locale-option:focus-visible {
  color: var(--gt-text, #fff);
  border-color: color-mix(in srgb, var(--gt-brand, #7dd3fc) 32%, transparent);
  background: color-mix(in srgb, var(--gt-brand, #7dd3fc) 11%, transparent);
  outline: none;
  transform: translateX(-1px);
}

.gt-locale-option[aria-checked="true"] {
  border-color: color-mix(in srgb, var(--gt-brand, #7dd3fc) 45%, transparent);
  background: color-mix(in srgb, var(--gt-brand, #7dd3fc) 16%, transparent);
}

.gt-locale-option[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .48;
  filter: saturate(.6);
}

.gt-locale-option[aria-disabled="true"]:hover { transform: none; background: transparent; border-color: transparent; }
.gt-locale-option-label {
  flex: 1 1 auto;
  text-align: left;
  font-family: "Noto Sans Thai", "Noto Sans SC", "Noto Sans JP", Inter, ui-sans-serif, system-ui, sans-serif;
}
.gt-locale-option-state { width: 18px; color: var(--gt-brand, #7dd3fc); text-align: center; font-size: .82rem; }
.gt-locale-option[aria-disabled="true"] .gt-locale-option-state { color: var(--gt-muted, #9aa4b2); font-size: .72rem; }

@media (max-width: 575.98px) {
  .gt-locale-menu {
    position: fixed;
    top: auto;
    right: 16px;
    bottom: 16px;
    left: 16px;
    width: auto;
    max-height: min(510px, calc(100vh - 32px));
    transform-origin: bottom center;
    transform: translateY(10px) scale(.98);
  }
  .gt-locale-menu[data-open="true"] { transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .gt-locale-menu,
  .gt-locale-caret,
  .gt-locale-option { transition: none; }
}
