/* Ghekko Language Switch — framework-free; works with YOOtheme (UIkit), Cassiopeia and others.
   Override the custom properties on .ghekko-lang (or via the module settings). */
.ghekko-lang {
  --g-lang-bg: #fff;
  --g-lang-accent: #e62852;
  --g-lang-radius: 500px;
  --g-lang-menu-radius: 6px;
  --g-lang-shadow: 0 5px 15px rgba(0, 0, 0, .08);
  --g-lang-z: 1030;
  position: relative;
}
.ghekko-lang__header, .ghekko-lang__footer { margin: .5em 0; }
.ghekko-lang ul { list-style: none; margin: 0; padding: 0; }
.ghekko-lang a,
.ghekko-lang a:hover,
.ghekko-lang a:focus,
.ghekko-lang a:active { text-decoration: none !important; color: inherit; }
.ghekko-lang__flag {
  display: block;
  flex: none;
  width: var(--g-lang-flag);
  height: var(--g-lang-flag);
  object-fit: contain;
  overflow: hidden;
  color: transparent; /* no alt text spilling out when an image cannot load */
}
.ghekko-lang--round .ghekko-lang__flag { border-radius: 50%; object-fit: cover; }
.ghekko-lang__menu .ghekko-lang__flag { width: var(--g-lang-flag-menu); height: var(--g-lang-flag-menu); }
.ghekko-lang__code { font-size: .875em; font-weight: 600; letter-spacing: .03em; }

/* Switch (dropdown) */
.ghekko-lang__switch { position: relative; display: inline-block; }
.ghekko-lang__toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: var(--g-lang-min-width);
  margin: 0;
  padding: 1px 10px;
  font: inherit;
  line-height: 1.8;
  color: inherit;
  background: transparent;
  border: 1px solid rgba(127, 127, 127, .45);
  border-color: var(--g-lang-border, color-mix(in srgb, currentColor 30%, transparent));
  border-radius: var(--g-lang-radius);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.ghekko-lang__toggle--plain { border-color: transparent; min-width: 0; }
/* Flag only: the pill shrinks to a circle around the flag */
.ghekko-lang .ghekko-lang__toggle.ghekko-lang__toggle--content-flag { min-width: 0; padding: 4px; line-height: 1; }
.ghekko-lang__toggle:focus-visible { outline: 2px dotted currentColor; outline-offset: 3px; }
.ghekko-lang__caret { flex: none; margin-left: auto; color: var(--g-lang-caret, var(--g-lang-icon, currentColor)); transition: transform .15s; }
.ghekko-lang__toggle[aria-expanded="true"] .ghekko-lang__caret { transform: rotate(180deg); }

.ghekko-lang__menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: var(--g-lang-z);
  display: none;
  gap: 6px;
  box-sizing: border-box;
  min-width: var(--g-lang-min-width);
  width: max-content;
  padding: 6px !important;
  color: var(--g-lang-fg, #222);
  background: var(--g-lang-bg);
  border-radius: var(--g-lang-menu-radius);
  box-shadow: var(--g-lang-shadow);
}
.ghekko-lang__switch--right .ghekko-lang__menu { left: auto; right: 0; }
/* Set by the script when there is no room below: open upward */
.ghekko-lang__switch.is-flip-y .ghekko-lang__menu { top: auto; bottom: calc(100% + 6px); }
.ghekko-lang__switch--center .ghekko-lang__menu { left: 50%; transform: translateX(-50%); }
.ghekko-lang__switch.is-open .ghekko-lang__menu,
.ghekko-lang:not(.is-ready) .ghekko-lang__switch:focus-within .ghekko-lang__menu { display: flex; }
.ghekko-lang__menu--flag { flex-direction: row; justify-content: space-around; align-items: center; }
.ghekko-lang__menu--flag_name, .ghekko-lang__menu--name { flex-direction: column; }
.ghekko-lang__menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.ghekko-lang__menu a:hover, .ghekko-lang__menu a:focus-visible { background: rgba(127, 127, 127, .12); outline: none; }
.ghekko-lang .ghekko-lang__menu .is-active > a { color: var(--g-lang-accent); }

/* List */
.ghekko-lang__list--inline { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.ghekko-lang__list--stacked { display: flex; flex-direction: column; gap: 4px; }
.ghekko-lang__list a { display: flex; align-items: center; gap: 6px; }
.ghekko-lang .ghekko-lang__list .is-active > a { color: var(--g-lang-accent); }

/* Compact below the chosen breakpoint: flag (or code) only, like a mobile header */
@media (max-width: 639.98px) {
  .ghekko-lang--compact-640 .ghekko-lang__toggle { min-width: 0; padding: 1px 6px; border-color: transparent; }
  .ghekko-lang--compact-640 .ghekko-lang__toggle .ghekko-lang__flag ~ .ghekko-lang__name,
  .ghekko-lang--compact-640 .ghekko-lang__name--collapsible { display: none; }
}
@media (max-width: 959.98px) {
  .ghekko-lang--compact-960 .ghekko-lang__toggle { min-width: 0; padding: 1px 6px; border-color: transparent; }
  .ghekko-lang--compact-960 .ghekko-lang__toggle .ghekko-lang__flag ~ .ghekko-lang__name,
  .ghekko-lang--compact-960 .ghekko-lang__name--collapsible { display: none; }
}
@media (max-width: 1199.98px) {
  .ghekko-lang--compact-1200 .ghekko-lang__toggle { min-width: 0; padding: 1px 6px; border-color: transparent; }
  .ghekko-lang--compact-1200 .ghekko-lang__toggle .ghekko-lang__flag ~ .ghekko-lang__name,
  .ghekko-lang--compact-1200 .ghekko-lang__name--collapsible { display: none; }
}
@media (prefers-reduced-motion: reduce) { .ghekko-lang__caret { transition: none; } }
