.language-switch {
  position: relative;
  z-index: 20;
  flex: 0 0 auto;
  direction: ltr;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

.menu-links > .language-switch {
  margin-left: 2px;
}

.language-switch--corner {
  position: fixed;
  top: 24px;
  right: 92px;
  z-index: 4;
}

.lang-toggle {
  height: 36px;
  min-width: 74px;
  padding: 0 10px;
  border: 1px solid rgba(255, 200, 110, 0.18);
  border-radius: 999px;
  background: rgba(15, 10, 7, 0.46);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition:
    transform 220ms ease,
    border-color 220ms ease,
    background 220ms ease,
    color 220ms ease,
    box-shadow 220ms ease;
}

.lang-toggle:hover,
.language-switch.is-open .lang-toggle {
  transform: translateY(-1px);
  border-color: rgba(255, 210, 130, 0.34);
  background: rgba(25, 16, 11, 0.68);
  color: #fff2d6;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.28);
}

.lang-flag {
  position: relative;
  width: 23px;
  height: 16px;
  flex: 0 0 23px;
  border-radius: 4px;
  overflow: hidden;
  font-size: 0;
  line-height: 0;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.28),
    0 5px 12px rgba(0, 0, 0, 0.22);
}

.lang-flag::before,
.lang-flag::after {
  content: "";
  position: absolute;
  inset: 0;
}

