/* =============================================================================
   Job Archive — horizontal filter bar, chip dropdowns, job cards, pagination
   Scoped to the alpha-vanilla Work for Tinies job archive override.
   Enqueued only on is_post_type_archive('job_listing') via archive-job_listing.php
============================================================================= */

/* ─── Speculative CV line (above search) ──────────────────────────────────── */

.job-archive__intro {
    position: relative;
    background-color: var(--theme-page-bg-colour);
    color: var(--theme-page-bg-text);
    padding: 60px 0 300px;
}

.job-archive__intro-body {
    margin: 0 auto;
}

.job-archive__cv-line {
    margin: 0 0 20px;
    font-size: 15px;
}

.job-archive__cv-line a {
    color: var(--theme-page-colour, var(--color-accent));
    font-weight: 700;
    text-decoration: underline;
}

/* ─── Archive section wrapper ─────────────────────────────────────────────── */

.job-archive {
    position: relative;
    z-index: 20;
    padding: 40px 0 80px;
    margin-top: -550px;
}

.job-archive .container {
    background: #fcfcfc;
    border-radius: 20px;
    padding-top: 25px;
}

/* ─── SEO text band (bottom of page, below listings) ──────────────────────── */

.job-archive__seo {
    position: relative;
    background-color: var(--theme-page-bg-colour);
    color: var(--theme-page-bg-text);
    padding: 60px 0;
}

.job-archive__seo-body {
    margin: 0 auto;
    padding: 48px 0;
}

.job-archive__seo-body a:not(.btn) {
    color: var(--theme-page-colour);
    text-decoration: underline;
}

.job-archive__seo-cv {
    margin-top: 24px;
    font-weight: 600;
}

.job-archive__seo .btn {
    margin-top: 12px;
}

.job-archive__results {
    margin-top: 32px;
}

.job-archive__list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.job-archive__no-results {
    font-size: 16px;
    color: var(--color-text);
    padding: 32px 0;
}

/* ─── Search bar (row 1) ──────────────────────────────────────────────────── */

.job-filters__bar {
    display: flex;
    flex-direction: column;
    overflow: visible;
}

.job-filters__bar-row {
    display: flex;
    align-items: stretch;
    gap: 0;
    background: #fff;
    padding: 10px 0;
    border-radius: 25px;;
}

.job-filters__bar-field {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 14px 20px;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.job-filters__bar-field--radius {
    flex: 0 0 200px;
}

.job-filters__bar-divider {
    width: 1px;
    background: rgba(44, 30, 89, 0.10);
    margin: 12px 0;
    flex-shrink: 0;
}

.job-filters__bar-label {
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--color-text);
    opacity: 0.5;
    white-space: nowrap;
}

.job-filters__bar-input {
    width: 100%;
    border: none;
    outline: none;
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--color-text);
    background: transparent;
    padding: 0;
}

.job-filters__bar-input::placeholder {
    color: var(--color-text);
    opacity: 0.35;
}

.job-filters__bar-field--location {
    flex: 0.75;
}

.job-filters__bar-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    margin: 8px;
}

.job-filters__bar-submit {
    flex-shrink: 0;
    align-self: stretch;
    margin: 0;
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    background: var(--theme-page-gradient, linear-gradient(92deg, #FF7705, #2ACCFF));
    color: var(--theme-page-text, #fff);
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.15s ease, transform 0.1s ease;
}

.job-filters__bar-submit:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.job-filters__bar-clear {
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 12px;
    color: var(--color-text);
    opacity: 0.45;
    text-decoration: underline;
    white-space: nowrap;
    padding: 0;
    line-height: 1;
    transition: opacity 0.15s ease;
}

.job-filters__bar-clear:hover {
    opacity: 0.75;
}

/* Radius compact field inside the bar */
.job-filters__radius-compact {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.job-filters__range-value {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    color: var(--theme-page-colour, var(--color-accent));
    white-space: nowrap;
}

.job-filters__slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 9999px;
    background: rgba(44, 30, 89, 0.15);
    outline: none;
    cursor: pointer;
}

.job-filters__slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--theme-page-colour, var(--color-accent));
    cursor: pointer;
    transition: transform 0.1s ease;
}

.job-filters__slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.job-filters__slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border: none;
    border-radius: 50%;
    background: var(--theme-page-colour, var(--color-accent));
    cursor: pointer;
}

