/* ===================================================================
 * careers.css — the /careers/ pages
 *
 * Layered on top of the site's base/vendor/fonts/main stylesheets, so type
 * and colour come from there. Nothing here loads a remote asset: no Google
 * Fonts, no CDN. That is the point of this project.
 *
 * ONE THING TO KNOW BEFORE EDITING
 * --------------------------------
 * base.css sets `body { line-height: 1 }`. Latin copy tolerates that; CJK
 * glyphs fill the full em box and get clipped top and bottom. So these
 * pages restore a readable leading at the root and let it inherit, and only
 * tighten it where a display line genuinely wants it. If you add an element
 * here and its Chinese text looks cropped, this is why.
 *
 * The site's `h1, .h01` rule also carries `letter-spacing: -.1rem`, tuned
 * for Montserrat capitals; it crushes Chinese characters. Headings that can
 * hold Chinese reset it to normal.
 * ------------------------------------------------------------------- */

.careers-page {
    background: #FFFFFF;
    color: #0D0A0B;
    line-height: 1.6;
}

/* Leading inherits into anything that renders text, including form controls,
   which do not inherit line-height from body on their own. */
.careers-page p,
.careers-page li,
.careers-page label,
.careers-page span,
.careers-page a,
.careers-page select,
.careers-page input,
.careers-page textarea,
.careers-page button {
    line-height: inherit;
}

/* --- site header ----------------------------------------------------- */

.careers-header-bar {
    position: relative;
    background: #2c68a9;
}

.careers-header-bar .header-nav a { color: rgba(255, 255, 255, .85); }

