/* ==========================================================================
   Job Board  —  .jobs-*
   Loaded by: jobs.html
   ========================================================================== */

.jobs-hero {
  padding: 120px 0 56px;
  background: linear-gradient(135deg, #eff6ff 0%, #fff7ed 100%);
  text-align: center;
}

body.dark-mode .jobs-hero {
  background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
}

.jobs-hero-title {
  font-family: "Poppins", sans-serif;
  font-size: 3rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 18px;
}

.jobs-section {
  padding: 48px 0 72px;
  scroll-margin-top: 90px;
}

/* --- Filters --- */

.jobs-filters {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto;
  gap: 16px;
  align-items: end;
  padding: 22px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
}

body.dark-mode .jobs-filters {
  background: #1f2937;
  border-color: #374151;
  box-shadow: none;
}

.jobs-filter-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.jobs-filter-field label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-light);
}

.jobs-filter-field input,
.jobs-filter-field select {
  width: 100%;
  padding: 11px 13px;
  font-family: inherit;
  font-size: 0.94rem;
  color: var(--text-dark);
  background-color: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.jobs-filter-field input:focus,
.jobs-filter-field select:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

body.dark-mode .jobs-filter-field input,
body.dark-mode .jobs-filter-field select {
  background-color: #111827;
  border-color: #4b5563;
  color: #f9fafb;
}

.jobs-reset {
  padding: 11px 20px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-light);
  background: transparent;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease;
}

.jobs-reset:hover {
  color: var(--primary-blue);
  border-color: var(--primary-blue);
  background-color: rgba(59, 130, 246, 0.06);
}

body.dark-mode .jobs-reset {
  border-color: #4b5563;
  color: #d1d5db;
}

/* --- Summary + states --- */

.jobs-summary {
  margin: 26px 0 18px;
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--text-light);
  min-height: 22px;
}

.jobs-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-light);
}

.jobs-state[hidden] {
  display: none;
}

.jobs-state-error {
  color: #b91c1c;
}

body.dark-mode .jobs-state-error {
  color: #fca5a5;
}

.jobs-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(59, 130, 246, 0.2);
  border-top-color: var(--primary-blue);
  border-radius: 50%;
  animation: jobs-spin 0.8s linear infinite;
}

@keyframes jobs-spin {
  to {
    transform: rotate(360deg);
  }
}

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

.jobs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 20px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.jobs-grid[hidden] {
  display: none;
}

.job-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.job-card:hover {
  transform: translateY(-4px);
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.1);
}

body.dark-mode .job-card {
  background: #1f2937;
  border-color: #374151;
}

.job-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.job-category {
  padding: 4px 11px;
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary-blue);
  background: rgba(59, 130, 246, 0.1);
  border-radius: 999px;
}

.job-posted {
  font-size: 0.78rem;
  color: var(--text-light);
  white-space: nowrap;
}

.job-title {
  font-family: "Poppins", sans-serif;
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 0;
}

/* The card's title and "View posting" are `<a>` elements with no `href` while
   the outbound Wanted links are disabled (see renderCard in jobs.js). The
   resting appearance is unchanged; the hover states are gone deliberately,
   because a colour shift or an underline on something that cannot be clicked
   promises a navigation that will not happen. A browser gives `cursor: pointer`
   only to `a[href]`, so the cursor already stays default on its own. */
.job-title a {
  color: inherit;
  text-decoration: none;
}

.job-company {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent-orange);
  margin: 0;
}

.job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 0.86rem;
  color: var(--text-light);
}

.job-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.job-tag {
  padding: 3px 9px;
  font-size: 0.74rem;
  color: var(--text-light);
  background: #f3f4f6;
  border-radius: 6px;
}

body.dark-mode .job-tag {
  background: #374151;
  color: #d1d5db;
}

.job-card-foot {
  display: flex;
  align-items: center;
  /* `space-between` kept the reward at the left and the CTA at the right. With
     the reward gone the CTA is the only child, and space-between would park it
     at the left edge, so it is pinned right explicitly to keep the card's
     shape. */
  justify-content: flex-end;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid #f3f4f6;
}

body.dark-mode .job-card-foot {
  border-top-color: #374151;
}

.job-apply {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary-blue);
  text-decoration: none;
  white-space: nowrap;
}

/* --- Pagination --- */

.jobs-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 40px;
}

.jobs-pagination[hidden] {
  display: none;
}

.jobs-page-numbers {
  display: flex;
  align-items: center;
  gap: 6px;
}

.jobs-page-btn,
.jobs-page-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 40px;
  height: 40px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dark);
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  cursor: pointer;
  transition:
    color 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease;
}

.jobs-page-number {
  padding: 0 10px;
}

.jobs-page-btn:hover:not(:disabled),
.jobs-page-number:hover:not(.active) {
  color: var(--primary-blue);
  border-color: var(--primary-blue);
  background-color: rgba(59, 130, 246, 0.06);
}

.jobs-page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.jobs-page-number.active {
  color: #ffffff;
  background: var(--primary-blue);
  border-color: var(--primary-blue);
  cursor: default;
}

body.dark-mode .jobs-page-btn,
body.dark-mode .jobs-page-number {
  background: #1f2937;
  border-color: #4b5563;
  color: #f9fafb;
}

body.dark-mode .jobs-page-number.active {
  background: var(--primary-blue);
  border-color: var(--primary-blue);
}

.jobs-page-gap {
  padding: 0 4px;
  color: var(--text-light);
}

/* --- CTA --- */

.jobs-cta {
  padding: 0 0 80px;
}

.jobs-cta-card {
  padding: 48px 32px;
  text-align: center;
  background: linear-gradient(135deg, var(--primary-blue) 0%, #2563eb 100%);
  border-radius: 22px;
  color: #ffffff;
}

.jobs-cta-card h2 {
  font-family: "Poppins", sans-serif;
  font-size: 1.9rem;
  font-weight: 800;
  margin-bottom: 12px;
  color: #ffffff;
}

.jobs-cta-card p {
  max-width: 560px;
  margin: 0 auto 26px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.9);
}

.jobs-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}

.jobs-cta-actions .btn-primary {
  background: #ffffff;
  color: var(--primary-blue);
}

.jobs-cta-actions .btn-secondary {
  border: 2px solid rgba(255, 255, 255, 0.85);
  color: #ffffff;
}

/* Six controls on one row need ~1200px before the selects start clipping
   their longest option, so the search box gets its own row below that. */
@media (max-width: 1200px) {
  .jobs-filters {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .jobs-filter-search {
    grid-column: 1 / -1;
  }

  .jobs-reset {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 1024px) {
  .jobs-filters {
    grid-template-columns: repeat(2, 1fr);
  }

  .jobs-filter-search {
    grid-column: 1 / -1;
  }

  .jobs-reset {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .jobs-hero {
    padding: 100px 0 40px;
  }

  .jobs-hero-title {
    font-size: 2.2rem;
  }

  .jobs-filters {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .jobs-grid {
    grid-template-columns: 1fr;
  }

  .jobs-page-btn span:not([aria-hidden]) {
    display: none;
  }

  .jobs-page-btn {
    padding: 0 12px;
  }

  .jobs-cta-card {
    padding: 34px 20px;
  }
}