/* Location group inactive when Nationwide selected */
.job-filters__bar-field--location.job-filters__group--inactive {
    opacity: 0.35;
    pointer-events: none;
}

@media (max-width: 820px) {
    /* The hero shrinks via clamped headings/heights here, but .job-archive's
       margin-top: -550px is fixed, so the floating card rides up over the hero
       breadcrumb. A wider top gap (the transparent area above .container) lets
       the breadcrumb show through again. Inverse of viewport size, so a media
       query is correct here — clamp() can only scale the same way as the width. */
    .job-archive {
        padding-top: 80px;
    }

    .job-filters__bar-row {
        flex-direction: column;
    }

    .job-filters__bar-divider {
        width: auto;
        height: 1px;
        margin: 0 16px;
    }

    .job-filters__bar-field--radius {
        flex: unset;
    }

    .job-filters__bar-actions {
        margin: 8px 12px 12px;
        align-self: stretch;
    }

    .job-filters__bar-submit {
        padding: 14px 20px;
        border-radius: 12px;
        text-align: center;
        align-self: stretch;
    }

    /* Dropdown panels: constrain to viewport width and centre under chip */
    .job-filters__panel {
        left: 50%;
        transform: translateX(-50%);
        width: calc(100vw - 32px);
        max-width: 100%;
        min-width: unset;
    }
}

/* ─── Filter chips (row 2) ────────────────────────────────────────────────── */

.job-filters__chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px 0;
    position: relative;
}

.job-filters__chip-wrap {
    position: relative;
}

/* ─── Results toolbar (count / range left, sort right) ───────────────────── */

.job-archive__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0 12px;
    border-top: 1px solid rgba(44, 30, 89, 0.08);
    flex-wrap: wrap;
}

.job-archive__toolbar-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.job-filters__count {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    color: var(--theme-page-colour, var(--color-accent));
    white-space: nowrap;
}

.job-archive__toolbar-range {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--color-text);
    opacity: 0.5;
    white-space: nowrap;
}

.job-archive__toolbar-sort {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.job-archive__sort-label {
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text);
    opacity: 0.5;
    white-space: nowrap;
}

.job-archive__sort {
    background-color: #fff;
    border: 1.5px solid rgba(44, 30, 89, 0.18);
    border-radius: 9999px;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    padding: 7px 32px 7px 14px;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%232c1e59' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.job-archive__sort:hover,
.job-archive__sort:focus {
    border-color: var(--theme-page-colour, var(--color-accent));
    color: var(--theme-page-colour, var(--color-accent));
}

.job-filters__chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    border: 1.5px solid rgba(44, 30, 89, 0.18);
    border-radius: 9999px;
    background: #fff;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
    user-select: none;
}

.job-filters__chip:hover {
    border-color: var(--theme-page-colour, var(--color-accent));
    color: var(--theme-page-colour, var(--color-accent));
}

.job-filters__chip--active {
    background: var(--theme-page-colour, var(--color-accent));
    border-color: var(--theme-page-colour, var(--color-accent));
    color: #fff;
}

.job-filters__chip--active .job-filters__chip-arrow {
    color: #fff;
}

.job-filters__chip[aria-expanded="true"] {
    border-color: var(--theme-page-colour, var(--color-accent));
    color: var(--theme-page-colour, var(--color-accent));
}

.job-filters__chip--active[aria-expanded="true"] {
    color: #fff;
}

.job-filters__chip-arrow {
    font-size: 10px;
    transition: transform 0.2s ease;
}

.job-filters__chip[aria-expanded="true"] .job-filters__chip-arrow {
    transform: rotate(180deg);
}

/* ─── Dropdown panels ─────────────────────────────────────────────────────── */

.job-filters__panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 200;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(44, 30, 89, 0.14);
    padding: 20px;
    min-width: 300px;
    max-width: 480px;
    width: max-content;
}

