.jab-archive-landing {
    margin-bottom: 32px;
}

.jab-archive-landing-inner {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.jab-archive-landing-inner > *:first-child {
    margin-top: 0;
}

.jab-archive-landing-inner > *:last-child {
    margin-bottom: 0;
}

.jab-archive-landing-inner p {
    line-height: 1.7;
}

body.jab-has-archive-landing .page-header,
body.jab-has-archive-landing .archive-header,
body.jab-has-archive-landing h1.page-title,
body.jab-has-archive-landing .entry-title.archive-title {
    display: none !important;
}

body.jab-has-archive-landing .jab-archive-landing-inner h1 {
    font-size: 38px;
    line-height: 1.15;
    margin-bottom: 18px;
}

body.jab-has-archive-landing .jab-archive-landing-inner h2 {
    margin-top: 32px;
}

/* v1.4: Builder template. This prevents the theme archive loop from repeating. */
.jab-template-wrap {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 96px 20px 56px;
    box-sizing: border-box;
}

.jab-template-main {
    width: 100%;
    min-width: 0;
}

/* v1.3/v1.4: Custom Latest Jobs list */
.jab-latest-jobs {
    margin: 34px 0;
}

.jab-latest-jobs-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 2px solid #0a7cff;
    padding-bottom: 10px;
    margin-bottom: 22px;
}

.jab-latest-jobs-header h2 {
    margin: 0;
    font-size: 30px;
    line-height: 1.2;
    font-weight: 800;
}

.jab-latest-jobs-header span {
    color: #64748b;
    font-size: 14px;
    white-space: nowrap;
}

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

.jab-job-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
}

.jab-job-card-image {
    display: block;
    background: #f8fafc;
}

.jab-job-card-image img {
    width: 100%;
    height: 170px;
    object-fit: cover;
    display: block;
}

.jab-job-card-content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.jab-job-card h3 {
    margin: 0 0 10px;
    font-size: 20px;
    line-height: 1.25;
    font-weight: 800;
}

.jab-job-card h3 a {
    color: inherit;
    text-decoration: none;
}

.jab-job-card h3 a:hover {
    color: #0a7cff;
}

.jab-job-card p {
    margin: 0 0 16px;
    line-height: 1.55;
    font-size: 14px;
    color: #334155;
}

.jab-job-card-button {
    display: inline-block;
    background: #0a7cff;
    color: #ffffff !important;
    padding: 11px 18px;
    border-radius: 6px;
    font-weight: 800;
    text-decoration: none !important;
    margin-top: auto;
    text-align: center;
}

/* Fallback CSS if the old theme-loop method is used. */
body.jab-hide-default-archive-loop:not(.jab-builder-template-active) article.post,
body.jab-hide-default-archive-loop:not(.jab-builder-template-active) .type-post,
body.jab-hide-default-archive-loop:not(.jab-builder-template-active) .pagination,
body.jab-hide-default-archive-loop:not(.jab-builder-template-active) .nav-links {
    display: none !important;
}

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

@media (max-width: 520px) {
    .jab-template-wrap {
        padding-top: 82px;
        padding-left: 14px;
        padding-right: 14px;
    }

    .jab-archive-landing-inner {
        padding: 0;
    }

    .jab-latest-jobs-header {
        display: block;
    }

    .jab-latest-jobs-header h2 {
        font-size: 25px;
    }

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

/* v1.5: Archive Builder pages are intentionally full width and do not use the theme sidebar. */
body.jab-builder-template-active aside,
body.jab-builder-template-active .sidebar,
body.jab-builder-template-active #secondary {
    display: none !important;
}
body.jab-builder-template-active .jab-template-wrap {
    max-width: 1180px;
}


/* v1.6: Extra top spacing to prevent fixed/sticky headers from covering the landing H1. */
body.jab-builder-template-active.admin-bar .jab-template-wrap {
    padding-top: 110px;
}

@media (max-width: 782px) {
    body.jab-builder-template-active.admin-bar .jab-template-wrap {
        padding-top: 118px;
    }
}


/* v1.7: Visual stability fixes for desktop, tablet and mobile. */
body.jab-builder-template-active .jab-template-wrap {
    padding-top: 124px;
}

body.jab-builder-template-active.admin-bar .jab-template-wrap {
    padding-top: 138px;
}

.jab-archive-title {
    display: block !important;
    margin: 0 0 24px !important;
    font-size: 38px;
    line-height: 1.15;
    font-weight: 800;
    color: #1f2937;
}

.jab-archive-content > *:first-child {
    margin-top: 0;
}

@media (max-width: 980px) {
    body.jab-builder-template-active .jab-template-wrap {
        padding-top: 132px;
    }

    body.jab-builder-template-active.admin-bar .jab-template-wrap {
        padding-top: 142px;
    }
}