.lang-flag--ru {
  background: linear-gradient(180deg, #fff 0 33.333%, #2457b7 33.333% 66.666%, #d52b1e 66.666% 100%);
}

.lang-flag--en {
  background: repeating-linear-gradient(180deg, #b22234 0 2px, #fff 2px 4px);
}

.lang-flag--en::before {
  width: 11px;
  height: 9px;
  background: #3c3b6e;
}

.lang-flag--en::after {
  inset: 2px auto auto 2px;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    4px 0 #fff,
    8px 0 #fff,
    0 3px #fff,
    4px 3px #fff,
    8px 3px #fff;
}

.lang-flag--es {
  background: linear-gradient(180deg, #aa151b 0 25%, #f1bf00 25% 75%, #aa151b 75% 100%);
}

.lang-flag--fr {
  background: linear-gradient(90deg, #0055a4 0 33.333%, #fff 33.333% 66.666%, #ef4135 66.666% 100%);
}

.lang-flag--zh {
  background: #de2910;
}

.lang-flag--zh::before {
  inset: 3px auto auto 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ffde00;
  box-shadow:
    7px -1px 0 -2px #ffde00,
    9px 3px 0 -2px #ffde00,
    6px 7px 0 -2px #ffde00;
}

.lang-flag--ar {
  background: #006c35;
}

.lang-flag--ar::before {
  inset: 7px 4px auto;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
}

.lang-flag--hi {
  background: linear-gradient(180deg, #ff9933 0 33.333%, #fff 33.333% 66.666%, #138808 66.666% 100%);
}

.lang-flag--hi::before {
  inset: 5px auto auto 8px;
  width: 7px;
  height: 7px;
  border: 1px solid #000080;
  border-radius: 50%;
}

.lang-flag--hi::after {
  inset: 8px auto auto 11px;
  width: 1px;
  height: 1px;
  border-radius: 50%;
  background: #000080;
  box-shadow:
    0 -3px #000080,
    0 3px #000080,
    -3px 0 #000080,
    3px 0 #000080;
}

.lang-code {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.lang-caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.72;
  transition: transform 180ms ease;
}

.language-switch.is-open .lang-caret {
  transform: rotate(180deg);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  min-width: 188px;
  padding: 8px;
  border: 1px solid rgba(255, 200, 110, 0.16);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(32, 21, 15, 0.94), rgba(10, 8, 6, 0.96)),
    radial-gradient(circle at top right, rgba(255, 176, 75, 0.14), transparent 36%);
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: grid;
  gap: 4px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top right;
  transition:
    opacity 180ms ease,
    visibility 180ms ease,
    transform 180ms ease;
}

.language-switch.is-open .lang-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.lang-option {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
}

.lang-option:hover,
.lang-option.is-active {
  border-color: rgba(255, 210, 130, 0.18);
  background: rgba(255, 204, 126, 0.08);
  color: #fff4dd;
}

.lang-name {
  font-size: 13px;
  line-height: 1.1;
}

.lang-check {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
}

.lang-option.is-active .lang-check {
  background: #ffd282;
  box-shadow: 0 0 12px rgba(255, 210, 130, 0.62);
}

.editor-showcase {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(360px, 1.14fr);
  gap: 28px;
  align-items: center;
  padding: 8px 0 4px;
  transform: translateZ(36px);
}

.editor-showcase::before {
  content: "";
  position: absolute;
  inset: -18px -12px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 16% 24%, rgba(187, 87, 71, 0.20), transparent 30%),
    radial-gradient(circle at 86% 18%, rgba(255, 206, 129, 0.13), transparent 34%),
    linear-gradient(135deg, rgba(70, 42, 36, 0.42), rgba(12, 9, 7, 0.08));
  border: 1px solid rgba(245, 219, 196, 0.10);
  pointer-events: none;
  opacity: 0.86;
}

.editor-copy,
.editor-shot-frame {
  position: relative;
  z-index: 1;
}

.editor-kicker {
  margin: 0 0 12px;
  color: #f5dbc4;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.editor-title {
  margin: 0;
  color: #fff3e8;
  font-size: clamp(2rem, 5vw, 4.8rem);
  line-height: 0.92;
  letter-spacing: -0.05em;
  font-weight: 700;
}

.editor-text {
  margin: 18px 0 0;
  max-width: 58ch;
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.76;
}

.editor-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.editor-point {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(245, 219, 196, 0.16);
  border-radius: 999px;
  background: rgba(12, 8, 6, 0.32);
  color: rgba(255, 239, 221, 0.86);
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  line-height: 1.2;
}

.editor-shot-frame {
  margin: 0;
  padding: 8px;
  border: 1px solid rgba(255, 205, 126, 0.14);
  border-radius: 24px;
  background: rgba(7, 5, 4, 0.46);
  box-shadow:
    0 24px 54px rgba(0, 0, 0, 0.42),
    0 0 44px rgba(187, 87, 71, 0.12);
  overflow: hidden;
}

.editor-shot {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: center top;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.editor-caption {
  margin: 9px 4px 2px;
  color: rgba(247, 230, 203, 0.58);
  font-size: 12px;
  line-height: 1.45;
}

html[dir="rtl"] .language-switch,
html[dir="rtl"] .language-switch * {
  direction: ltr;
}

html[dir="rtl"] .editor-showcase {
  direction: rtl;
}

html[dir="rtl"] .editor-points {
  justify-content: flex-start;
}

html[dir="rtl"] .lang-option {
  text-align: left;
}

@media (max-width: 980px) {
  .language-switch--corner {
    top: 18px;
    right: 82px;
  }

  .editor-showcase {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .editor-title {
    font-size: clamp(2.25rem, 10vw, 4rem);
  }
}

@media (max-width: 920px) {
  .menu-links > .language-switch {
    margin-left: 0;
  }
}

@media (max-width: 640px) {
  .language-switch--corner {
    position: absolute;
    top: 24px;
    right: 84px;
  }

  .lang-toggle {
    min-width: 60px;
    height: 34px;
    padding: 0 9px;
  }

  .lang-code {
    display: none;
  }

  .lang-menu {
    min-width: 174px;
  }

  .editor-showcase::before {
    inset: -14px -8px;
    border-radius: 22px;
  }

  .editor-shot-frame {
    border-radius: 18px;
    padding: 6px;
  }

  .editor-shot {
    border-radius: 12px;
  }
}
