/* 메인 페이지 채용공고 섹션 — 사이트 공통 토큰(base.css)을 사용하는 절제된 게시판 스타일 */
.jb-page {
  --jb-line: var(--border);
  --jb-soft: #f6f8fb;
  --jb-text: var(--text);
  --jb-muted: var(--text-muted);
  --jb-radius: 6px;
  --jb-control-h: 40px;
  --jb-fs-xl: 1.2rem;
  --jb-fs-lg: 1rem;
  --jb-fs-md: 0.9rem;
  --jb-fs-sm: 0.82rem;
  --jb-fs-xs: 0.74rem;
  color: var(--jb-text);
}

.jb-page button,
.jb-page input,
.jb-page select {
  font-family: inherit;
}

.jb-container {
  width: min(100% - 40px, 1280px);
}

/* ── 버튼 ── */
.jb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--jb-control-h);
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--jb-radius);
  font-size: var(--jb-fs-md);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s;
}

.jb-btn-light {
  background: #fff;
  color: var(--primary);
}

.jb-btn-light:hover {
  background: var(--surface-alt);
}

.jb-btn:focus-visible,
.jb-tab:focus-visible,
.jb-chip:focus-visible,
.jb-quick-item:focus-visible,
.pag-btn:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 2px;
}

/* ── 헤더 ── */
.jb-head {
  margin-bottom: 8px;
}

.jb-head-title h2 {
  margin: 0;
  color: #1f3760;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.4;
}

/* ── 레이아웃 ── */
.jb-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--home-aside-w, 308px);
  gap: var(--home-col-gap, 16px);
  align-items: start;
}

.jb-main {
  min-width: 0;
}

@media (min-width: 981px) {
  .recruitment-section.jb-page {
    padding-top: 28px;
    padding-bottom: 40px;
  }
}

/* ── 업종 탭 (밑줄형) ── */
.jb-tabs {
  display: flex;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--jb-line);
  overflow-x: auto;
  scrollbar-width: none;
}

.jb-tabs::-webkit-scrollbar {
  display: none;
}

.jb-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 132px;
  height: 42px;
  margin-bottom: -1px;
  padding: 0 16px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--jb-muted);
  font-size: var(--jb-fs-md);
  font-weight: 600;
  cursor: pointer;
}

.jb-tab:hover {
  color: var(--jb-text);
}

.jb-tab.is-active {
  border-bottom-color: var(--primary);
  color: var(--primary);
  font-weight: 800;
}

