/**
 * v3 careerweb — results meta bar.
 * Bar between the nav and the main grid. Counts on the left, sort
 * dropdown trigger on the right. Container constrained to the same
 * 1600px max-width as the main grid so they read as one column.
 */

.results-meta {
    /* Sticky below the nav. The bar carries the Showing location
       chip + Sort pill — both are navigation affordances, so they
       should stay reachable while the user scrolls the long list /
       detail panel. Background is opaque so the scrolling content
       under it stays hidden, and z-index sits just below the nav
       (50) so any open sort/nav popover lands on top. */
    position: sticky;
    top: var(--nav-h);
    z-index: 40;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 32px 12px;
    font-size: 13px;
    color: var(--ink-2);
    width: 100%;
}
.results-count { display: flex; align-items: center; gap: 8px; }
.results-count strong {
    font-family: 'Archivo', sans-serif;
    font-weight: 700;
    color: var(--ink);
    font-size: 15px;
}
/* Keep the sort pill anchored to the right edge even when the
   left-hand counter is missing (currently hidden — see partial). */
.results-meta > .sort-select { margin-left: auto; }

/* Sort trigger — pill button, opens a menu (popover comes in Stage D). */
.sort-select {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    background: transparent;
    border: 1px solid var(--border-2);
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--ink);
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
}
.sort-select:hover { background: var(--surface-2); }
.sort-select i { font-size: 14px; color: var(--ink-3); }
.sort-label { color: var(--ink-3); }
.sort-value { color: var(--ink); font-weight: 700; }

/* ─── Sort popover menu ───
   Positioned by JS (fixed, top-right-anchored to .sort-select).
   Renders into <body> on first open so it escapes the .results-meta
   stacking context. Keep z-index above the nav (50) but below modals
   (100) and the chat drawer (70). */
.sort-popover {
    display: none;
    position: fixed;
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 4px;
    min-width: 220px;
    z-index: 80;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 140ms ease, transform 140ms ease;
}
.sort-popover.open {
    display: block;
    opacity: 1;
    transform: translateY(0);
}
.sort-popover-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 9px 12px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--ink);
    font-size: 13.5px;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: background 100ms ease;
}
.sort-popover-item:hover { background: var(--surface-2); }
.sort-popover-label { color: var(--ink); }
.sort-popover-check {
    font-size: 14px;
    color: var(--brand);
    opacity: 0;
    transition: opacity 100ms ease;
}
.sort-popover-item.selected .sort-popover-label {
    color: var(--brand);
    font-weight: 700;
}
.sort-popover-item.selected .sort-popover-check { opacity: 1; }

/* ─── Inline location + distance popover ───
   Anchored under the nav-location pill in this same meta row. Owns
   the Google Places autocomplete + radius dropdown that used to live
   inside the filters modal; clicking the pill no longer pays the
   /apis/filter_options.php cold-cache cost just to change location.
   Shares geometry / tokens with the apply form's .filter-input so the
   two surfaces read as one design language. */
.loc-popover {
    position: fixed;
    z-index: 90;            /* above results-meta (40) + sticky nav */
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 16px;
    min-width: 320px;
    max-width: 420px;
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity 160ms ease, transform 160ms cubic-bezier(0.16, 1, 0.3, 1);
}
.loc-popover.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.loc-popover-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--ink-3);
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease;
}
.loc-popover-close:hover {
    background: var(--surface-2);
    color: var(--ink);
}
.loc-popover-close:focus-visible {
    outline: none;
    background: var(--surface-2);
    color: var(--ink);
    box-shadow: 0 0 0 3px var(--brand-ring);
}
.loc-popover-close i { font-size: 16px; }
.loc-popover-field { margin-bottom: 12px; }
.loc-popover-field:first-of-type {
    /* Push the first label clear of the close button so they don't
       collide visually when the popover is tight. */
    padding-right: 32px;
}
.loc-popover-field:last-child { margin-bottom: 0; }
.loc-popover-label {
    display: block;
    font-family: 'Geist', sans-serif;
    font-weight: var(--fw-bold);
    font-size: var(--fs-meta);
    color: var(--ink-2);
    margin-bottom: 6px;
    letter-spacing: -0.005em;
}
.loc-popover-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.loc-popover-input-icon {
    position: absolute;
    left: 14px;
    color: var(--ink-3);
    font-size: 18px;
    pointer-events: none;
}
.loc-popover-input {
    width: 100%;
    height: 48px;
    padding: 0 38px 0 40px;
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-lg);
    font-size: var(--fs-h3);
    color: var(--ink);
    outline: none;
    font-family: inherit;
    transition: border-color 160ms ease, box-shadow 200ms ease;
}
.loc-popover-input::placeholder { color: var(--ink-3); }
.loc-popover-input:hover { border-color: var(--ink-2); }
.loc-popover-input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px var(--brand-ring);
}
.loc-popover-clear {
    position: absolute;
    right: 6px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: var(--ink-3);
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease;
}
.loc-popover-clear:hover {
    background: var(--surface-2);
    color: var(--ink);
}
.loc-popover-clear i { font-size: 15px; }
.loc-popover-select {
    width: 100%;
    height: 48px;
    padding: 0 40px 0 16px;
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-lg);
    font-size: var(--fs-h3);
    color: var(--ink);
    outline: none;
    font-family: inherit;
    appearance: none;
    -webkit-appearance: none;
    /* Match the .filter-select chevron exactly so the two dropdowns
       read as the same control across surfaces. */
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235A554D' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 20px;
    cursor: pointer;
    transition: border-color 160ms ease, box-shadow 200ms ease;
}
.loc-popover-select:hover { border-color: var(--ink-2); }
.loc-popover-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px var(--brand-ring);
}
[data-theme="dark"] .loc-popover-select {
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A8A299' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

@media (max-width: 480px) {
    .loc-popover {
        left: 12px !important;
        right: 12px;
        min-width: auto;
        max-width: none;
    }
}
