/*
 * category-pages — global category page styles
 * Loads on every category page (pageType = category, see stylesheet.json rules).
 * Add shared category CSS below.
 */

/*
 * Shared widget title style — Badge Winners (.qa-badges-container) and
 * Most helpful members (.qa-widget-most-liked).
 * Translations of these headings live in the non-page-targeted translations-global
 * stylesheet (stylesheets/translations/global).
 */
#customcss #root .qa-badges-container .widget-title,
#customcss #root .qa-widget-most-liked .widget-title {
    color: #2C2C2C;
    font-size: 18px;
    font-weight: 700;
    line-height: 125%;
}

/*
 * COMM-3312-16 — "Pinned" status label on sticky topics
 * (#customcss #root .topic-view.topic-view--sticky::before)
 * Only the label text is replaced; the platform's own label styling is untouched.
 * Source: ExL Localization Translation Handoff v2. Locales: see ../locales.md
 */

/* de-DE */
html[insided-lang="de_de"] {
    #customcss #root {
        .topic-view.topic-view--sticky::before {
            content: "Angeheftet";
        }
    }
}

/* es-ES */
html[insided-lang="es_es"],
html[insided-lang="es_us"] {
    #customcss #root {
        .topic-view.topic-view--sticky::before {
            content: "Fijado";
        }
    }
}

/* fr-FR */
html[insided-lang="fr_fr"],
html[insided-lang="fr_ca"] {
    #customcss #root {
        .topic-view.topic-view--sticky::before {
            content: "Épinglage";
        }
    }
}

/* it-IT */
html[insided-lang="it_it"] {
    #customcss #root {
        .topic-view.topic-view--sticky::before {
            content: "Fissato";
        }
    }
}

/* ja-JP */
html[insided-lang="ja_jp"],
html[insided-lang="jp_jp"] {
    #customcss #root {
        .topic-view.topic-view--sticky::before {
            content: "ピン留め";
        }
    }
}

/* ko-KR */
html[insided-lang="ko_kr"] {
    #customcss #root {
        .topic-view.topic-view--sticky::before {
            content: "고정됨";
        }
    }
}

/* pt-BR */
html[insided-lang="pt_br"],
html[insided-lang="pt_pt"] {
    #customcss #root {
        .topic-view.topic-view--sticky::before {
            content: "Fixado";
        }
    }
}

/* zh-Hans */
html[insided-lang="zh_cn"] {
    #customcss #root {
        .topic-view.topic-view--sticky::before {
            content: "已置顶";
        }
    }
}

/* zh-Hant */
html[insided-lang="zh_tw"] {
    #customcss #root {
        .topic-view.topic-view--sticky::before {
            content: "已置頂";
        }
    }
}

/*
 * COMM-3312-05 — "Unsolved" status label (category pages)
 * (#customcss #root .topic-view_info .tooltip--thread-type i.icon--question-circle::before)
 * "Solved" label (i.icon--thread-solved): unofficial strings, see note below.
 * "Solved" strings are NOT in the ExL sheet (no row exists). They are unofficial,
 * matched to the wording of the COMM-3312-05 "Unsolved" translations — send to the
 * translators for confirmation.
 * Only the label text is replaced; the platform label styling is untouched.
 * Source: ExL Localization Translation Handoff v2. Locales: see ../locales.md
 */

/* de-DE */
html[insided-lang="de_de"] {
    #customcss #root {
        .topic-view_info .tooltip--thread-type i.icon--question-circle::before {
            content: "Ungelöst";
        }
        .topic-view_info .tooltip--thread-type i.icon--thread-solved::before {
            content: "Gelöst";
        }
    }
}

/* es-ES */
html[insided-lang="es_es"],
html[insided-lang="es_us"] {
    #customcss #root {
        .topic-view_info .tooltip--thread-type i.icon--question-circle::before {
            content: "Sin resolver";
        }
        .topic-view_info .tooltip--thread-type i.icon--thread-solved::before {
            content: "Resuelto";
        }
    }
}

