/* ==============================================
   GTranslate Language Switcher — Independent Writer
   All overrides use !important to beat GTranslate's
   plugin stylesheet and inline styles.
   ============================================== */

/* Lift off the bottom edge */
.gt_switcher_wrapper {
  bottom: 16px !important;
}

/* Google's native translate bar — not needed */
#google_translate_element2 {
  display: none !important;
}

/* ── Container ──
   Must be position:relative so .gt_option (absolute) anchors to it.
   Clear GTranslate's default dark background. */

.gt_switcher {
    width: auto !important;
  position: relative !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  font-family: var(--iw-font) !important;
}

/* ── Trigger button ── */
.gt_switcher .gt_selected {
  background: transparent !important;
  border: none !important;
  height: auto !important;
  padding: 0 !important;
}

.gt_switcher .gt_selected a {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  background: var(--iw-white) !important;
  border: 1px solid var(--iw-border) !important;
  border-radius: var(--iw-radius-sm) !important;
  padding: 8px 12px !important;
  font-family: var(--iw-font) !important;
  font-size: var(--iw-fs-sm) !important;
  font-weight: 600 !important;
  color: var(--iw-gray-700) !important;
  text-decoration: none !important;
  box-shadow: var(--iw-shadow) !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  line-height: 1.4 !important;
  height: auto !important;
  transition: border-color 0.22s ease, color 0.22s ease, box-shadow 0.22s ease !important;
}

.gt_switcher .gt_selected a:hover {
  border-color: var(--iw-navy) !important;
  color: var(--iw-navy) !important;
  box-shadow: var(--iw-shadow-lg) !important;
}

/* Replace GTranslate's ::after chevron with our own */
.gt_switcher .gt_selected a::after {
  content: '' !important;
  display: inline-block !important;
  width: 0 !important;
  height: 0 !important;
  border-left: 4px solid transparent !important;
  border-right: 4px solid transparent !important;
  border-top: 5px solid currentColor !important;
  border-bottom: none !important;
  opacity: 0.5 !important;
  margin-left: 2px !important;
  flex-shrink: 0 !important;
  background: none !important;
}

/* Flag inside trigger */
.gt_switcher .gt_selected a img {
  width: 18px !important;
  height: 18px !important;
  border-radius: 2px !important;
  flex-shrink: 0 !important;
  display: block !important;
  margin: 0 !important;
}

/* ── Dropdown panel ──
   top: auto cancels any GTranslate "top" position so our "bottom" wins.
   z-index keeps it above all page content. */
.gt_switcher .gt_option {
  position: relative;
  bottom: calc(100% + 8px) !important;
  top: auto !important;
  right: 0 !important;
  left: auto !important;
  background: var(--iw-white) !important;
  border: 1px solid var(--iw-border) !important;
  border-radius: var(--iw-radius-sm) !important;
  box-shadow: var(--iw-shadow-lg) !important;
  min-width: 160px !important;
  padding: 6px !important;
  height: auto !important;
  max-height: 260px !important;
  overflow-y: auto !important;
  z-index: 999998 !important;
  margin: 0 !important;
  scrollbar-width: thin;
  scrollbar-color: var(--iw-gray-300) transparent;
}

/* ── Each language row ── */
.gt_switcher .gt_option .nturl,
.gt_switcher .gt_option a {
  display: flex !important;
  align-items: center !important;
  gap: 9px !important;
  padding: 7px 10px !important;
  border-radius: var(--iw-radius-xs) !important;
  font-family: var(--iw-font) !important;
  font-size: var(--iw-fs-sm) !important;
  font-weight: 500 !important;
  color: var(--iw-gray-700) !important;
  text-decoration: none !important;
  background: transparent !important;
  white-space: nowrap !important;
  line-height: 1.2 !important;
  transition: background 0.22s ease, color 0.22s ease !important;
}

.gt_switcher .gt_option .nturl:hover,
.gt_switcher .gt_option a:hover {
  background: var(--iw-gray-100) !important;
  color: var(--iw-navy) !important;
}

/* Active / currently selected language */
.gt_switcher .gt_option .nturl.gt_current,
.gt_switcher .gt_option a.gt_current {
  background: var(--iw-gray-100) !important;
  color: var(--iw-navy) !important;
  font-weight: 700 !important;
}

/* Flags inside each row */
.gt_switcher .gt_option .nturl img,
.gt_switcher .gt_option a img {
  width: 18px !important;
  height: 18px !important;
  border-radius: 2px !important;
  flex-shrink: 0 !important;
  display: block !important;
  margin: 0 !important;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .gt_switcher_wrapper {
    right: 4% !important;
  }

  .gt_switcher .gt_selected a {
    font-size: var(--iw-fs-xs) !important;
    padding: 7px 10px !important;
  }

  .gt_switcher .gt_option {
    max-height: 210px !important;
  }
}
