/* =====================================================================
   صفحة «الوظائف» (jobs.html, 22 Nov) — التحالف الوطني | NACDW v2
   Data: nacdw.org/jobs (pages-src/jobs.json). Owner's choice «و١»: search + filter chips by field on top,
   one quiet row per job that opens to the description and the two links (apply / job file).
   Hero = the shared photo hero (site.css .hero + pages-areas.css #mj .mj-hero), like «البرامج والمبادرات».
   Tokens only (site.css + #mj in pages-areas.css). No shadows on the rows, no orange bars; medium weights.
   ===================================================================== */

/* ---------- hero: same height as the programs hero ---------- */
.jb-hero .hero-bg{ object-position:22% 40%; }   /* 22 Nov: owner's photo — the volunteers stand on the left, the copy sits over the street on the right */
@media (min-width:981px){
  .jb-hero .hero-grid{ padding-top:150px; padding-bottom:56px; }
}

.jb-sr{ position:absolute!important; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
#mj ol.jb-list{ margin:0; padding:0; list-style:none; }
#mj .jb-sec{ padding:80px 0 96px; }
#mj .jb-sec .wrap{ max-width:1180px; }

/* ---------- tools: search + chips ---------- */
#mj .jb-tools{ display:grid; gap:18px; }
#mj .jb-search{ position:relative; display:block; }
#mj .jb-search > svg{ position:absolute; inset-inline-start:20px; top:50%; width:20px; height:20px; transform:translateY(-50%); color:var(--medium); pointer-events:none; }
#mj .jb-search input{ width:100%; height:56px; box-sizing:border-box; padding:0 56px; border:1px solid var(--line); border-radius:999px; background:#fff;
  font:inherit; font-size:16px; color:var(--dark); transition:border-color .2s; -webkit-appearance:none; appearance:none; }
#mj .jb-search input::placeholder{ color:var(--medium); }
#mj .jb-search input::-webkit-search-cancel-button{ display:none; }
#mj .jb-search input:hover{ border-color:#C9D6D3; }
#mj .jb-search input:focus{ outline:none; border-color:var(--base); }
#mj .jb-search input:focus-visible{ outline:2px solid var(--base); outline-offset:2px; }
#mj .jb-clear{ position:absolute; inset-inline-end:10px; top:50%; transform:translateY(-50%); width:38px; height:38px; border:0; border-radius:50%;
  background:var(--soft); color:var(--base); display:grid; place-items:center; cursor:pointer; }
#mj .jb-clear[hidden]{ display:none; }
#mj .jb-clear svg{ width:16px; height:16px; }
#mj .jb-clear:hover{ background:#E4ECEA; }

#mj .jb-chips{ display:flex; flex-wrap:wrap; gap:10px; }
#mj .jb-chip{ display:inline-flex; align-items:center; gap:8px; height:42px; padding:0 18px; border:1px solid var(--line); border-radius:999px; background:#fff;
  font:inherit; font-size:15px; font-weight:500; color:var(--body); cursor:pointer; transition:background .2s, border-color .2s, color .2s; }
#mj .jb-chip span{ font-size:13px; color:var(--medium); font-variant-numeric:tabular-nums; transition:color .2s; }
#mj .jb-chip:hover{ border-color:var(--base); color:var(--base); }
#mj .jb-chip[aria-pressed="true"]{ background:var(--base); border-color:var(--base); color:#fff; }
#mj .jb-chip[aria-pressed="true"] span{ color:rgba(255,255,255,.75); }
#mj .jb-chip:disabled{ opacity:.45; cursor:default; border-color:var(--line); color:var(--body); }

/* status (المتاحة / المنتهية / الكل) + sort, right above the list */
#mj .jb-bar{ display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; margin:36px 0 16px; }
#mj .jb-seg{ display:inline-flex; padding:4px; border-radius:999px; background:var(--soft); }
#mj .jb-seg button{ display:inline-flex; align-items:center; gap:8px; height:40px; padding:0 20px; border:0; border-radius:999px; background:none;
  font:inherit; font-size:15px; font-weight:500; color:var(--body); cursor:pointer; transition:background .2s, color .2s, box-shadow .2s; }
