/**
 * v3 careerweb — nav.
 * Sticky header: logo (image, max 200×44), search (max 520px), location
 * pill, filters button, phone button (hidden until JS shows), theme
 * toggle. Mobile layout / icon-only collapses live in responsive.css.
 */

.nav {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 14px 32px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

/* ─── Logo slot ─── */
.logo {
    display: flex;
    align-items: center;
    height: 44px;
    flex-shrink: 0;
    text-decoration: none;
    color: inherit;
}
.logo-img {
    max-height: 44px;
    max-width: 200px;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
    object-position: left center;
}
/* Most tenant logos are dark on light — invert in dark mode when the
   tenant has opted in via the .invert-on-dark class. JS may add that
   class once we know the logo's dominant color (TBD). */
[data-theme="dark"] .logo-img.invert-on-dark {
    filter: invert(1) hue-rotate(180deg);
}
/* Multi-tenant careerweb wordmark. The asset is a 1024×341 canvas whose
   actual mark is only 875×128 — ~62% of the height is transparent
   padding — so the default contain-fit renders the wordmark at ~17px,
   timid next to the search field. Pin a box and crop the dead vertical
   space with object-fit:cover (left-anchored, so it reads as a flush
   brand lockup). Width is the binding edge here so cover only trims the
   vertical whitespace, never the glyphs — and the glyph height is then
   width × 128/1024. 240px → ~30px, calibrated to match a tenant logo's
   visible height (TMC's mark renders at ~30px in the same 44px slot) so
   the multi-tenant board reads at the same logo scale as single-tenant
   pages, just wider as a wordmark naturally is. */
.logo-img.cwv3-wordmark {
    max-width: none;
    max-height: none;
    width: 240px;
    height: 44px;
    object-fit: cover;
    object-position: left center;
}

/* ─── Keyword search input ─── */
.nav-search {
    flex: 1;
    max-width: 520px;
    position: relative;
}
.nav-search input {
    width: 100%;
    height: 40px;
    /* No keyboard-shortcut hint anymore (mobile devices have no kbd,
       and the visual hint ate ~36px of input). responsive.css bumps
       the right padding back up to ~52px on ≤860px to clear the
       embedded .nav-search-filter button. */
    padding: 0 14px 0 40px;
    font-size: 13.5px;
    background: var(--surface-2);
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: var(--ink);
    transition: all 150ms ease;
    outline: none;
}
.nav-search input::placeholder { color: var(--ink-3); }
.nav-search input:hover { background: var(--surface-3); }
.nav-search input:focus {
    background: var(--surface);
    border-color: var(--border-2);
    box-shadow: 0 0 0 3px var(--brand-ring);
}
.nav-search .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ink-3);
    font-size: 16px;
    pointer-events: none;
    transition: opacity 120ms ease;
}
/* Search-busy state — body.cwv3-search-busy is added by search.js
   the moment the user types (before debounce fires) and stays up
   through the listJobs() round-trip. Fades the magnifier icon and
   paints a small spinning glyph in its place so the user sees an
   immediate cue that their keystroke registered. */
body.cwv3-search-busy .nav-search .search-icon { opacity: 0.35; }
body.cwv3-search-busy .nav-search::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    border: 2px solid var(--border-2);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: cwv3-search-spin 0.7s linear infinite;
    pointer-events: none;
    z-index: 1;
}
@keyframes cwv3-search-spin { to { transform: translateY(-50%) rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    body.cwv3-search-busy .nav-search::before { animation: none; }
}
/* Embedded filter trigger inside the search bar. Hidden by default
   (the standalone .filters-btn carries the label on desktop) and
   shown on ≤860px via responsive.css so mobile users get filter
   right next to the keyword field, reading as one cohesive control.
   Anchored absolute to the search bar; a hairline divider on its
   left edge signals the boundary between input and action. */
.nav-search-filter {
    display: none;
    position: absolute;
    top: 4px;
    right: 4px;
    bottom: 4px;
    width: 36px;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-left: 1px solid var(--border);
    /* Brand glyph to match the standalone filter/hamburger chips. No tint
       background here — this trigger lives inside the search input, so a
       wash would clash with the field surface; the brand-coloured icon
       alone carries the cue. */
    color: var(--brand);
    cursor: pointer;
    padding: 0;
    transition: color 120ms ease, background 120ms ease;
}
.nav-search-filter:hover {
    color: var(--brand);
    background: var(--surface-3);
    border-radius: 0 var(--radius) var(--radius) 0;
}
/* Suppress the default browser focus outline; the :focus-visible
   rule below paints the brand ring only for keyboard navigation
   so a mouse click → close → focus-still-on-button doesn't leave a
   stray ring behind. */
.nav-search-filter:focus { outline: none; }
.nav-search-filter:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: -2px;
    border-radius: 0 var(--radius) var(--radius) 0;
}
.nav-search-filter i { font-size: 17px; }
/* Position the count badge in the top-right corner of the embedded
   filter button so an active-filter count is visible without the
   text label. */
