.latest-opportunities {
    background: var(--mtw-white);
}

.latest-opportunities-container {
    width: min(1480px, calc(100% - 64px));
    margin: 0 auto;
}

.latest-opportunities-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 40px;
    margin-bottom: 44px;
    padding-bottom: 34px;
    border-bottom: 1px solid var(--mtw-border);
}

.latest-opportunities-heading {
    max-width: 760px;
}

.latest-opportunities-heading h2 {
    margin-bottom: 18px;
}

.latest-opportunities-heading p:not(.kicker) {
    color: var(--mtw-muted);
    font-size: 1.05rem;
    line-height: 1.75;
}

.latest-opportunities-top-btn {
    flex-shrink: 0;
}

/* Job cards */

.latest-jobs-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.latest-job-card {
    position: relative;
    min-height: 360px;
    display: grid;
    grid-template-rows: auto 1fr auto;
    background: var(--mtw-white);
    border: 1px solid var(--mtw-border);
    border-radius: var(--radius-lg);
    padding: 30px;
    overflow: hidden;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.latest-job-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 30px;
    right: 30px;
    height: 4px;
    background: var(--mtw-red);
}

.latest-job-card::after {
    content: "";
    position: absolute;
    right: -58px;
    bottom: -58px;
    width: 160px;
    height: 160px;
    border: 1px solid rgba(176, 0, 36, 0.14);
    border-radius: 999px;
    pointer-events: none;
}

.latest-job-card:hover {
    border-color: var(--mtw-red);
    box-shadow: var(--shadow-soft);
    transform: translateY(-2px);
}

.latest-job-meta,
.latest-job-body,
.latest-job-actions {
    position: relative;
    z-index: 1;
}

.latest-job-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 26px;
    padding-top: 4px;
}

.latest-job-category,
.latest-job-location {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    width: fit-content;
    padding: 0 11px;
    border-radius: 999px;
    font-size: 0.74rem;
    line-height: 1;
    font-weight: 850;
}

.latest-job-category {
    background: var(--mtw-red-soft);
    color: var(--mtw-red-dark);
}

.latest-job-location {
    background: var(--mtw-off-white);
    border: 1px solid var(--mtw-border);
    color: var(--mtw-muted);
}

.latest-job-body h3 {
    margin-bottom: 14px;
    font-size: clamp(1.35rem, 1.65vw, 1.85rem);
    line-height: 1.08;
}

.latest-job-body h3 a {
    color: var(--mtw-black);
    text-decoration: none;
}

.latest-job-body h3 a:hover {
    color: var(--mtw-red);
}

.latest-job-body p {
    color: var(--mtw-muted);
    line-height: 1.7;
}

.latest-job-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 30px;
    padding-top: 22px;
    border-top: 1px solid var(--mtw-border);
}

.latest-job-apply {
    min-width: 104px;
    flex-shrink: 0;
}

.latest-job-details {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    color: var(--mtw-black);
    font-size: 0.94rem;
    font-weight: 850;
    text-decoration: none;
    white-space: nowrap;
    transition:
        color 0.2s ease,
        gap 0.2s ease;
}

.latest-job-details span {
    color: var(--mtw-red);
}

.latest-job-details:hover {
    color: var(--mtw-red);
    gap: 12px;
}

/* Empty state */

.latest-opportunities-empty {
    display: grid;
    grid-template-columns: 5px 1fr;
    gap: 26px;
    align-items: center;
    max-width: 820px;
    background: var(--mtw-off-white);
    border: 1px solid var(--mtw-border);
    border-radius: var(--radius-md);
    padding: 32px;
}

.latest-opportunities-empty-line {
    width: 5px;
    height: 100%;
    min-height: 88px;
    background: var(--mtw-red);
    border-radius: var(--radius-xs);
}

.latest-opportunities-empty h3 {
    margin-bottom: 10px;
    font-size: clamp(1.35rem, 1.7vw, 1.75rem);
}

.latest-opportunities-empty p {
    max-width: 620px;
    color: var(--mtw-muted);
}

.latest-opportunities-bottom-action {
    display: none;
    margin-top: 32px;
}

/* Responsive */

@media (max-width: 1200px) {
    .latest-jobs-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .latest-opportunities-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .latest-opportunities-top-btn {
        display: none;
    }

    .latest-opportunities-bottom-action {
        display: block;
    }
}

@media (max-width: 900px) {
    .latest-opportunities-container {
        width: min(100% - 32px, 1480px);
    }

    .latest-opportunities-header {
        margin-bottom: 34px;
        padding-bottom: 28px;
    }

    .latest-opportunities-heading p:not(.kicker) {
        font-size: 1rem;
    }

    .latest-jobs-list {
        grid-template-columns: 1fr;
    }

    .latest-job-card {
        min-height: auto;
        padding: 26px;
    }

    .latest-job-card::before {
        left: 26px;
        right: 26px;
    }
}

@media (max-width: 620px) {
    .latest-job-actions {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    .latest-job-apply,
    .latest-job-details {
        width: 100%;
        justify-content: center;
    }

    .latest-job-details {
        padding: 0 18px;
        border: 1px solid var(--mtw-border);
        border-radius: 8px;
        background: var(--mtw-white);
    }

    .latest-opportunities-empty {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 26px;
    }

    .latest-opportunities-empty-line {
        width: 58px;
        height: 4px;
        min-height: 4px;
    }

    .latest-opportunities-bottom-action .btn {
        width: 100%;
    }
}