/**
 * 🌐 多言語対応スタイルシート
 * 各言語に最適化されたフォントとレイアウト
 */

/* === 🇯🇵 日本語フォント設定 === */
:lang(ja) {
    font-family: "Source Sans 3", "Noto Sans JP", 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Yu Gothic Medium', 'Meiryo', 'MS PGothic', sans-serif;
    font-size: 0.9rem;
    line-height: 1.8;
    letter-spacing: 0.05em;
}

:lang(ja) h1, :lang(ja) h2, :lang(ja) h3 {
    font-family: "Source Sans 3", "Noto Sans JP", 'Hiragino Mincho ProN', 'Yu Mincho', 'MS PMincho', serif;
    font-weight: 600;
    letter-spacing: 0.1em;
}

/* === 🇺🇸 英語フォント設定 === */
:lang(en) {
    font-family: "Source Sans 3", 'Inter', 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.95rem;
    line-height: 1.7;
    letter-spacing: 0.025em;
}

:lang(en) h1, :lang(en) h2, :lang(en) h3 {
    font-family: "Source Sans 3", 'Playfair Display', 'Georgia', 'Times New Roman', serif;
    font-weight: 700;
    letter-spacing: 0.05em;
}

/* === 🇨🇳 中国語フォント設定 === */
:lang(zh-CN), :lang(cn) {
    font-family: "Source Sans 3", 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', sans-serif;
    font-size: 0.85rem;
    line-height: 1.9;
    letter-spacing: 0.08em;
}

:lang(zh-CN) h1, :lang(zh-CN) h2, :lang(zh-CN) h3,
:lang(cn) h1, :lang(cn) h2, :lang(cn) h3 {
    font-family: "Source Sans 3", 'PingFang SC', 'Hiragino Sans GB', 'STHeiti', serif;
    font-weight: 600;
    letter-spacing: 0.12em;
}

/* === 🇰🇷 韓国語フォント設定 === */
:lang(ko), :lang(kr) {
    font-family: "Source Sans 3", 'Apple SD Gothic Neo', 'Malgun Gothic', 'Nanum Gothic', 'Dotum', sans-serif;
    font-size: 0.9rem;
    line-height: 1.8;
    letter-spacing: 0.06em;
}

:lang(ko) h1, :lang(ko) h2, :lang(ko) h3,
:lang(kr) h1, :lang(kr) h2, :lang(kr) h3 {
    font-family: "Source Sans 3", 'Apple SD Gothic Neo', 'Nanum Myeongjo', 'Batang', serif;
    font-weight: 600;
    letter-spacing: 0.1em;
}

/* === 🎨 言語別カラーアクセント === */
.lang-ja .hero-title {
    color: #2c5aa0; /* 日本の藍色 */
}

.lang-en .hero-title {
    color: #1e3a8a; /* 英国ネイビー */
}

.lang-cn .hero-title {
    color: #dc2626; /* 中国の赤 */
}

.lang-kr .hero-title {
    color: #059669; /* 韓国の緑 */
}


/* === 🌐 言語切り替えボタン === */
.language-switcher {
    position: relative;
    display: inline-block;
    margin-left: 0.1rem;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    flex-shrink: 0;
}

