/* Listings: filter sidebar + grid, with list view toggle */
.page-wrap { padding-top: 28px; padding-bottom: 80px; }
.results-bar { margin: 24px 0 16px; font-size: 0.871rem; color: var(--muted); }
.results-bar strong { font-weight: 400; }
.featured-strip { padding: 20px; background: rgba(201,168,76,0.05); }
.featured-strip .listing-card { background: var(--dark2); border-color: var(--border-subtle); }
.featured-strip .listing-card__img { padding-top: 62%; }
.listing-card__meta.row { flex-wrap: nowrap; }
.filter-chips { gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; font-size: 0.808rem; letter-spacing: 0.05em; color: var(--white); background: var(--gold-10); border: 1px solid var(--border); transition: all var(--ease); }
.chip span { color: var(--muted); font-size: 0.766rem; }
.chip:hover { border-color: var(--gold); }
.chip:hover span { color: var(--gold); }
.ac-dropdown { position: absolute; left: 0; right: 0; z-index: 100; display: none; max-height: 320px; overflow-y: auto; background: var(--dark2); border: 1px solid var(--border); border-top: none; }
.ac-dropdown.is-open { display: block; }
.ac-item { display: flex; flex-direction: column; padding: 11px 20px; border-bottom: 1px solid var(--border-subtle); color: var(--white); }
.ac-item:last-child { border-bottom: none; }
.ac-item:hover, .ac-item.is-active { background: var(--gold-10); color: var(--white); }
.ac-item__title { font-size: 0.887rem; line-height: 1.3; }
.ac-item__title mark { background: none; color: var(--gold); font-weight: 500; }
.ac-item__meta { font-size: 0.808rem; color: var(--muted); }

.listings-layout { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; }
.filters { position: sticky; top: calc(var(--nav-h) + 16px); max-height: calc(100vh - var(--nav-h) - 32px); overflow-y: auto; } /* taller than the screen: scrolls on its own so Apply stays reachable */
.filters__search { position: relative; }
.filters .ac-dropdown { top: 100%; }
.filters .ac-item { padding: 9px 14px; }
.filters__toggle { display: none; border: none; }
.featured-strip .grid--4 { grid-template-columns: repeat(4, 1fr); }
.filter { padding: 16px 0; border-top: 1px solid var(--border-subtle); }
.filter__title { font-size: 0.777rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.filter__opt { padding: 4px 0; font-size: 0.861rem; align-items: center; }
.filter__opt input { margin-top: 0; }
.filter__opt span { flex: 1; }
.filter__opt em { font-style: normal; font-size: 0.798rem; color: var(--muted2); }
.results-bar { margin-top: 28px; }
@media (max-width: 1024px) {
  .listings-layout { grid-template-columns: 1fr; }
  .filters { position: static; max-height: none; overflow: visible; }
  .filters__toggle { display: flex; background: transparent; }
  .filters__toggle.is-open { border-bottom: 1px solid var(--border-subtle); }
  .filters__panel { display: none; }
  .filters__panel.is-open { display: block; }
  .featured-strip .grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) { .featured-strip .grid--4 { grid-template-columns: 1fr; } }

.view-toggle { display: flex; border: 1px solid var(--border-subtle); }
.view-toggle button { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; color: var(--muted); transition: all var(--ease); }
.view-toggle button + button { border-left: 1px solid var(--border-subtle); }
.view-toggle button:hover { color: var(--gold); }
.view-toggle button.is-active { background: var(--gold); color: var(--black); }
/* List view: same cards, laid out horizontally */
.results-grid--list { grid-template-columns: 1fr; }
.results-grid--list .listing-card { flex-direction: row; }
.results-grid--list .listing-card__img { flex: 0 0 240px; padding-top: 0; min-height: 160px; }
.results-grid--list .listing-card__body { padding: 18px 22px; justify-content: center; }
.results-grid--list .listing-card__title { font-size: 1.05rem; }
.results-grid--list .listing-card__meta.row { margin-top: 6px; }
/* Short description: list view only, two lines max */

.results-grid--list .listing-card__excerpt { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin: 6px 0 0; font-size: 0.871rem; line-height: 1.6; color: var(--text-soft); }
@media (max-width: 540px) { .results-grid--list .listing-card { flex-direction: column; } .results-grid--list .listing-card__img { flex: none; padding-top: 68%; } }

/* Nested category tree */
.cat-tree__item + .cat-tree__item { margin-top: 2px; }
.cat-tree__row { display: flex; align-items: center; gap: 4px; }
.cat-tree__row .filter__opt { flex: 1; }
.cat-tree__sub { display: none; padding: 0 0 6px 26px; }
/* subcategories show only while the parent checkbox is checked */
.cat-tree__row:has(input:checked) + .cat-tree__sub { display: block; }
.filter__opt--sub { font-size: 0.829rem; padding: 3px 0; }
.filter__opt--sub input { width: 13px; height: 13px; }
.filter__opt--sub span { color: var(--muted); }

/* Skeleton loading: add .is-loading to .results (CSS only) */
.results.is-loading .results-grid { pointer-events: none; }
.results.is-loading .listing-card { position: relative; border-color: var(--border-subtle); }
.results.is-loading .listing-card > * { visibility: hidden; }
.results.is-loading .listing-card::before,
.results.is-loading .listing-card::after { content: ''; position: absolute; left: 0; right: 0; background: var(--skeleton); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.results.is-loading .listing-card::before { top: 0; height: 58%; }
.results.is-loading .listing-card::after { bottom: 16px; left: 16px; right: 16px; height: 30%;
  -webkit-mask: linear-gradient(#000 0 0) 0 0 / 100% 14px no-repeat, linear-gradient(#000 0 0) 0 22px / 70% 14px no-repeat, linear-gradient(#000 0 0) 0 46px / 45% 12px no-repeat;
          mask: linear-gradient(#000 0 0) 0 0 / 100% 14px no-repeat, linear-gradient(#000 0 0) 0 22px / 70% 14px no-repeat, linear-gradient(#000 0 0) 0 46px / 45% 12px no-repeat; }
.results.is-loading .results-grid--list .listing-card::before { top: 0; bottom: 0; right: auto; width: 240px; height: auto; }
.results.is-loading .results-grid--list .listing-card::after { left: 262px; right: 22px; top: 50%; bottom: auto; height: 60px; transform: translateY(-50%); }
.results.is-loading .results-bar strong, .results.is-loading .pagination { opacity: 0.4; }
@media (prefers-reduced-motion: reduce) { .results.is-loading .listing-card::before, .results.is-loading .listing-card::after { animation: none; } }

/* Tag filter */
.tag-filter { gap: 6px; }
.tag-filter .tag { cursor: pointer; }
.tag-filter .tag.is-active { background: var(--gold); border-color: var(--gold); color: var(--black); }
.chip--tag { background: transparent; }
.listing-card .tag { position: relative; z-index: 1; }
/* Real ads: no matches, and selected tags in the filter */
.listings-empty { padding: 40px 24px; text-align: center; margin-bottom: 20px; }
.tag-filter a.tag { text-decoration: none; }
