/**
 * v3 careerweb — main grid + job list + cards + load-more.
 *
 * Two-column grid (400px sticky list / 1fr detail) on desktop. Mobile
 * stacks them — handled in responsive.css with a list-then-detail
 * swap so only one is visible at a time.
 */

/* ─── Main grid container ─── */
.main {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 24px;
    padding: 0 32px 32px;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
    align-items: start;
}

/* ─── List wrap — sticky + scrollable ─── */
.joblist-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: sticky;
    top: 88px;  /* nav (~62px sticky) + results-meta */
    max-height: calc(100vh - 104px);
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-2) transparent;
}
.joblist-wrap::-webkit-scrollbar { width: 6px; }
.joblist-wrap::-webkit-scrollbar-thumb {
    background: var(--border-2);
    border-radius: 3px;
}
.joblist {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ─── Card ─── */
.jobcard {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 18px 16px;
    cursor: pointer;
    transition: all 160ms ease;
    position: relative;
    overflow: hidden;
}
/* Brand strip on the active card's left edge — animated in via the
   .active class so the user gets a clear "this is selected" cue. */
.jobcard::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: transparent;
    transition: background 160ms ease;
}
.jobcard:hover {
    border-color: var(--border-2);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
/* Keyboard focus indicator — brand-tinted ring for Tab users. We use
   :focus-visible so the ring only appears on keyboard nav, not on
   mouse click (which already shows .active styling). The negative
   outline-offset tucks the ring just inside the rounded corner so it
   reads as part of the card chrome rather than a stray system rect. */
.jobcard:focus { outline: none; }
.jobcard:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: -2px;
    box-shadow: var(--shadow-md), 0 0 0 4px var(--brand-ring);
}
.jobcard.active {
    background: var(--brand-tint);
    border-color: var(--brand);
}
.jobcard.active::before { background: var(--brand); }
/* When the active card is also the focused one, drop the extra
   ring — the brand border + strip + tint background already shout
   "this is selected" loudly enough without doubling up. */
.jobcard.active:focus-visible {
    box-shadow: var(--shadow-md);
    outline-color: var(--brand);
}

/* Per-card company chip — multi-tenant only. Single-tenant pages
   carry the brand in the nav and would only repeat themselves.
   joblist.js gates this render on an empty boot.companyId. */
.jobcard-company {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 700;
}
.jobcard-company-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: contain;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 4px;
    flex-shrink: 0;
}
.jobcard-company-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    letter-spacing: -0.01em;
}

.jobcard-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}
.jobcard-title {
    font-family: 'Archivo', sans-serif;
    font-weight: 700;
    font-size: 15px;
    color: var(--ink);
    line-height: 1.3;
    letter-spacing: -0.01em;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.jobcard-loc {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--ink-2);
    margin-bottom: 12px;
}
.jobcard-loc i { font-size: 13px; }

/* ─── Distance pill — top-right corner, shown when the list call
       carried userCoords. The mini pin icon reads as a peer of the
       location row below, so the eye can connect "this job is X
       miles from your spot" without a label. ─── */
.jobcard-distance {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 8px;
    font-family: 'Geist', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: var(--ink-2);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    letter-spacing: 0.01em;
    white-space: nowrap;
}
.jobcard-distance i { font-size: 11px; line-height: 1; }
.jobcard.active .jobcard-distance {
    background: var(--surface);
    border-color: var(--brand);
    color: var(--brand);
}

.jobcard-pay {
    font-family: 'Archivo', sans-serif;
    font-weight: 800;
    font-size: 24px;
    color: var(--ink);
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 4px;
}
.jobcard-pay-unit {
    font-family: 'Geist', sans-serif;
    font-size: 12px;
    color: var(--ink-3);
    font-weight: 400;
    margin-left: 4px;
    letter-spacing: 0;
}
.jobcard-pay-empty {
    font-size: 13px;
    color: var(--ink-3);
    font-style: italic;
    margin-bottom: 4px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.jobcard-pay-empty i { font-size: 14px; }

.jobcard-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}
.meta-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: var(--surface-2);
    border-radius: 6px;
    font-size: 11px;
    color: var(--ink-2);
    font-weight: 500;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.meta-tag i { font-size: 12px; }
.meta-tag-more {
    color: var(--ink-3);
    background: transparent;
    border: 1px dashed var(--border-2);
}

.jobcard-desc {
    margin-top: 12px;
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--ink-2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ─── Load more ─── */
.load-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    background: var(--surface);
    border: 1px dashed var(--border-2);
    border-radius: var(--radius);
    color: var(--ink);
    font-family: 'Archivo', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 120ms ease;
    margin-top: 4px;
}
.load-more:hover {
    background: var(--brand-tint);
    border-color: var(--brand);
    border-style: solid;
}
.load-more i { font-size: 16px; }
.load-more:disabled { opacity: 0.6; cursor: not-allowed; }
.load-more[hidden] { display: none; }