.language-switcher-button {
    background: rgba(44, 90, 160, 0.1);
    border: 2px solid var(--primary-blue, #2c5aa0);
    border-radius: 6px;
    padding: 0.15rem 0.3rem;
    color: var(--primary-blue, #2c5aa0);
    font-weight: 600;
    font-size: 0.65rem;
    line-height: 1.2;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    text-decoration: none;
    height: auto;
    min-height: 22px;
    box-sizing: border-box;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    white-space: nowrap;
    margin-right: 0.5rem;
}

.language-switcher-button:hover {
    background: var(--primary-blue, #2c5aa0);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(44, 90, 160, 0.3);
}

.language-switcher-button::after {
    content: '▼';
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.language-switcher.is-open .language-switcher-button::after {
    transform: rotate(180deg);
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 2px solid var(--primary-blue, #2c5aa0);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    min-width: 90px;
    margin-top: 0.25rem;
    max-width: 140px;
    font-size: 0.65rem;
}

.language-switcher.is-open .language-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    display: flex;
    padding: 0.3rem 0.5rem;
    color: var(--text-dark, #333);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.65rem;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
    align-items: center;
    gap: 0.3rem;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    white-space: nowrap;
}

.language-option:last-child {
    border-bottom: none;
}

.language-option:hover {
    background: rgba(44, 90, 160, 0.1);
    color: var(--primary-blue, #2c5aa0);
}

.language-option.current {
    background: var(--primary-blue, #2c5aa0);
    color: white;
    font-weight: 600;
}

.language-flag {
    font-size: 0.9rem;
    width: 14px;
    text-align: center;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
}

.language-switcher-button .language-name {
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    white-space: nowrap;
    display: none; /* ボタン内のみ非表示 */
}

.language-option .language-name {
    display: inline; /* ドロップダウン内は表示 */
}

/* === 📱 言語別レスポンシブ調整 === */
@media (min-width: 361px) {
    .language-switcher {
        margin-left: 0.25rem;
    }

    .language-switcher-button {
        padding: 0.2rem 0.4rem;
        font-size: 0.7rem;
        min-height: 24px;
        gap: 0.2rem;
    }

    .language-flag {
        font-size: 1rem;
        width: 16px;
    }

    .language-dropdown {
        min-width: 100px;
        right: 0;
        left: auto;
        margin-top: 0.25rem;
    }

    .language-option {
        padding: 0.4rem 0.6rem;
        font-size: 0.7rem;
        gap: 0.3rem;
    }

    .language-option .language-flag {
        font-size: 0.9rem;
        width: 14px;
    }
}

@media (min-width: 481px) {
    .language-switcher {
        margin-left: 0.5rem;
    }

    .language-switcher-button {
        padding: 10px 12px;
        font-size: 0.8rem;
        min-height: 44px;
        line-height: 1.2;
        min-width: auto;
        margin-right: 8px;
        gap: 0.5rem;
    }

    .language-switcher-button .language-name {
        display: inline;
    }

    .language-dropdown {
        min-width: 120px;
        right: 0;
        left: auto;
    }

    .language-option {
        padding: 0.5rem 0.8rem;
        font-size: 0.75rem;
    }
}

@media (min-width: 769px) {
    :lang(ja) {
        font-size: 1rem;
        line-height: 1.7;
    }

    :lang(en) {
        font-size: 1rem;
        line-height: 1.6;
    }

    :lang(zh-CN),
    :lang(cn) {
        font-size: 1rem;
        line-height: 1.8;
    }

    :lang(ko),
    :lang(kr) {
        font-size: 1rem;
        line-height: 1.7;
    }

    .language-switcher {
        margin-left: 1rem;
    }

    .language-switcher-button {
        padding: 12px 16px;
        font-size: 0.85rem;
        min-height: 48px;
        margin-right: 16px;
        gap: 8px;
    }

    .language-switcher-button .language-name {
        display: inline-block;
    }

    .language-dropdown {
        min-width: 160px;
        margin-top: 8px;
        max-width: 180px;
        right: -16px;
        font-size: 0.85rem;
    }

    .language-option {
        padding: 0.7rem 1rem;
        font-size: 0.85rem;
        gap: 0.5rem;
    }

    .language-flag {
        font-size: 1.1rem;
        width: 20px;
    }
}

/* === 🎯 言語別テキスト配置調整 === */
.lang-ja .text-center {
    text-align: center;
}

.lang-en .text-center {
    text-align: center;
}

.lang-cn .text-center {
    text-align: center;
}

.lang-kr .text-center {
    text-align: center;
}

/* === 🔤 言語別文字サイズ調整 === */
.lang-ja .hero-subtitle {
    font-size: 1.1rem;
}

/* removed: Japanese tagline adjustments */
.lang-ja .logo-container {
    max-width: 280px;
    flex: 0 0 auto;
}

.lang-ja .logo {
    flex: 1 1 auto;
    min-width: 0;
}

.lang-en .hero-subtitle {
    font-size: 1.15rem;
}

.lang-cn .hero-subtitle {
    font-size: 1.05rem;
}

.lang-kr .hero-subtitle {
    font-size: 1.1rem;
}

/* === 🎨 言語別ボタンスタイル === */
.lang-ja .cta-button {
    padding: 0.8rem 2rem;
    font-weight: 600;
}

.lang-en .cta-button {
    padding: 0.75rem 1.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.lang-cn .cta-button {
    padding: 0.85rem 2.2rem;
    font-weight: 600;
}

.lang-kr .cta-button {
    padding: 0.8rem 2rem;
    font-weight: 600;
}

/* === 🌐 RTL言語サポート（将来拡張用） === */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] .language-switcher {
    margin-right: auto;
    margin-left: 0;
}

/* === 🎵 アニメーション調整 === */
.lang-transition {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === 📊 言語別メトリクス最適化 === */
.lang-ja .card-title {
    line-height: 1.4;
}

.lang-en .card-title {
    line-height: 1.3;
}

.lang-cn .card-title {
    line-height: 1.5;
}

.lang-kr .card-title {
    line-height: 1.4;
}
