/**
 * 多言語ピル UI
 */

.n2-lang-pills {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    margin: 8px 0 16px;
    padding: 4px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    /* 右端フェードでスクロール可能を示唆（モバイル用） */
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent 100%);
    mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent 100%);
    align-items: center;
}

.n2-lang-pills::-webkit-scrollbar {
    height: 4px;
}

.n2-lang-pills::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 2px;
}

/* 地球儀アイコン（翻訳と分かるための国際マーク） */
.n2-lang-icon {
    flex-shrink: 0;
    font-size: 15px;
    line-height: 1;
    margin-right: 2px;
    opacity: 0.7;
}

.n2-lang-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #f0f0f0;
    color: #333;
    font-size: 13px;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

.n2-lang-pill:hover {
    background: #e0e0e0;
    color: #000;
    text-decoration: none;
}

.n2-lang-pill.is-active {
    background: #0073aa;
    color: #fff;
    font-weight: 600;
}

.n2-lang-pill.is-active:hover {
    background: #005a87;
    color: #fff;
}

.n2-lang-pill .n2-lang-flag {
    font-size: 14px;
    line-height: 1;
}

/* ネパール語 */
.n2-lang-ne {
    font-family: "Noto Sans Devanagari", "Hiragino Sans", sans-serif;
}

/* ミャンマー語 */
.n2-lang-my {
    font-family: "Noto Sans Myanmar", "Hiragino Sans", sans-serif;
}

/* 翻訳中バッジ */
.n2-translation-pending {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 4px;
    background: #fffbcc;
    color: #8a6d3b;
    font-size: 12px;
}

/* 翻訳結果のバッジ（自動翻訳の注記） */
.n2-translation-notice {
    display: block;
    margin: 8px 0;
    padding: 8px 12px;
    border-radius: 4px;
    background: #f7f7f7;
    color: #666;
    font-size: 12px;
    border-left: 3px solid #0073aa;
}

/* スマホ向け調整（より多くの言語が見えるよう少しコンパクトに） */
@media (max-width: 600px) {
    .n2-lang-pills {
        margin: 4px 0 12px;
        gap: 4px;
    }
    .n2-lang-pill {
        padding: 4px 9px;
        font-size: 11px;
    }
    .n2-lang-pill .n2-lang-flag {
        font-size: 12px;
    }
    .n2-lang-icon {
        font-size: 14px;
    }
}

/* ============================================================
 * PC/スマホ 表示切替（テーマで2箇所に出力して使い分け）
 * - PC: byline 内（日時の左に）コンパクトに表示
 * - スマホ: タイトル直下（既存位置）に通常サイズで表示
 * ============================================================ */

/* デフォルト（モバイル想定）: PC用は非表示 */
.n2-lang-pills.n2-pills-desktop {
    display: none;
}

@media (min-width: 768px) {
    /* PC: タイトル直下のスマホ用を非表示にして、byline 内のPC用を表示 */
    .n2-lang-pills.n2-pills-mobile {
        display: none;
    }
    .n2-lang-pills.n2-pills-desktop {
        display: inline-flex;
        gap: 4px;
        margin: 0 8px 0 4px;
        padding: 0;
        vertical-align: middle;
        overflow: visible; /* バイライン内なのでスクロール不要 */
        scrollbar-width: auto;
        /* PC ではフェードマスク不要 */
        -webkit-mask-image: none;
        mask-image: none;
    }
    .n2-lang-pills.n2-pills-desktop .n2-lang-pill {
        padding: 2px 8px;
        font-size: 11px;
        line-height: 1.4;
    }
    .n2-lang-pills.n2-pills-desktop .n2-lang-flag {
        font-size: 11px;
    }
    /* PC では翻訳注記もコンパクトに */
    .n2-translation-notice {
        font-size: 11px;
        padding: 6px 10px;
    }
}
