/* index.css — DESIGN-VISION-MP flagship rework: recruitment list.

   Presentation-layer elevation on the Cerebro DS. Function, data and
   behaviour unchanged — every JS hook (.listing/[data-kind]/[data-id],
   .save-button, .c-disclosure, skeleton grid, hidden toggles) preserved.

   Proposed DS amendments implemented app-side (see LANE-REPORT-VISION.md §4):
   --c-type-display (36px display step beyond --c-type-metric 28px) and
   --c-shadow-card (deeper hero-surface elevation). They ride on page-scoped
   --v-* vars so nothing silently forks the token file. */

.c-theme {
  /* Proposed --c-type-display: 36px — the price numerals' headline step. */
  --v-type-display: 36px;
  --v-shadow-card: inset 0 1px 0 rgb(255 255 255 / .05), 0 20px 54px rgb(0 0 0 / .46), 0 5px 16px rgb(0 0 0 / .3);
  --v-card-face: linear-gradient(180deg, rgb(255 255 255 / .028), transparent 36%);
}

/* ---------- base (what styles.css used to own) ---------- */
body { margin:0; background-color:var(--c-surface-canvas); background-image:
  radial-gradient(1020px 500px at 50% -14%, color-mix(in srgb, var(--c-accent-base) 7%, transparent), transparent 72%),
  radial-gradient(860px 640px at 90% 114%, color-mix(in srgb, var(--c-status-info) 5%, transparent), transparent 74%),
  radial-gradient(132% 106% at 50% 40%, transparent 57%, rgb(0 0 0 / .38) 100%);
  background-attachment:fixed; font-synthesis:none; }
.icon-library { position:absolute; width:0; height:0; overflow:hidden; }
.c-theme button { touch-action:manipulation; }
/* shared/shell.js still emits legacy class="icon" SVGs into .shell-header
   and .shell-dialog; styles.css supplied their stroke/size base. Restated
   here on DS values until the shell adopts .c-icon (shell.css already owns
   the 18px nav/menu-button sizes and loads after this file). */
.shell-header .icon, .shell-dialog .icon { fill:none; stroke:currentColor; stroke-width:1.5; stroke-linecap:round; stroke-linejoin:round; flex:none; }
.shell-dialog .icon { width:var(--c-size-icon); height:var(--c-size-icon); }
/* .c-theme resets h1–h4/p margins but not dl/dd — the conditions list needs it. */
.conditions dd { margin:0; }

/* Mobile inputs need ≥16px to avoid iOS focus zoom (A15/C9 page duty). */
@media (max-width:560px) {
  .search-field .c-input, .inquiry-body .c-textarea { font-size:16px !important; }
}

/* ---------- page heading / search ---------- */
.page-heading { display:flex; justify-content:space-between; align-items:flex-end; flex-wrap:wrap; gap:var(--c-space-16) var(--c-space-28); padding-block:var(--c-space-32) var(--c-space-24); }
/* Chrome title: metric step (was detail 21) — the listings' price numerals
   own the display step; chrome stays one rung below content. */
.page-heading h1 { font-size:var(--c-type-metric); letter-spacing:var(--c-track-title); font-weight:var(--c-weight-medium); text-wrap:balance; }
.search-field { width:260px; margin-inline-start:auto; }

/* ---------- surface tabs: cross-page nav pills (no DS primitive — these
   are links to other routes, not a tablist; kept page-owned, token-driven) ---------- */
.surface-tabs { display:flex; gap:var(--c-space-6); width:fit-content; padding:var(--c-space-4); margin-bottom:var(--c-space-20); background:var(--c-surface-well); border:1px solid var(--c-border-default); border-radius:var(--c-radius-round); box-shadow:inset 0 1px 3px rgb(0 0 0 / .35), inset 0 -1px 0 rgb(255 255 255 / .03); }
.surface-tabs a { min-width:72px; min-height:var(--c-size-control-large); display:grid; place-items:center; padding:0 var(--c-space-24); border-radius:var(--c-radius-round); text-decoration:none; color:var(--c-text-secondary); font-size:var(--c-type-body); transition:color var(--c-motion-fast) var(--c-motion-ease), background-color var(--c-motion-fast) var(--c-motion-ease), transform var(--c-motion-press) var(--c-motion-ease); }
.surface-tabs a[aria-current="page"] { background:var(--c-material-selected-face); color:var(--c-accent-text); box-shadow:inset 0 0 0 1px var(--c-accent-border); font-weight:var(--c-weight-semibold); }
@media (hover:hover) {
  .surface-tabs a:not([aria-current="page"]):hover { color:var(--c-text-primary); background:var(--c-surface-hover); }
  .surface-tabs a[aria-current="page"]:hover { color:var(--c-accent-text); }
}
@media (pointer:coarse) { .surface-tabs a { min-height:var(--c-size-touch); } }
/* Press dips the pill — ungated so touch gets feedback too. */
.surface-tabs a:active { transform:scale(.96); }