.careers-header-bar .header-nav a:hover,
.careers-header-bar .header-nav a:focus { color: #FFFFFF; }

/* The section you are in, in the site's accent orange. Hover and focus are
   listed too: without them, pointing at 加入安贤 would drop it back to white
   via the rule above and read as the link going dead. */
.careers-header-bar .header-nav li.current a,
.careers-header-bar .header-nav li.current a:hover,
.careers-header-bar .header-nav li.current a:focus { color: #ffa200; }

/* --- shared ---------------------------------------------------------- */

.careers-nav {
    margin-bottom: 2.4rem;
    font-family: "montserrat-regular", sans-serif;
    font-size: 1.4rem;
}

.careers-nav a { color: #2c68a9; text-decoration: none; }
.careers-nav a:hover { text-decoration: underline; }

/* --- job board ------------------------------------------------------- */

.careers-board {
    max-width: 1140px;
    margin: 0 auto;
    padding: 5.6rem 2.4rem 9rem;
}

.board-header { margin-bottom: 4.8rem; }

.board-title {
    font-family: "montserrat-bold", sans-serif;
    font-size: 4rem;
    line-height: 1.35;
    letter-spacing: normal;
    margin: 0 0 2rem;
    color: #2c68a9;
}

/* Intro copy comes from the Greenhouse board, so it arrives as whatever
   markup HR wrote there - style by element, not by class.

   One block spanning the full header width, matching the width the filters
   and listings occupy below. No max-width: capping it pinned the text to
   the left and left the right half of the header empty. */
.board-intro {
    margin-bottom: 2.4rem;
}

.board-intro p {
    font-family: "PingFang SC", "PingFang", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    font-size: 1.55rem;
    line-height: 1.95;
    color: #262626;
    margin: 0 0 1.4rem;
}

.board-intro p:first-child { margin-top: 0; }

/* The closing line ("Join us in shaping the future… For inquiries:") is a
   sign-off, not body copy - italic sets it apart without another device. */
.board-intro p:last-child {
    font-style: italic;
    color: #4a5560;
    margin-bottom: 0;
}
.board-intro strong { font-family: "montserrat-semibold", sans-serif; color: #0D0A0B; }
.board-intro a { color: #2c68a9; }

.board-count {
    font-family: "montserrat-regular", sans-serif;
    font-size: 1.4rem;
    line-height: 1.6;
    color: #6c6c6c;
    margin: 0;
}

.board-count #job-count { color: #2c68a9; font-weight: bold; }

.board-body {
    display: flex;
    align-items: flex-start;
    gap: 5.6rem;
}

/* left rail */

.board-filters { flex: 0 0 22rem; }

.filters-sticky { position: sticky; top: 3.2rem; }

.filter-group { margin-bottom: 2.8rem; }

.filter-heading {
    display: block;
    font-family: "montserrat-semibold", sans-serif;
    font-size: 1.3rem;
    line-height: 1.6;
    color: #2c68a9;
    margin: 0 0 1rem;
    padding-bottom: .8rem;
    border-bottom: 1px solid #e6e6e6;
}

/* A dropdown whose panel holds checkboxes: reads as a dropdown, takes
   several values. */
.filter-dropdown { position: relative; }

.filter-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 1rem 1.2rem;
    font-family: "PingFang SC", "PingFang", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    font-size: 1.4rem;
    line-height: 1.6;
    text-align: left;
    text-transform: none;
    letter-spacing: normal;
    margin: 0;
    color: #6c6c6c;
    background: #FFFFFF;
    background-image: none;
    border: 1px solid #d8dee6;
    border-radius: 6px;
    cursor: pointer;
}

.filter-toggle:hover { border-color: #2c68a9; }

.filter-dropdown.has-selection .filter-toggle {
    color: #0D0A0B;
    border-color: #2c68a9;
}

.filter-toggle__text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.filter-toggle__caret {
    flex: 0 0 auto;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #8a9099;
}

.filter-toggle[aria-expanded="true"] .filter-toggle__caret {
    border-top: 0;
    border-bottom: 5px solid #2c68a9;
}

.filter-panel {
    position: absolute;
    z-index: 40;
    left: 0;
    right: 0;
    margin-top: .4rem;
    padding: .8rem;
    max-height: 32rem;
    overflow-y: auto;
    background: #FFFFFF;
    border: 1px solid #d8dee6;
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(13, 10, 11, .1);
}

.filter-panel[hidden] { display: none; }

.filter-option {
    display: flex;
    align-items: flex-start;
    gap: .9rem;
    font-family: "PingFang SC", "PingFang", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    font-size: 1.35rem;
    line-height: 1.6;
    color: #0D0A0B;
    padding: .5rem .4rem;
    margin: 0;
    border-radius: 4px;
    cursor: pointer;
}

.filter-option:hover { background: #f4f8fc; }
.filter-option input { margin: .3rem 0 0; flex: 0 0 auto; cursor: pointer; }

.filter-reset {
    font-family: "montserrat-regular", sans-serif;
    font-size: 1.3rem;
    line-height: 1.6;
    color: #2c68a9;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
}

/* listings */

.board-listings { flex: 1 1 auto; min-width: 0; }

.dept-group { margin-bottom: 4.4rem; }
.dept-group[hidden] { display: none; }

.dept-heading {
    font-family: "montserrat-semibold", sans-serif;
    font-size: 1.8rem;
    line-height: 1.5;
    letter-spacing: normal;
    color: #2c68a9;
    margin: 0 0 1.2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #2c68a9;
}

.job-rows { list-style: none; margin: 0; padding: 0; }

.job-row { border-bottom: 1px solid #e6e6e6; }
.job-row[hidden] { display: none; }

.job-row__link {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 2.4rem;
    padding: 1.6rem .4rem;
    text-decoration: none;
    transition: background-color .12s ease;
}

.job-row__link:hover { background: #f4f8fc; }
.job-row__link:hover .job-row__title { color: #2c68a9; }

.job-row__title {
    font-family: "PingFang SC", "PingFang", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    font-size: 1.6rem;
    line-height: 1.6;
    color: #0D0A0B;
}

.job-row__meta {
    font-family: "montserrat-regular", sans-serif;
    font-size: 1.3rem;
    line-height: 1.6;
    color: #2c68a9;
    white-space: nowrap;
    flex: 0 0 auto;
}

.board-empty {
    font-family: "PingFang SC", "PingFang", Arial, sans-serif;
    font-size: 1.5rem;
    line-height: 1.8;
    color: #6c6c6c;
    padding: 4rem 0;
}

/* --- job detail (shaped after the Greenhouse job page) --------------- */

.careers-main,
.job-post {
    max-width: 900px;
    margin: 0 auto;
    padding: 5.6rem 2rem 8rem;
}

.job-post-container { max-width: 72rem; }

.job__header { margin-bottom: 3.2rem; }

.job__title {
    font-family: "montserrat-bold", sans-serif;
    font-size: 3.4rem;
    line-height: 1.35;
    letter-spacing: normal;
    color: #2c68a9;
    margin: 0 0 1.6rem;
}

/* Greenhouse renders location and team as pill badges rather than a line of
   metadata; it makes them scannable and separates them from the prose. */
.job__tags {
    display: flex;
    flex-wrap: wrap;
    gap: .8rem;
    margin: 0;
}

.pill {
    display: inline-block;
    font-family: "montserrat-regular", sans-serif;
    font-size: 1.25rem;
    line-height: 1.6;
    padding: .5rem 1.4rem;
    border-radius: 100px;
    background: #e8f0fa;
    color: #2c68a9;
    border: 1px solid #cfe0f2;
}

.pill--muted { background: #f4f5f7; color: #6c6c6c; border-color: #e3e5e9; }

.divider {
    border: 0;
    border-top: 1px solid #e6e6e6;
    margin: 4.8rem 0;
}

.application__header { margin-bottom: 2.8rem; }

.application__title {
    font-family: "montserrat-semibold", sans-serif;
    font-size: 2.2rem;
    line-height: 1.5;
    letter-spacing: normal;
    color: #2c68a9;
    margin: 0 0 .6rem;
}

.application__required {
    font-family: "PingFang SC", "PingFang", Arial, sans-serif;
    font-size: 1.3rem;
    line-height: 1.7;
    color: #6c6c6c;
    margin: 0;
}

.application__asterisk { color: #e6850e; }

.careers-header { margin-bottom: 3.2rem; }

.careers-header .h01 {
    margin: 0 0 .8rem;
    line-height: 1.35;
    letter-spacing: normal;
}

.careers-meta {
    font-family: "montserrat-regular", sans-serif;
    font-size: 1.5rem;
    line-height: 1.6;
    color: #2c68a9;
    margin: 0;
}

.careers-jd {
    font-family: "PingFang SC", "PingFang", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    line-height: 1.9;
    color: #262626;
    margin-bottom: 0;
}

.careers-jd p,
.careers-jd ul,
.careers-jd ol { margin-bottom: 1.6rem; line-height: 1.9; }

.careers-jd ul,
.careers-jd ol { padding-left: 2.4rem; }

.careers-jd li { margin-bottom: .6rem; line-height: 1.9; }

.careers-jd h2,
.careers-jd h3 {
    font-family: "montserrat-semibold", sans-serif;
    line-height: 1.5;
    letter-spacing: normal;
}

.careers-jd strong { font-family: "montserrat-semibold", sans-serif; }

/* --- application form ------------------------------------------------
 *
 * Tighter than the site's default rhythm: a 10-field form read as a wall
 * at 2.4rem gaps. Controls get a small radius and the mode switches are
 * pills, following the Greenhouse form's own vocabulary.
 * ------------------------------------------------------------------- */

.careers-apply { margin-top: 0; }

.apply-form { max-width: 58rem; }

.apply-form .field { margin-bottom: 1.8rem; }

.apply-form .field-label {
    display: block;
    font-family: "montserrat-semibold", sans-serif;
    font-size: 1.35rem;
    line-height: 1.6;
    margin-bottom: .6rem;
    color: #262626;
}

.apply-form label {
    display: block;
    font-family: "montserrat-semibold", sans-serif;
    font-size: 1.35rem;
    line-height: 1.6;
    margin-bottom: .6rem;
    color: #262626;
}

.apply-form .req { color: #e6850e; margin-left: .3rem; }

.apply-form .hint {
    font-family: "PingFang SC", "PingFang", Arial, sans-serif;
    font-size: 1.2rem;
    line-height: 1.7;
    color: #8a9099;
    margin: .4rem 0 0;
}

.apply-form .filetypes { margin-top: .6rem; }

/* Controls: rounded, quiet by default, blue on focus. */
.apply-form input[type="text"],
.apply-form textarea,
.apply-form select {
    width: 100%;
    max-width: 100%;
    font-family: "PingFang SC", "PingFang", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    font-size: 1.4rem;
    line-height: 1.6;
    color: #262626;
    background: #FFFFFF;
    border: 1px solid #d8dee6;
    border-radius: 6px;
    padding: 1rem 1.2rem;
    margin-bottom: 0;
    transition: border-color .12s ease, box-shadow .12s ease;
}

.apply-form input[type="text"] { height: 4.4rem; }
.apply-form select { height: 4.4rem; }
.apply-form textarea { min-height: 12rem; resize: vertical; }

.apply-form input[type="text"]:hover,
.apply-form textarea:hover,
.apply-form select:hover { border-color: #b9c4d1; }

.apply-form input[type="text"]:focus,
.apply-form textarea:focus,
.apply-form select:focus {
    border-color: #2c68a9;
    box-shadow: 0 0 0 3px rgba(44, 104, 169, .12);
    outline: none;
}

/* --- buttons ---------------------------------------------------------
 *
 * main.css styles every <button> with height: 5.4rem, padding: 0 3rem,
 * letter-spacing: .3rem and text-transform: uppercase. A class cannot
 * override a property it does not set, so our buttons must neutralise each
 * of those explicitly - otherwise a "flat pill" still renders 54px tall and
 * 300px wide.
 * ------------------------------------------------------------------- */

.careers-page .btn-pill,
.careers-page .btn-submit,
.careers-page .filter-toggle,
.careers-page .filter-reset {
    height: auto;
    min-height: 0;
    text-transform: none;
    letter-spacing: normal;
    margin: 0;
    background-image: none;
}

/* Attach / Enter manually switches, as pills. */
.button-container {
    display: flex;
    flex-wrap: wrap;
    gap: .8rem;
    margin-bottom: 1rem;
}

.btn-pill {
    font-family: "montserrat-regular", sans-serif;
    font-size: 1.25rem;
    /* Flat: a tall pill reads as a primary action, and these are just mode
       switches. 12.5px text + 2x5px padding + borders ~= 26px. */
    line-height: 1.5;
    padding: .5rem 1.6rem;
    border-radius: 100px;
    border: 1px solid #cfd9e4;
    background: #FFFFFF;
    color: #4a5560;
    cursor: pointer;
    transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}

.btn-pill:hover { border-color: #2c68a9; color: #2c68a9; }

.btn-pill.is-active {
    background: #e8f0fa;
    border-color: #2c68a9;
    color: #2c68a9;
    font-family: "montserrat-semibold", sans-serif;
}

.input-mode[hidden] { display: none; }

/* Hidden from sight, still reachable by keyboard and screen readers. The
   Attach pill clicks it, so there is no second "Choose file" control. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* With the input hidden there is no other sign the attachment landed. */
.file-chosen {
    font-family: "PingFang SC", "PingFang", Arial, sans-serif;
    font-size: 1.3rem;
    line-height: 1.7;
    color: #2c68a9;
    margin: .8rem 0 0;
    word-break: break-all;
}

.file-chosen[hidden] { display: none; }

/* Keyboard focus has to show on the pill, since the input it triggers is
   invisible. */
.apply-form input[type="file"].visually-hidden:focus + .file-chosen,
.apply-form input[type="file"].visually-hidden:focus-visible + .file-chosen {
    outline: none;
}

.apply-form input[type="file"]:not(.visually-hidden) {
    width: 100%;
    font-family: "montserrat-regular", sans-serif;
    font-size: 1.3rem;
    line-height: 1.6;
    padding: 1.2rem;
    border: 1px dashed #cfd9e4;
    border-radius: 6px;
    background: #fbfcfd;
    cursor: pointer;
}

.apply-form input[type="file"]:not(.visually-hidden):hover {
    border-color: #2c68a9;
    background: #f4f8fc;
}

/* Focus ring belongs on the pill: it is the visible control. */
.btn-pill:focus-visible {
    outline: 2px solid #2c68a9;
    outline-offset: 2px;
}

.apply-form .checks {
    display: flex;
    flex-direction: column;
    gap: .4rem;
}

.apply-form .checks label {
    font-family: "PingFang SC", "PingFang", Arial, sans-serif;
    font-weight: normal;
    font-size: 1.35rem;
    line-height: 1.8;
    margin-bottom: 0;
}

.apply-form .checks input[type="checkbox"] { margin-right: .8rem; }

/* Consent must be legible and deliberate — it is a PIPL requirement, not
   fine print, so it keeps generous leading even in a compact form. */
.consent-field {
    margin-top: 2.8rem;
    padding: 1.6rem 1.8rem;
    background: #f8fafc;
    border: 1px solid #e5ebf2;
    border-radius: 8px;
}

.apply-form label.consent {
    display: flex;
    align-items: flex-start;
    gap: 1.2rem;
    font-family: "PingFang SC", "PingFang", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    font-weight: normal;
    font-size: 1.3rem;
    line-height: 1.85;
    color: #4a5560;
    margin-bottom: 0;
}

.apply-form label.consent input[type="checkbox"] {
    margin-top: .5rem;
    flex: 0 0 auto;
}

.apply-form label.consent a { color: #2c68a9; }

.captcha-field { margin-top: 2rem; }

.apply-form .error {
    font-family: "PingFang SC", "PingFang", Arial, sans-serif;
    font-size: 1.25rem;
    line-height: 1.7;
    color: #a83e2c;
    margin: .5rem 0 0;
}

.apply-form .error:empty { display: none; }

/* Submit, as a pill to match the mode switches. */
.form-actions {
    display: flex;
    align-items: center;
    gap: 1.6rem;
    flex-wrap: wrap;
    margin-top: 2.8rem;
}

.btn-submit {
    font-family: "montserrat-semibold", sans-serif;
    font-size: 1.4rem;
    line-height: 1.6;
    padding: 1.2rem 4rem;
    white-space: nowrap;
    border-radius: 100px;
    border: 1px solid #2c68a9;
    background: #2c68a9;
    color: #FFFFFF;
    cursor: pointer;
    transition: background-color .12s ease, border-color .12s ease;
}

.btn-submit:hover { background: #245a94; border-color: #245a94; }

.btn-submit[disabled] { opacity: .5; cursor: not-allowed; }

.apply-form .form-status {
    font-family: "PingFang SC", "PingFang", Arial, sans-serif;
    font-size: 1.3rem;
    line-height: 1.7;
    color: #6c6c6c;
    margin: 0;
}

.apply-form .fallback { margin-top: 2rem; }
.apply-form .fallback a { color: #2c68a9; }

.apply-form .submitted {
    padding: 3.2rem;
    border: 1px solid #cfe0f2;
    border-radius: 8px;
    background: #f4f8fc;
}

.apply-form .submitted h3 {
    font-family: "montserrat-bold", sans-serif;
    font-size: 2rem;
    line-height: 1.5;
    letter-spacing: normal;
    color: #2c68a9;
    margin: 0 0 .8rem;
}

.apply-form .submitted p {
    font-family: "PingFang SC", "PingFang", Arial, sans-serif;
    font-size: 1.4rem;
    line-height: 1.8;
    color: #4a5560;
    margin: 0;
}

/* The honeypot: in the DOM for bots, unreachable for humans and for screen
   readers. Never display:none — some bots skip those. */
.hp-field {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* --- privacy notice -------------------------------------------------- */

.careers-legal h1,
.careers-legal .h01 { line-height: 1.4; letter-spacing: normal; }

.careers-legal h2,
.careers-legal .h02 {
    font-size: 1.9rem;
    line-height: 1.6;
    letter-spacing: normal;
    margin-top: 4rem;
}

.careers-legal p,
.careers-legal li {
    font-family: "PingFang SC", "PingFang", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    font-size: 1.5rem;
    line-height: 1.95;
}

.careers-legal ul,
.careers-legal ol { padding-left: 2.4rem; margin-bottom: 1.6rem; }
.careers-legal li { margin-bottom: .8rem; }
.careers-legal a { color: #2c68a9; }

/* --- focus ----------------------------------------------------------- */

.job-row__link:focus-visible,
.filter-reset:focus-visible,
.filter-toggle:focus-visible,
.apply-form input:focus-visible,
.apply-form textarea:focus-visible,
.apply-form select:focus-visible,
.apply-form button:focus-visible {
    outline: 2px solid #2c68a9;
    outline-offset: 2px;
}

/* --- responsive ------------------------------------------------------ */

@media only screen and (max-width: 900px) {
    .board-body { flex-direction: column; gap: 3.2rem; }
    .board-filters { flex: 1 1 auto; width: 100%; }
    .filters-sticky { position: static; display: flex; gap: 2rem; flex-wrap: wrap; }
    .filter-group { flex: 1 1 22rem; margin-bottom: 1.6rem; }
    .board-title { font-size: 3.2rem; }
    .careers-board { padding: 4rem 1.6rem 6rem; }
}

@media only screen and (max-width: 600px) {
    .job-row__link { flex-direction: column; gap: .4rem; align-items: flex-start; }
    .job-row__meta { white-space: normal; }
    .careers-main { padding: 4rem 1.6rem 6rem; }
}


/* --- fallback page ---------------------------------------------------- */

.fallback-actions { margin: 0 0 3.2rem; }

.fallback-actions .btn-submit {
    display: inline-block;
    text-decoration: none;
    height: auto;
    text-transform: none;
    letter-spacing: normal;
    margin: 0;
}

.fallback-note { color: #6c6c6c; }
.fallback-note a { color: #2c68a9; }

/* --- site footer ------------------------------------------------------
 * The homepage footer, included as _site_footer.html.j2. main.css already
 * styles every .footer-banner element, so the only thing to settle here is
 * leading.
 *
 * The .careers-page rules at the top of this file push line-height to 1.6 so
 * Chinese is not clipped. Applied to the footer that inflates the two-line
 * BUSINESS/CONTACT/OFFICE blocks and knocks the row out of alignment with
 * the 136px QR code, because on the homepage they sit at body's 1. 1.3 is
 * the middle: as tight as the homepage reads, still tall enough for
 * 北京｜上海｜香港｜纽约 and 微信公众号 to keep their full glyph height.
 * ------------------------------------------------------------------- */

.careers-page .footer-banner { line-height: 1.3; }
