/* Jobs List */
.jobs-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── 채용공고 등록 버튼 ── */
.jobs-actions-row .section-actions .btn-secondary {
  background: #1d4ed8;
  color: #fff;
  border-color: #1d4ed8;
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 600;
}

.jobs-actions-row .section-actions .btn-secondary:hover,
.jobs-actions-row .section-actions .btn-secondary:focus-visible {
  background: #1e40af;
  border-color: #1e40af;
}

.jobs-actions-row .section-actions .btn-secondary:active {
  background: #1e3a8a;
  border-color: #1e3a8a;
}

/* ── 채용공고 필터바 ── */
.jobs-search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  flex: 1;
}

.jobs-search-bar select {
  height: 42px;
  padding: 0 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.84rem;
  color: #374151;
  background: #fff;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}

.jobs-search-bar select:focus {
  border-color: #3b82f6;
}

body.page-primary-jobs .jobs-actions-row {
  margin-bottom: 14px;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

body.page-primary-jobs .jobs-actions-row .section-actions {
  margin-left: auto;
  display: flex;
  justify-content: flex-end;
}

@media (min-width: 901px) {
  body.page-primary-jobs .jobs-actions-row,
  body.page-primary-jobs #job-card-list {
    width: min(100%, 960px);
    margin-inline: auto;
  }
}

@media (max-width: 760px) {
  .jobs-search-bar {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-areas: "region type career status";
    gap: 8px;
    align-items: stretch;
  }

  #jobs-region-filter {
    grid-area: region;
  }

  #jobs-type-filter {
    grid-area: type;
  }

  #jobs-career-filter {
    grid-area: career;
  }

  #jobs-status-filter {
    grid-area: status;
  }

  .jobs-search-bar select {
    width: 100%;
    min-width: 0;
    padding: 0 8px;
    font-size: 0.82rem;
  }

  body.page-primary-jobs .jobs-actions-row .section-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

.job-item {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid #d5e0f0;
  border-radius: 10px;
  background: #fff;
  padding: 0;
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
  cursor: pointer;
  overflow: hidden;
}

.job-item:hover {
  box-shadow: 0 3px 12px rgba(31, 91, 182, 0.12);
  border-color: #a8bfdf;
}

/* Type Badge - 다양한 타입별 색상 */
.job-type-badge {
  display: inline-block;
  padding: 5px 11px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  min-width: 60px;
  text-align: center;
  /* Default: 기타 타입 */
  background: #f0f4f9;
  color: #516380;
}

.job-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 9px 18px 4px;
}

.job-date-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  align-self: flex-start;
  gap: 3px;
}

.job-dday {
  font-size: 0.96rem;
  font-weight: 800;
  color: #e64b7a;
  letter-spacing: 0.01em;
  background: #fff0f5;
  border: 1px solid #f7b8cd;
  border-radius: 4px;
  padding: 2px 8px;
  white-space: nowrap;
}

.job-reg-date {
  font-size: 0.78rem;
  color: #8a9dc0;
  white-space: nowrap;
}

/* 공설 - 파란색 */
.job-type-badge.tag-public {
  background: #e8f4f9;
  color: #1b6b9e;
}

/* 병원 - 녹색 */
.job-type-badge.tag-hospital {
  background: #e8f8f4;
  color: #1b7a5c;
}

/* 시립 - 주황색 */
.job-type-badge.tag-municipal {
  background: #fef5e8;
  color: #b86f00;
}

/* 사설 - 회색 */
.job-type-badge.tag-private {
  background: #f5f5f5;
  color: #424242;
}

/* 상조회사 - 보라색 */
.job-type-badge.tag-mutual-aid {
  background: #f5eff8;
  color: #8b3e6f;
}

/* 장지시설 - 갈색 */
.job-type-badge.tag-burial {
  background: #f8f0e8;
  color: #8b5d00;
}

/* Main Row */
.job-main-row {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 2.2fr) minmax(96px, 0.72fr) minmax(132px, 0.95fr) minmax(168px, 1fr) auto;
  gap: 12px;
  align-items: start;
  min-height: 60px;
  padding: 0 18px 14px;
  grid-template-areas: "company title region salary career action";
}

.job-company,
.job-title,
.job-salary,
.job-career-group,
.job-career,
.job-apply-type,
.job-region-text {
  align-self: center;
}

.job-company {
  grid-area: company;
}

.job-title {
  grid-area: title;
}

.job-region-text {
  grid-area: region;
}

.job-salary {
  grid-area: salary;
}

