/* 매물 찾기(/listings) 전용 스타일(VIEW-B). base.css 의 토큰과 .lrow · .chip · .empty · .btn 을 그대로 쓴다.
   모바일 우선(390px) → 600px → 900px. 맨 아래 .errpage 블록은 404·500 페이지(errors.ts)가 이 파일을 함께 불러 쓴다. */

/* ───────── 상단: 제목 + 개수 요약(카드 없이 라벨+숫자) ───────── */
.lhead { background: var(--bg-soft); }
.lhead__inner { padding-top: 24px; padding-bottom: 28px; }
.lhead__row {
  margin-top: 14px;
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: 20px 48px;
}
.lhead__text { max-width: 720px; }
.lhead__title { font-size: 30px; line-height: 1.3; }
.lhead__lead { margin-top: 10px; font-size: 15px; line-height: 1.8; color: var(--ink-2); }

.lsum { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.lsum__item { display: flex; flex-direction: column; gap: 2px; }
.lsum__label { font-size: 13px; color: var(--muted); }
.lsum__count { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.3; }

.lpage { padding-bottom: 64px; }

/* ───────── 조건 카드 ───────── */
.lfilters { padding-top: 20px; scroll-margin-top: 8px; }
.lfilters__card {
  display: flex; flex-direction: column; gap: 14px;
  padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-card); background: #FFFFFF;
}
.lfilter { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lfilter__label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
/* 조건 카드 안에서는 칩을 가로 스크롤 대신 줄바꿈해 모든 선택지가 한눈에 보이게 한다 */
.lfilter__chips { min-width: 0; flex-wrap: wrap; overflow: visible; }

.lsearch {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 10px;
  padding-bottom: 14px; border-bottom: 1px solid var(--line-2);
}
.lsearch__field { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.lsearch__input {
  width: 100%; min-width: 0; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--chip-line); border-radius: 12px; background: var(--bg-field);
  font-size: 16px; color: var(--ink);
  transition: border-color .2s ease, background-color .2s ease;
}
.lsearch__input::placeholder { color: var(--placeholder-text); opacity: 1; }
.lsearch__input:hover { border-color: var(--line-strong); }
.lsearch__input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; background: #FFFFFF; }
.lsearch__submit { flex: 0 0 auto; gap: 6px; }
.lsearch__clear, .lreset {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px;
  font-size: 14px; font-weight: 600; color: var(--muted);
  text-decoration: underline; text-underline-offset: 3px;
}
.lsearch__clear:hover, .lreset:hover { color: var(--ink); }

.lfilters__foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px;
  padding-top: 14px; border-top: 1px solid var(--line-2);
}
.lcheck {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  font-size: 14px; font-weight: 600; color: var(--ink-2);
}
.lcheck:hover { color: var(--ink); }
.lcheck__box {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border: 2px solid var(--line-strong); border-radius: 6px;
  background: #FFFFFF; color: #FFFFFF;
  transition: background-color .2s ease, border-color .2s ease;
}
.lcheck__box svg { display: block; opacity: 0; transition: opacity .2s ease; }
.lcheck:hover .lcheck__box { border-color: var(--ink-2); }
.lcheck[aria-current="true"] .lcheck__box { background: var(--brand); border-color: var(--brand); }
.lcheck[aria-current="true"] .lcheck__box svg { opacity: 1; }

/* ───────── 결과 ───────── */
.lresults { padding-top: 28px; scroll-margin-top: 8px; }
.lresults__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.lresults__count { font-size: 17px; font-weight: 700; line-height: 1.4; }
.lresults__num { color: var(--brand); }
.lresults__more { margin-top: 18px; font-size: 14px; color: var(--muted); text-align: center; }

.lsort { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: var(--bg-cmp); }
.lsort__opt {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 9px;
  font-size: 14px; font-weight: 600; color: var(--muted);
  transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.lsort__opt:hover { color: var(--ink); }
.lsort__opt[aria-current="true"] { background: #FFFFFF; color: var(--ink); box-shadow: 0 1px 3px rgba(14, 23, 38, .16); }

.lgrid {
  margin-top: 18px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 560px), 1fr)); gap: 14px;
}
/* 카드 등장: fill-mode backwards 라 끝난 뒤 .lift 의 호버 transform 을 가리지 않는다 */
.lgrid > .lrow { animation: lrow-in .5s var(--ease-out) backwards; }
.lgrid > .lrow:nth-child(2) { animation-delay: .04s; }
.lgrid > .lrow:nth-child(3) { animation-delay: .08s; }
.lgrid > .lrow:nth-child(4) { animation-delay: .12s; }
.lgrid > .lrow:nth-child(5) { animation-delay: .16s; }
.lgrid > .lrow:nth-child(6) { animation-delay: .2s; }
.lgrid > .lrow:nth-child(7) { animation-delay: .24s; }
.lgrid > .lrow:nth-child(n + 8) { animation-delay: .28s; }
@keyframes lrow-in { from { opacity: 0; transform: translateY(10px); } }