/* Salary panel is wider to fit two sections */
#job-filters-panel-salary {
    min-width: 340px;
}

.job-filters__panel[hidden] {
    display: none;
}

.job-filters__panel-section {
    padding-bottom: 20px;
}

.job-filters__panel-section + .job-filters__panel-section {
    border-top: 1px solid rgba(44, 30, 89, 0.08);
    padding-top: 20px;
}

.job-filters__panel-section-title {
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text);
    opacity: 0.5;
    margin-bottom: 14px;
}

.job-filters__panel-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 12px;
    border-top: 1px solid rgba(44, 30, 89, 0.08);
    margin-top: 4px;
}

.job-filters__panel-clear {
    background: none;
    border: none;
    padding: 0;
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--color-text);
    opacity: 0.5;
    cursor: pointer;
    text-decoration: underline;
    transition: opacity 0.15s ease;
}

.job-filters__panel-clear:hover {
    opacity: 0.85;
}

/* ─── Checkboxes inside panels ────────────────────────────────────────────── */

.job-filters__checkboxes {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 4px;
}

.job-filters__checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--color-text);
    cursor: pointer;
    line-height: 1.3;
}

.job-filters__checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    cursor: pointer;
}

/* ─── Dual-range salary slider ────────────────────────────────────────────── */

.job-filters__dual-range {
    user-select: none;
}

.job-filters__dual-range-vals {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 14px;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    color: var(--theme-page-colour, var(--color-accent));
}

.job-filters__dual-range-sep {
    opacity: 0.5;
    font-weight: 400;
    color: var(--color-text);
}

.job-filters__dual-range-track {
    position: relative;
    height: 4px;
    background: rgba(44, 30, 89, 0.15);
    border-radius: 9999px;
    margin: 10px 0;
}

.job-filters__dual-range-fill {
    position: absolute;
    top: 0;
    height: 100%;
    background: var(--theme-page-colour, var(--color-accent));
    border-radius: 9999px;
    pointer-events: none;
}

.job-filters__dual-range-track input[type="range"] {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 4px;
    transform: translateY(-50%);
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    outline: none;
    margin: 0;
    padding: 0;
    pointer-events: none;
}

.job-filters__dual-range-track input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--theme-page-colour, var(--color-accent));
    cursor: pointer;
    pointer-events: all;
    transition: transform 0.1s ease;
    box-shadow: 0 1px 4px rgba(44, 30, 89, 0.2);
}

.job-filters__dual-range-track input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.job-filters__dual-range-track input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: var(--theme-page-colour, var(--color-accent));
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 1px 4px rgba(44, 30, 89, 0.2);
}

/* ─── Job Card ────────────────────────────────────────────────────────────── */

.job-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(44, 30, 89, 0.07);
    padding: 24px 28px;
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.job-card:hover {
    box-shadow: 0 8px 32px rgba(44, 30, 89, 0.13);
    transform: translateY(-2px);
}

.job-card__inner {
    display: flex;
    gap: 28px;
    align-items: flex-start;
}

.job-card__content {
    flex: 1;
    min-width: 0;
}

.job-card__title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 12px;
}

.job-card__title a {
    color: var(--color-accent);
    text-decoration: none;
    transition: opacity 0.15s ease;
}

.job-card__title a:hover {
    opacity: 0.78;
}

.job-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
    list-style: none;
    margin: 0 0 14px;
    padding: 0;
}

.job-card__meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--color-text);
    line-height: 1.3;
}

.job-card__meta-icon {
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    color: var(--theme-page-colour, var(--color-accent));
}

.job-card__excerpt {
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.65;
    color: var(--color-text);
    opacity: 0.75;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.job-card__actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    flex-shrink: 0;
    padding-top: 4px;
}