#mj .jb-seg button span{ font-size:13px; color:var(--medium); font-variant-numeric:tabular-nums; }
#mj .jb-seg button:hover{ color:var(--base); }
#mj .jb-seg button[aria-pressed="true"]{ background:#fff; color:var(--base); font-weight:600; box-shadow:0 1px 4px rgba(14,91,82,.1); }
#mj .jb-seg button[aria-pressed="true"] span{ color:var(--base); }
#mj .jb-seg button:focus-visible{ outline:2px solid var(--base); outline-offset:2px; }
#mj .jb-sort{ display:inline-flex; align-items:center; gap:10px; font-size:14.5px; color:var(--medium); }
#mj .jb-sort select{ height:44px; padding:0 40px 0 16px; border:1px solid var(--line); border-radius:999px; font:inherit; font-size:15px; color:var(--dark); cursor:pointer;
  -webkit-appearance:none; appearance:none; background:#fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230E5B52' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center / 16px; }
#mj .jb-sort select:hover{ border-color:#C9D6D3; }
#mj .jb-sort select:focus-visible{ outline:2px solid var(--base); outline-offset:2px; }

/* ---------- rows ---------- */
#mj .jb-list{ display:grid; gap:12px; }
#mj .jb-row{ border:1px solid var(--line); border-radius:var(--r-md); background:#fff; transition:border-color .25s, background .25s; }
#mj .jb-row[hidden]{ display:none; }
#mj .jb-row:hover{ border-color:#C9D6D3; }
#mj .jb-row.open{ border-color:var(--base); }
#mj .jb-row h3{ margin:0; font-size:inherit; }
#mj .jb-q{ width:100%; display:grid; grid-template-columns:minmax(0,1fr) auto 40px; align-items:center; gap:24px; padding:20px 26px; border:0; background:none;
  font:inherit; text-align:start; cursor:pointer; border-radius:inherit; }
#mj .jb-q:focus-visible{ outline:2px solid var(--base); outline-offset:-2px; }
#mj .jb-t{ font-size:17.5px; font-weight:600; line-height:1.6; color:var(--dark); transition:color .2s; }
#mj .jb-q:hover .jb-t, #mj .jb-row.open .jb-t{ color:var(--base); }
#mj .jb-main{ display:grid; gap:6px; min-width:0; }
#mj .jb-meta{ display:flex; flex-wrap:wrap; align-items:center; gap:6px 20px; font-size:13.5px; font-weight:500; color:var(--medium); }
#mj .jb-g{ color:var(--base); }
#mj .jb-d{ display:inline-flex; align-items:center; gap:6px; }
#mj .jb-d svg{ width:15px; height:15px; flex:none; }
/* status badge */
#mj .jb-st{ font-size:13.5px; font-weight:600; white-space:nowrap; }
#mj .jb-st > span{ display:inline-flex; align-items:center; gap:7px; height:32px; padding:0 14px; border-radius:999px; }
#mj .jb-st .on{ background:#E3F3EF; color:var(--base); }
#mj .jb-st .on::before{ content:""; width:7px; height:7px; border-radius:50%; background:var(--teal-c); }
#mj .jb-st .off{ display:none; background:#F0F2F2; color:var(--medium); }
#mj .jb-row.is-closed .jb-st .on{ display:none; }
#mj .jb-row.is-closed .jb-st .off{ display:inline-flex; }
/* closed job: quieter row, no apply link (the job file stays) */
#mj .jb-row.is-closed{ background:#FAFBFB; }
#mj .jb-row.is-closed .jb-t{ color:var(--medium); }
#mj .jb-row.is-closed .jb-q:hover .jb-t, #mj .jb-row.is-closed.open .jb-t{ color:var(--body); }
#mj .jb-row.is-closed .jb-dl{ text-decoration:line-through; text-decoration-color:rgba(107,122,119,.5); }
#mj .jb-c{ width:40px; height:40px; border-radius:50%; display:grid; place-items:center; background:var(--soft); color:var(--base); transition:background .25s, color .25s; }
#mj .jb-c svg{ width:18px; height:18px; transition:transform .35s var(--ease); }
#mj .jb-row.open .jb-c{ background:var(--base); color:#fff; }
#mj .jb-row.open .jb-c svg{ transform:rotate(-180deg); }

