/* static/deals/feed.css — page-local rules for the public /deals feed (plan §6).
   Layout + spacing only. Colours come from tokens.css, components from components.css. No hex, no radius. */

/* ── "what this is" portfolio block (collapsed by default) ─────────── */
.feed-about { margin: 0 0 var(--gap); border: 1px solid var(--border); background: var(--surface); }
.feed-about > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; padding: 10px var(--pad); cursor: pointer; list-style: none; }
.feed-about > summary::-webkit-details-marker { display: none; }
.feed-about > summary::before { content: "+"; font-family: var(--mono); color: var(--dim); }
.feed-about[open] > summary::before { content: "–"; }
.feed-about-kicker { font: 500 var(--fs-xs)/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.feed-about-title { font: 400 var(--fs-lg)/1.2 var(--display); color: var(--text); }
.feed-about-body { display: grid; gap: var(--gap); padding: 4px var(--pad) var(--pad); border-top: 1px solid var(--border); grid-template-columns: 1fr; }
@media (min-width: 1024px) { .feed-about-body { grid-template-columns: 1.3fr 1fr; } }
.feed-about-copy p { margin: 10px 0 0; color: var(--muted); max-width: 60ch; }
.feed-how { margin: 12px 0 0; padding: 0 0 0 1.4em; color: var(--muted); font-size: var(--fs-sm); }
.feed-how li { margin: 0 0 4px; }
.feed-how b { font-weight: 500; color: var(--text); }
.feed-stats { display: grid; gap: 1px; margin: 12px 0 0; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); background: var(--border); border: 1px solid var(--border); }
.feed-stats > div { padding: 12px; background: var(--surface-2); }
.feed-stats dt { font: 500 var(--fs-xs)/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.feed-stats dd { margin: 6px 0 0; font: 700 var(--fs-xl)/1 var(--mono); color: var(--accent); font-variant-numeric: tabular-nums; }

/* ── rail ──────────────────────────────────────────────────────────── */
.feed-rail .select { width: 100%; }
.feed-rail .seg { display: flex; }
.feed-rail .seg-btn { flex: 1 1 0; }
.feed-rail-search { display: none; }               /* the topbar search owns ≥ 1024; the panel copy shows when it collapses */
.feed-rail-search input { width: 100%; height: 32px; padding: 0 10px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-family: var(--sans); }
.feed-rail-search input::placeholder { color: var(--dim); }
.feed-rail-search input:focus { border-color: var(--border-strong); outline: none; }
@media (max-width: 1023px) { .feed-rail-search { display: block; } }
.feed-range { display: flex; align-items: center; gap: 6px; }
.feed-range input { flex: 1 1 0; min-width: 0; height: 32px; padding: 0 8px; background: var(--surface); border: 1px solid var(--border); color: var(--text);
  font: 400 var(--fs-sm)/1 var(--mono); font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.feed-range input::-webkit-outer-spin-button, .feed-range input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.feed-range input::placeholder { color: var(--dim); }
.feed-range input:focus { border-color: var(--border-strong); outline: none; }
.feed-range-dash { color: var(--dim); font-family: var(--mono); }
.feed-rail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.feed-rail-done { display: none; }
@media (max-width: 767px) { .feed-rail-done { display: inline-flex; } }

/* ── filter panel (under the control row; was the side rail) ─────────── */
.feed-filter-panel { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 20px; margin: 10px 0 2px; padding: 4px 14px 10px;
  border: 1px solid var(--border); background: var(--surface); }
.feed-filter-panel[hidden] { display: none; }
.feed-filter-panel .rail-group { border-top: 0; padding: 10px 0; }
.feed-filter-panel .feed-rail-actions { grid-column: 1 / -1; padding-top: 4px; }
.feed-near { display: flex; gap: 6px; }
.feed-near input { flex: 1 1 0; min-width: 0; height: 32px; padding: 0 8px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font: 400 var(--fs-sm)/1 var(--mono); }
.feed-near input::placeholder { color: var(--dim); }
.feed-near input:focus { border-color: var(--border-strong); outline: none; }
.feed-near .select { flex: 0 0 92px; }
.feed-near input[type="text"] { flex: 0 1 120px; }
.feed-saved { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 2px; }
.feed-saved[hidden] { display: none; }
.feed-saved-label { font: 500 var(--fs-xs)/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); margin-right: 4px; }
.feed-saved .chip { text-decoration: none; }
.feed-saved .chip.is-starter { opacity: .85; }
.card-photo { display: block; margin: 0 calc(-1 * var(--pad)) 6px; aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface-2); }
.card-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ── control row ───────────────────────────────────────────────────── */
.feed-filters-btn { display: inline-flex; }
.feed-filters-btn[aria-expanded="true"] { border-color: var(--border-strong); }
@media (max-width: 767px) {
  .feed-controls .select { flex: 1 1 120px; min-width: 0; }
  .feed-controls .result-count { flex-basis: 100%; margin-left: 0; }
}