/* ---------- toolbar / counts / error ---------- */
.toolbar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:var(--c-space-10) var(--c-space-12); border-bottom:1px solid var(--c-border-default); }
.results-note { display:flex; justify-content:space-between; gap:var(--c-space-12); margin-block:var(--c-space-16); color:var(--c-text-muted); font-size:var(--c-type-meta); }
/* The live count earns a half-step of emphasis — it is the screen's answer. */
#result-count { color:var(--c-text-secondary); font-weight:var(--c-weight-medium); font-variant-numeric:tabular-nums; }
#listing-save-error { margin:var(--c-space-16) 0; }

/* ---------- listing grid + cards (.c-surface supplies chrome;
   .listing adds the flagship elevation — shadow + face gradient) ---------- */
.listing-grid { display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:var(--c-space-16); align-items:start; }
.listing { min-width:0; padding:var(--c-inset-detail); overflow:hidden; box-shadow:var(--v-shadow-card); background-image:var(--v-card-face); }
.transport { grid-column:1 / -1; }
@media (max-width:680px) {
  .listing { padding:var(--c-space-10) var(--c-space-20) var(--c-space-20); }
  .skel-card { padding:var(--c-space-10) var(--c-space-20) var(--c-space-20); }
}
.listing-topline { display:flex; align-items:center; gap:var(--c-space-12); min-height:var(--c-size-touch); margin-bottom:var(--c-space-16); }
.type-label { font-size:var(--c-type-label); font-weight:var(--c-weight-semibold); letter-spacing:var(--c-track-title); color:var(--c-text-primary); }
.publisher { display:inline-flex; align-items:center; gap:var(--c-space-8); color:var(--c-text-secondary); font-size:var(--c-type-meta); }
.role-label { font-size:var(--c-type-meta); color:var(--c-text-muted); }
.save-button { flex:0 0 auto; margin-right:0; }
.save-button[aria-pressed="true"] { color:var(--c-accent-text); }
.save-button[aria-pressed="true"] .c-icon { fill:currentColor; }

/* transport journey */
.journey { display:grid; grid-template-columns:auto minmax(80px,1fr) auto; align-items:center; gap:var(--c-space-28); padding:0 var(--c-space-12) var(--c-space-28); }
.endpoint-label { font-size:var(--c-type-label); color:var(--c-text-secondary); display:flex; gap:var(--c-space-10); align-items:center; letter-spacing:var(--c-track-title); }
.endpoint-label span { color:var(--c-text-primary); }
.city { margin-block:var(--c-space-8) var(--c-space-12); font-size:var(--c-type-metric); font-weight:var(--c-weight-medium); letter-spacing:var(--c-track-title); line-height:var(--c-lh-tight); }
.schedule { display:flex; gap:var(--c-space-10); align-items:baseline; font-size:var(--c-type-body); font-variant-numeric:tabular-nums; }
.schedule small { color:var(--c-text-secondary); font-size:var(--c-type-meta); margin-left:var(--c-space-2); }
/* Times are decision data — promoted from panel 15 to detail 21. */
.schedule strong { font-weight:var(--c-weight-medium); font-size:var(--c-type-detail); letter-spacing:var(--c-track-title); }
.route-graphic { align-self:center; margin-top:var(--c-space-6); position:relative; }
.route-graphic::before, .route-graphic::after { content:""; position:absolute; bottom:10px; width:6px; height:6px; border:1px solid var(--c-text-secondary); background:var(--c-surface-panel); border-radius:50%; }
.route-graphic::before { left:-2px; } .route-graphic::after { right:-2px; }
.route-graphic > span { display:flex; justify-content:center; align-items:center; gap:var(--c-space-8); color:var(--c-text-secondary); font-size:var(--c-type-meta); letter-spacing:var(--c-track-eyebrow); }
.route-graphic .c-icon { width:var(--c-size-icon-small); height:var(--c-size-icon-small); }
.route { display:block; width:100%; height:64px; overflow:visible; margin-top:var(--c-space-4); }
.route-track { stroke:var(--c-border-strong); stroke-width:1; }
.route-dashes { stroke:var(--c-text-secondary); stroke-width:1.3; stroke-dasharray:2 7; }
/* The dashes drift almost imperceptibly — the route quietly suggests flow.
   dasharray period is 9px; -18 offset loops two periods seamlessly. Dies
   under reduced-motion via the DS animation gate. */