.job-career-group {
  grid-area: career;
}

.job-action-wrap {
  grid-area: action;
}

.job-career-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.job-company {
  margin: 0;
  color: #14213d;
  font-size: 0.96rem;
  font-weight: 400;
  line-height: 1.35;
  word-break: break-word;
}

.job-region-text {
  font-size: 0.88rem;
  font-weight: 500;
  color: #5a7ab0;
  white-space: nowrap;
  text-align: left;
}

.job-title {
  margin: 0;
  color: #1e3a5f;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.45;
  word-break: break-word;
}

.job-salary,
.job-career,
.job-apply-type {
  font-size: 0.92rem;
  color: #3d5a80;
  font-weight: 500;
}

.job-salary,
.job-career {
  white-space: nowrap;
}

.job-salary {
  text-align: left;
}

.job-apply-type {
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: anywhere;
  line-height: 1.4;
}

.job-action-wrap {
  display: flex;
  justify-content: center;
  align-self: center;
}

/* Apply Button */
.btn-apply {
  padding: 8px 0;
  min-width: 90px;
  width: 90px;
  border: 1px solid #2b5fb8;
  border-radius: 6px;
  background: #2b5fb8;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.18s ease, box-shadow 0.18s ease;
  white-space: nowrap;
  text-decoration: none;
  text-align: center;
  align-self: center;
  letter-spacing: 0.01em;
}

.btn-apply:hover {
  background: #1f467b;
  border-color: #1f467b;
  box-shadow: 0 2px 6px rgba(31, 70, 123, 0.3);
}

.btn-apply:active {
  opacity: 0.9;
}

/* Responsive */
@media (max-width: 1200px) {
  .job-main-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.8fr) minmax(88px, 0.7fr) minmax(120px, 0.9fr) minmax(152px, 0.95fr) auto;
    gap: 10px;
    padding: 8px 16px 12px;
    grid-template-areas: "company title region salary career action";
  }

  .job-company {
    font-size: 0.92rem;
  }

  .job-title {
    font-size: 1.02rem;
  }

  .job-region-text {
    font-size: 0.84rem;
  }

  .job-salary,
  .job-career,
  .job-apply-type {
    font-size: 0.86rem;
  }
}

@media (max-width: 980px) {
  .job-top-row {
    padding: 9px 14px;
  }

  .job-main-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "title action"
      "region action"
      "career action"
      "salary action";
    gap: 4px 10px;
    padding: 7px 14px 11px;
    align-items: flex-start;
  }

  .job-company {
    display: none;
  }

  .job-career-group {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
  }

  .job-career,
  .job-apply-type {
    white-space: nowrap;
  }

  .job-action-wrap {
    justify-content: center;
    align-self: center;
    padding-top: 2px;
  }

  .btn-apply {
    width: 82px;
    min-width: 82px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 680px) {
  .job-top-row {
    padding: 8px 12px;
  }

  .job-main-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "title action"
      "region action"
      "career action"
      "salary action";
    padding: 6px 12px 10px;
  }

  .job-type-badge {
    font-size: 0.7rem;
    padding: 3px 8px;
    min-width: 50px;
  }

  .job-title {
    font-size: 0.94rem;
  }

  .job-region-text {
    font-size: 0.8rem;
  }

  .job-salary,
  .job-career,
  .job-apply-type {
    font-size: 0.82rem;
  }

  .job-career-group {
    transform: none;
  }

  .job-salary {
    transform: none;
  }

  .btn-apply {
    padding: 7px 0;
    min-width: 78px;
    width: 78px;
    height: 40px;
    font-size: 0.78rem;
  }
}

/* Pagination */
.jobs-pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 24px 0 8px;
  flex-wrap: wrap;
}

.pag-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #c8d8ee;
  border-radius: 6px;
  background: #fff;
  color: #2b5fb8;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
  line-height: 1;
}

.pag-btn:hover:not([disabled]):not(.active) {
  background: #eef4ff;
  border-color: #2b5fb8;
}

.pag-btn.active {
  background: #2b5fb8;
  border-color: #2b5fb8;
  color: #fff;
  cursor: default;
}

.pag-btn[disabled] {
  color: #b0bec5;
  border-color: #e0e7ef;
  cursor: default;
  background: #f8fafc;
}

@media (max-width: 680px) {
  .pag-btn {
    min-width: 32px;
    height: 32px;
    font-size: 0.84rem;
    padding: 0 8px;
  }

  .jobs-pagination {
    gap: 4px;
    padding: 18px 0 6px;
  }
}