.job-card__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 26px;
    border-radius: 9999px;
    background: var(--theme-page-gradient, linear-gradient(92deg, #FF7705, #2ACCFF));
    color: var(--theme-page-text, #fff);
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.15s ease, transform 0.1s ease;
}

.job-card__cta:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.job-card__fav {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--theme-page-colour, var(--color-accent));
    background: transparent;
    cursor: pointer;
    color: var(--theme-page-colour, var(--color-accent));
    padding: 0;
    transition: background 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
}

.job-card__fav:hover,
.job-card__fav.is-active {
    background: var(--theme-page-colour, var(--color-accent));
    color: #fff;
}

.job-card__fav.is-active svg path {
    fill: currentColor;
}

.job-card__fav svg {
    width: 18px;
    height: 18px;
}

.job-card__date {
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    color: var(--theme-page-colour, var(--color-accent));
    white-space: nowrap;
    text-align: right;
    margin: 0;
}

.job-card__date-label {
    font-weight: 400;
    color: var(--color-text);
}

@media (max-width: 600px) {
    .job-card {
        padding: 20px;
    }

    .job-card__inner {
        flex-direction: column;
        gap: 20px;
    }

    .job-card__title {
        font-size: 18px;
    }

    .job-card__actions {
        flex-direction: row;
        align-items: center;
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 10px;
    }

    .job-card__date {
        width: 100%;
        text-align: left;
    }
}

/* ─── Pagination ──────────────────────────────────────────────────────────── */

.job-archive__pagination {
    margin-top: 36px;
}

.job-archive__pagination .navigation {
    display: flex;
    justify-content: center;
}

.job-archive__pagination .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.job-archive__pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    border-radius: 9999px;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    text-decoration: none;
    border: 1.5px solid rgba(44, 30, 89, 0.15);
    background: #fff;
    transition: all 0.15s ease;
}

.job-archive__pagination .page-numbers.current,
.job-archive__pagination .page-numbers:hover {
    background: var(--theme-page-gradient, linear-gradient(92deg, #FF7705, #2ACCFF));
    color: var(--theme-page-text, #fff);
    border-color: transparent;
}

.job-archive__pagination .page-numbers.dots {
    border-color: transparent;
    background: transparent;
    cursor: default;
}

.job-archive__pagination .page-numbers.dots:hover {
    background: transparent;
    color: var(--color-text);
}

.job-archive__pagination button.page-numbers {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

/* ─── Loading state ───────────────────────────────────────────────────────── */

.job-archive__list.is-loading {
    opacity: 0.45;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

/* ─── Autocomplete dropdown ───────────────────────────────────────────────── */

.job-filters__bar-field--location {
    position: relative;
}

.job-filters__suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: -20px;
    right: -20px;
    z-index: 300;
    list-style: none;
    margin: 0;
    padding: 4px 0;
    background: #fff;
    border: 1.5px solid rgba(44, 30, 89, 0.12);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(44, 30, 89, 0.12);
    max-height: 240px;
    overflow-y: auto;
}

.job-filters__suggestion {
    padding: 10px 16px;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--color-text);
    cursor: pointer;
    transition: background 0.1s ease;
}

.job-filters__suggestion:hover,
.job-filters__suggestion.is-active {
    background: rgba(44, 30, 89, 0.06);
}

/* ── Toolbar controls (sort + view toggle) ──────────────────────────────── */

.job-archive__toolbar-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
    margin-left: auto;
}

/* ── View toggle (List / Map) ───────────────────────────────────────────── */

.job-archive__view-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(44, 30, 89, 0.06);
    border-radius: 9999px;
    padding: 3px;
}

.job-archive__view-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border: none;
    border-radius: 9999px;
    background: transparent;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.job-archive__view-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.job-archive__view-btn.is-active {
    background: var(--theme-page-colour, var(--color-accent));
    color: #fff;
}

/* ── Map container ──────────────────────────────────────────────────────── */

.job-archive__map {
    width: 100%;
    height: 700px;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 32px;
}

@media (max-width: 768px) {
    .job-archive__map {
        height: 520px;
        border-radius: 12px;
    }
}

/* ── Map info window ────────────────────────────────────────────────────── */

.job-map__info {
    font-family: var(--font-body);
    min-width: 200px;
    max-width: 280px;
    padding: 4px 15px 4px 2px;
}

.job-map__info-areahead {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    text-transform: capitalize;
    letter-spacing: 0.04em;
    color: var(--theme-page-colour, var(--color-accent));
    margin: -2px 0 14px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.job-map__info-title {
    display: block;
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text);
    text-decoration: none;
    margin-bottom: 6px;
    line-height: 1.3;
}

.job-map__info-title:hover {
    color: var(--theme-page-colour, var(--color-accent));
}

.job-map__info-meta,
.job-map__info-salary {
    font-size: 13px;
    color: var(--color-text);
    opacity: 0.7;
    margin: 0 0 4px;
}

.job-map__info-cta {
    display: inline-block;
    margin-top: 10px;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    color: var(--theme-page-colour, var(--color-accent));
    text-decoration: none;
}

.job-map__info-cta:hover {
    text-decoration: underline;
}

/* ── Google Maps InfoWindow chrome: reduce top white gap ───────────────── */

.gm-style .gm-style-iw-c {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.gm-style .gm-style-iw-chr {
    height: 28px !important;
    padding: 0 !important;
}

.gm-style .gm-style-iw-d {
    overflow: auto !important;
    padding-bottom: 8px !important;
}

/* ── Map carousel navigation ────────────────────────────────────────────── */

.job-map__nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    padding-top: 8px;
    border-top: 1px solid rgba(44, 30, 89, 0.1);
}

.job-map__nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1.5px solid rgba(44, 30, 89, 0.2);
    border-radius: 50%;
    background: none;
    cursor: pointer;
    color: var(--color-text);
    font-size: 14px;
    transition: border-color 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
    padding: 0;
}