@media (max-width: 520px) {
    body.jab-builder-template-active .jab-template-wrap {
        padding-top: 156px;
        padding-left: 20px;
        padding-right: 20px;
    }

    body.jab-builder-template-active.admin-bar .jab-template-wrap {
        padding-top: 166px;
    }

    .jab-archive-title {
        font-size: 32px;
        line-height: 1.18;
        margin-bottom: 18px !important;
    }

    .jab-archive-landing {
        margin-bottom: 36px;
    }
}


/* v1.8: Integrated job search */
.jab-jobs-search {
    display: flex;
    align-items: stretch;
    gap: 10px;
    margin: 0 0 24px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.035);
}

.jab-jobs-search input[type="search"] {
    flex: 1;
    min-width: 0;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 15px;
    line-height: 1.4;
    background: #ffffff;
    color: #111827;
    box-sizing: border-box;
}

.jab-jobs-search button {
    border: 0;
    border-radius: 8px;
    background: #0a7cff;
    color: #ffffff;
    padding: 0 22px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
}

.jab-jobs-search button:hover {
    background: #006be0;
}

.jab-jobs-search-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    color: #475569;
    font-weight: 700;
    text-decoration: none !important;
}

.jab-search-status,
.jab-no-results {
    margin: 0 0 20px;
    color: #475569;
    font-size: 15px;
}

@media (max-width: 640px) {
    .jab-jobs-search {
        display: block;
        padding: 12px;
    }

    .jab-jobs-search input[type="search"],
    .jab-jobs-search button,
    .jab-jobs-search-reset {
        width: 100%;
        min-height: 46px;
    }

    .jab-jobs-search button {
        margin-top: 10px;
    }

    .jab-jobs-search-reset {
        margin-top: 8px;
    }
}

/* v1.9: Smart filter chips */
.jab-filter-panel {
    margin: -8px 0 24px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.03);
}

.jab-filter-title {
    font-size: 14px;
    font-weight: 800;
    color: #334155;
    margin-bottom: 10px;
}

.jab-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.jab-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid #dbe3ef;
    border-radius: 999px;
    background: #f8fafc;
    color: #1f2937 !important;
    padding: 8px 13px;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 800;
    text-decoration: none !important;
    white-space: nowrap;
}

.jab-filter-chip span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #eaf2ff;
    color: #0a7cff;
    font-size: 12px;
    font-weight: 900;
    padding: 0 6px;
}

.jab-filter-chip:hover,
.jab-filter-chip.is-active {
    border-color: #0a7cff;
    background: #0a7cff;
    color: #ffffff !important;
}

.jab-filter-chip:hover span,
.jab-filter-chip.is-active span {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
}

@media (max-width: 640px) {
    .jab-filter-panel {
        margin-top: -4px;
        padding: 12px;
    }

    .jab-filter-chips {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }

    .jab-filter-chip {
        flex: 0 0 auto;
        padding: 9px 13px;
    }
}

/* v1.9.1: Smart filters UX polish */
.jab-filter-desktop {
    display: block;
}

.jab-filter-mobile-select {
    display: none;
    width: 100%;
    min-height: 48px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    background: #ffffff;
    color: #111827;
    padding: 10px 12px;
    font-size: 16px;
    font-weight: 700;
    box-sizing: border-box;
}

.jab-filter-more {
    margin-top: 10px;
}

.jab-filter-more summary {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    color: #0a7cff;
    font-weight: 800;
    font-size: 14px;
    list-style: none;
}

.jab-filter-more summary::-webkit-details-marker {
    display: none;
}

.jab-filter-more summary::after {
    content: '+';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-left: 8px;
    border-radius: 999px;
    background: #eaf2ff;
    color: #0a7cff;
    font-size: 14px;
    line-height: 1;
}

.jab-filter-more[open] summary::after {
    content: '–';
}

.jab-filter-chips-extra {
    margin-top: 10px;
}

@media (min-width: 641px) {
    .jab-filter-panel {
        padding: 13px 14px;
    }

    .jab-filter-chip {
        padding: 7px 12px;
        font-size: 13px;
    }

    .jab-filter-chip span {
        min-width: 20px;
        height: 20px;
        font-size: 11px;
    }
}

@media (max-width: 640px) {
    .jab-filter-desktop {
        display: none;
    }

    .jab-filter-mobile-select {
        display: block;
    }

    .jab-filter-panel {
        padding: 14px;
    }
}


/* v1.9.2: UX polish. Make filter/search reloads land at the jobs block and let landing content feel native. */
#latest-jobs {
    scroll-margin-top: 120px;
}

body.jab-builder-template-active .jab-archive-landing-inner {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
}

body.jab-builder-template-active .jab-archive-landing {
    margin-bottom: 42px;
}

@media (max-width: 640px) {
    #latest-jobs {
        scroll-margin-top: 150px;
    }
}
