/* ==========================================================================
   ZedHome — Job posting page (jobs/detail.php)
   A thin layer over components.css: the page reuses its breadcrumb banner,
   profile-header card, detail-layout and contact-card exactly like the employer
   and professional profile pages, so a job reads as part of the same site. This
   file only adds what a posting needs: the overview grid, a readable description,
   the deadline chip and the apply card's dates. Tokens only; no new colours.
   ========================================================================== */

/* ---- Header card: see company.css (co-head); only the closed tag is specific to a posting ----- */
.job-closed-tag {
  display: inline-flex; align-items: center; padding: 11px 18px; border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  background: var(--color-paper); font-size: 0.875rem; font-weight: 700; color: var(--color-text-soft); white-space: nowrap;
}

/* ---- Overview grid: one box, hairline-divided cells ------------------------------- */
.job-facts {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; overflow: hidden;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md);
}
/* each cell draws its own right and bottom hairline; the box's edge clips the outer ones, so any count of cells tiles cleanly */
.job-fact { min-width: 0; padding: 18px 20px; box-shadow: 1px 0 0 0 var(--color-border), 0 1px 0 0 var(--color-border); }
.job-fact dt { margin: 0 0 7px; font-size: var(--fs-2xs, 0.6875rem); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-text-soft); }
.job-fact dd { margin: 0; font-size: 1rem; font-weight: 700; line-height: 1.35; color: var(--color-ink); overflow-wrap: anywhere; }
.job-fact dd small { display: block; margin-top: 5px; font-size: 0.8125rem; font-weight: 500; color: var(--color-text-soft); }
.job-fact--salary dd { font-family: var(--font-display); font-size: 1.1875rem; color: var(--color-brand-dark); }
.job-fact__none { font-weight: 500; color: var(--color-text-soft); }
/* a last cell that would sit alone in its row stretches across the rest of it, so the box never shows a hole */
.job-fact:last-child:nth-child(3n+1) { grid-column: span 3; }
.job-fact:last-child:nth-child(3n+2) { grid-column: span 2; }

/* ---- Description -------------------------------------------------------------------- */
.job-desc p { max-width: 68ch; margin: 0 0 1.05em; font-size: 1.0625rem; line-height: 1.75; text-wrap: pretty; }
.job-desc > :last-child { margin-bottom: 0; }
.job-desc ul { max-width: 68ch; margin: 0 0 1.15em; padding: 0; list-style: none; }
.job-desc li { position: relative; margin: 9px 0; padding-left: 22px; font-size: 1.0625rem; line-height: 1.65; }
.job-desc li::before { content: ""; position: absolute; left: 2px; top: 0.72em; width: 7px; height: 7px; border-radius: 50%; background: var(--color-brand); }
.job-desc__lead { font-weight: 700; color: var(--color-ink); }
.job-muted { margin: 0; font-size: 0.9375rem; line-height: 1.6; color: var(--color-text-soft); }
.job-employer-link { margin: 14px 0 0; }

/* ---- Apply card ----------------------------------------------------------------------- */
.job-apply__title { margin: 0 0 14px; font-size: 1.125rem; }
.job-apply__dates { display: grid; gap: 10px; margin: 0 0 16px; padding: 0 0 16px; border-bottom: 1px solid var(--color-border); }
.job-apply__dates > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 0.875rem; }
.job-apply__dates dt { margin: 0; font-weight: 600; color: var(--color-text-soft); }
.job-apply__dates dd { margin: 0; font-weight: 700; color: var(--color-ink); text-align: right; }
.job-apply .job-muted { margin-bottom: 4px; }
.job-company .contact-card__person { margin-bottom: 14px; }
.job-company .contact-card__note { margin-top: 14px; }

/* ---- Smaller screens -------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .job-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .job-fact:last-child:nth-child(3n+1), .job-fact:last-child:nth-child(3n+2) { grid-column: auto; }
  .job-fact:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .job-fact { padding: 15px 16px; }
  .job-fact--salary { grid-column: 1 / -1; }
  .job-closed-tag { flex: 1 1 0; justify-content: center; }
}

/* ---- Qualifications & requirements: a plain checklist ---- */
.job-quals { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.job-quals li { display: flex; align-items: flex-start; gap: 10px; max-width: 68ch; font-size: 1.0625rem; line-height: 1.6; color: var(--color-text); }
.job-quals svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 4px; padding: 2px; border-radius: 50%; background: var(--color-verified-light); color: var(--color-verified); stroke-width: 3; }

/* ---- Similar jobs: two job cards side by side (one on phones), auto-sliding when there are more ---- */
/* contain: inline-size stops the off-screen cards from widening the page column on phones. */
.auto-slider__viewport { overflow: hidden; overflow: clip; contain: inline-size paint; }
.detail-layout > .detail-main { min-width: 0; }
.auto-slider__track { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.auto-slider.is-ready .auto-slider__track { display: flex; will-change: transform; }
.auto-slider.is-ready .auto-slider__item { flex: 0 0 calc((100% - 16px) / 2); min-width: 0; }
.auto-slider__item > .card { height: 100%; }
.job-similar__more { margin: 20px 0 0; }
.job-similar__more .btn svg { width: 16px; height: 16px; }
@media (max-width: 640px) {
  .auto-slider__track { grid-template-columns: minmax(0, 1fr); }
  .auto-slider.is-ready .auto-slider__item { flex-basis: 100%; }
  .job-similar__more .btn { width: 100%; }
}
