/* Job board — layered on top of the tokens defined in styles.css. */

.site-nav a.current { color: var(--ink); }
.site-nav a.current::after { width: 100%; }

/* ---------------------------------------------------------------- heading */

.board-head { max-width: 620px; }
.board-head h1 { margin: 12px 0 10px; font-size: clamp(2.1rem, 5vw, 3.1rem); font-weight: 800; line-height: 1.15; }
.board-head h1 em { font-style: normal; color: var(--teal); }
.board-head > p { margin: 0; max-width: 520px; color: var(--muted); font-size: .86rem; line-height: 1.85; }

/* ---------------------------------------------------------------- filters */

.board-filters {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 14px; margin-top: 26px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 18px;
  background: var(--glass); backdrop-filter: blur(14px);
}

.city-chips { display: flex; flex-wrap: wrap; gap: 8px; }

/*
 * Both of these are empty in the markup and filled by jobs.js, so without a
 * reserved height the whole board slid down the moment the feed landed — 55px
 * of shift on top of the grid's own. The values are measured: the chip row
 * wraps to two lines under 1000px, three under 500px and four under 375px.
 */
.city-chips { min-height: 41px; }
@media (max-width: 999px) { .city-chips { min-height: 90px; } }
@media (max-width: 499px) { .city-chips { min-height: 130px; } }
@media (max-width: 374px) { .city-chips { min-height: 176px; } }
.board-status { min-height: 22px; }
.city-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted); background: transparent; cursor: pointer;
  font: 600 .76rem "Noto Kufi Arabic", Inter, sans-serif;
  transition: color .2s, border-color .2s, background .2s, transform .2s;
}
.city-chip:hover { color: var(--ink); border-color: var(--teal); transform: translateY(-1px); }
.city-chip b { font-weight: 800; }
.city-chip i {
  min-width: 20px; padding: 1px 6px; border-radius: 999px;
  background: var(--teal-light); color: var(--teal);
  font: 700 .64rem Inter, sans-serif; font-style: normal; text-align: center;
}
.city-chip[aria-pressed="true"] { color: var(--white); background: var(--ink); border-color: var(--ink); }
.city-chip[aria-pressed="true"] i { color: var(--ink); background: var(--gold); }
[data-theme="dark"] .city-chip[aria-pressed="true"] { color: #071d22; background: #edf8f7; border-color: #edf8f7; }

.filter-inputs { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }

.search-field, .select-field {
  display: flex; align-items: center; gap: 8px;
  height: 40px; padding-inline: 12px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); color: var(--muted);
  transition: border-color .2s;
}
.search-field:focus-within, .select-field:focus-within { border-color: var(--teal); }
.search-field svg, .select-field svg { width: 16px; flex: 0 0 auto; }
.search-field input, .select-field select {
  min-width: 0; border: 0; outline: 0; background: none; color: var(--ink);
  font: 500 .78rem "Noto Kufi Arabic", Inter, sans-serif;
}
.search-field input { width: 190px; }
.search-field input::-webkit-search-cancel-button { filter: grayscale(1) opacity(.5); }
.select-field { position: relative; padding-inline-end: 8px; }
.select-field select { appearance: none; padding-inline-end: 4px; cursor: pointer; }
.select-field select option { color: #082f38; background: #fff; }

.board-status { margin: 18px 2px 0; color: var(--muted); font: 600 .72rem Inter, "Noto Kufi Arabic", sans-serif; }

/* ------------------------------------------------------------------ cards */

.job-grid {
  display: grid; gap: 14px; margin-top: 14px;
  grid-template-columns: repeat(auto-fill, minmax(315px, 1fr));
}

.job-card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 18px 18px 15px;
  border: 1px solid var(--line); border-radius: 18px;
  background: var(--card); box-shadow: 0 10px 30px rgba(5, 46, 54, .05);
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.job-card:hover { transform: translateY(-3px); border-color: var(--teal); box-shadow: var(--shadow); }
[data-theme="dark"] .job-card { box-shadow: none; }

.job-card > header { display: flex; align-items: flex-start; gap: 12px; }
.job-title { margin: 0; flex: 1; font-size: .96rem; font-weight: 800; line-height: 1.45; }
.job-age { flex: 0 0 auto; margin-top: 2px; color: var(--muted); font: 600 .62rem Inter, sans-serif; white-space: nowrap; }

.job-company { display: flex; align-items: center; gap: 7px; color: var(--teal); font-size: .78rem; font-weight: 700; }
.job-company svg { width: 14px; flex: 0 0 auto; }

.job-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.job-tags li {
  padding: 4px 10px; border-radius: 8px;
  background: var(--teal-light); color: var(--teal);
  font: 600 .66rem "Noto Kufi Arabic", Inter, sans-serif;
}
.job-tags .is-city { color: var(--ink); background: var(--line); }
/* "$1,200 monthly" must not be re-ordered by the surrounding RTL paragraph. */
.job-tags .is-salary { color: #6b4f14; background: rgba(201, 162, 85, .26); direction: ltr; unicode-bidi: isolate; }
[data-theme="dark"] .job-tags .is-salary { color: #e7c988; background: rgba(215, 182, 110, .18); }

.job-summary {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3;
  overflow: hidden; margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.8;
}

.job-card > footer { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 4px; }
.job-open {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border: 0; border-radius: 10px;
  color: var(--white); background: var(--ink); cursor: pointer;
  font: 700 .72rem "Noto Kufi Arabic", Inter, sans-serif;
  transition: background .2s;
}
.job-open:hover { background: var(--teal); }
[data-theme="dark"] .job-open { color: #071d22; background: #edf8f7; }

.job-quick { display: flex; gap: 6px; margin-inline-start: auto; }
.job-quick a {
  display: grid; place-items: center; width: 32px; height: 32px;
  border: 1px solid var(--line); border-radius: 9px; color: var(--muted);
  transition: color .2s, border-color .2s, transform .2s;
}
.job-quick a:hover { color: var(--teal); border-color: var(--teal); transform: translateY(-1px); }
.job-quick svg { width: 15px; }

.today-toggle {
  display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto;
  height: 40px; padding-inline: 13px;
  border: 1px solid var(--line); border-radius: 12px;
  color: var(--muted); background: var(--card); cursor: pointer;
  font: 600 .76rem "Noto Kufi Arabic", Inter, sans-serif;
  transition: color .2s, border-color .2s, background .2s;
}
.today-toggle svg { width: 15px; flex: 0 0 auto; }
.today-toggle i {
  min-width: 20px; padding: 1px 6px; border-radius: 999px;
  background: var(--teal-light); color: var(--teal);
  font: 700 .64rem Inter, sans-serif; font-style: normal; text-align: center;
}
.today-toggle[aria-checked="true"] { color: var(--white); background: var(--ink); border-color: var(--ink); }
.today-toggle[aria-checked="true"] i { color: var(--ink); background: var(--gold); }
[data-theme="dark"] .today-toggle[aria-checked="true"] { color: #071d22; background: #edf8f7; border-color: #edf8f7; }

/* ----------------------------------------------------- empty / pagination */

/* Both of these set `display`, so they need to opt back in to [hidden]. */
.board-empty[hidden], .pager[hidden] { display: none; }

.board-empty {
  display: grid; justify-items: center; gap: 8px;
  margin-top: 20px; padding: 54px 20px;
  border: 1px dashed var(--line); border-radius: 20px; text-align: center;
}
.board-empty svg { width: 34px; color: var(--gold); }
.board-empty strong { font-size: .95rem; }
.board-empty span { color: var(--muted); font-size: .78rem; }

.pager { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 26px; }
.pager button {
  display: grid; place-items: center;
  min-width: 38px; height: 38px; padding-inline: 10px;
  border: 1px solid var(--line); border-radius: 11px;
  color: var(--ink); background: var(--card); cursor: pointer;
  font: 700 .76rem Inter, sans-serif;
  transition: color .2s, border-color .2s, background .2s;
}
.pager button:hover:not(:disabled) { color: var(--teal); border-color: var(--teal); }
.pager button:disabled { opacity: .35; cursor: default; }
.pager-page[aria-current="page"] { color: var(--white); background: var(--ink); border-color: var(--ink); }
[data-theme="dark"] .pager-page[aria-current="page"] { color: #071d22; background: #edf8f7; border-color: #edf8f7; }
.pager-arrow svg { width: 16px; }
/* One chevron asset, pointed by direction: "previous" is on the right in RTL. */
.pager-prev svg { transform: scaleX(-1); }
.pager-next svg { transform: none; }
html[dir="ltr"] .pager-prev svg { transform: none; }
html[dir="ltr"] .pager-next svg { transform: scaleX(-1); }
.pager-gap { padding-inline: 2px; color: var(--muted); font: 700 .8rem Inter, sans-serif; }

/* --------------------------------------------------------------- skeleton */

/* Height is measured, not guessed: real cards run 270-335px tall and grid rows
   size to the tallest in the row, so these track the row height at each column
   count. Wrong here means a visible jump when the cards arrive. */
.job-skeleton { min-height: 300px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); overflow: hidden; position: relative; }
.job-skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(127, 172, 180, .13), transparent);
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .job-skeleton::after { animation: none; } }

/* ----------------------------------------------------------------- dialog */

.job-dialog {
  width: min(560px, calc(100% - 32px)); max-height: min(86svh, 760px);
  padding: 0; border: 1px solid var(--line); border-radius: 22px;
  color: var(--ink); background: var(--paper); box-shadow: var(--shadow);
  overflow: hidden;
}
.job-dialog::backdrop { background: rgba(6, 30, 36, .55); backdrop-filter: blur(3px); }
.job-dialog[open] { display: flex; }
.dialog-body { display: flex; flex-direction: column; gap: 12px; padding: 26px 26px 24px; overflow-y: auto; }
.dialog-close {
  position: absolute; inset-block-start: 14px; inset-inline-end: 14px;
  display: grid; place-items: center; width: 32px; height: 32px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%;
  color: var(--muted); background: var(--card); cursor: pointer;
}
.dialog-close:hover { color: var(--ink); }
.dialog-close svg { width: 15px; }
.dialog-body h2 { margin: 0; padding-inline-end: 34px; font-size: 1.12rem; font-weight: 800; line-height: 1.45; }
.dialog-body h3 { margin: 0; color: var(--muted); font-size: .82rem; font-weight: 600; line-height: 1.5; }
.dialog-body > p { margin: 0; font-size: .82rem; line-height: 1.9; }
.dialog-meta { display: grid; gap: 8px; padding: 14px 16px; border-radius: 14px; background: var(--teal-light); }
.dialog-meta div { display: flex; align-items: center; gap: 9px; font-size: .76rem; font-weight: 600; }
.dialog-meta svg { width: 15px; flex: 0 0 auto; color: var(--teal); }
.dialog-meta span { color: var(--muted); font-weight: 500; }

.apply-title { margin-top: 4px; color: var(--gold); font: 700 .72rem "Noto Kufi Arabic", Inter, sans-serif; letter-spacing: .02em; }
.apply-list { display: flex; flex-wrap: wrap; gap: 8px; }
.apply-list a {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  padding: 9px 14px; border: 1px solid var(--line); border-radius: 11px;
  background: var(--card); font: 600 .75rem Inter, "Noto Kufi Arabic", sans-serif;
  transition: border-color .2s, transform .2s;
}
.apply-list a:hover { border-color: var(--teal); transform: translateY(-1px); }
.apply-list a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; }
.apply-list svg { width: 15px; flex: 0 0 auto; color: var(--teal); }
.apply-note { margin: 0; color: var(--muted); font-size: .73rem; }

/* ------------------------------------------------------------- responsive */

/* two columns below 980px, one below 630px — the auto-fill breakpoints */
@media (max-width: 980px) { .job-skeleton { min-height: 285px; } }
@media (max-width: 630px) { .job-skeleton { min-height: 275px; } }

@media (max-width: 850px) {
  .site-nav { display: none; }
  .board-filters { padding: 12px; }
  .filter-inputs { width: 100%; margin-inline-start: 0; }
  .search-field { flex: 1; }
  .search-field input { width: 100%; }
}

@media (max-width: 560px) {
  .pager { flex-wrap: wrap; gap: 5px; }
  .pager button { min-width: 34px; height: 34px; padding-inline: 8px; }
  .board-head h1 { margin: 10px 0 8px; }
  .board-head > p { font-size: .8rem; line-height: 1.75; }
  .board-filters { margin-top: 20px; border-radius: 16px; }
  .city-chip { padding: 7px 12px; font-size: .72rem; }
  .filter-inputs { flex-direction: column; align-items: stretch; }
  .job-grid { grid-template-columns: 1fr; }
  .job-card { padding: 16px; border-radius: 16px; }
  .dialog-body { padding: 22px 20px; }
}