/* fr-FR */
html[insided-lang="fr_fr"],
html[insided-lang="fr_ca"] {
    #customcss #root {
        .topic-view_info .tooltip--thread-type i.icon--question-circle::before {
            content: "Éléments non résolus";
        }
        .topic-view_info .tooltip--thread-type i.icon--thread-solved::before {
            content: "Résolu";
        }
    }
}

/* it-IT */
html[insided-lang="it_it"] {
    #customcss #root {
        .topic-view_info .tooltip--thread-type i.icon--question-circle::before {
            content: "Non risolto";
        }
        .topic-view_info .tooltip--thread-type i.icon--thread-solved::before {
            content: "Risolto";
        }
    }
}

/* ja-JP */
html[insided-lang="ja_jp"],
html[insided-lang="jp_jp"] {
    #customcss #root {
        .topic-view_info .tooltip--thread-type i.icon--question-circle::before {
            content: "未解決";
        }
        .topic-view_info .tooltip--thread-type i.icon--thread-solved::before {
            content: "解決済み";
        }
    }
}

/* ko-KR */
html[insided-lang="ko_kr"] {
    #customcss #root {
        .topic-view_info .tooltip--thread-type i.icon--question-circle::before {
            content: "미해결";
        }
        .topic-view_info .tooltip--thread-type i.icon--thread-solved::before {
            content: "해결됨";
        }
    }
}

/* pt-BR */
html[insided-lang="pt_br"],
html[insided-lang="pt_pt"] {
    #customcss #root {
        .topic-view_info .tooltip--thread-type i.icon--question-circle::before {
            content: "Não resolvido";
        }
        .topic-view_info .tooltip--thread-type i.icon--thread-solved::before {
            content: "Resolvido";
        }
    }
}

/* zh-Hans */
html[insided-lang="zh_cn"] {
    #customcss #root {
        .topic-view_info .tooltip--thread-type i.icon--question-circle::before {
            content: "未解决";
        }
        .topic-view_info .tooltip--thread-type i.icon--thread-solved::before {
            content: "已解决";
        }
    }
}

/* zh-Hant */
html[insided-lang="zh_tw"] {
    #customcss #root {
        .topic-view_info .tooltip--thread-type i.icon--question-circle::before {
            content: "未解決";
        }
        .topic-view_info .tooltip--thread-type i.icon--thread-solved::before {
            content: "已解決";
        }
    }
}

/*
 * Label width adaptation (Solved / Unsolved)
 * The legacy CSS hard-codes label widths and the space reserved for the title for the
 * English strings (Unsolved 66px, Solved 53px, reserve = label + gap). Translations are
 * wider or narrower, so these per-locale overrides keep the badge and the title in step.
 *
 * Widths are estimates, not browser-measured with the live font: Latin text is measured in
 * Arial and scaled by 0.889 (the ratio that reproduces the English 66px/53px exactly), CJK
 * is 12px per character, then + 18px padding + 2px safety. Verify on the live page.
 * Reserved space = 4 + widest label of the locale (legacy: 70px = 66px + 4px).
 */

/* de-DE — unsolved 66px, solved 54px */
html[insided-lang="de_de"] {
    #customcss #root .qa-topic-block:has(.tooltip--thread-type) > .topic-view_header {
        max-width: calc(100% - 70px);
    }
}

/* es-ES — unsolved 82px, solved 66px */
html[insided-lang="es_es"],
html[insided-lang="es_us"] {
    #customcss #root .qa-topic-block:has(.tooltip--thread-type) > .topic-view_header {
        max-width: calc(100% - 86px);
    }
}

/* fr-FR — unsolved 131px, solved 56px */
html[insided-lang="fr_fr"],
html[insided-lang="fr_ca"] {
    #customcss #root .qa-topic-block:has(.tooltip--thread-type) > .topic-view_header {
        max-width: calc(100% - 135px);
    }
}

/* it-IT — unsolved 77px, solved 57px */
html[insided-lang="it_it"] {
    #customcss #root .qa-topic-block:has(.tooltip--thread-type) > .topic-view_header {
        max-width: calc(100% - 81px);
    }
}

