/* HR job list & detail — Iraeta-inspired, extends hr-page tokens */

.hr-jobs-page {
    --hr-max: min(1680px, 100%);
    --hr-gutter: clamp(20px, 4vw, 80px);
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: clip;
    color: var(--rm-color-neutral-800);
    background: #fff;
}

.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;
}

/* Override legacy Bootstrap link blue inside HR pages */
.hr-home a:not(.hr-btn):not(.hr-subnav a):hover,
.hr-home a:not(.hr-btn):not(.hr-subnav a):focus,
.hr-jobs-page a:not(.hr-btn):not(.hr-subnav a):not(.hr-jobs-table__title):not(.hr-jobs-table__link):hover,
.hr-jobs-page a:not(.hr-btn):not(.hr-subnav a):not(.hr-jobs-table__title):not(.hr-jobs-table__link):focus {
    color: var(--rm-color-brand);
}

.hr-btn--brand {
    color: #fff;
    background: linear-gradient(135deg, var(--rm-color-brand), var(--rm-color-brand-light));
    box-shadow: 0 8px 24px rgba(0, 133, 111, 0.25);
}

.hr-btn--brand:hover,
.hr-btn--brand:focus,
.hr-btn--brand:visited {
    color: #fff;
    background: linear-gradient(135deg, var(--rm-color-brand-light), var(--rm-color-brand));
}

.hr-btn--brand:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 133, 111, 0.32);
}

/* ── Hero ─────────────────────────────────────────────────────────── */

.hr-jobs-hero {
    position: relative;
    padding: clamp(48px, 6vw, 72px) 0;
    overflow: hidden;
}

.hr-jobs-hero--compact {
    padding: clamp(40px, 5vw, 56px) 0;
}

.hr-jobs-hero__bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 80% at 10% 50%, rgba(0, 168, 138, 0.22), transparent 60%),
        linear-gradient(135deg, var(--rm-color-brand-800) 0%, var(--rm-color-brand-800) 45%, var(--rm-color-brand-dark) 100%);
}

.hr-jobs-hero__inner {
    position: relative;
    z-index: 1;
}

/* 面包屑 — 与 demo.reemoon.com/hr/campus 一致 */
.hr-jobs-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 20px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.55);
}

.hr-jobs-breadcrumb a {
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s ease;
}

.hr-jobs-breadcrumb a:hover {
    color: var(--rm-color-brand-bright);
}

.hr-jobs-breadcrumb span[aria-hidden] {
    color: rgba(255, 255, 255, 0.55);
    user-select: none;
}

.hr-jobs-breadcrumb > span:last-child {
    color: rgba(255, 255, 255, 0.55);
}

.hr-jobs-hero__title {
    margin: 0 0 12px;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: #fff;
}

.hr-jobs-hero__lead {
    margin: 0;
    max-width: 640px;
    font-size: clamp(1rem, 1.2vw, 1.125rem);
    line-height: 1.75;
    color: rgba(255, 255, 255, 0.78);
}

.hr-job-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.hr-job-meta li {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
}

.hr-job-meta__label {
    margin-right: 8px;
    color: var(--rm-color-brand-bright);
    font-weight: 600;
}

/* ── List section ─────────────────────────────────────────────────── */

.hr-jobs-list {
    padding: clamp(48px, 6vw, 80px) 0;
}

.hr-jobs-section-title {
    margin: 0 0 clamp(28px, 3vw, 36px);
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 700;
    color: var(--rm-color-neutral-800);
}

.hr-jobs-filter {
    display: grid;
    gap: 16px;
    margin-bottom: clamp(32px, 4vw, 48px);
    padding: clamp(20px, 2.5vw, 28px);
    background: var(--rm-color-brand-muted);
    border-radius: 16px;
    border: 1px solid rgba(0, 133, 111, 0.1);
    position: relative;
    z-index: 2;
}

/* Legacy footer script runs niceSelect() on all selects — keep native controls here */
.hr-jobs-page .hr-jobs-filter select {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    padding: 12px 14px !important;
    appearance: auto;
    -webkit-appearance: menulist;
}

.hr-jobs-page .hr-jobs-filter .nice-select {
    display: none !important;
}