/* ── grid / load more ──────────────────────────────────────────────── */
/* Smaller cards, more per row: the feed fills the width with 200 px columns (5 on a laptop, 7+ on a wide screen). */
.feed-grid { min-height: 160px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
@media (min-width: 1100px) { .feed-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.feed-grid .card { min-height: 0; gap: 4px; padding-bottom: 10px; }
.feed-grid .card-band { height: 24px; margin-bottom: 4px; font-size: 10px; }
.feed-grid .card-price { font-size: 15px; }
.feed-grid .card-unit, .feed-grid .card-meta { font-size: 12px; }
.feed-grid .card-title { font-size: 13px; line-height: 1.3; }
.feed-grid .card-chips .chip { font-size: 10px; padding: 2px 6px; }
.feed-grid .card-photo { aspect-ratio: 16 / 10; margin-bottom: 4px; }
/* The results box scrolls on its own; the controls and the filters above it stay put. */
.feed-scroll { height: calc(100dvh - var(--feed-scroll-top, 320px)); min-height: 320px; overflow-y: auto; overscroll-behavior: contain;
  padding: 2px 2px 24px; scrollbar-gutter: stable; }
@media (max-width: 767px) { .feed-scroll { height: auto; overflow: visible; } }
.feed-radius { display: flex; align-items: center; gap: 8px; flex: 0 0 150px; font: 400 var(--fs-sm)/1 var(--mono); color: var(--text); }
.feed-radius output { min-width: 48px; text-align: right; font-variant-numeric: tabular-nums; }
.feed-radius input[type="range"] { flex: 1 1 0; min-width: 0; accent-color: var(--accent); }
.feed-fav-btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.feed-fav-note { margin: 0 0 10px; font-size: var(--fs-sm); color: var(--muted); }
.card-star { position: absolute; top: 30px; right: 8px; z-index: 2; width: 28px; height: 28px; border: 0; border-radius: 50%;
  background: rgba(0,0,0,.55); color: var(--text); font-size: 15px; line-height: 28px; text-align: center; cursor: pointer; opacity: .85; }
.card-star:hover, .card-star:focus-visible { opacity: 1; }
.card-star[aria-pressed="true"] { color: var(--accent); opacity: 1; }
.card-star[aria-pressed="true"]::before { content: "★"; }
.card-star[aria-pressed="false"]::before { content: "☆"; }
.feed-more-wrap:has(> [hidden]) { display: none; }
body[data-view="map"] .feed-grid, body[data-view="map"] .feed-more-wrap { display: none; }

/* ── view switch: cards | table | map ──────────────────────────────── */
.feed-view-seg .seg-btn { cursor: pointer; }
.feed-table-wrap, .feed-pager { display: none; }
body[data-view="table"] .feed-grid, body[data-view="table"] .feed-more-wrap { display: none; }
body[data-view="table"] .feed-table-wrap { display: block; min-height: 160px; margin: 0 0 var(--gap); }
body[data-view="table"] .feed-pager:not([hidden]) {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin: 0 0 var(--gap);
}
.feed-pager-where { font: 400 var(--fs-sm)/1.4 var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.feed-pager-where strong { color: var(--text); }
.feed-table .feed-td-title { color: var(--text); text-decoration: none; font-weight: 500; }
.feed-table a.feed-td-title:hover { color: var(--accent); text-decoration: underline; }
.feed-table td:first-child { min-width: 220px; }
.feed-table .feed-td-site a { color: var(--muted); white-space: nowrap; }
.feed-table .feed-td-qty { color: var(--muted); }
.feed-table .feed-td-ends { white-space: nowrap; }
.feed-table tr.is-closed td { color: var(--muted); }
.feed-table-wrap .ui-empty, .feed-table-wrap .ui-error { padding: 32px 12px; }
@media (max-width: 767px) {   /* a phone keeps lot, place, bid, bids, ends */
  .feed-table .feed-td-site, .feed-table .feed-td-unit { display: none; }
  .feed-table td:first-child { min-width: 150px; }
  .feed-view-seg { order: -1; }
}

/* ── footer ────────────────────────────────────────────────────────── */
.feed-footer .footer-note { margin: 0 0 4px; }
