/* Job-archive faceted filter panel (2026-08-11). Interaction pattern mirrors the
 * encyclopaedia plugin's own archive portal (accordion groups, mobile bottom-sheet,
 * progressive enhancement via a `.vf-js` gate) translated to this theme's own tokens —
 * a different plugin, a different design-token scope (--brand/--font-mono/--radius-*,
 * not the encyclopaedia's --vf-enc-*), same vocabulary so a candidate who has used one
 * recognises the other.
 *
 * PROGRESSIVE ENHANCEMENT: every rule below that depends on JS is scoped under
 * `.vf-js` (added by job-facets.js on boot). With JS off, .vf-jobs-facets-wrap renders
 * as a plain, always-visible block — a working <form> with ordinary <select>/<input>
 * controls, no toggle button, no sheet, no accordion collapse. Nothing is ever hidden
 * with no way to reveal it.
 */

.vf-jobs-layout{display:grid;grid-template-columns:272px minmax(0,1fr);gap:32px;align-items:start}
.vf-jobs-layout .grid{margin-top:0}

.vf-jobs-facets-wrap{position:relative}
.vf-jobs-facets{display:flex;flex-direction:column;gap:18px;background:var(--surface);
  border:1px solid var(--line);border-radius:var(--radius);padding:20px;position:sticky;top:20px}

.vf-jf-field{display:flex;flex-direction:column;gap:6px}
.vf-jf-field label{font-family:var(--font-mono);font-size:.72rem;letter-spacing:.04em;text-transform:uppercase;color:var(--muted)}
.vf-jf-field input,.vf-jf-field select{font:inherit;font-size:.95rem;padding:.6rem .75rem;
  border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--surface);color:var(--ink);width:100%}
/* Dark mode: the field was #fff with the dark theme's #E2E8F0 text (~1.2:1), so the typed keyword and every select value were
   invisible on all four sites (measured 2026-11-12). The field takes the surface token, and its hint the muted one (5.35:1 dark). */
.vf-jf-field input::placeholder{color:var(--muted);opacity:1}
.vf-jf-field input:focus,.vf-jf-field select:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 3px var(--brand-soft)}

.vf-jobs-facet-group{border-top:1px solid var(--line-2);padding-top:14px}
.vf-jobs-facet-group__h{width:100%;display:flex;align-items:center;justify-content:space-between;
  background:none;border:0;padding:0 0 10px;font:inherit;font-weight:700;color:var(--ink);cursor:pointer;text-align:left}
.vf-jobs-facet-group__caret{color:var(--muted);transition:transform var(--dur-natural,.2s) var(--ease-natural,ease)}
.vf-jobs-facet-group__list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px}
.vf-jobs-facet-group__list label{display:flex;align-items:center;gap:8px;padding:5px 2px;font-size:.92rem;
  color:var(--ink-soft);cursor:pointer;border-radius:6px}
.vf-jobs-facet-group__list label:hover{background:var(--paper-2)}
.vf-jobs-facet-group__list input[type="checkbox"]{width:16px;height:16px;accent-color:var(--brand);flex:0 0 auto}
.vf-jobs-facet-group__list input:disabled{opacity:.4;cursor:not-allowed}
.vf-jobs-facet-group__list span:first-of-type{flex:1 1 auto}
.vf-jobs-facet-group__list .n{font-family:var(--font-mono);font-size:.74rem;color:var(--muted);flex:0 0 auto}

.vf-jf-check{display:flex;align-items:center;gap:8px;font-size:.92rem;color:var(--ink-soft);cursor:pointer;
  border-top:1px solid var(--line-2);padding-top:14px}
.vf-jf-check input{width:16px;height:16px;accent-color:var(--brand)}
.vf-jf-check .n{font-family:var(--font-mono);font-size:.74rem;color:var(--muted);margin-left:auto}

.vf-jf-submit{font:inherit;font-weight:600;padding:.7rem 1.1rem;background:var(--brand-fill);color:var(--on-brand);
  border:0;border-radius:var(--radius-sm);cursor:pointer}
.vf-jf-submit:hover{background:var(--brand-fill-hover)} /* fill/on-brand: white on gold was 1.86:1 in dark; light is unchanged (navy, white) */

/* Active-filter chips — a job archive combines facets simultaneously (unlike the
 * encyclopaedia's one-taxonomy-per-page browse), so showing what is currently applied,
 * removable one at a time, is the thing this filter set has that the encyclopaedia's
 * doesn't need. */
.vf-jobs-chips{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 16px}
.vf-jobs-chip{display:inline-flex;align-items:center;gap:6px;font-family:var(--font-mono);font-size:.74rem;
  padding:5px 10px;border-radius:var(--radius-pill);background:var(--brand-soft);color:var(--brand-ink);
  border:1px solid transparent;text-decoration:none;transition:border-color .15s ease}
.vf-jobs-chip:hover{border-color:var(--brand);color:var(--brand-ink)}
.vf-jobs-chip span{opacity:.7}
.vf-jobs-chip--clear{background:none;border-color:var(--line);color:var(--muted)}
.vf-jobs-chip--clear:hover{border-color:var(--muted);color:var(--ink)}