/* open / close: height animates through a grid row (0fr ↔ 1fr) */
#mj .jb-a{ display:grid; grid-template-rows:0fr; transition:grid-template-rows .35s var(--ease); }
#mj .jb-a[hidden]{ display:none; }
#mj .jb-row.open .jb-a{ grid-template-rows:1fr; }
#mj .jb-in{ overflow:hidden; min-height:0; }
#mj .jb-in p{ margin:0 26px; padding-top:18px; border-top:1px solid var(--line-2); font-size:16px; line-height:1.95; color:var(--body); }
#mj .jb-act{ display:flex; flex-wrap:wrap; gap:12px; padding:22px 26px 26px; }
#mj .jb-btn{ display:inline-flex; align-items:center; gap:10px; height:46px; padding:0 24px; border-radius:999px; font-size:15px; font-weight:600; text-decoration:none;
  border:1.5px solid var(--base); transition:background .2s, color .2s, border-color .2s; }
#mj .jb-btn svg{ width:18px; height:18px; }
#mj .jb-apply{ background:var(--base); color:#fff; }
#mj .jb-apply:hover{ background:var(--base-2); border-color:var(--base-2); }
#mj .jb-info{ background:#fff; color:var(--base); }
#mj .jb-info:hover{ background:var(--soft); }
#mj .jb-btn:focus-visible{ outline:2px solid var(--base); outline-offset:3px; }
/* closed job (22 Nov, owner): no apply link; a plain line of text in its place, not a button. Open jobs never show it. */
#mj .jb-act .jb-shut{ display:none; align-items:center; gap:8px; font-size:15px; font-weight:500; color:var(--medium); }
#mj .jb-shut svg{ width:18px; height:18px; flex:none; }
#mj .jb-row.is-closed .jb-act .jb-apply{ display:none; }
#mj .jb-row.is-closed .jb-act .jb-shut{ display:inline-flex; order:2; }

#mj .jb-empty{ margin-top:8px; padding:40px 24px; text-align:center; border:1px dashed var(--line); border-radius:var(--r-md); color:var(--medium); }
#mj .jb-empty[hidden]{ display:none; }

@media (max-width:980px){
  #mj .jb-sec{ padding:64px 0 72px; }
}
@media (max-width:767px){
  #mj .jb-chips{ flex-wrap:nowrap; overflow-x:auto; margin-inline:calc(-1 * var(--gr)); padding-inline:var(--gr); scrollbar-width:none; }
  #mj .jb-chips::-webkit-scrollbar{ display:none; }
  #mj .jb-chip{ flex:none; }
  #mj .jb-q{ grid-template-columns:minmax(0,1fr) 36px; gap:12px 14px; padding:16px 18px; }
  #mj .jb-main{ grid-column:1; grid-row:2; }
  #mj .jb-st{ grid-column:1; grid-row:1; justify-self:start; font-size:12.5px; }
  #mj .jb-st > span{ height:28px; padding:0 12px; }
  #mj .jb-t{ font-size:16px; }
  #mj .jb-meta{ flex-direction:column; align-items:flex-start; gap:4px; font-size:13px; }
  #mj .jb-c{ grid-column:2; grid-row:1 / span 2; width:36px; height:36px; }
  #mj .jb-bar{ margin-top:28px; }
  #mj .jb-seg{ width:100%; }
  #mj .jb-seg button{ flex:1; justify-content:center; padding:0 10px; }
  #mj .jb-sort{ width:100%; justify-content:space-between; }
  #mj .jb-in p{ margin:0 18px; font-size:15.5px; }
  #mj .jb-act{ padding:18px 18px 20px; }
  #mj .jb-btn{ flex:1 1 auto; justify-content:center; }
}
@media (prefers-reduced-motion:reduce){
  #mj .jb-a, #mj .jb-c svg{ transition:none; }
}
