/* =========================================================
   CAREER / JOBS
   Mobile-first. Desktop rules are layered on at >=768px.
   ========================================================= */

.career-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 15px;
}

/* ---------- Hero ---------- */
.career-hero {
  margin: 0 0 20px;
  padding: 26px 15px;
  background: linear-gradient(135deg, #8e1b19, #5d1110);
  color: #fff;
  border-radius: 4px;
}

.career-hero h1 {
  margin: 0 0 6px;
  font-size: 1.35rem;
  line-height: 1.3;
}

.career-hero p {
  margin: 0 0 16px;
  font-size: .92rem;
  opacity: .92;
}

.career-search {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.career-search input {
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: 3px;
  /* 16px keeps iOS from zooming the viewport on focus */
  font-size: 16px;
}

.career-search button {
  padding: 11px 20px;
  background: #ffd24a;
  color: #4a0f0e;
  border: 0;
  border-radius: 3px;
  font-weight: 800;
  font-size: .95rem;
  cursor: pointer;
}

.career-search button:hover { background: #ffc61f; }

/* ---------- Type tabs ---------- */
.career-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.career-tab {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 8px;
  background: #fff;
  border: 1px solid #e0dcd4;
  border-radius: 3px;
  color: #2b2b2b;
  font-weight: 700;
  font-size: .88rem;
  text-align: center;
  text-decoration: none;
}

.career-tab.is-active,
.career-tab:hover {
  background: #8e1b19;
  border-color: #8e1b19;
  color: #fff;
}

.career-tab .count {
  padding: 1px 7px;
  background: rgba(0, 0, 0, .12);
  border-radius: 10px;
  font-size: .8rem;
}

.career-tab.is-active .count,
.career-tab:hover .count { background: rgba(255, 255, 255, .22); }

/* ---------- Section headings ---------- */
.career-section { margin-bottom: 26px; }

.career-section > h2 {
  margin: 0 0 12px;
  padding-bottom: 7px;
  border-bottom: 2px solid #8e1b19;
  font-size: 1.05rem;
}

/* ---------- Job cards ---------- */
.job-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.job-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e6e2da;
  border-radius: 4px;
  overflow: hidden;
}

.job-card.is-closing { border-left: 3px solid #c62828; }

.job-card .job-thumb {
  display: block;
  /* Reserve the box before the image decodes so nothing jumps */
  aspect-ratio: 16 / 9;
  background: #f0eee9;
}

.job-card .job-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.job-card-body { padding: 12px 13px 14px; }

.job-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 7px;
}

.job-badge {
  padding: 2px 8px;
  border-radius: 2px;
  color: #fff;
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.job-badge.government { background: #2e7d32; }
.job-badge.private { background: #1565c0; }
.job-badge.expired { background: #c62828; }

.job-card h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  line-height: 1.35;
}

.job-card h3 a {
  color: #8e1b19;
  text-decoration: none;
}

.job-card h3 a:hover { text-decoration: underline; }

.job-org {
  margin: 0 0 9px;
  color: #666;
  font-size: .85rem;
}

.job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 14px;
  margin-bottom: 10px;
  color: #555;
  font-size: .8rem;
}

/* The deadline is the thing readers scan for, so keep it visually distinct */
.job-deadline {
  display: block;
  margin-bottom: 10px;
  padding: 7px 9px;
  background: #fff7e6;
  border-left: 3px solid #e8a317;
  font-size: .82rem;
}

.job-deadline strong { color: #9a5b00; }
.job-deadline.is-urgent { background: #fdecea; border-left-color: #c62828; }
.job-deadline.is-urgent strong { color: #b71c1c; }

.job-apply {
  display: block;
  min-height: 44px;
  padding: 11px 16px;
  background: #8e1b19;
  border-radius: 3px;
  color: #fff;
  font-weight: 700;
  font-size: .9rem;
  text-align: center;
  text-decoration: none;
}

.job-apply:hover { background: #6f1513; color: #fff; }
.job-apply.is-disabled {
  background: #ddd8d0;
  color: #7a7a7a;
  pointer-events: none;
}

/* ---------- Listing rows ---------- */
.job-list { display: grid; gap: 12px; }

.job-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 13px;
  background: #fff;
  border: 1px solid #e6e2da;
  border-radius: 4px;
}

.job-row-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #f0eee9;
  border-radius: 3px;
  overflow: hidden;
}

.job-row-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.job-row-main { min-width: 0; }

.job-row-side { flex-shrink: 0; }

/* ---------- Toolbar ---------- */
.career-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px;
  background: #faf9f6;
  border: 1px solid #e6e2da;
  border-radius: 4px;
}

.career-toolbar label {
  font-size: .85rem;
  font-weight: 700;
}

.career-toolbar select {
  width: 100%;
  padding: 10px;
  border: 1px solid #d8d3ca;
  border-radius: 3px;
  font-size: 16px;
}

/* ---------- Categories ---------- */
.career-cats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.career-cat {
  padding: 12px 10px;
  background: #fff;
  border: 1px solid #e6e2da;
  border-radius: 3px;
  color: #2b2b2b;
  font-size: .85rem;
  text-align: center;
  text-decoration: none;
}

.career-cat:hover { border-color: #8e1b19; color: #8e1b19; }
.career-cat .n { display: block; color: #8e1b19; font-weight: 800; font-size: 1.1rem; }

/* ---------- Detail page ---------- */
.job-detail-head {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e6e2da;
}

.job-detail-head h1 {
  margin: 0 0 8px;
  font-size: 1.3rem;
  line-height: 1.3;
}

.job-facts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 14px 0;
}

.job-fact {
  padding: 9px 11px;
  background: #faf9f6;
  border: 1px solid #eceae4;
  border-radius: 3px;
}

.job-fact .k {
  display: block;
  color: #8e1b19;
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.job-fact .v { font-size: .92rem; }

.job-notice {
  margin: 14px 0;
  padding: 12px;
  background: #fdecea;
  border-left: 3px solid #c62828;
  border-radius: 3px;
  color: #b71c1c;
  font-size: .9rem;
}

.job-section { margin-bottom: 22px; }

.job-section h2 {
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid #8e1b19;
  font-size: 1.05rem;
}

.job-section .rich { font-size: .95rem; line-height: 1.75; }

.job-figure { margin: 0 0 18px; }

.job-figure img {
  display: block;
  width: 100%;
  height: auto;
  background: #f0eee9;
  border-radius: 4px;
}

.job-figure figcaption {
  margin-top: 6px;
  color: #666;
  font-size: .82rem;
}

.job-figure .credit {
  margin-left: 5px;
  color: #999;
  font-style: italic;
}

.job-links { margin: 0; padding: 0; list-style: none; }
.job-links li { margin-bottom: 8px; }

.job-links a {
  display: block;
  padding: 11px 13px;
  background: #faf9f6;
  border: 1px solid #e0dcd4;
  border-radius: 3px;
  color: #8e1b19;
  font-weight: 600;
  font-size: .9rem;
  text-decoration: none;
}

.job-links a:hover { background: #8e1b19; border-color: #8e1b19; color: #fff; }

.job-share {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.job-share a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: #8e1b19;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.job-share a:hover { background: #6f1513; color: #fff; }

/* ---------- Pagination ---------- */
.career-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin-top: 22px;
}

.career-pager a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  background: #8e1b19;
  border-radius: 3px;
  color: #fff;
  font-weight: 700;
  font-size: .88rem;
  text-decoration: none;
}

.career-pager a:hover { background: #6f1513; color: #fff; }
.career-pager .pos { color: #666; font-size: .85rem; }

.career-empty {
  padding: 40px 18px;
  background: #faf9f6;
  border: 1px solid #e6e2da;
  border-radius: 4px;
  color: #666;
  text-align: center;
}

/* =========================================================
   TABLET / DESKTOP
   ========================================================= */
@media (min-width: 768px) {
  .career-wrap { padding: 0 20px; }

  .career-hero { padding: 44px 30px; }
  .career-hero h1 { font-size: 2rem; }
  .career-hero p { font-size: 1.02rem; }

  .career-search {
    flex-direction: row;
    max-width: 560px;
  }

  .career-search input { flex: 1; }
  .career-search button { flex: 0 0 auto; }

  .career-tabs { gap: 12px; }
  .career-tab { flex: 0 1 240px; font-size: .95rem; }

  .career-section > h2 { font-size: 1.25rem; }

  .job-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }

  .job-row {
    flex-direction: row;
    align-items: flex-start;
    gap: 16px;
    padding: 16px;
  }

  .job-row-thumb { flex: 0 0 170px; width: 170px; }

  .job-row-main { flex: 1; }

  .job-row-side {
    width: 210px;
    text-align: right;
  }

  .career-toolbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .career-toolbar select { width: auto; min-width: 220px; }

  .career-cats { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }

  .job-detail-head h1 { font-size: 1.85rem; }

  .job-facts { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }

  .job-apply { display: inline-block; min-width: 220px; }
}

@media (min-width: 1024px) {
  .career-hero h1 { font-size: 2.3rem; }
}