.nav-search-filter .filters-count {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 10px;
    line-height: 16px;
}

/* ─── Location pill ─── */
.nav-location {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 40px;
    padding: 0 12px 0 14px;
    background: transparent;
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    color: var(--ink);
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    transition: all 150ms ease;
    /* Yields to Sort when the location string is long — the value
       ellipsises (see .nav-location-value) instead of the pill growing
       past the column and shoving Sort off the row. */
    flex-shrink: 1;
    min-width: 0;
}
.nav-location:hover {
    background: var(--surface-2);
    border-color: var(--ink-3);
}
.nav-location:focus-visible {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-ring);
}
.nav-location > i:first-child {
    font-size: 18px;
    color: var(--ink-2);
    flex-shrink: 0;
}
.nav-location .chevron {
    font-size: 14px;
    color: var(--ink-3);
    margin-left: 2px;
}
.nav-location-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1;
    gap: 2px;
    min-width: 0;   /* allow the value to ellipsis within the pill */
    overflow: hidden;
}
.nav-location-label {
    font-size: 10px;
    color: var(--ink-3);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
    font-family: 'Archivo', sans-serif;
}
.nav-location-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
    font-family: 'Archivo', sans-serif;
    letter-spacing: -0.01em;
    /* Truncate long "City, ST, US · 250 mi" strings instead of widening
       the pill — keeps Sort in place. */
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ─── Phone CTA ───
   Brand-color pill matching the LP revamp's .lp-nav-phone-pill so the
   two surfaces stay visually unified. Single line ("Call: 555-…"), solid
   brand background, white text, full-rounded. Tracking number gets
   written into .nav-phone-number by brand.js::applyCompanyPhone. */
.nav-phone {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 8px 18px;
    background: var(--brand);
    border: 1px solid var(--brand);
    border-radius: 9999px;
    color: var(--brand-on, #fff);
    text-decoration: none;
    white-space: nowrap;
    font-family: 'Archivo', sans-serif;
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.2;
    transition: all 150ms ease;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums lining-nums;
    /* Push the phone pill flush right within the nav — without this
       the pill sat ~24px past the filters button (search hits its
       520px max-width and the remaining slack falls at the very end
       of the row), reading as "stuck to the middle controls" rather
       than a deliberate top-right dial-now affordance. margin-left:
       auto absorbs whatever slack remains after the search caps,
       on both desktop and the mobile flex-wrap row 1. */
    margin-left: auto;
}
/* (.nav-actions display:none rule lives further down with the rest of
   the right-side icon group definitions — see "Right-side icon group".) */
.nav-phone:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
    color: var(--brand-on, #fff);
    text-decoration: none;
}
.nav-phone:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--brand-ring);
}
.nav-phone > i:first-child {
    font-size: 18px;
    color: var(--brand-on, #fff);
    flex-shrink: 0;
}
.nav-phone-text {
    /* Single flex item holding "Call:&nbsp;<strong>NNN…</strong>" so
       the flex gap doesn't add extra space between label and number —
       only the icon → text gap remains. */
    display: inline;
    line-height: 1.2;
}
.nav-phone-number {
    font-family: 'Archivo', sans-serif;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--brand-on, #fff);
    letter-spacing: -0.01em;
}

/* ─── Filters button (with count badge) ─── */
.filters-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 14px;
    /* Brand-chip treatment: faint brand wash + brand glyph so the button
       reads as an on-brand action rather than a flat gray box. The border
       stays NEUTRAL (--border-2), NOT brand-tinted: a brand-coloured
       hairline vanishes on light brands (Dollar General's yellow at 0.16
       alpha is invisible on white) and on near-black brands in dark
       theme, so the edge has to be brand-independent to read everywhere.
       Brand presence lives on the glyph + wash instead. Label stays --ink
       for legibility; brand-light / brand-dark tenants swap the glyph to
       ink via tokens.css so it never drops below contrast. */
    background: var(--brand-tint);
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    color: var(--ink);
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all 120ms ease;
    white-space: nowrap;
    flex-shrink: 0;
}
.filters-btn:hover {
    /* Border darkens to neutral --ink-3 on hover (not brand) so the hover
       edge stays visible on every brand — a brand border would vanish on
       light/dark brands, making the button look like it LOSES its outline
       on hover. The brand-tint-strong wash carries the brand-flavoured
       hover on saturated brands. */
    background: var(--brand-tint-strong);
    border-color: var(--ink-3);
}
.filters-btn:focus-visible {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-ring);
}
.filters-btn i { font-size: 16px; color: var(--brand); }
.filters-count {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--brand);
    color: var(--brand-on);
    font-size: 11px;
    font-weight: 700;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
}
.filters-count[hidden] { display: none; }

/* ─── Right-side icon group ─── */
/* .nav-actions is hidden in v3 (the dark-mode toggle that lived here
   was removed per VP review 2026-05-28). Kept the rule so adding
   anything back later just needs the display flip — flex + auto
   margin still describe the intended layout when it's populated. */
