/* ==========================================================================
   for-sale.html — surplus from the workshop
   Loaded after seidr-v2.css; only page-specific rules live here.
   The sale-* / lightbox rules below re-skin the classes that js/market.js
   and the listing generator (scripts/market/build-market.mjs) emit, so the
   filter bar, cards and photo viewer fit the night theme when items are listed.
   ========================================================================== */

.section-head .eyebrow + h2 { margin-top: 18px; }
.listings-state { display: flex; }

/* ---------- designed empty state ---------- */
.sale-empty {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: clamp(26px, 5vw, 70px); align-items: center;
  padding: clamp(24px, 4vw, 56px); border-radius: var(--r-l);
  border: 1.5px dashed var(--line-2);
  background: radial-gradient(70% 90% at 0% 50%, rgba(243, 183, 95, .07), transparent 60%), linear-gradient(180deg, var(--moss), var(--night-2));
}
.shadow-board { position: relative; color: var(--mist-2); }
.shadow-board svg { width: 100%; height: auto; }
.shadow-board .sb-pegs { opacity: .35; }
.shadow-board .sb-outline { color: var(--sap); opacity: .55; }
.shadow-rune {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-family: var(--f-rune); font-size: clamp(3rem, 7vw, 5rem); line-height: 1; color: var(--sap);
  text-shadow: 0 0 30px rgba(243, 183, 95, .55), 0 0 80px rgba(243, 183, 95, .3);
  animation: ember 5s ease-in-out infinite;
}
@keyframes ember { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }
.sale-empty-copy { display: grid; gap: 16px; justify-items: start; }
.sale-empty-copy .label { color: var(--sap); }
.sale-empty-copy h3 { font-size: clamp(2rem, 3.2vw, 2.8rem); }
.sale-empty-copy p { color: var(--mist); max-width: 52ch; }
.sale-empty-copy .hero-actions { margin-top: 6px; }
.sale-empty-copy .btn { white-space: normal; line-height: 1.2; }
@media (max-width: 800px) { .sale-empty { grid-template-columns: 1fr; } .shadow-board { max-width: 420px; } }

/* ---------- how it works ---------- */
.how-buy { padding-top: 0; }
.buy-steps { list-style: none; margin: 0; padding: 0; counter-reset: none; }
/* keep each card's rows packed at the top, so the rune, label and heading line up across the row when one card has more text */
.buy-steps .step { align-content: start; }
.step-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 2.4rem; }
.step-top .label { color: var(--mist-2); }
/* two-up on tablets: let step 3 run full width instead of sitting alone under step 1 */
@media (min-width: 641px) and (max-width: 900px) { .buy-steps .step:last-child { grid-column: 1 / -1; } }

/* ---------- enquiry ---------- */
.enquire-section { border-top: 1px solid var(--line); background: linear-gradient(180deg, var(--night-2), var(--night)); }
.enquire-intro { display: grid; gap: 20px; align-content: start; }
.enquire-intro h2 { font-size: var(--t-h2); }
.enquire-intro .facts-list { margin-top: 10px; padding-top: 22px; border-top: 1px solid var(--line); }
.enquire-intro .facts-list a { color: var(--sap); }
.form-card .field textarea { min-height: 170px; }
.field input::placeholder, .field textarea::placeholder { color: var(--mist-2); }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.form-actions .btn-sap[disabled] { opacity: .7; cursor: progress; }
.form-note a { color: var(--sap); }

/* ==========================================================================
   Listing styles (used when build-market.mjs emits items)
   ========================================================================== */
.sale-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 36px; }
.sale-filters[hidden] { display: none; }
.sale-filter {
  font-family: var(--f-mono); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase;
  padding: 8px 14px; border: 1px solid var(--line-2); border-radius: 99px; background: rgba(10, 19, 22, .55); color: var(--mist);
  transition: border-color .2s, color .2s, background .2s;
}
.sale-filter:hover { border-color: var(--sap); color: var(--bone); }
.sale-filter[aria-pressed="true"] { background: var(--sap); border-color: var(--sap); color: var(--ink-on-sap); }