@keyframes v-route-drift { to { stroke-dashoffset:-18; } }
.route-dashes { animation:v-route-drift 9s linear infinite; }

/* cargo band — promoted from hairline rows to a recessed well strip that
   bleeds to the card edges, so the card reads in material zones. */
.cargo-line { display:flex; justify-content:space-between; align-items:center; gap:var(--c-space-16); padding:var(--c-space-16) var(--c-space-20); margin-inline:calc(-1 * var(--c-space-20)); background:var(--c-surface-well); border-top:1px solid var(--c-border-subtle); border-bottom:1px solid var(--c-border-subtle); }
.cargo-description > strong { font-size:var(--c-type-panel); font-weight:var(--c-weight-semibold); }
.cargo-description > strong span { font-size:var(--c-type-label); margin-left:var(--c-space-8); font-weight:var(--c-weight-regular); color:var(--c-text-secondary); }
.cargo-description p { margin-top:var(--c-space-8); color:var(--c-text-secondary); font-size:var(--c-type-label); line-height:var(--c-lh-tight); }
.separator { margin-inline:var(--c-space-6); color:var(--c-text-muted); }
.quantity { display:flex; flex-direction:column; align-items:flex-end; gap:var(--c-space-6); flex:0 0 auto; font-size:var(--c-type-meta); color:var(--c-text-secondary); }
.quantity strong { color:var(--c-text-primary); font-size:var(--c-type-label); font-weight:var(--c-weight-medium); }
.pallets { display:flex; gap:var(--c-space-4); }
.pallets i { width:17px; height:17px; border:1px solid var(--c-text-muted); border-radius:var(--c-radius-small); position:relative; }
.pallets i::after { content:""; position:absolute; left:-1px; right:-1px; bottom:3px; border-bottom:1px solid var(--c-text-muted); }

/* price line (shared by all three card kinds) — the commercial anchor.
   Numerals take the proposed display step; units and tax notes stay quiet. */
.price-line { display:flex; align-items:center; justify-content:space-between; gap:var(--c-space-14); padding-block:var(--c-space-20); }
.price { display:flex; align-items:baseline; flex-wrap:wrap; gap:var(--c-space-8); }
.price-label { color:var(--c-text-secondary); font-size:var(--c-type-meta); margin-right:var(--c-space-4); }
.price > strong { font-size:var(--v-type-display); font-weight:var(--c-weight-medium); letter-spacing:var(--c-track-title); line-height:var(--c-lh-tight); font-variant-numeric:tabular-nums; }
.price > strong.negotiable { font-size:var(--c-type-detail); }
.price > strong > span { font-size:var(--c-type-body); margin-left:var(--c-space-4); letter-spacing:0; }
.tax, .availability { font-size:var(--c-type-meta); color:var(--c-text-secondary); }

/* place card */
.place-heading, .vehicle-heading { display:flex; align-items:center; justify-content:space-between; gap:var(--c-space-12); }
.place h2, .vehicle h2 { font-size:var(--c-type-detail); letter-spacing:var(--c-track-title); font-weight:var(--c-weight-medium); text-wrap:balance; }
.place-heading p, .vehicle-heading p { margin-top:var(--c-space-8); color:var(--c-text-secondary); font-size:var(--c-type-meta); line-height:var(--c-lh-base); }
.duration { display:flex; flex-direction:column; align-items:center; flex:0 0 auto; padding-left:var(--c-space-12); }
.duration strong { font-size:var(--c-type-metric); font-weight:var(--c-weight-medium); letter-spacing:var(--c-track-title); line-height:var(--c-lh-tight); font-variant-numeric:tabular-nums; }
.duration span { font-size:var(--c-type-meta); margin-top:var(--c-space-4); color:var(--c-text-secondary); }
.time-window { padding-block:var(--c-space-24) var(--c-space-20); }
.time-window > p { color:var(--c-text-secondary); font-size:var(--c-type-meta); margin-bottom:var(--c-space-8); letter-spacing:var(--c-track-eyebrow); }
.time-window > p > span { margin-left:var(--c-space-4); }
.time-points { display:flex; align-items:center; gap:var(--c-space-16); }
.time-points time { font-size:var(--c-type-detail); font-weight:var(--c-weight-regular); letter-spacing:var(--c-track-title); line-height:var(--c-lh-tight); font-variant-numeric:tabular-nums; }
.time-rule { flex:1; height:1px; background:var(--c-text-secondary); position:relative; }
.time-rule::before, .time-rule::after { content:""; position:absolute; top:-3px; width:1px; height:7px; background:var(--c-text-secondary); }
.time-rule::before { left:0; } .time-rule::after { right:0; }
.place-requirements { font-size:var(--c-type-label); color:var(--c-text-secondary); padding-bottom:var(--c-space-20); border-bottom:1px solid var(--c-border-subtle); line-height:var(--c-lh-loose); }
.place-requirements strong { font-weight:var(--c-weight-regular); color:var(--c-text-primary); }