.job-map__nav-btn:hover {
    border-color: var(--theme-page-colour, var(--color-accent));
    color: var(--theme-page-colour, var(--color-accent));
}

.job-map__nav-count {
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text);
    opacity: 0.5;
}

/* ════════════════════════════════════════════════════════════════════════
   Mobile filter sheet (≤768px)
   The advanced filters (Salary / Job Type / Job Role) collapse behind a
   "More filters" button (beneath Search Jobs) and open as a slide-up bottom
   sheet. Desktop is untouched — the sheet chrome below is hidden by default
   and only revealed inside the mobile media query.
   ════════════════════════════════════════════════════════════════════════ */

/* Mobile-only chrome — hidden on desktop */
.job-filters__sheet-header,
.job-filters__sheet-footer,
.job-filters__group-title,
.job-filters__overlay,
.job-filters__more-filters {
    display: none;
}

/* "More filters" — secondary button beneath Search Jobs (mobile only). Mirrors
   the bar-submit dimensions so the two stack cleanly; theme-coloured outline. */
.job-filters__more-filters {
    align-self: stretch;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 13px 28px;
    border: 1.5px solid var(--theme-page-colour, var(--color-accent));
    border-radius: 12px;
    background: transparent;
    color: var(--theme-page-colour, var(--color-accent));
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

@media (max-width: 768px) {
    .job-archive__sort {
        padding: 10px 32px 10px 14px;
    }
    .job-archive__view-btn {
        padding: 8px 14px;
    }

    /* "More filters" button shown beneath Search Jobs */
    .job-filters__more-filters {
        display: inline-flex;
    }

    /* ── Toolbar: [toggle ⟷ sort] row, count detached above the listing ──── */
    .job-archive__toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        border: none;
    }

    .job-archive__toolbar-controls {
        order: 1;
        margin-left: 0;
        flex-wrap: nowrap;
        justify-content: space-between;
        gap: 8px;
    }

    /* Map/List toggle on the left, sort on the right */
    .job-archive__view-toggle {
        order: -1;
    }

    /* Count detaches from the controls and sits right-aligned, close to the list */
    .job-archive__toolbar-info {
        order: 2;
        margin-top: 22px;
        justify-content: flex-end;
    }

    /* "Showing X–Y" range is dropped on mobile so the jobs-found count is the
       lone title above the listing. */
    .job-archive__toolbar-range {
        display: none;
    }

    .job-archive__filters-count {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        border-radius: 9999px;
        background: var(--theme-page-colour, var(--color-accent));
        color: #fff;
        font-size: 11px;
        font-weight: 700;
    }

    .job-archive__filters-count[hidden] {
        display: none;
    }

    /* ── Overlay backdrop ────────────────────────────────────────────────── */
    .job-filters__overlay {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 999;
        border: 0;
        padding: 0;
        background: rgba(44, 30, 89, 0.45);
    }

    .job-filters__overlay[hidden] {
        display: none;
    }

    /* ── The sheet ───────────────────────────────────────────────────────── */
    .job-filters__advanced {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1000;
        display: flex;
        flex-direction: column;
        max-height: 88vh;
        background: #fff;
        border-radius: 24px 24px 0 0;
        box-shadow: 0 -8px 40px rgba(44, 30, 89, 0.18);
        transform: translateY(100%);
        transition: transform 0.3s ease;
    }

    .job-filters__advanced.is-open {
        transform: translateY(0);
    }

    /* ── Sheet header ────────────────────────────────────────────────────── */
    .job-filters__sheet-header {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 22px 20px 14px;
        border-bottom: 1px solid rgba(44, 30, 89, 0.08);
    }

    .job-filters__sheet-title {
        font-family: var(--font-heading);
        font-size: 22px;
        font-weight: 700;
        color: var(--color-text);
    }

    .job-filters__sheet-clear {
        margin-left: auto;
        background: none;
        border: none;
        padding: 0;
        font-family: var(--font-heading);
        font-size: 14px;
        font-weight: 600;
        color: var(--theme-page-colour, var(--color-accent));
        cursor: pointer;
    }

    .job-filters__sheet-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        border: none;
        background: rgba(44, 30, 89, 0.06);
        border-radius: 50%;
        font-size: 20px;
        line-height: 1;
        color: var(--color-text);
        cursor: pointer;
    }

    /* ── Sheet body (filter groups, scrollable) ──────────────────────────── */
    .job-filters__chips {
        flex: 1;
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 0;
        padding: 4px 20px 8px;
        overflow-y: auto;
    }

    .job-filters__chip-wrap {
        position: static;
        width: 100%;
    }

    .job-filters__chip-wrap + .job-filters__chip-wrap {
        border-top: 1px solid rgba(44, 30, 89, 0.08);
    }

    /* Chip buttons replaced by static section titles */
    .job-filters__chip {
        display: none;
    }

    .job-filters__group-title {
        display: block;
        font-family: var(--font-heading);
        font-size: 12px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: var(--theme-page-colour, var(--color-accent));
        margin: 18px 0 12px;
    }

    /* Panels always shown, in normal flow (overrides desktop dropdown rules) */
    .job-filters__advanced .job-filters__panel,
    .job-filters__advanced .job-filters__panel[hidden] {
        display: block;
        position: static;
        transform: none;
        width: auto;
        min-width: 0;
        max-width: none;
        padding: 0;
        border-radius: 0;
        box-shadow: none;
        z-index: auto;
    }

    /* The salary panel's own min-width override no longer applies in the sheet */
    #job-filters-panel-salary {
        min-width: 0;
    }

    /* Per-panel "Clear" footers are redundant — Reset / Clear all cover them */
    .job-filters__advanced .job-filters__panel-footer {
        display: none;
    }

    .job-filters__checkboxes {
        max-height: none;
    }

    /* ── Sheet footer (Reset / Show jobs) ────────────────────────────────── */
    .job-filters__sheet-footer {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px 20px calc(14px + env(safe-area-inset-bottom, 0px));
        border-top: 1px solid rgba(44, 30, 89, 0.08);
    }

    .job-filters__sheet-cancel {
        flex-shrink: 0;
        padding: 14px 22px;
        border: 1.5px solid rgba(44, 30, 89, 0.18);
        border-radius: 9999px;
        background: #fff;
        font-family: var(--font-heading);
        font-size: 15px;
        font-weight: 700;
        color: var(--color-text);
        cursor: pointer;
    }

    .job-filters__sheet-apply {
        flex: 1;
        padding: 14px 22px;
        border: none;
        border-radius: 9999px;
        background: var(--theme-page-gradient, linear-gradient(92deg, #FF7705, #2ACCFF));
        font-family: var(--font-heading);
        font-size: 15px;
        font-weight: 700;
        color: var(--theme-page-text, #fff);
        cursor: pointer;
    }
}
