/* Language switcher — separate desktop and portrait implementations */

/* Shared button styles */
.tse-lang-switcher__btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px 4px 5px;
  border: 1.5px solid currentColor;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
  opacity: 0.72;
}

.tse-lang-switcher__btn:hover,
.tse-lang-switcher__btn:focus-visible {
  opacity: 1;
  background: rgba(255, 255, 255, 0.14);
  outline: none;
}

.tse-lang-switcher__btn--active {
  opacity: 1;
  background: rgba(255, 255, 255, 0.22);
  border-color: currentColor;
  cursor: default;
}

.tse-lang-switcher__flag {
  display: block;
  width: 20px;
  height: 14px;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
}

.tse-lang-switcher__flag--ua {
  background-image: linear-gradient(to bottom, #005bbb 0 50%, #ffd500 50% 100%);
}

.tse-lang-switcher__flag--en {
  background-color: #012169;
  background-image:
    linear-gradient(33deg, transparent 42%, #fff 42%, #fff 46%, transparent 46%),
    linear-gradient(-33deg, transparent 42%, #fff 42%, #fff 46%, transparent 46%),
    linear-gradient(90deg, transparent 46%, #fff 46%, #fff 54%, transparent 54%),
    linear-gradient(0deg, transparent 46%, #fff 46%, #fff 54%, transparent 54%),
    linear-gradient(33deg, transparent 44%, #c8102e 44%, #c8102e 48%, transparent 48%),
    linear-gradient(-33deg, transparent 44%, #c8102e 44%, #c8102e 48%, transparent 48%),
    linear-gradient(90deg, transparent 48%, #c8102e 48%, #c8102e 52%, transparent 52%),
    linear-gradient(0deg, transparent 48%, #c8102e 48%, #c8102e 52%, transparent 52%);
}

.background--dark .tse-lang-switcher__btn,
.header--scrolled .tse-lang-switcher__btn {
  color: #27342f;
}

.background--dark .tse-lang-switcher__btn--active,
.header--scrolled .tse-lang-switcher__btn--active {
  background: rgba(39, 52, 47, 0.08);
}

/* Desktop — flags + UA/EN in header right section */
.tse-lang-switcher--desktop {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 12px;
  vertical-align: middle;
}

@media (max-width: 991px) {
  .tse-lang-switcher--desktop {
    display: none !important;
  }
}

/* Portrait / mobile — compact UA/EN toggle above burger */
.tse-header-portrait-controls {
  display: none;
}

.tse-lang-switcher--portrait {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tse-lang-switcher--portrait .tse-lang-switcher__btn {
  min-width: 32px;
  justify-content: center;
  padding: 3px 6px;
  font-size: 10px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 991px) {
  .tse-header-portrait-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }

  .tse-lang-switcher--portrait {
    order: -1;
  }
}