.sale-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 16px; list-style: none; margin: 0; padding: 0; }
.sale-card {
  display: flex; flex-direction: column; overflow: hidden; border-radius: var(--r-m); border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--moss), var(--night-2)); transition: transform .4s var(--ease), border-color .3s;
}
.sale-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--sap) 40%, transparent); }
.sale-media { position: relative; margin: 0; aspect-ratio: 4 / 3; background: #050a0b; overflow: hidden; }
.sale-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.sale-card:hover .sale-media img { transform: scale(1.03); }
.sale-media-btn { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.sale-media-btn:focus-visible { outline: 2px solid var(--sap); outline-offset: -3px; }
.sale-count { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 99px; background: rgba(6, 11, 13, .8); color: var(--bone); font-family: var(--f-mono); font-size: .75rem; pointer-events: none; }
.sale-count svg { width: 13px; height: 13px; }
.sale-media--empty { display: grid; place-items: center; color: var(--mist-2); }
.sale-media--empty svg { width: 44px; height: 44px; opacity: .5; }
.sale-card--sold .sale-media img { filter: grayscale(1); opacity: .55; }
.sale-card--sold { opacity: .86; }
.sale-card--sold:hover { transform: none; }
.sale-ribbon { position: absolute; top: 14px; left: 0; padding: 4px 14px; font-family: var(--f-mono); font-size: .75rem; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--night); background: var(--ember); border-radius: 0 99px 99px 0; }
.sale-ribbon--pending { background: var(--sap); }
.sale-body { display: flex; flex-direction: column; flex: 1; gap: 12px; padding: 22px; }
.sale-title { font-family: var(--f-display); font-size: 1.7rem; line-height: 1.1; font-weight: 500; color: var(--bone); margin: 0; }
.sale-priceline { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.sale-price { font-family: var(--f-display); font-size: 1.8rem; font-weight: 600; color: var(--sap); }
.sale-price--poa { font-size: 1.3rem; color: var(--aurora); }
.sale-pricenote { font-size: .85rem; color: var(--mist-2); }
.sale-summary { color: var(--mist); font-size: .94rem; margin: 0; }
.sale-specs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sale-specs li { display: flex; gap: 8px; align-items: flex-start; font-size: .9rem; color: var(--mist); line-height: 1.5; }
.sale-specs svg { width: 15px; height: 15px; flex: none; margin-top: 3px; color: var(--aurora); }
.sale-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.sale-cta { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 6px; }
.sale-cta .btn { flex: 1 1 auto; justify-content: center; }
.sale-noresults { grid-column: 1 / -1; text-align: center; padding: 60px 24px; color: var(--mist); }

/* photo viewer created by market.js */
.lightbox { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 32px; background: rgba(4, 8, 9, .95); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.lightbox[hidden] { display: none; }
.lightbox-figure { margin: 0; max-width: min(1100px, 100%); max-height: 74vh; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.lightbox-figure img { max-width: 100%; max-height: 66vh; width: auto; height: auto; object-fit: contain; border-radius: var(--r-m); background: var(--night-2); }
.lightbox-caption { color: var(--bone); font-size: .95rem; text-align: center; max-width: 70ch; }
.lightbox-counter { font-family: var(--f-mono); font-size: .76rem; letter-spacing: .12em; color: var(--mist); }
.lightbox-btn { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(6, 11, 13, .7); color: var(--bone); transition: border-color .2s, background .2s; }
.lightbox-btn:hover { border-color: var(--sap); background: rgba(6, 11, 13, .95); }
.lightbox-btn svg { width: 22px; height: 22px; }
.lightbox-close { position: absolute; top: 22px; right: 22px; }
.lightbox-prev { position: absolute; left: 22px; top: 50%; transform: translateY(-50%); }
.lightbox-next { position: absolute; right: 22px; top: 50%; transform: translateY(-50%); }
.lightbox--single .lightbox-prev, .lightbox--single .lightbox-next, .lightbox--single .lightbox-counter { display: none; }
@media (max-width: 640px) {
  .lightbox { padding: 16px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox-close { top: 12px; right: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .sale-card, .sale-card:hover, .sale-media img, .sale-card:hover .sale-media img { transform: none; transition: none; }
  .shadow-rune { animation: none; }
}
