/*
 * 언어 전환 버튼 (한국어 | English)
 * <html data-lang> 은 js/i18n.js 가 정한다. 스크립트가 없으면 버튼도 숨긴다.
 */
html:not([data-lang]) .lang-switch {
    display: none;
}

.lang-switch {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 100000; /* PC 위쪽 메뉴 띠(99999, 폭 전체·투명)보다 위, 로더(999999)보다 아래 */
    display: flex;
    padding: 3px;
    border-radius: 999px;
    background-color: rgba(17, 17, 17, 0.72);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
    font-family: 'Roboto', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
    font-size: 13px;
    line-height: 1;
    transition: top 0.3s;
}

/* PC 위쪽 메뉴 띠: 첫 화면(높이 105px)에선 메뉴 글자 높이에, 스크롤해 47px로 줄면 띠 가운데에 맞춘다 */
@media (min-width: 992px) {
    .lang-switch {
        top: 22px;
    }

    body:has(#sidebar-menu.shrink) .lang-switch {
        top: 6px;
    }
}

.lang-switch a {
    display: block;
    padding: 8px 12px;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: background-color 0.2s, color 0.2s;
}

.lang-switch a + a {
    margin-left: 2px;
}

.lang-switch a:hover,
.lang-switch a:focus {
    color: #ffffff;
    text-decoration: none;
}

.lang-switch a:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 1px;
}

.lang-switch a[aria-current="true"] {
    background-color: #ff3131;
    color: #ffffff;
    font-weight: 700;
}

@media (max-width: 767px) {
    .lang-switch {
        top: 12px;
        right: 12px;
    }

    .lang-switch a {
        padding: 8px 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lang-switch,
    .lang-switch a {
        transition: none;
    }
}
