/* ==========================================================================
   Multilingual support: Simplified Chinese (zh-CN), French (fr), German (de)
   Loaded after the theme CSS by Web.Master, Default.aspx, Account.aspx and
   Unsubscribe.aspx. Rules are scoped to html[lang] values of the new
   languages, so Arabic (ar) and English (en) rendering is unchanged.
   ========================================================================== */

/* Chinese: keep the Latin design font for Latin text, add CJK fonts for Han glyphs */
html[lang="zh-CN"] body,
html[lang="zh-CN"] input,
html[lang="zh-CN"] select,
html[lang="zh-CN"] textarea,
html[lang="zh-CN"] button,
html[lang="zh-CN"] :is(h1, h2, h3, h4, h5, h6, p, a, li, td, th, label, small, strong, b, em, .btn, span:not([class*="fa"]):not([class*="glyphicon"]):not([class*="icon"])) {
    font-family: "Open Sans", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", sans-serif;
}

html[lang="zh-CN"] body {
    line-height: 1.7;
    letter-spacing: 0;
    word-break: normal;
    line-break: strict;
}

/* French / German: long compound words must wrap instead of overflowing menus, cards and buttons */
html[lang="fr"] :is(h1, h2, h3, h4, h5, h6, p, li, td, th, label, .btn, button, a),
html:is([lang="de"], [lang="tr"]) :is(h1, h2, h3, h4, h5, h6, p, li, td, th, label, .btn, button, a) {
    overflow-wrap: break-word;
    -webkit-hyphens: auto;
    hyphens: auto;
}

/* Header navigation: allow the longer labels to wrap neatly instead of pushing the menu off-screen */
html:is([lang="fr"], [lang="de"], [lang="tr"], [lang="zh-CN"]) .TenderHeaderMenu-linkTitle,
html:is([lang="fr"], [lang="de"], [lang="tr"], [lang="zh-CN"]) .TenderHeaderMenu-linkSubtitle,
html:is([lang="fr"], [lang="de"], [lang="tr"], [lang="zh-CN"]) .dropdown-item-title,
html:is([lang="fr"], [lang="de"], [lang="tr"], [lang="zh-CN"]) .dropdown-item-subtitle {
    white-space: normal;
}

/* Language selector: five options in the region panel */
.TenderHeaderMenu-languageOption.zh { color: #b91c1c; }
.TenderHeaderMenu-languageOption.fr { color: #1d4ed8; }
.TenderHeaderMenu-languageOption.de { color: #92400e; }
.TenderHeaderMenu-languageOption.tr { color: #b91c1c; }
.TenderHeaderMenu-languageOption.is-selected.zh,
.TenderHeaderMenu-languageOption.is-selected.fr,
.TenderHeaderMenu-languageOption.is-selected.de { color: #ffffff; }
.TenderHeaderMenu-languageOption.is-selected.tr { color: #ffffff; }
.TenderHeaderMenu-languageOption.zh { font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif; }

/* Desktop compact navigation: French/German/Chinese labels are longer than English.
   Let titles wrap onto two lines and tighten the quick "Add tender" action so the
   absolutely positioned button never overlaps the last menu items. */
@media (min-width: 992px) {
    html:is([lang="fr"], [lang="de"], [lang="tr"], [lang="zh-CN"]) .TenderCompactNav .nav-link {
        white-space: normal;
        padding-left: 4px;
        padding-right: 4px;
    }
    html:is([lang="fr"], [lang="de"], [lang="tr"], [lang="zh-CN"]) .TenderCompactNav .nav-link-title {
        font-size: 13px;
        max-width: 11em;
    }
    html:is([lang="fr"], [lang="de"], [lang="tr"]) .TenderCompactNav .nav-link-kicker {
        letter-spacing: 0.2px;
        max-width: 13em;
    }
    html:is([lang="fr"], [lang="de"], [lang="tr"], [lang="zh-CN"]) .TenderCompactNav .cta {
        padding: 6px 10px;
        gap: 6px;
    }
    html:is([lang="fr"], [lang="de"], [lang="tr"], [lang="zh-CN"]) .TenderCompactNav .cta-text {
        font-size: 13px;
        letter-spacing: 0;
        line-height: 1.15;
        max-width: 7.5em;
        white-space: normal;
        text-align: start;
    }
}