/* Once the careers-menu hamburger lives in here, flip nav-actions to
   flex so it lays out alongside the search / filters / phone group.
   :has() keeps the original "hidden when empty" rule for tenants
   that don't ship extra pages.
   margin-left: 0 (overriding the original auto) is critical — .nav-phone
   already carries margin-left: auto to absorb the row's slack and pin
   itself flush right. If .nav-actions ALSO carried auto, the slack would
   split between the two siblings and the phone pill would float into
   the middle of the row. Keeping auto only on .nav-phone lets phone +
   hamburger sit as one adjacent pair at the right edge. */
.nav-actions { display: none; align-items: center; gap: 4px; margin-left: auto; }
.nav-actions:has(.cwv3-careers-menu) {
    display: inline-flex;
    margin-left: 0;
}
/* Phone-absent fallback. brand.js::applyCompanyPhone writes the pill's
   inline `display: none;` (no tracking number resolved) or
   `display: inline-flex;` (number present). When it's hidden the pill
   leaves the flex flow and its margin-left:auto goes with it, so the
   hamburger group collapses left against the filters button. When the
   phone is hidden, move the auto margin onto .nav-actions so the
   hamburger still pins flush right. Higher specificity than the
   margin-left:0 rule above, so it wins; reverts automatically the moment
   brand.js flips the pill back to inline-flex. */
.nav-phone[style*="display: none"] ~ .nav-actions:has(.cwv3-careers-menu) {
    margin-left: auto;
}
.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--ink-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 120ms ease;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn i { font-size: 18px; }

/* ─── Careers-pages kebab (nav-actions slot) ───
   Tenant-curated "Other pages" menu — surfaces the same data v2 careerweb
   and the LP shells render, styled here in the v3 token language rather
   than mirroring the LP's Bootstrap dropdown. Compact Chrome-style kebab:
   a bare vertical-dots glyph with NO resting chip, so it keeps a tight
   footprint next to the wider Filters chip instead of reading as a second
   full-size button. Hover / open paint a subtle brand-tint pill for
   affordance; height matches the 40px row so it centers against
   .filters-btn / .nav-phone. */
.cwv3-careers-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.cwv3-careers-trigger {
    /* Bare Chrome-style kebab at rest — just the dots, no chip / resting
       background, minimal width so it sits tight against the phone pill.
       Height matches the 40px row for centering. The 1px border is
       transparent at rest (box-sizing keeps the width fixed); pale brands
       colour it in on hover — see tokens.css. */
    width: 26px;
    height: 40px;
    padding: 0;
    box-sizing: border-box;
    border-radius: var(--radius);
    background: transparent;
    border: 1px solid transparent;
    color: var(--ink);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
    flex-shrink: 0;
}
.cwv3-careers-trigger i { font-size: 20px; color: var(--ink-2); transition: color 140ms ease; }
/* Hover / open: an accent (brand) tint fills behind the dots and the dots
   darken to ink — that fade IS the hover cue. On saturated ("dark") brands
   the tint reads on its own; on pale brands (body.brand-light) the tint is
   too faint against white, so tokens.css colours the border in to give the
   highlight an edge ("accent + border for light"). */
.cwv3-careers-trigger:hover,
.cwv3-careers-trigger[aria-expanded="true"] { background: var(--brand-tint-strong); }
.cwv3-careers-trigger:hover i,
.cwv3-careers-trigger[aria-expanded="true"] i { color: var(--ink); }
.cwv3-careers-trigger:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--brand-ring);
}

/* Dropdown panel — anchored to the trigger's right edge so the menu
   never spills off-screen on tenants whose nav crowds the right side.
   Floats above the joblist with the same elevation/shape as the
   filters modal but smaller. */
.cwv3-careers-list {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 220px;
    max-width: 320px;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 32px -12px rgba(14, 14, 14, 0.18),
                0 4px 12px -4px rgba(14, 14, 14, 0.10);
    z-index: 1000;
    /* Enter animation — short fade + lift. Honours reduced-motion. */
    animation: cwv3-careers-pop 140ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.cwv3-careers-list[hidden] { display: none; }

@keyframes cwv3-careers-pop {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .cwv3-careers-list { animation: none; }
}

.cwv3-careers-list li { margin: 0; padding: 0; }
.cwv3-careers-link {
    display: block;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--ink);
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    line-height: 1.35;
    transition: background 100ms ease, color 100ms ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cwv3-careers-link:hover,
.cwv3-careers-link:focus-visible {
    background: var(--brand-tint);
    color: var(--brand);
    outline: none;
}

/* Mobile — match the rest of the action-row sizing. Trigger keeps
   40px so its hit target stays comfortable; menu widens to fit. */
@media (max-width: 768px) {
    .cwv3-careers-list { min-width: 180px; max-width: 80vw; }
}