@media (min-width: 768px) {
    .hr-jobs-filter {
        grid-template-columns: 1fr 1fr 1.2fr auto;
        align-items: end;
    }
}

.hr-jobs-filter__field label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--rm-color-text-muted);
}

.hr-jobs-filter__field select,
.hr-jobs-filter__field input {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    color: var(--rm-color-neutral-800);
    background: #fff;
    border: 1px solid rgba(0, 133, 111, 0.18);
    border-radius: 10px;
    box-sizing: border-box;
}

.hr-jobs-filter__field select:focus,
.hr-jobs-filter__field input:focus {
    outline: none;
    border-color: var(--rm-color-brand);
    box-shadow: 0 0 0 3px rgba(0, 133, 111, 0.12);
}

.hr-jobs-empty {
    padding: 48px 24px;
    text-align: center;
    color: var(--rm-color-text-muted);
    background: var(--rm-color-brand-muted);
    border-radius: 16px;
}

.hr-jobs-table-wrap {
    overflow-x: auto;
    border: 1px solid rgba(0, 133, 111, 0.12);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 24px rgba(0, 77, 65, 0.06);
}

.hr-jobs-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}

.hr-jobs-table thead {
    background: var(--rm-color-brand-muted);
}

.hr-jobs-table th {
    padding: 16px 20px;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    color: var(--rm-color-text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(0, 133, 111, 0.12);
}

.hr-jobs-table td {
    padding: 18px 20px;
    font-size: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    vertical-align: middle;
}

.hr-jobs-table tbody tr:last-child td {
    border-bottom: none;
}

.hr-jobs-table tbody tr:hover {
    background: rgba(0, 133, 111, 0.03);
}

.hr-jobs-table__title {
    font-weight: 600;
    color: var(--rm-color-neutral-800);
    text-decoration: none;
}

.hr-jobs-table__title:hover,
.hr-jobs-table__title:focus,
.hr-jobs-table__title:visited {
    color: var(--rm-color-brand);
    text-decoration: none;
}

.hr-jobs-table__action {
    text-align: right;
    white-space: nowrap;
}

.hr-jobs-table__link {
    font-size: 14px;
    font-weight: 600;
    color: var(--rm-color-brand);
    text-decoration: none;
}

.hr-jobs-table__link:hover,
.hr-jobs-table__link:focus,
.hr-jobs-table__link:visited {
    color: var(--rm-color-brand-light);
    text-decoration: none;
}

@media (min-width: 768px) {
    .hr-jobs-table {
        display: table !important;
    }

    .hr-jobs-table thead {
        display: table-header-group !important;
    }

    .hr-jobs-table tbody {
        display: table-row-group !important;
    }

    .hr-jobs-table tr {
        display: table-row !important;
    }

    .hr-jobs-table th,
    .hr-jobs-table td {
        display: table-cell !important;
    }

    .hr-jobs-table td::before {
        content: none !important;
        display: none !important;
    }
}

@media (max-width: 767px) {
    .hr-jobs-table thead {
        display: none;
    }

    .hr-jobs-table,
    .hr-jobs-table tbody,
    .hr-jobs-table tr,
    .hr-jobs-table td {
        display: block;
        min-width: 0;
    }

    .hr-jobs-table tr {
        padding: 16px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    }

    .hr-jobs-table td {
        padding: 6px 0;
        border: none;
    }

    .hr-jobs-table td::before {
        content: attr(data-label) ": ";
        font-weight: 600;
        color: var(--rm-color-text-muted);
        font-size: 12px;
    }

    .hr-jobs-table__action {
        text-align: left;
        padding-top: 12px;
    }

    .hr-jobs-table__action::before {
        display: none;
    }
}

/* ── Job detail ───────────────────────────────────────────────────── */

.hr-job-detail {
    padding: clamp(48px, 6vw, 80px) 0;
    background: linear-gradient(180deg, #fff 0%, var(--rm-color-brand-muted) 100%);
}

.hr-job-detail__grid {
    display: grid;
    gap: clamp(32px, 4vw, 48px);
    align-items: start;
}

@media (min-width: 1024px) {
    .hr-job-detail__grid {
        grid-template-columns: 1fr minmax(320px, 400px);
    }
}

.hr-job-detail__content {
    padding: clamp(28px, 3vw, 36px);
    background: #fff;
    border-radius: 20px;
    border: 1px solid rgba(0, 133, 111, 0.1);
    box-shadow: 0 4px 24px rgba(0, 77, 65, 0.05);
}

.hr-job-body {
    font-size: 15px;
    line-height: 1.8;
    color: var(--rm-color-text-muted);
}

.hr-job-body p {
    margin: 0 0 12px;
}

.hr-job-body p:last-child {
    margin-bottom: 0;
}

.hr-apply-card {
    position: sticky;
    top: 72px;
    padding: clamp(24px, 3vw, 32px);
    background: #fff;
    border-radius: 20px;
    border: 1px solid rgba(0, 133, 111, 0.12);
    box-shadow: 0 12px 40px rgba(0, 77, 65, 0.08);
}

.hr-apply-card__title {
    margin: 0 0 10px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--rm-color-neutral-800);
}

.hr-apply-card__lead {
    margin: 0 0 24px;
    font-size: 14px;
    line-height: 1.65;
    color: var(--rm-color-text-muted);
}

/* ── Apply form ───────────────────────────────────────────────────── */

.hr-apply-form__success {
    margin-bottom: 20px;
    padding: 14px 16px;
    font-size: 14px;
    color: var(--rm-color-brand-800);
    background: rgba(0, 133, 111, 0.12);
    border-radius: 10px;
    border: 1px solid rgba(0, 133, 111, 0.2);
}

.hr-apply-form__errors {
    margin-bottom: 20px;
    padding: 14px 16px;
    font-size: 14px;
    color: #b42318;
    background: #fef3f2;
    border-radius: 10px;
    border: 1px solid #fecdca;
}

.hr-apply-form__errors ul {
    margin: 0;
    padding-left: 18px;
}

.hr-apply-form__grid {
    display: grid;
    gap: 16px;
}

.hr-apply-form__field label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--rm-color-neutral-800);
}

