/* list.css : 지역 필터(한 줄), 상세 필터, 6칸 이미지, TOP 3, 최신 공고(무한스크롤) */

/* 지역 필터: 한 줄, 사진 칸 */
.filters { padding-bottom: 28px; scroll-margin-top: 84px; }
.filter-bar { display: flex; align-items: flex-start; gap: 20px; }
.regions { flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 4px; }
.regions::-webkit-scrollbar { display: none; }
.region {
  flex: 1 0 72px; min-width: 72px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 2px 0;
  font-size: 13px; font-weight: 600; color: var(--fg-sub);
}
.region .thumb {
  width: 60px; height: 60px; border-radius: 18px; overflow: hidden;
  background: var(--bg-soft); color: var(--fg-mute); font-size: 18px; font-weight: 800;
  display: grid; place-items: center;
  box-shadow: 0 0 0 3px transparent; transition: box-shadow .15s, transform .15s;
}
.region .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.region:hover .thumb { transform: translateY(-2px); }
.region.on { color: var(--accent); font-weight: 800; }
.region.on .thumb { box-shadow: 0 0 0 3px var(--accent); }

.detail-btn {
  flex: none; display: inline-flex; align-items: center; gap: 8px; margin-top: 10px;
  padding: 12px 18px; border-radius: 14px; background: var(--bg-soft); color: var(--fg); font-weight: 700; font-size: 15px;
}
.detail-btn:hover { background: var(--accent-weak); color: var(--accent); }
.detail-btn .count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; display: grid; place-items: center; }

.summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 0; font-size: 14px; color: var(--fg-sub); }
.summary b { color: var(--fg); font-weight: 800; }
.summary a { color: var(--accent); font-weight: 700; flex: none; }

/* 상세 필터 창 */
dialog.detail {
  border: 0; padding: 0; border-radius: 24px; width: min(520px, calc(100% - 32px)); max-height: min(720px, 88vh);
  background: var(--card); color: var(--fg); box-shadow: 0 24px 64px rgba(0,0,0,.28); overflow: hidden;
}
dialog.detail[open] { display: flex; }
dialog.detail::backdrop { background: rgba(0,0,0,.5); }
dialog.detail form { display: flex; flex-direction: column; width: 100%; min-height: 0; }
.detail-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px 8px; }
.detail-head h2 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -0.03em; }
.detail-close { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; color: var(--fg-sub); }
.detail-close:hover { background: var(--bg-soft); }
.detail-body { padding: 8px 24px 8px; overflow-y: auto; min-height: 0; }
.detail-body fieldset { border: 0; margin: 0 0 22px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.detail-body legend { padding: 0; margin-bottom: 10px; font-size: 15px; font-weight: 800; float: left; width: 100%; }
.detail-body legend small { font-weight: 500; color: var(--fg-mute); font-size: 13px; }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt span { display: inline-block; padding: 9px 16px; border-radius: 999px; background: var(--bg-soft); color: var(--fg-sub); font-size: 14px; font-weight: 700; cursor: pointer; }
.opt input:checked + span { background: var(--accent); color: #fff; }
.opt input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.detail-foot { display: flex; align-items: center; gap: 12px; padding: 14px 24px 20px; border-top: 1px solid var(--line); }
.detail-foot .reset { padding: 14px 18px; border-radius: 14px; background: var(--bg-soft); color: var(--fg-sub); font-weight: 700; flex: none; }
.detail-foot .apply { flex: 1; padding: 14px; border-radius: 14px; background: var(--accent); color: #fff; font-weight: 700; font-size: 16px; }
.detail-foot .apply:hover { background: var(--accent-press); }

/* 금액 입력칸 + 슬라이더 (상세 필터) */
.pay-box { width: 100%; }
.pay-inputs { display: flex; align-items: center; gap: 10px; }
.pay-inputs .tilde { color: var(--fg-mute); font-weight: 700; }
.pay-field {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; height: 46px; padding: 0 14px;
  border-radius: 14px; background: var(--bg-soft); border: 2px solid transparent;
}
.pay-field:focus-within { border-color: var(--accent); background: var(--card); }
.pay-field input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; text-align: right;
  font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield;
}
.pay-field input::-webkit-outer-spin-button, .pay-field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pay-field input::placeholder { color: var(--fg-mute); font-weight: 500; }
.pay-field em { font-style: normal; font-size: 13px; font-weight: 600; color: var(--fg-mute); flex: none; }

/* 손잡이 두 개짜리 슬라이더. 막대는 손잡이 중심이 움직이는 범위(양쪽 11px 안쪽)에 맞춘다. */
.dual { position: relative; height: 28px; margin-top: 14px; }
.dual-track { position: absolute; left: 11px; right: 11px; top: 50%; height: 6px; margin-top: -3px; border-radius: 3px; background: var(--bg-soft); }
.dual-fill { position: absolute; top: 0; bottom: 0; left: var(--lo, 0%); right: calc(100% - var(--hi, 100%)); border-radius: 3px; background: var(--accent); }
.dual input[type="range"] {
  position: absolute; left: 0; top: 0; width: 100%; height: 28px; margin: 0; padding: 0;
  background: transparent; pointer-events: none; -webkit-appearance: none; appearance: none;
}
.dual input[type="range"]::-webkit-slider-runnable-track { height: 28px; background: transparent; }
.dual input[type="range"]::-moz-range-track { height: 28px; background: transparent; }
.dual input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; pointer-events: auto; width: 22px; height: 22px; margin-top: 3px;
  border-radius: 50%; background: var(--card); border: 3px solid var(--accent); box-shadow: 0 1px 4px rgba(0,0,0,.25); cursor: grab;
}
.dual input[type="range"]::-moz-range-thumb {
  pointer-events: auto; box-sizing: border-box; width: 22px; height: 22px;
  border-radius: 50%; background: var(--card); border: 3px solid var(--accent); box-shadow: 0 1px 4px rgba(0,0,0,.25); cursor: grab;
}
.dual input[type="range"]:focus-visible::-webkit-slider-thumb { outline: 3px solid var(--accent); outline-offset: 2px; }
.dual input[type="range"]:focus-visible::-moz-range-thumb { outline: 3px solid var(--accent); outline-offset: 2px; }
.dual-scale { display: flex; justify-content: space-between; margin-top: 2px; padding: 0 2px; font-size: 12px; color: var(--fg-mute); font-variant-numeric: tabular-nums; }
.pay-hint { margin: 10px 0 0; font-size: 12px; line-height: 1.5; color: var(--fg-mute); }

/* 바둑판 이미지 6칸 */
.picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; padding-block: 40px 8px; }
.picks .ph { --ratio: 3 / 2; }