/* ja-JP — unsolved 56px, solved 68px */
html[insided-lang="ja_jp"],
html[insided-lang="jp_jp"] {
    #customcss #root .qa-topic-block:has(.tooltip--thread-type) > .topic-view_header {
        max-width: calc(100% - 72px);
    }
}

/* ko-KR — unsolved 56px, solved 56px */
html[insided-lang="ko_kr"] {
    #customcss #root .qa-topic-block:has(.tooltip--thread-type) > .topic-view_header {
        max-width: calc(100% - 60px);
    }
}

/* pt-BR — unsolved 91px, solved 71px */
html[insided-lang="pt_br"],
html[insided-lang="pt_pt"] {
    #customcss #root .qa-topic-block:has(.tooltip--thread-type) > .topic-view_header {
        max-width: calc(100% - 95px);
    }
}

/* zh-Hans — unsolved 56px, solved 56px */
html[insided-lang="zh_cn"] {
    #customcss #root .qa-topic-block:has(.tooltip--thread-type) > .topic-view_header {
        max-width: calc(100% - 60px);
    }
}

/* zh-Hant — unsolved 56px, solved 56px */
html[insided-lang="zh_tw"] {
    #customcss #root .qa-topic-block:has(.tooltip--thread-type) > .topic-view_header {
        max-width: calc(100% - 60px);
    }
}

/*
 * Pinned label vs status pill offset (category topic list)
 * Live CSS shifts the status pill left of the Pinned label on sticky topics:
 *   #customcss #root .category-topic-list .topic-view.topic-view--sticky .pill { right: 105px !important; }
 * 105px = 32px right offset + 73px Pinned label (35.6px text + 37px padding) for English.
 * The Pinned label is a different width per language, so the offset is recalculated:
 *   right = 32 + ceil(Pinned text width + 37) + 2 safety.
 * Text widths are estimates (Arial x 0.889 for Latin, 12px/char for CJK), not measured with
 * the live font. !important is required to beat the live rule, and the html[insided-lang]
 * prefix makes these more specific. Verify on a pinned topic in each language.
 */

/* de-DE — pill right: 127px */
html[insided-lang="de_de"] {
    #customcss #root .category-topic-list .topic-view.topic-view--sticky .pill {
        right: 127px !important;
    }
}

/* es-ES — pill right: 103px */
html[insided-lang="es_es"],
html[insided-lang="es_us"] {
    #customcss #root .category-topic-list .topic-view.topic-view--sticky .pill {
        right: 103px !important;
    }
}

/* fr-FR — pill right: 122px */
html[insided-lang="fr_fr"],
html[insided-lang="fr_ca"] {
    #customcss #root .category-topic-list .topic-view.topic-view--sticky .pill {
        right: 122px !important;
    }
}

/* it-IT — pill right: 109px */
html[insided-lang="it_it"] {
    #customcss #root .category-topic-list .topic-view.topic-view--sticky .pill {
        right: 109px !important;
    }
}

/* ja-JP — pill right: 119px */
html[insided-lang="ja_jp"],
html[insided-lang="jp_jp"] {
    #customcss #root .category-topic-list .topic-view.topic-view--sticky .pill {
        right: 119px !important;
    }
}

/* ko-KR — pill right: 107px */
html[insided-lang="ko_kr"] {
    #customcss #root .category-topic-list .topic-view.topic-view--sticky .pill {
        right: 107px !important;
    }
}

/* pt-BR — pill right: 106px */
html[insided-lang="pt_br"],
html[insided-lang="pt_pt"] {
    #customcss #root .category-topic-list .topic-view.topic-view--sticky .pill {
        right: 106px !important;
    }
}

/* zh-Hans — pill right: 107px */
html[insided-lang="zh_cn"] {
    #customcss #root .category-topic-list .topic-view.topic-view--sticky .pill {
        right: 107px !important;
    }
}

/* zh-Hant — pill right: 107px */
html[insided-lang="zh_tw"] {
    #customcss #root .category-topic-list .topic-view.topic-view--sticky .pill {
        right: 107px !important;
    }
}
