/* 상단 언어 스위치 — 기본 2×2, 데스크톱(721px+)은 콤팩트 1열 */
.lang-switch {
  --lang-switch-divider: rgba(255, 255, 255, 0.2);
  display: grid;
  grid-template-columns: repeat(2, minmax(1.2rem, 1fr));
  grid-template-rows: 1fr 1fr;
  flex-shrink: 0;
  align-self: stretch;
  box-sizing: border-box;
  width: 2.65rem;
  min-height: calc(1rem + (var(--fs-sm, 0.9375rem) * 1.35) + 2px);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: var(--radius-md, 8px);
  background: rgba(12, 18, 34, 0.55);
}

.lang-switch__link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  padding: 0;
  margin: 0;
  border: 0;
  border-right: 1px solid var(--lang-switch-divider);
  border-bottom: 1px solid var(--lang-switch-divider);
  border-radius: 0;
  background: transparent;
  color: rgba(245, 240, 225, 0.78);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.lang-switch__link:nth-child(2n) {
  border-right: none;
}

.lang-switch__link:nth-child(n + 3) {
  border-bottom: none;
}

.lang-switch__link:hover,
.lang-switch__link:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
}

.lang-switch__link:focus-visible {
  outline: 2px solid var(--color-accent, #e8c56b);
  outline-offset: -2px;
  z-index: 1;
}

.lang-switch__link.is-active {
  color: #1a1f2e;
  background: #e8c56b;
}

.lang-switch__link.is-active:hover,
.lang-switch__link.is-active:focus-visible {
  color: #1a1f2e;
  background: #f0d27a;
}

@media (max-width: 720px) {
  .lang-switch {
    width: 2.5rem;
    min-height: 2.5rem;
    height: 2.5rem;
    align-self: center;
  }

  .lang-switch__link {
    font-size: 0.55rem;
  }
}

@media (min-width: 721px) {
  .lang-switch:not(.lang-switch--footer) {
    --lang-switch-divider: transparent;
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    align-self: center;
    width: auto;
    min-width: 0;
    min-height: 0;
    height: auto;
    padding: 0.12rem;
    gap: 0.04rem;
    overflow: hidden;
    border-radius: 999px;
  }

  .lang-switch:not(.lang-switch--footer) .lang-switch__link {
    flex: 0 0 auto;
    box-sizing: border-box;
    width: 1.6rem;
    min-width: 1.6rem;
    height: 1.6rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    font-size: 0.58rem;
    letter-spacing: 0.02em;
  }

  .lang-switch:not(.lang-switch--footer) .lang-switch__link:nth-child(2n),
  .lang-switch:not(.lang-switch--footer) .lang-switch__link:nth-child(n + 3) {
    border: none;
  }
}

/* 푸터 — dadaforum 스타일 가로 1열 알약 */
.site-footer__lang {
  margin: 0 0 1rem;
}

.lang-switch--footer {
  --lang-switch-divider: transparent;
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  align-self: auto;
  width: auto;
  min-height: 0;
  height: auto;
  padding: 0.18rem 0.22rem;
  gap: 0.12rem;
  overflow: visible;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.lang-switch--footer .lang-switch__link {
  width: auto;
  min-width: 2.15rem;
  height: 1.75rem;
  padding: 0 0.55rem;
  border: 0;
  border-radius: 999px;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

.lang-switch--footer .lang-switch__link:nth-child(2n),
.lang-switch--footer .lang-switch__link:nth-child(n + 3) {
  border: none;
}

.lang-switch--footer .lang-switch__link:hover,
.lang-switch--footer .lang-switch__link:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.lang-switch--footer .lang-switch__link.is-active,
.lang-switch--footer .lang-switch__link.is-active:hover,
.lang-switch--footer .lang-switch__link.is-active:focus-visible {
  color: #1a1f2e;
  background: #e8c56b;
}

@media (max-width: 720px) {
  .lang-switch--footer {
    width: auto;
    min-height: 0;
    height: auto;
    align-self: flex-start;
  }

  .lang-switch--footer .lang-switch__link {
    min-width: 2rem;
    height: 1.65rem;
    padding: 0 0.45rem;
    font-size: 0.62rem;
  }
}
