/* ═══════════════════════════════════════════
   HOTELA i18n — Shared language styles
   Matches book.html lang switcher design
   Used by: own-v10, residence-* pages
   ═══════════════════════════════════════════ */

/* CJK + Arabic font imports */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;600;700&family=Noto+Sans+KR:wght@300;400;500;600;700&family=Noto+Sans+Arabic:wght@300;400;500;600;700&display=swap');

/* Language-specific fonts */
body.lang-ja { font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Inter', sans-serif; }
body.lang-zh { font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Inter', sans-serif; }
body.lang-ko { font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Inter', sans-serif; }
body.lang-ar { font-family: 'Noto Sans Arabic', -apple-system, BlinkMacSystemFont, 'Inter', sans-serif; }

/* RTL Support for Arabic */
body.lang-ar { direction: rtl; text-align: right; }
body.lang-ar .nav { direction: ltr; }
body.lang-ar .lang-switcher { direction: ltr; }
body.lang-ar .lang-dropdown-menu { direction: ltr; text-align: left; }
body.lang-ar .footer-links { direction: ltr; }

/* ── Language Switcher (matching book.html design) ── */
.lang-switcher {
    position: absolute;
    right: 22px;
}

.lang-dropdown-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    font-family: inherit;
    font-size: 0.85em;
    font-weight: 500;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.lang-dropdown-btn:hover {
    background: rgba(255,255,255,0.25);
}

/* Scrolled nav override — dark text on light bg */
.nav.scrolled .lang-dropdown-btn {
    background: rgba(0,0,0,0.05);
    border-color: rgba(0,0,0,0.12);
    color: #1d1d1f;
}

.nav.scrolled .lang-dropdown-btn:hover {
    background: rgba(0,0,0,0.1);
}

.lang-dropdown-btn svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
    transition: transform 0.3s ease;
}

.lang-dropdown.open .lang-dropdown-btn svg {
    transform: rotate(180deg);
}

.lang-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 12px;
    width: 320px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    overflow: hidden;
    z-index: 1000;
    padding: 8px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
}

.lang-dropdown.open .lang-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 12px;
    background: none;
    border: none;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9em;
    color: #1a1a1a;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s;
}

.lang-option:hover {
    background: #f5f5f5;
}

.lang-option.active {
    background: #f0f0f0;
    font-weight: 600;
}

.lang-option span {
    opacity: 0.5;
    font-size: 0.75em;
    margin-top: 2px;
}

/* ── Residence pages: light nav (always scrolled look) ── */
.nav-light .lang-dropdown-btn {
    background: rgba(0,0,0,0.05);
    border-color: rgba(0,0,0,0.12);
    color: #1d1d1f;
}

.nav-light .lang-dropdown-btn:hover {
    background: rgba(0,0,0,0.1);
}

/* ── Mobile ── */
@media (max-width: 768px) {
    .lang-switcher {
        position: static;
    }

    .lang-dropdown-menu {
        width: 280px;
        right: -10px;
    }

    .lang-dropdown-btn {
        padding: 8px 12px;
        font-size: 0.8em;
    }
}

@media (max-width: 480px) {
    .lang-switcher {
        position: absolute;
        right: 16px;
    }

    .lang-dropdown-menu {
        width: calc(100vw - 32px);
        right: -8px;
    }
}
