/* ============================================================
   hywin Jobs List — [hywin_jobs_list]
   ============================================================ */

/* ── Wrapper ───────────────────────────────────────────────── */
.aajl-wrapper {
    width: 100%;
}

/* ── Filter bar ────────────────────────────────────────────── */
.aajl-filters {
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.aajl-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.aajl-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 16px;
    background: transparent;
    border: none;
    outline: none;
    font-size: var(--font-size-body-md);
    color: var(--color-outline);
    cursor: pointer;
    transition: color 0.15s;
    line-height: 1.2;
}

.aajl-tag:hover {
    color: var(--color-outline-variant)
}

.aajl-tag.is-active {
    color: var(--color-on-surface);
}

.aajl-filter-buttons .aajl-tag:first-child {
    padding-left: 0;
}

.aajl-tag__count {
    font-weight: 400;
    opacity: 0.6;
}


/* ── Unsolicited application button ────────────────────────── */
.aajl-application-button {
    flex-shrink: 0;
}

.aajl-application-button--desktop {
    margin-left: auto;
}

.aajl-application-button--mobile {
    display: none;
}

.aajl-unsolicited-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    border: none;
    border-radius: 1000px;
    text-decoration: none !important;
    background-color: var(--color-white, #1a1a1a);
    color: var(--color-black, #1a1a1a) !important;
    font-size: var(--font-size-body-md);
    font-weight: 500;
    line-height: 1.2;
    transition: background-color 0.15s, color 0.15s;
    white-space: nowrap;
}

.aajl-unsolicited-btn .aajl-item__arrow {
    color: var(--color-black, #1a1a1a) !important;
}

.aajl-unsolicited-btn:hover {
    background-color: var(--color-on-surface);
    color: var(--color-black, #fff) !important;
}

.aajl-unsolicited-btn:hover .aajl-item__arrow {
    transform: translate(3px, -3px);
}

/* ── List ──────────────────────────────────────────────────── */
.aajl-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ── Item (anchor row) ─────────────────────────────────────── */
.aajl-item {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 20px 0 40px 0;
    text-decoration: none !important;
    color: inherit !important;
    border-bottom: 1px solid var(--color-container-high, #E8E7F0);
    transition: background-color 0.15s;
}

.aajl-list .aajl-item:first-child {
    border-top: 1px solid var(--color-container-high, #E8E7F0);
}

.aajl-item:hover {
    background-color: var(--color-container-low, #F4F3FB);
}

/* ── Body (title + meta) ───────────────────────────────────── */
.aajl-item__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 24px;
}

/* ── Title ─────────────────────────────────────────────────── */
.aajl-item__title {
    margin: 0;
    font-size: var(--font-size-body-md);
    line-height: 1.3;
    color: var(--color-on-surface, #1a1a1a);
}

/* ── Meta (department / employment / location) ─────────────── */
.aajl-item__meta {
    display: flex;
    flex: 1;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
}

.aajl-item__department,
.aajl-item__employment,
.aajl-item__location {
    display: inline-block;
    font-size: var(--font-size-body-md);
    letter-spacing: 0.06em;
    color: var(--color-outline, #6b6b80);
}

.aajl-item__department {
    color: var(--color-outline, #6b6b80);
}

.aajl-item__location {
    margin-left: auto;
    text-align: right;
}

/* ── CTA (arrow + apply label) ─────────────────────────────── */
.aajl-item__cta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    white-space: nowrap;
}

/* ── Arrow ─────────────────────────────────────────────────── */
.aajl-item__arrow {
    flex-shrink: 0;
    width: 12px;
    height: 12px;
    color: var(--color-on-surface, #1a1a1a);
    transition: transform 0.2s;
}

.aajl-item:hover .aajl-item__arrow {
    transform: translate(3px, -3px);
}

.aajl-item__apply {
    font-size: var(--font-size-body-md);
    color: var(--color-on-surface, #1a1a1a);
}

/* ── No results ────────────────────────────────────────────── */
.aajl-no-results {
    padding: 32px 0;
    color: var(--color-outline, #6b6b80);
    font-size: var(--font-size-body-md);
}

/* ── Load more ─────────────────────────────────────────────── */
.aajl-load-more-wrap {
    margin-top: 32px;
    text-align: center;
}

.aajl-btn--load-more {
    padding: 10px 32px;
    border: 1px solid var(--color-on-surface, #1a1a1a);
    background: transparent;
    color: var(--color-on-surface, #1a1a1a);
    border-radius: 1000px;
    font-size: var(--font-size-body-md);
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}

.aajl-btn--load-more:hover {
    background-color: var(--color-on-surface, #1a1a1a);
    color: var(--color-container-lowest, #fff);
}

/* ── Loading spinner ───────────────────────────────────────── */
.aajl-loading {
    text-align: center;
    padding: 24px 0;
}

.aajl-spinner {
    display: inline-block;
    width: 28px;
    height: 28px;
    border: 3px solid var(--color-container-high, #E8E7F0);
    border-top-color: var(--color-on-surface, #1a1a1a);
    border-radius: 50%;
    animation: aajl-spin 0.7s linear infinite;
}

@keyframes aajl-spin {
    to { transform: rotate(360deg); }
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
    .aajl-filters {
        margin-bottom: 20px;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: flex-start;
        overflow: hidden;
    }

    .aajl-filter-buttons {
        flex: 1 1 auto;
        min-width: 0;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-right: 1.25rem;
        margin-right: -1.25rem;
    }

    .aajl-filter-buttons::-webkit-scrollbar {
        display: none;
    }

    .aajl-item {
        flex-wrap: wrap;
        padding: 16px 0;
        gap: 0;
    }

    /* Row 1: title (left) + location (right) */
    .aajl-item__body {
        flex: 0 0 100%;
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        align-items: baseline;
        gap: 4px 12px;
    }

    .aajl-item__title {
        margin-bottom: 10px;
        grid-column: 1;
        grid-row: 1;
    }

    /* Row 1 right: location */
    .aajl-item__meta {
        display: contents; /* let children participate in parent grid */
    }

    .aajl-item__location {
        grid-column: 2;
        grid-row: 1;
        margin-left: 0;
        text-align: right;
    }

    /* Row 2: department full width */
    .aajl-item__department {
        margin-bottom: 10px;
        grid-column: 1 / -1;
        grid-row: 2;
    }

    /* hide employment on mobile to keep it clean */
    .aajl-item__employment {
        display: none;
    }

    /* Row 3: CTA full width */
    .aajl-item__cta {
        flex: 0 0 100%;
        margin-top: 8px;
    }

    .aajl-application-button--desktop {
        display: none;
    }

    .aajl-application-button--mobile {
        display: block;
        width: 100%;
        text-align: center;
        margin: 80px 0 0;
    }
}