/* vehicle card */
.vehicle-year { display:flex; flex-direction:column; align-items:flex-end; font-size:var(--c-type-detail); font-weight:var(--c-weight-regular); gap:var(--c-space-4); }
.vehicle-year span { font-size:var(--c-type-meta); color:var(--c-text-secondary); }
/* DS media frame: .c-ratio-4x3 reserves the box (truck.png is 3:2 — 4:3 is
   the nearest DS ratio; object-fit:cover crops ~11% of the width).
   A hairline frame + radius gives the photo a printed-print feel. */
.vehicle-photo { width:min(80%,250px); margin:-5px 0 var(--c-space-8) auto; border:1px solid var(--c-border-default); border-radius:var(--c-radius-group); overflow:hidden; }
.vehicle-photo .c-skel-content { transform:scale(1.04); transition:opacity var(--c-motion-fast) ease, transform .8s var(--c-motion-ease); }
.vehicle-photo .c-skel-content.is-loaded { transform:scale(1); }
.vehicle-specs { display:flex; align-items:flex-end; gap:var(--c-space-28); padding-bottom:var(--c-space-20); border-bottom:1px solid var(--c-border-subtle); }
.vehicle-specs p { display:flex; flex-direction:column; gap:var(--c-space-6); }
.vehicle-specs p > span { color:var(--c-text-secondary); font-size:var(--c-type-meta); }
.vehicle-specs strong { font-size:var(--c-type-detail); font-weight:var(--c-weight-regular); line-height:var(--c-lh-tight); }
.vehicle-specs strong span { font-size:var(--c-type-meta); margin-left:var(--c-space-4); }
.photo-note { margin-left:auto; font-size:var(--c-type-meta); color:var(--c-text-secondary); }

/* ---------- inquiry: .c-disclosure owns the chrome; these rules only
   retune the interior composition inside the listing card ---------- */
.inquiry { margin:var(--c-space-16) 0 0; border:0; }
.inquiry .open-label { display:none; }
.inquiry [aria-expanded="true"] .open-label { display:inline; }
.inquiry [aria-expanded="true"] .closed-label { display:none; }
.inquiry-body { padding:var(--c-space-8) var(--c-space-12) var(--c-space-12); background:transparent; }
.inquiry-body .c-label { display:block; margin:var(--c-space-16) 0 var(--c-space-8); }
.conditions { margin:0 0 var(--c-space-20); font-size:var(--c-type-label); }
.conditions > div { display:flex; align-items:baseline; justify-content:space-between; gap:var(--c-space-20); padding-block:var(--c-space-10); border-bottom:1px solid var(--c-border-subtle); }
.conditions > div:last-child { border-bottom:0; }
.conditions dt { color:var(--c-text-secondary); }
.conditions dd { text-align:right; }
.draft-actions { display:flex; align-items:center; justify-content:space-between; gap:var(--c-space-14); margin-top:var(--c-space-12); flex-wrap:wrap; }
.draft-note { color:var(--c-text-secondary); font-size:var(--c-type-meta); }
.draft-action-group { display:flex; align-items:center; gap:var(--c-space-14); }
.copy-status { color:var(--c-text-secondary); font-size:var(--c-type-meta); }
.copy-status:not(:empty) { margin-top:var(--c-space-12); }

/* ---------- skeleton (same grid tracks as the real list → CLS-free swap) ---------- */
/* Skeleton cards carry the same elevation as .listing so the dissolve→reveal
   swap doesn't change the surface the eye is tracking. */
.skel-card { padding:var(--c-inset-detail); display:flex; flex-direction:column; gap:var(--c-space-12); min-width:0; box-shadow:var(--v-shadow-card); background-image:var(--v-card-face); }
/* Designed swap: the skeleton dissolves on the exit ease (~190ms token)
   before app.js reveals the real grid + stagger. transform+opacity only. */
