﻿/* AJen: property search and results. Loaded after property.css, so it can lean on
   the same tokens, .wrap, .nav and .btn. One accent: the AJen green. */

.listing { padding: 34px 0 10px; }

.listing__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding-bottom: 26px; }
.listing__intro .eyebrow { color: var(--blue); }
.listing h1 { font-size: clamp(36px, 4.6vw, 60px); line-height: 1.02; margin: 10px 0 0; }
.listing__lede { margin: 12px 0 0; max-width: 58ch; color: var(--muted); font-size: 17px; }

.tabs { display: inline-flex; gap: 2px; padding: 4px; border: 1px solid #dce5de; background: var(--surface); border-radius: 999px; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 999px; text-decoration: none; font-size: 14px; font-weight: 500; color: var(--ink); }
.tabs a b { font-weight: 500; font-size: 12px; color: var(--muted); }
.tabs a:hover { background: #e7f1e9; }
.tabs a[aria-current="page"] { background: var(--blue); color: #fff; }
.tabs a[aria-current="page"] b { color: rgb(255 255 255 / .82); }
.tabs a[aria-current="page"]:hover { background: var(--blue); filter: brightness(1.06); }

/* ---------------------------------------------------------------- filters */
.filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(150px, .9fr) auto; gap: 12px; align-items: end; padding: 16px; border: 1px solid #dce5de; border-radius: 8px; background: var(--surface); }
.filter { display: block; min-width: 0; }
.filter > span { display: block; margin-bottom: 7px; font: 500 10px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.filter select { width: 100%; height: 44px; padding: 0 34px 0 12px; border: 1px solid var(--line); border-radius: 5px; background-color: #fff; color: var(--ink); font: 500 14px/1 var(--sans);
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23111' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 10px 6px; }
.filter select:hover { border-color: #16823b; }
.filter select:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.filter--actions { display: flex; gap: 8px; }
.filter--actions .btn { height: 44px; padding: 0 20px; white-space: nowrap; }
.btn--reset { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn--reset:hover { filter: none; background: #e7f1e9; border-color: var(--blue); }

/* ---------------------------------------------------------------- results bar */
.results-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 22px; padding-bottom: 14px; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.results-bar p { margin: 0; }
.results-bar b { color: var(--ink); font-weight: 500; }
.view-toggle { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.view-toggle button { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font: 500 13px/1 var(--sans); cursor: pointer; }
.view-toggle svg { width: 12px; height: 12px; }
.view-toggle button:hover { background: var(--surface); color: var(--ink); }
.view-toggle button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.view-toggle button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------------------------------------------------------------- results */
.results[hidden], .empty[hidden] { display: none; }
.results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; padding: 24px 0 18px; }
.result { display: flex; flex-direction: column; min-width: 0; border: 1px solid #dce5de; border-radius: 6px; background: #fff; color: var(--ink); text-decoration: none; overflow: hidden; transition: border-color 160ms ease, transform 160ms ease; }
.result:hover { border-color: var(--blue); }
.result:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.result__img { position: relative; display: block; aspect-ratio: 4 / 3; overflow: clip; background: #edf3ef; }
.result__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms cubic-bezier(.2, .8, .2, 1); }
.result:hover .result__img img { transform: scale(1.03); }
.result__badge { position: absolute; top: 12px; left: 12px; padding: 6px 10px; border-radius: 3px; background: var(--blue); color: #fff; font: 600 10px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; }
.result__body { display: grid; align-content: start; }
.result__price { padding: 12px 16px; background: #f0f7f2; font: 500 26px/1.1 var(--sans); letter-spacing: -.01em; }
.result__price small { margin-left: 6px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.result__where { padding: 12px 16px 0; font-size: 16px; font-weight: 500; line-height: 1.35; }
.result__facts { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px 0; }
.result__facts span { padding: 6px 8px; border: 1px solid var(--line); border-radius: 4px; font-size: 12px; font-weight: 500; line-height: 1; }
.result__facts .epc { background: var(--blue); border-color: var(--blue); color: #fff; }
.result__more { margin: 13px 16px 15px; font: 500 11px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--blue); }

/* list view */
.results.is-list { grid-template-columns: 1fr; gap: 12px; }
.results.is-list .result { flex-direction: row; }
.results.is-list .result__img { flex: 0 0 300px; aspect-ratio: auto; min-height: 196px; }
.results.is-list .result__body { flex: 1 1 auto; align-content: center; padding-bottom: 12px; }
.results.is-list .result__price { padding: 10px 16px; }

/* ---------------------------------------------------------------- empty */
.empty { margin: 24px 0 30px; padding: 38px 28px; border: 1px solid #dce5de; border-radius: 8px; background: var(--surface); text-align: center; }
.empty h2 { font-size: clamp(24px, 3vw, 32px); margin: 0 0 8px; }
.empty p { margin: 0 0 18px; color: var(--muted); }
.empty .btn { background: var(--blue); color: #fff; }

/* ---------------------------------------------------------------- tablet and phone */
@media (max-width: 1099px) {
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter--actions { grid-column: 1 / -1; }
}
@media (max-width: 899px) {
  .results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .results.is-list .result__img { flex-basis: 240px; min-height: 180px; }
}
@media (max-width: 639px) {
  .listing { padding-top: 22px; }
  .listing__head { padding-bottom: 20px; align-items: flex-start; }
  .listing h1 { font-size: clamp(32px, 9vw, 42px); }
  .tabs { width: 100%; }
  .tabs a { flex: 1 1 0; justify-content: center; padding: 10px 12px; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 14px; }
  .filter:first-child, .filter--actions { grid-column: 1 / -1; }
  .filter--actions .btn { flex: 1 1 0; }
  .results { grid-template-columns: 1fr; gap: 14px; }
  .results.is-list .result { flex-direction: column; }
  .results.is-list .result__img { flex: none; aspect-ratio: 4 / 3; min-height: 0; }
  .results.is-list .result__body { padding-bottom: 0; }
  .view-toggle button { padding: 7px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .result, .result__img img { transition: none; }
}