.lempty__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* ───────── 비교·정리 글 · 최근 거래완료 ───────── */
.lsec { padding-top: 48px; }
.lsec__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px; }
.lsec__title { font-size: 22px; font-weight: 600; letter-spacing: -.02em; line-height: 1.4; }
.lsec__sub { font-size: 13px; color: var(--muted); }

.lposts { margin-top: 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.lposts__item { display: flex; }
.lpost {
  flex: 1; display: flex; flex-direction: column; gap: 10px;
  padding: 20px; border-radius: 16px; border: 1px solid var(--line); background: #FFFFFF; color: var(--ink);
}
.lpost:hover { color: var(--ink); }
.lpost__title { font-size: 16px; font-weight: 700; line-height: 1.5; letter-spacing: -.01em; }
.lpost__sub {
  font-size: 14px; line-height: 1.6; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.lpost__date { margin-top: auto; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }

.ldone__grid { margin-top: 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 12px; }
.ldone__item { display: flex; }
.ldone__card {
  flex: 1; display: flex; flex-direction: column; gap: 6px;
  padding: 18px 20px; border-radius: 16px; background: var(--bg-soft); color: var(--ink);
}
.ldone__card:hover { color: var(--ink); }
.ldone__tag {
  align-self: flex-start; padding: 3px 9px; border-radius: 6px;
  background: #E1E6EF; color: var(--ink-2); font-size: 12px; font-weight: 700;
}
.ldone__name { font-size: 16px; font-weight: 700; }
.ldone__deal { font-size: 14px; color: var(--ink-2); }

/* ───────── 600px 이상 ───────── */
@media (min-width: 600px) {
  .lhead__inner { padding-top: 48px; padding-bottom: 44px; }
  .lhead__row { margin-top: 18px; }
  .lhead__title { font-size: clamp(32px, 3.6vw, 48px); line-height: 1.25; }
  .lhead__lead { margin-top: 14px; font-size: 16px; }
  .lsum { gap: 8px 36px; }
  .lsum__count { font-size: 28px; }

  .lfilters { padding-top: 32px; }
  .lfilters__card { gap: 16px; padding: 22px 24px; }
  .lfilter { flex-direction: row; align-items: center; gap: 8px 10px; }
  .lfilter__label { flex: 0 0 72px; font-size: 14px; }
  .lfilter__chips { flex: 1 1 auto; }
  .lsearch { align-items: center; padding-bottom: 16px; }
  .lsearch__field { flex: 0 1 520px; flex-direction: row; align-items: center; gap: 10px; }
  .lsearch__field .lfilter__label { flex: 0 0 72px; }
  .lfilters__foot { padding-top: 16px; }

  .lresults { padding-top: 36px; }
  .lgrid { margin-top: 24px; gap: 20px; }

  .lsec { padding-top: 72px; }
  .lsec__title { font-size: 28px; }
  .lposts, .ldone__grid { margin-top: 20px; }
  .lpost { padding: 24px; }
}

/* ───────── 900px 이상 ───────── */
@media (min-width: 900px) {
  .lpage { padding-bottom: 96px; }
}

/* ───────── 404·500 (errors.ts) ───────── */
.errpage { padding-top: 56px; padding-bottom: 72px; }
.errpage__inner { max-width: 640px; }
.errpage__title { font-size: 28px; font-weight: 600; letter-spacing: -.03em; line-height: 1.35; }
.errpage__body { margin-top: 14px; font-size: 16px; line-height: 1.8; color: var(--ink-2); }
.errpage__id { margin-top: 14px; font-size: 14px; color: var(--muted); }
.errpage__id code {
  margin-left: 4px; padding: 2px 6px; border-radius: 6px;
  background: var(--bg-soft); color: var(--ink);
  font-family: var(--font-mono); font-size: 13px; word-break: break-all;
}
.errpage__actions { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 10px; }
.errpage__help { margin-top: 24px; font-size: 14px; line-height: 1.7; color: var(--muted); }
.errpage__help a { color: var(--ink); font-weight: 600; }
.errpage__help a:hover { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }

@media (min-width: 600px) {
  .errpage { padding-top: 96px; padding-bottom: 120px; }
  .errpage__title { font-size: clamp(32px, 3.6vw, 44px); }
  .errpage__body { font-size: 17px; }
}