.listing-skel-grid { transition:opacity var(--c-motion-exit) var(--c-motion-out), transform var(--c-motion-exit) var(--c-motion-out); }
.listing-skel-grid.is-dissolving { opacity:0; transform:scale(.985); pointer-events:none; }
.skel-transport { grid-column:1 / -1; }
.skel-top { display:flex; align-items:center; gap:var(--c-space-12); }
.skel-journey { display:grid; grid-template-columns:1fr auto 1fr; align-items:center; gap:var(--c-space-24); }
.skel-lines { display:flex; flex-direction:column; gap:var(--c-space-8); }
.skel-rule { display:flex; align-items:center; justify-content:space-between; gap:var(--c-space-12); padding:var(--c-space-10) 0; border-top:1px solid var(--c-border-subtle); border-bottom:1px solid var(--c-border-subtle); }
@media (max-width:680px) {
  .skel-journey { grid-template-columns:1fr 1fr; }
}

/* ---------- no-JS fallback ----------
   With scripting disabled the <noscript><p> in index.html parses into the
   DOM (with JS it stays raw text), so main:has(> noscript p) detects the
   fallback: hide the eternal skeleton/status and un-hide the static grid —
   the three listings are plain markup and need no JS to render. */
main:has(> noscript p) .listing-skel-grid,
main:has(> noscript p) #listing-status { display:none; }
main:has(> noscript p) #listing-grid { display:grid !important; }

/* ---------- empty state ---------- */
#empty-state { margin-top:var(--c-space-16); }

/* ---------- hover affordances (pointer-gated per DS A4) ---------- */
@media (hover:hover) {
  .listing { transition:box-shadow var(--c-motion-fast) var(--c-motion-ease), border-color var(--c-motion-fast) var(--c-motion-ease), transform var(--c-motion-fast) var(--c-motion-ease); }
  .listing:hover { transform:translateY(-2px); border-color:var(--c-border-strong); box-shadow:inset 0 1px 0 rgb(255 255 255 / .06), 0 32px 72px rgb(0 0 0 / .55), 0 8px 22px rgb(0 0 0 / .38); }
}

/* ---------- ≤680px ---------- */
@media (max-width:680px) {
  .page-heading { gap:var(--c-space-16); align-items:center; padding-block:var(--c-space-20) var(--c-space-14); }
  .page-heading h1 { font-size:var(--c-type-detail); }
  .search-field { width:200px; }
  .surface-tabs { margin-bottom:var(--c-space-16); }
  .results-note { margin-block:var(--c-space-14); }
  .listing-grid { grid-template-columns:minmax(0,1fr); gap:var(--c-space-14); }
  .listing-topline { margin-bottom:var(--c-space-14); }
  .journey { position:relative; gap:var(--c-space-16); padding:0 0 var(--c-space-20); grid-template-columns:repeat(2, minmax(0,1fr)); }
  .city { margin-block:var(--c-space-8) var(--c-space-32); }
  .destination { text-align:right; grid-column:2; }
  .destination .endpoint-label { justify-content:flex-end; }
  .destination .schedule { justify-content:flex-end; }
  .schedule { flex-wrap:wrap; gap:var(--c-space-4) var(--c-space-8); font-size:var(--c-type-label); }
  /* The arc floats over the endpoint grid (absolute), so its lane must be
     bounded by the whitespace between the city block (~70px) and the
     schedule line (~102px). The 24px arc + endpoint dots bottomed out
     ~15px above the date line; the 20px lane recentres the composition
     and guarantees ~20px clearance inside the same gap. */
  .route-graphic { position:absolute; left:3px; right:3px; top:64px; margin-top:0; }
  .route-graphic > span { display:none; }
  .route { height:20px; margin-top:0; }
  .route-graphic::before, .route-graphic::after { bottom:2px; }
  .cargo-line { gap:var(--c-space-16); align-items:flex-start; flex-direction:column; padding-block:var(--c-space-16); }
  .quantity { flex-direction:row; align-items:center; width:100%; justify-content:space-between; }
  .pallets { gap:var(--c-space-4); }
  .pallets i { width:18px; height:16px; }
  .price-line { padding-block:var(--c-space-16); }
  .price > strong { font-size:32px; }
  .availability { display:none; }
}

/* ---------- ≤360px ---------- */
@media (max-width:360px) {
  .page-heading { gap:var(--c-space-14); }
  .page-heading h1 { font-size:var(--c-type-panel); }
  .journey { gap:var(--c-space-12); }
  .separator { margin-inline:var(--c-space-4); }
  .price > strong { font-size:30px; }
  .pallets i { width:15px; }
  .place-heading p { max-width:160px; }
  #saved-filter > span:not(.c-count) { display:none; }
  #saved-filter { min-width:var(--c-size-touch); }
}