/* 섹션 제목 */
.sec-head { margin-bottom: 12px; }
.sec-head h2 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.035em; }
.sec-head .sub { margin: 4px 0 0; font-size: 14px; color: var(--fg-mute); }
.top { padding-block: 48px 0; scroll-margin-top: 84px; }
.feed-sec { padding-block: 56px 80px; scroll-margin-top: 84px; }

/* 공고 한 줄 (TOP 3, 최신 공고 공통): 왼쪽 사진 + 내용 + 급여 + 마감 */
.list { list-style: none; margin: 0; padding: 0; }
.job {
  display: grid; grid-template-columns: 112px minmax(0, 1fr) auto 72px;
  grid-template-areas: "thumb info pay dday";
  align-items: center; gap: 20px; padding: 14px 12px; border-radius: 20px;
  transition: background .15s; cursor: pointer;
}
.job:hover { background: var(--bg-soft); }
.job-thumb { grid-area: thumb; position: relative; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: var(--bg-soft); }
.job:hover .job-thumb { background: var(--line); }
.job-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.job-thumb .rank {
  position: absolute; left: 8px; top: 8px; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 9px;
  background: var(--fg-sub); color: #fff; font-size: 14px; font-weight: 800; display: grid; place-items: center;
  font-variant-numeric: tabular-nums;
}
.job.top3 .job-thumb .rank { background: var(--accent); }
.job-info { grid-area: info; min-width: 0; }
.job h3 { margin: 0 0 6px; font-size: 18px; font-weight: 700; letter-spacing: -0.03em; overflow-wrap: anywhere; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 8px; font-size: 14px; color: var(--fg-mute); align-items: center; }
.meta i { width: 3px; height: 3px; border-radius: 50%; background: var(--fg-mute); display: inline-block; }
.badge { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--accent-weak); color: var(--accent); }
.badge.soft { background: var(--bg-soft); color: var(--fg-sub); }
.job:hover .badge.soft { background: var(--card); }
.badge.hot { background: rgba(240,68,82,.12); color: var(--danger); }
.pay { grid-area: pay; text-align: right; font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
.pay small { display: block; font-size: 12px; font-weight: 500; color: var(--fg-mute); }
.dday { grid-area: dday; text-align: right; font-weight: 700; font-size: 14px; color: var(--fg-sub); font-variant-numeric: tabular-nums; }
.dday.soon { color: var(--danger); }

.empty { padding: 56px 0; text-align: center; color: var(--fg-mute); }
.empty strong { display: block; color: var(--fg); font-size: 18px; margin-bottom: 4px; }
.note { margin: 16px 12px 0; font-size: 13px; color: var(--fg-mute); }

/* 무한스크롤 상태 */
.feed-status { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 28px 0 8px; font-size: 14px; color: var(--fg-mute); }
.feed-status .spin { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.feed-status button { padding: 10px 18px; border-radius: 12px; background: var(--bg-soft); color: var(--fg); font-weight: 700; font-size: 14px; }
.feed-status button:hover { background: var(--accent-weak); color: var(--accent); }
#feed-end { height: 1px; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .picks { grid-template-columns: repeat(2, 1fr); }
  /* 지역은 한 줄 그대로 옆으로 넘긴다. 상세필터 버튼은 위쪽 오른쪽에 둔다. */
  .filter-bar { flex-direction: column-reverse; gap: 6px; }
  .detail-btn { align-self: flex-end; margin-top: 0; }
  .regions { width: 100%; flex: none; }
}
@media (max-width: 760px) {
  .filters, .top, .feed-sec { scroll-margin-top: 124px; }
}
@media (max-width: 720px) {
  .picks { gap: 10px; padding-block: 28px 4px; }
  .sec-head h2 { font-size: 22px; }
  .top { padding-top: 36px; }
  .feed-sec { padding-block: 44px 64px; }
  /* 모바일: 사진은 왼쪽 위, 내용 아래에 급여와 마감 */
  .job {
    grid-template-columns: 92px minmax(0, 1fr) auto;
    grid-template-areas: "thumb info info" "thumb pay dday";
    align-items: start; gap: 6px 14px; padding: 14px 8px;
  }
  .job-thumb { aspect-ratio: 1; }
  .job h3 { font-size: 16px; margin-bottom: 4px; }
  .meta { font-size: 13px; }
  .pay { text-align: left; font-size: 16px; align-self: end; }
  .pay small { display: inline; margin-left: 6px; }
  .dday { align-self: end; }
}
@media (prefers-reduced-motion: reduce) { .feed-status .spin { animation: none; } }