.vf-jf-sheet-bar,.vf-jobs-toggle,.vf-jobs-backdrop,.vf-jf-state{display:none}
.vf-jobs-toggle__n{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;
  padding:0 5px;border-radius:999px;background:var(--brand);color:#fff;font-family:var(--font-mono);font-size:.68rem}

/* The phone sheet is opened by a server-rendered checkbox + label (`.vf-jf-state` / `.vf-jobs-toggle`), so it opens, closes and submits with JavaScript off or
   failed, and needs no class set after first paint: a layout keyed on `.vf-js` (added by job-facets.js after paint) moved the results (CLS 0.2203 at 390 px).
   The closed sheet is position:fixed (no in-flow space) and the opener has a reserved min-height, so nothing shifts. The checkbox is visually hidden but stays
   focusable, which is what makes it keyboard-operable (Space) and announced as "Filters, checkbox"; its focus ring is drawn on the label. job-facets.js only enhances. */
@media (max-width:900px){
  .vf-jobs-layout{grid-template-columns:1fr}

  .vf-jobs-facets-wrap .vf-jf-state{display:block;position:absolute;width:1px;height:1px;margin:0;opacity:0;overflow:hidden;clip-path:inset(50%)}
  .vf-jobs-facets-wrap .vf-jobs-toggle{
    display:inline-flex;align-items:center;gap:8px;margin:0 0 16px;padding:.65rem 1rem;min-height:44px;box-sizing:border-box;
    font:inherit;font-weight:600;background:var(--surface);border:1px solid var(--line);
    border-radius:var(--radius-sm);color:var(--ink);cursor:pointer}
  .vf-jobs-facets-wrap .vf-jf-state:focus-visible + .vf-jobs-toggle{outline:3px solid var(--brand);outline-offset:2px}

  .vf-jobs-facets-wrap .vf-jobs-facets{
    position:fixed;left:0;right:0;bottom:0;top:auto;max-height:85vh;overflow-y:auto;
    border-radius:16px 16px 0 0;box-shadow:var(--shadow-lg);z-index:210;
    transform:translateY(100%);visibility:hidden;transition:transform var(--dur-natural,.2s) var(--ease-natural,ease)}
  .vf-jobs-facets-wrap .vf-jf-state:checked ~ .vf-jobs-facets{transform:translateY(0);visibility:visible}

  .vf-jobs-facets-wrap .vf-jf-sheet-bar{display:flex;align-items:center;justify-content:space-between;margin:0 0 6px}
  .vf-jobs-facets-wrap .vf-jf-sheet-bar strong{font-size:1.1rem}
  .vf-jf-close{background:none;border:0;font-size:1.4rem;line-height:1;color:var(--muted);cursor:pointer;padding:4px 10px;min-width:44px;min-height:44px;
    display:inline-flex;align-items:center;justify-content:center}

  .vf-jobs-facets-wrap .vf-jobs-backdrop{
    display:block;position:fixed;inset:0;background:rgba(20,22,26,.4);z-index:205;
    opacity:0;visibility:hidden;transition:opacity var(--dur-natural,.2s) ease}
  .vf-jobs-facets-wrap .vf-jf-state:checked ~ .vf-jobs-backdrop{opacity:1;visibility:visible}
}

.has-js .vf-jobs-facets-wrap .vf-jobs-facet-group[aria-collapsed="true"] .vf-jobs-facet-group__caret{transform:rotate(-90deg)}
.has-js .vf-jobs-facets-wrap .vf-jobs-facet-group[aria-collapsed="true"] .vf-jobs-facet-group__list{display:none}

@media (prefers-reduced-motion:reduce){
  .vf-jobs-facets,.vf-jobs-backdrop,.vf-jobs-facet-group__caret{transition:none}
}

/* ── S2 (2026-09-17): listing capacity ─────────────────────────────────────── */
/* Three columns beside the facet rail from 1280px; two below it; one on phones
   (style.css already collapses .g-3 at 900px / 760px). */
@media (max-width:1279px){.vf-jobs-layout .vf-jobs-grid.g-3{grid-template-columns:repeat(2,1fr)}}
@media (max-width:760px){.vf-jobs-layout .vf-jobs-grid.g-3{grid-template-columns:1fr}}
/* The whole card is the title's link (stretched link); the apply and save controls
   sit above it so they keep their own targets. */
.vf-jobs-grid .job-card{position:relative}
.vf-jobs-grid .job-card h3 a::after{content:"";position:absolute;inset:0;border-radius:inherit}
.vf-jobs-grid .job-card .job-card-apply,.vf-jobs-grid .job-card .job-card-view,.vf-jobs-grid .job-card .job-card-save,.vf-jobs-grid .job-card .job-card-attrib a{position:relative;z-index:1}
.vf-load-more{display:flex;flex-direction:column;align-items:center;gap:8px;margin-top:26px}
.vf-load-more__btn{min-width:220px}
.vf-load-more__status{font-size:.85rem}

/* ── S3b: towns under a ticked region, and the employer filter link ──────────
 *
 * The town level is a nested list of LINKS (see the shortcode for why links and
 * not checkboxes: the `location` param already has a form-side owner), indented
 * and quieter than its parent so the hierarchy reads without a heading of its own.
 */
.vf-jobs-facet-sub{margin-left:14px;padding-left:10px;border-left:1px solid var(--line-2,var(--line))}
.vf-jobs-facet-sub__a{display:flex;align-items:center;justify-content:space-between;gap:8px;
  padding:4px 0;color:var(--muted);text-decoration:none;font-size:.9rem}
.vf-jobs-facet-sub__a:hover{color:var(--brand)}
.vf-jobs-facet-sub__a[aria-current="true"]{color:var(--ink);font-weight:600}

/* The employer name on a job card became a link to /jobs/?company=… (S3b).
 * position:relative + z-index:1 for the same reason .job-card-apply needs them:
 * the card is the hover/press target, and any stretched-link overlay a future card
 * treatment lays over it (the ::after inset:0 pattern) would otherwise swallow this
 * anchor's clicks — a link that looks clickable and is not is worse than no link.
 * Declared WITH the link rather than left to be remembered when the overlay lands. */
.job-card-employer a{position:relative;z-index:1;color:inherit;text-decoration:none}
.job-card-employer a:hover{color:var(--brand);text-decoration:underline}
