/* 
 * NONKE SPA 多言語システム CSS
 * 言語切り替えボタンと多言語対応スタイル
 */

/* ==========================================================================
   言語切り替えボタン
   ========================================================================== */

.language-switcher {
    display: inline-block;
    margin: 10px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ドロップダウン形式 */
.language-dropdown select {
    padding: 8px 12px;
    border: 2px solid #0073aa;
    border-radius: 4px;
    background: white;
    color: #0073aa;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230073aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 35px;
}

.language-dropdown select:hover {
    background-color: #f0f8ff;
    border-color: #005a87;
}

.language-dropdown select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.2);
}

/* ボタン形式 */
.language-buttons {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.language-buttons .lang-btn {
    padding: 8px 16px;
    background: white;
    color: #0073aa;
    text-decoration: none;
    border: 2px solid #0073aa;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-block;
}

.language-buttons .lang-btn:hover {
    background: #0073aa;
    color: white;
    text-decoration: none;
}

.language-buttons .lang-btn.active {
    background: #0073aa;
    color: white;
    cursor: default;
}

/* ==========================================================================
   言語別フォント設定
   ========================================================================== */

/* 日本語 */
.lang-ja {
    /* font-family は既存テーマの設定を使用 */
}

.lang-ja .staff-name,
.lang-ja .staff-tagline {
    letter-spacing: 0.05em;
}

/* 英語 */
.lang-en {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.lang-en .staff-name {
    font-weight: 600;
    letter-spacing: 0.025em;
}

.lang-en .staff-tagline {
    font-style: italic;
    font-weight: 400;
}

/* 中国語 */
.lang-zh {
    font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
}

.lang-zh .staff-name,
.lang-zh .staff-tagline {
    letter-spacing: 0.02em;
}

/* ==========================================================================
   言語別セクション表示制御
   ========================================================================== */

/* 言語別表示制御クラス */
/* 英語のみ表示 */
.lang-ja .lang-en-only,
.lang-zh .lang-en-only {
    display: none !important;
}

/* 中国語のみ表示 */
.lang-ja .lang-zh-only,
.lang-en .lang-zh-only {
    display: none !important;
}

/* 日本語のみ表示 */
.lang-en .lang-ja-only,
.lang-zh .lang-ja-only {
    display: none !important;
}

/* 日本語では非表示 */
.lang-ja .lang-hide-ja {
    display: none !important;
}

/* 英語では非表示 */
.lang-en .lang-hide-en {
    display: none !important;
}

/* 中国語では非表示 */
.lang-zh .lang-hide-zh {
    display: none !important;
}

/* 特定言語のみ表示（複数言語対応） */
/* 英語と中国語のみ */
.lang-ja .lang-en-zh-only {
    display: none !important;
}

/* 日本語と英語のみ */
.lang-zh .lang-ja-en-only {
    display: none !important;
}

/* 日本語と中国語のみ */
.lang-en .lang-ja-zh-only {
    display: none !important;
}

/* ==========================================================================
   スタッフカード多言語対応
   ========================================================================== */

.staff-card {
    transition: transform 0.3s ease;
}

.staff-card:hover {
    transform: translateY(-2px);
}

/* 言語別のスタッフ名スタイル */
.lang-ja .staff-name {
    font-size: 1.2em;
}

.lang-en .staff-name {
    font-size: 1.1em;
    text-transform: capitalize;
}

.lang-zh .staff-name {
    font-size: 1.2em;
}

/* キャッチフレーズの言語別調整 */
.staff-tagline {
    margin: 8px 0;
    color: #666;
    line-height: 1.4;
}

.lang-en .staff-tagline {
    font-size: 0.9em;
}

.lang-zh .staff-tagline {
    font-size: 0.95em;
}

/* ==========================================================================
   時間表示の言語別スタイル
   ========================================================================== */

.staff-schedule .schedule-time {
    font-weight: 500;
    color: #0073aa;
}

.lang-ja .schedule-time {
    font-family: "Yu Gothic", "Hiragino Sans", sans-serif;
}

.lang-en .schedule-time {
    font-family: "Roboto Mono", monospace;
    letter-spacing: 0.05em;
}

.lang-zh .schedule-time {
    font-family: "PingFang SC", sans-serif;
}

/* ==========================================================================
   ボタンの多言語対応
   ========================================================================== */

.btn-detail {
    display: inline-block;
    padding: 10px 20px;
    background: #0073aa;
    color: white !important;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-detail:hover {
    background: #005a87;
    transform: translateY(-1px);
    text-decoration: none;
}

/* 言語別のボタンテキストサイズ調整 */
.lang-en .btn-detail {
    font-size: 0.9em;
    letter-spacing: 0.025em;
}

.lang-zh .btn-detail {
    font-size: 0.95em;
}

/* ==========================================================================
   レスポンシブ対応
   ========================================================================== */

@media (max-width: 768px) {
    .language-switcher {
        width: 100%;
        margin: 15px 0;
    }
    
    .language-dropdown select {
        width: 100%;
        padding: 12px 16px;
        font-size: 16px; /* iOS zoom prevention */
    }
    
    .language-buttons {
        justify-content: center;
        width: 100%;
    }
    
    .language-buttons .lang-btn {
        flex: 1;
        text-align: center;
        min-width: 80px;
    }
    
    /* モバイルでのスタッフカード調整 */
    .staff-card {
        margin-bottom: 20px;
    }
    
    .staff-name {
        font-size: 1.1em !important;
    }
    
    .staff-tagline {
        font-size: 0.9em !important;
    }
}

@media (max-width: 480px) {
    .language-buttons .lang-btn {
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .staff-details {
        font-size: 0.85em;
    }
    
    .btn-detail {
        width: 100%;
        padding: 12px;
        font-size: 14px;
    }
}

/* ==========================================================================
   アクセシビリティ対応
   ========================================================================== */

/* フォーカス表示の改善 */
.language-switcher select:focus,
.lang-btn:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* スクリーンリーダー対応 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ハイコントラスト対応 */
@media (prefers-contrast: high) {
    .language-dropdown select,
    .lang-btn {
        border-width: 3px;
    }
    
    .btn-detail {
        border: 2px solid #0073aa;
    }
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    .language-dropdown select {
        background: #1a1a1a;
        color: #4fc3f7;
        border-color: #4fc3f7;
    }
    
    .language-dropdown select:hover {
        background-color: #2a2a2a;
    }
    
    .lang-btn {
        background: #1a1a1a;
        color: #4fc3f7;
        border-color: #4fc3f7;
    }
    
    .lang-btn:hover,
    .lang-btn.active {
        background: #4fc3f7;
        color: #1a1a1a;
    }
    
    .staff-tagline {
        color: #ccc;
    }
    
    .schedule-time {
        color: #4fc3f7 !important;
    }
}

/* ==========================================================================
   印刷スタイル
   ========================================================================== */

@media print {
    .language-switcher {
        display: none;
    }
    
    .staff-card {
        break-inside: avoid;
        margin-bottom: 20px;
        border: 1px solid #ccc;
        padding: 15px;
    }
    
    .btn-detail {
        display: none;
    }
}

/* ==========================================================================
   カスタムアニメーション
   ========================================================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.staff-card {
    animation: fadeInUp 0.6s ease forwards;
}

.staff-card:nth-child(2) { animation-delay: 0.1s; }
.staff-card:nth-child(3) { animation-delay: 0.2s; }
.staff-card:nth-child(4) { animation-delay: 0.3s; }
.staff-card:nth-child(5) { animation-delay: 0.4s; }
.staff-card:nth-child(6) { animation-delay: 0.5s; }

/* 言語切り替え時のトランジション */
.multilang-transition {
    transition: opacity 0.3s ease;
}

.multilang-transition.changing {
    opacity: 0.7;
}

/* ==========================================================================
   管理画面での多言語フィールド表示
   ========================================================================== */

.acf-multilang-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid #0073aa;
    margin: 20px 0;
}

.acf-multilang-section h3 {
    background: rgba(0, 115, 170, 0.1);
    margin: -15px -15px 15px -15px;
    padding: 15px;
    border-bottom: 1px solid rgba(0, 115, 170, 0.2);
}

.translation-helper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.translate-btn {
    font-size: 11px;
    height: 24px;
    line-height: 22px;
    padding: 0 8px;
}

.translation-status {
    color: #46b450;
}

/* ==========================================================================
   エラー・成功メッセージのスタイル
   ========================================================================== */

.multilang-message {
    padding: 12px 16px;
    border-radius: 4px;
    margin: 15px 0;
    font-weight: 500;
}

.multilang-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.multilang-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.multilang-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}