.jb-tab-count {
  margin-left: 4px;
  font-size: var(--jb-fs-sm);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.jb-tab-count::before {
  content: "(";
}

.jb-tab-count::after {
  content: ")";
}

/* ── 검색·필터 ── */
.jb-filter {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.jb-filter-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.jb-filter-row-sub {
  justify-content: space-between;
  gap: 12px;
}

.jb-search {
  position: relative;
  flex: 1 1 220px;
  min-width: 0;
}

.jb-search-icon {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--jb-muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.jb-search input,
.jb-filter select {
  height: var(--jb-control-h);
  border: 1px solid var(--jb-line);
  border-radius: var(--jb-radius);
  background: #fff;
  color: var(--jb-text);
  font-size: var(--jb-fs-md);
  outline: none;
}

.jb-search input {
  width: 100%;
  padding: 0 12px 0 38px;
}

.jb-filter select {
  flex: 0 0 auto;
  max-width: 150px;
  padding: 0 8px;
  cursor: pointer;
}

.jb-search input:focus,
.jb-filter select:focus {
  border-color: var(--primary);
}

.jb-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 0 6px;
  font-size: var(--jb-fs-sm);
  white-space: nowrap;
  cursor: pointer;
}

.jb-check input {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
}

.jb-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 4px;
  min-width: 0;
}

.jb-chips-label {
  margin-right: 6px;
  color: var(--jb-text);
  font-size: var(--jb-fs-sm);
  font-weight: 700;
}

.jb-chip {
  padding: 2px 6px;
  border: 0;
  background: none;
  color: var(--jb-muted);
  font-size: var(--jb-fs-sm);
  cursor: pointer;
}

.jb-chip:hover {
  color: var(--primary);
  text-decoration: underline;
}

.jb-chip.is-active {
  color: var(--primary);
  font-weight: 800;
  text-decoration: underline;
}

.jb-filter .jb-sort {
  height: 34px;
  min-width: 108px;
  font-size: var(--jb-fs-sm);
}

/* ── 목록 테이블 ── */
.jb-table {
  border-top: 2px solid var(--primary);
  background: #fff;
}

.jb-thead,
.jb-row {
  display: grid;
  grid-template-columns: 36px 68px minmax(160px, 1fr) 100px 96px 92px 92px 88px 40px;
  align-items: center;
  column-gap: 6px;
  padding: 0 10px;
}

.jb-thead {
  min-height: 40px;
  border-bottom: 1px solid var(--jb-line);
  background: var(--jb-soft);
  color: var(--jb-text);
  font-size: var(--jb-fs-sm);
  font-weight: 700;
}

.jb-thead span {
  text-align: center;
}

.jb-thead span:nth-child(3) {
  text-align: left;
}

.jb-row {
  height: 64px;
  border-bottom: 1px solid var(--jb-line);
  color: var(--jb-text);
  font-size: var(--jb-fs-sm);
  text-decoration: none;
}

.jb-row:hover,
.jb-row:focus-visible {
  background: var(--jb-soft);
  color: var(--jb-text);
  outline: none;
}

.jb-row:hover .jb-company,
.jb-row:focus-visible .jb-company {
  text-decoration: underline;
}

.jb-c {
  min-width: 0;
  text-align: center;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.jb-c-no {
  color: var(--jb-muted);
}

.jb-c-region,
.jb-c-salary,
.jb-c-career,
.jb-c-deadline {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jb-c-title {
  display: grid;
  gap: 2px;
  text-align: left;
}

.jb-company,
.jb-title {
  display: flex;
  align-items: center;
  min-width: 0;
}

.jb-ellipsis {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.jb-company {
  gap: 4px;
  font-size: var(--jb-fs-md);
  font-weight: 700;
  line-height: 1.35;
}

.jb-title {
  color: var(--jb-muted);
  font-size: var(--jb-fs-sm);
  line-height: 1.35;
}

.jb-subtype {
  flex: 0 0 auto;
  margin-right: 5px;
  color: var(--jb-text);
  font-size: var(--jb-fs-xs);
  font-style: normal;
  font-weight: 700;
}

.jb-subtype::before {
  content: "[";
}

.jb-subtype::after {
  content: "]";
}

.jb-new {
  flex: 0 0 auto;
  color: var(--danger);
  font-size: var(--jb-fs-xs);
  font-weight: 800;
}

.jb-type {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 3px;
  font-size: var(--jb-fs-xs);
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.jb-type-funeral {
  background: #e8eef8;
  color: var(--primary);
}

.jb-type-mutual {
  background: #e3f3ec;
  color: var(--success);
}

.jb-type-burial {
  background: #fdf0e3;
  color: var(--warning);
}

.jb-type-etc {
  background: var(--surface-alt);
  color: var(--text-muted);
}

.jb-empty {
  padding: 48px 16px;
  color: var(--jb-muted);
  text-align: center;
}

/* ── 페이지네이션 ── */
.jobs-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 34px;
  margin-top: 18px;
}

.pag-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--jb-line);
  border-radius: 4px;
  background: #fff;
  color: var(--jb-text);
  font-size: var(--jb-fs-md);
  cursor: pointer;
}

.pag-btn:hover:not([disabled]):not(.active) {
  background: var(--jb-soft);
}

.pag-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.pag-btn[disabled] {
  opacity: 0.4;
  cursor: default;
}

.pag-ellipsis {
  min-width: 20px;
  color: var(--jb-muted);
  text-align: center;
}

/* ── 사이드바 ── */
.jb-side {
  display: grid;
  gap: 12px;
}

.jb-banner {
  position: relative;
  display: grid;
  align-content: space-between;
  gap: 10px;
  min-height: 168px;
  padding: 16px 16px 14px;
  overflow: hidden;
  border: 1px solid #e3e9f3;
  border-radius: var(--jb-radius);
  background:
    radial-gradient(120% 90% at 100% 100%, #dfe8f6 0%, rgba(223, 232, 246, 0.55) 40%, rgba(255, 255, 255, 0) 72%),
    #fff;
  color: var(--primary);
}

.jb-banner::after {
  content: "";
  position: absolute;
  right: -26px;
  bottom: -20px;
  width: 152px;
  aspect-ratio: 560 / 521;
  background: url("../images/inc_001.webp") right bottom / contain no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 22%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 22%);
  pointer-events: none;
}

.jb-banner > * {
  position: relative;
  z-index: 1;
}

.jb-banner h3 {
  margin: 0;
  font-size: var(--jb-fs-xl);
  line-height: 1.4;
  word-break: keep-all;
}

.jb-banner h3 em {
  font-style: normal;
}

.jb-banner p {
  margin: 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: var(--jb-fs-sm);
  line-height: 1.6;
  word-break: keep-all;
}

.jb-banner .jb-btn {
  justify-self: start;
  align-self: end;
  margin-top: 4px;
  background: var(--primary);
  color: #fff;
}

.jb-banner .jb-btn:hover {
  background: #142c55;
}

.jb-side-card {
  padding: 16px;
  border: 1px solid var(--jb-line);
  border-radius: var(--jb-radius);
  background: #fff;
}

.jb-side-card h3 {
  margin: 0 0 12px;
  font-size: var(--jb-fs-md);
  font-weight: 800;
}

.jb-quick {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.jb-quick-item {
  padding: 9px 4px;
  border: 1px solid var(--jb-line);
  border-radius: 4px;
  background: #fff;
  color: var(--jb-text);
  font-size: var(--jb-fs-sm);
  cursor: pointer;
}

.jb-quick-item:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.jb-quick-item.is-active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.jb-guide {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 16px;
  color: var(--jb-muted);
  font-size: var(--jb-fs-sm);
  line-height: 1.5;
}

/* 데스크톱에서는 래퍼가 표 레이아웃에 영향을 주지 않는다 */
.jb-meta,
.jb-dates {
  display: contents;
}

.jb-views-icon {
  display: none;
}

/* ── 반응형 ── */
@media (max-width: 1279px) {
  .jb-layout {
    grid-template-columns: 1fr;
  }

  .jb-side {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 899px) {
  .jb-filter-row:first-child {
    flex-wrap: wrap;
  }

  .jb-search {
    flex: 1 1 100%;
  }

  .jb-filter select {
    flex: 1 1 calc(33.333% - 6px);
    max-width: none;
  }

  .jb-check {
    flex: 1 1 auto;
  }

  .jb-thead {
    display: none;
  }

  /* 모바일 카드형 목록: 구분 태그 + 회사/제목, 그 아래 조건·날짜 */
  .jb-row {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    column-gap: 10px;
    row-gap: 4px;
    align-items: start;
    height: auto;
    padding: 14px 6px;
    -webkit-tap-highlight-color: rgba(24, 58, 111, 0.08);
  }

  .jb-row:active {
    background: var(--jb-soft);
  }

  .jb-c {
    text-align: left;
  }

  .jb-c-no {
    display: none;
  }

  .jb-c-type {
    grid-column: 1;
    grid-row: 1;
    padding-top: 1px;
  }

  .jb-type {
    display: block;
    text-align: center;
  }

  .jb-c-title {
    grid-column: 2;
    grid-row: 1;
  }

  .jb-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    grid-column: 2;
    width: 100%;
    min-width: 0;
    color: var(--jb-muted);
  }

  .jb-meta .jb-c {
    flex: 0 0 auto;
    min-width: 0;
    white-space: nowrap;
  }

  .jb-meta .jb-c-career::before {
    content: attr(data-label) " ";
    color: var(--jb-muted);
  }

  .jb-dates {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 34px;
    align-items: center;
    column-gap: 4px;
    grid-column: 2;
    width: 100%;
    min-width: 0;
    color: var(--jb-muted);
    font-size: 0.64rem;
    letter-spacing: -0.02em;
  }

  .jb-dates .jb-c {
    min-width: 0;
  }

  .jb-dates .jb-c::before {
    content: attr(data-label) " ";
  }

  .jb-dates .jb-c-deadline.jb-deadline-always::before {
    content: none;
  }

  .jb-dates .jb-c-deadline,
  .jb-dates .jb-c-reg {
    white-space: nowrap;
  }

  .jb-dates .jb-c-views {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    gap: 3px;
    color: var(--jb-muted);
    white-space: nowrap;
  }

  .jb-dates .jb-c-views::before {
    content: none;
  }

  .jb-views-icon {
    display: block;
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .jb-side {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .jb-container {
    width: min(100% - 28px, 1280px);
  }

  .jb-head-title h2 {
    font-size: 1.1rem;
  }

  .jb-tabs {
    scroll-snap-type: x proximity;
  }

  .jb-tab {
    min-width: 96px;
    height: 44px;
    padding: 0 10px;
    scroll-snap-align: start;
  }

  /* 터치 영역 44px, 입력창 16px(iOS 자동 확대 방지) */
  /* 필터 행 래퍼를 풀어서 모든 컨트롤을 한 줄 흐름(flex-wrap)으로 재배치한다 */
  .jb-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 6px;
  }

  .jb-filter-row {
    display: contents;
  }

  .jb-search {
    order: 1;
    flex: 1 1 100%;
  }

  .jb-filter select {
    order: 3;
    flex: 1 1 calc(33.333% - 4px);
    min-width: 0;
    height: 44px;
    padding: 0 6px;
    font-size: 16px;
  }

  /* 지역·경력·정렬 드롭다운은 한 줄에 3등분, '마감공고 포함'은 모바일에서 숨긴다 */
  .jb-check {
    display: none;
  }

  .jb-filter .jb-sort {
    order: 4;
    flex: 1 1 calc(33.333% - 4px);
    min-width: 0;
    height: 44px;
    font-size: 16px;
  }

  .jb-search input {
    height: 44px;
    font-size: 16px;
  }

  /* 추천 검색어는 모바일에서 숨긴다(업종 탭·필터로 충분) */
  .jb-chips {
    display: none;
  }

  .pag-btn {
    min-width: 40px;
    height: 40px;
  }

  /* '많이 찾는 채용조건'은 상단 필터와 중복되므로, '이용안내'는 부가 정보라 모바일에서는 숨긴다 */
  .jb-side-card:has(.jb-quick),
  .jb-side-card:has(.jb-guide) {
    display: none;
  }

  .jb-banner {
    padding: 18px 16px;
  }

  .jb-banner h3 {
    font-size: var(--jb-fs-lg);
  }

  .jb-banner .jb-btn {
    height: 44px;
  }
}