.hr-apply-form__field label span {
    color: #c0392b;
}

.hr-apply-form__field input,
.hr-apply-form__field textarea {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
    font-family: inherit;
    color: var(--rm-color-neutral-800);
    background: var(--rm-color-brand-muted);
    border: 1px solid rgba(0, 133, 111, 0.15);
    border-radius: 10px;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.hr-apply-form__field input[type="file"] {
    padding: 10px;
    background: #fff;
}

.hr-apply-form__field input:focus,
.hr-apply-form__field textarea:focus {
    outline: none;
    border-color: var(--rm-color-brand);
    box-shadow: 0 0 0 3px rgba(0, 133, 111, 0.12);
    background: #fff;
}

.hr-apply-form__field--full {
    grid-column: 1 / -1;
}

.hr-apply-form__hint {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--rm-color-text-muted);
}

.hr-apply-form__submit {
    width: 100%;
    margin-top: 8px;
    padding: 16px;
    font-size: 15px;
    border: none;
    cursor: pointer;
}

/* ── Contact band ───────────────────────────────────────────────────── */

.hr-jobs-contact {
    padding: clamp(48px, 6vw, 64px) 0;
    background: linear-gradient(135deg, var(--rm-color-brand-800) 0%, var(--rm-color-brand) 100%);
}

.hr-jobs-contact__inner {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

@media (min-width: 768px) {
    .hr-jobs-contact__inner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.hr-jobs-contact__title {
    margin: 0 0 8px;
    font-size: clamp(1.375rem, 2.5vw, 1.75rem);
    font-weight: 700;
    color: #fff;
}

.hr-jobs-contact__dept {
    margin: 0;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.72);
}

.hr-jobs-contact__channels {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hr-jobs-contact__item {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--rm-color-brand-bright);
    text-decoration: none;
}

.hr-jobs-contact__item:hover,
.hr-jobs-contact__item:focus,
.hr-jobs-contact__item:visited {
    color: #fff;
    text-decoration: none;
}

@media (prefers-reduced-motion: reduce) {
    .hr-btn--brand:hover {
        transform: none;
    }
}

/* ── Hide base.html <hr> between content and footer ─────────────────── */
main + hr { display: none; }