/* ================================================================
   McKinney Multifamily Group — Listings front end (/apartment-buildings-for-sale/)
   Page styles for index + market pages. Card copy rules live in the
   spec (§6/§7): attribution is body-size and never truncated.
   ================================================================ */

/* ---- hero ------------------------------------------------------ */
.lst-hero {
  background: var(--navy);
  padding: 10rem 0 4.5rem;
  position: relative;
  overflow: hidden;
}
.lst-hero::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 90% at 80% 0%, rgba(184,168,138,0.14), transparent 60%);
  pointer-events: none;
}
.lst-hero .wrap { position: relative; z-index: 1; }
.lst-h1 {
  font-family: var(--font-d);
  font-weight: 400;
  font-size: var(--d-section);
  line-height: 1.1;
  color: var(--white);
  max-width: 20em;
}
.lst-dek {
  margin-top: 1.25rem;
  font-size: var(--b-lg);
  font-weight: 300;
  line-height: 1.65;
  color: rgba(255,255,255,0.72);
  max-width: 44em;
}

/* Coverage disclosure — IDX 6.3(j) forbids claiming full access to the MLS®
   System, and the feed does not carry every Ontario board. */
.lst-coverage {
  margin-top: 0.75rem;
  font-size: var(--b-sm);
  font-weight: 300;
  line-height: 1.6;
  color: rgba(255,255,255,0.58);
  max-width: 44em;
}

/* ---- pagination (IDX 6.3(b): 100 listings per inquiry) ---------- */
.lst-pagination {
  display: flex; align-items: center; justify-content: center; gap: 1.5rem;
  margin-top: 2.5rem; font-size: var(--b-sm);
}
.lst-pagination a { color: var(--text-1); text-decoration: none; border-bottom: 1px solid var(--gold-dark); padding-bottom: 2px; }
.lst-pagination a:hover { color: var(--gold-dark); }
.lst-page-of { color: var(--text-2); }

/* ---- filter bar ------------------------------------------------ */
.lst-controls {
  position: sticky; top: 4.5rem; z-index: 50;
  background: var(--offwhite);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}
#lst-filters {
  display: flex; flex-wrap: wrap; gap: 1.25rem 2rem; align-items: flex-end;
}
.lst-group { border: none; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.lst-group-label {
  display: block; width: 100%;
  font-size: var(--b-xs); font-weight: 500; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-3);
  margin-bottom: 0.375rem; padding: 0;
}
.lst-pill { cursor: pointer; }
.lst-pill input { position: absolute; opacity: 0; pointer-events: none; }
.lst-pill span {
  display: inline-block; padding: 0.375rem 0.875rem;
  font-size: var(--b-sm); color: var(--text-2);
  border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--white); transition: all 0.2s; white-space: nowrap;
}
.lst-pill input:checked + span {
  background: var(--navy); border-color: var(--navy); color: var(--white);
}
.lst-pill input:focus-visible + span { outline: 2px solid var(--gold-dark); outline-offset: 1px; }
.lst-group input[type="number"], .lst-group select {
  font-family: var(--font-b); font-size: var(--b-sm); color: var(--text-1);
  padding: 0.4rem 0.625rem; border: 1px solid var(--border-strong);
  background: var(--white); width: 7.5rem;
}
.lst-group select { width: auto; }
.lst-cap-min { width: 5.25rem !important; }
.lst-dash { color: var(--text-3); }
.lst-check { display: inline-flex; align-items: center; gap: 0.5rem; font-size: var(--b-sm); color: var(--text-2); cursor: pointer; }
.lst-check input { accent-color: var(--navy); }

/* market multi-select dropdown (index page only) */
.lst-mkt { position: relative; }
.lst-mkt summary {
  list-style: none; cursor: pointer;
  display: inline-block; padding: 0.4rem 0.875rem;
  font-size: var(--b-sm); color: var(--text-2);
  border: 1px solid var(--border-strong); background: var(--white);
}
.lst-mkt summary::-webkit-details-marker { display: none; }
.lst-mkt[open] summary { border-color: var(--navy); color: var(--text-1); }
.lst-mkt-list {
  position: absolute; left: 0; top: calc(100% + 0.375rem); z-index: 60;
  display: flex; flex-direction: column; gap: 0.375rem;
  max-height: 21rem; overflow-y: auto;
  background: var(--white); border: 1px solid var(--border-strong);
  box-shadow: 0 12px 32px rgba(26,31,46,0.12);
  padding: 0.75rem; min-width: 16rem;
}
.lst-mkt-list .lst-pill span { border: none; padding: 0.25rem 0.5rem; border-radius: 4px; width: 100%; }
.lst-mkt-list .lst-pill input:checked + span { background: var(--cream); color: var(--text-1); font-weight: 500; }

/* ---- results --------------------------------------------------- */
.lst-results { padding: 2.5rem 0 4rem; background: var(--white); }
.lst-count { font-size: var(--b-sm); color: var(--text-2); margin-bottom: 1.5rem; }
.lst-grid {
  display: grid; gap: 2rem;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.lst-empty { font-size: var(--b-md); color: var(--text-2); padding: 3rem 0; }

/* ---- card (spec §6) -------------------------------------------- */
/* The card is a div with a stretched cover link; the own-listing tag
   (restoration brief §2) is its own link layered above the cover. */
.lst-card {
  position: relative; display: block; background: var(--white);
  border: 1px solid var(--border); transition: all 0.25s;
}
.lst-card:hover { border-color: var(--border-strong); box-shadow: 0 16px 40px rgba(26,31,46,0.10); transform: translateY(-2px); }
.lst-card-cover { position: absolute; inset: 0; z-index: 1; }
.lst-card-media { position: relative; aspect-ratio: 3 / 2; overflow: hidden; background: var(--cream); }
.lst-card-media img { width: 100%; height: 100%; object-fit: cover; }
.lst-flags {
  position: absolute; top: 0.75rem; left: 0.75rem; z-index: 2;
  display: flex; gap: 0.5rem; flex-wrap: wrap;
}
.lst-badge, .lst-tag {
  font-size: var(--b-xs); font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--white); padding: 0.25rem 0.625rem;
}
.lst-badge { background: var(--gold-dark); }
.lst-tag { background: var(--navy); transition: background 0.2s; }
.lst-tag:hover { background: var(--navy-light); }
.lst-card-body { padding: 1.25rem 1.375rem 1.375rem; }
.lst-card-l1 { font-family: var(--font-d); font-size: 1.3125rem; font-weight: 500; color: var(--text-1); line-height: 1.25; }
.lst-card-l2 { margin-top: 0.5rem; font-size: var(--b-md); color: var(--text-1); }
/* Attribution (§7.1 + IDX Data Agreement 6.3(c)): the listing brokerage must
   be "in the same font and size as the other Listing(s) details and not
   visually separated from the Listing(s) display". So it matches .lst-card-l2
   exactly and carries NO separating rule. The previous treatment had a
   border-top and a muted colour — both are the thing 6.3(c) prohibits.
   Do not re-add a divider or de-emphasise this line. */
.lst-card-l3 { margin-top: 0.5rem; font-size: var(--b-md); color: var(--text-1); }

/* ---- snapshot age (§7.5) --------------------------------------- */
.lst-refreshed { background: var(--white); padding: 0 0 2rem; }
.lst-refreshed .wrap { font-size: var(--b-sm); color: var(--text-3); }

/* ---- staging banner (fixture mode only; cannot be dismissed) --- */
.lst-staging-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 200;
  background: var(--gold-dark); color: var(--white);
  font-size: var(--b-sm); font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; text-align: center;
  padding: 0.625rem var(--side);
}

/* ================================================================
   DETAIL PAGE (spec §6 "Detail page")
   ================================================================ */
.det-head { background: var(--offwhite); border-bottom: 1px solid var(--border); padding: 7.5rem 0 2.5rem; }
.det-back {
  display: inline-block; margin-bottom: 1.5rem;
  font-size: var(--b-xs); font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold-dark); border-bottom: 1px solid rgba(154,139,111,0.4); padding-bottom: 2px;
}
.det-head-grid { display: flex; justify-content: space-between; gap: 2.5rem; align-items: flex-start; flex-wrap: wrap; }
.det-h1 { font-family: var(--font-d); font-weight: 400; font-size: var(--d-section); line-height: 1.1; color: var(--text-1); }
.det-sub { margin-top: 0.625rem; font-size: var(--b-md); color: var(--text-2); }
/* Attribution block: above the fold on mobile, never collapsed (§6/§7.1) */
/* 6.3(c): same size and weight as the surrounding listing details. */
.det-attribution { margin-top: 1rem; font-size: var(--b-md); color: var(--text-1); line-height: 1.7; }
.det-price { text-align: right; }
.det-price-main { font-family: var(--font-d); font-size: var(--d-stat-sm); font-weight: 500; color: var(--text-1); line-height: 1.1; }
.det-ctas { margin-top: 2rem; display: flex; gap: 2.5rem; flex-wrap: wrap; }
.det-cta { max-width: 24rem; }
.det-cta-help { margin-top: 0.625rem; font-size: var(--b-sm); color: var(--text-3); line-height: 1.6; }

.det-photos { padding: 2.5rem 0 0; background: var(--white); }
.det-photo-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.det-photo { aspect-ratio: 3 / 2; overflow: hidden; background: var(--cream); }
.det-photo img { width: 100%; height: 100%; object-fit: cover; }
.det-photo:first-child { grid-column: 1 / -1; aspect-ratio: 21 / 9; }

.det-h2 { font-family: var(--font-d); font-weight: 500; font-size: var(--d-sub); color: var(--text-1); margin-bottom: 1.25rem; }
.det-figures { padding: 3.5rem 0 0; background: var(--white); }
.det-figures-table { width: 100%; max-width: 34rem; border-collapse: collapse; }
.det-figures-table td { padding: 0.75rem 0; border-bottom: 1px solid var(--border); font-size: var(--b-md); color: var(--text-1); }
.det-figures-table td:last-child { text-align: right; }

.det-remarks { padding: 3.5rem 0 0; background: var(--white); }
/* PublicRemarks as supplied — line breaks preserved, no editing (§7.8) */
.det-remarks-text { font-size: var(--b-md); font-weight: 300; line-height: 1.75; color: var(--text-1); max-width: 46rem; white-space: pre-line; }

.det-request { padding: 3.5rem 0 4rem; background: var(--white); }
.det-request-box { max-width: 34rem; border: 1px solid var(--border-strong); background: var(--offwhite); padding: 2rem; }
.det-req-form { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1.25rem; }
.det-req-form input[type="text"], .det-req-form input[type="email"], .det-req-form input[type="tel"] {
  width: 100%; padding: 0.875rem 1rem;
  font-family: var(--font-b); font-size: var(--b-sm); color: var(--text-1);
  background: var(--white); border: 1px solid var(--border-strong);
}
.det-req-form input:focus { outline: none; border-color: var(--gold-dark); }
.det-req-form input[aria-invalid="true"] { border-color: #B0413E; }
.det-req-consent { display: flex; gap: 0.625rem; align-items: flex-start; font-size: var(--b-xs); line-height: 1.55; color: var(--text-2); }
.det-req-consent input { margin-top: 2px; accent-color: var(--gold-dark); }
.det-req-form .btn { justify-content: center; width: 100%; }
.det-req-note { font-size: var(--b-xs); line-height: 1.6; color: var(--text-3); margin-top: 0.875rem; }
.det-req-sent { font-size: var(--b-md); line-height: 1.7; color: var(--text-1); padding: 0.5rem 0; }
.det-req-sent strong { color: var(--gold-dark); }
.det-hp { position: absolute; left: -9999px; }

.det-gone { padding: 10rem 0 6rem; }

/* ---- responsive ------------------------------------------------ */
@media (max-width: 768px) {
  .det-head { padding-top: 6.5rem; }
  .det-head-grid { flex-direction: column; gap: 1.25rem; }
  .det-price { text-align: left; }
  .det-photo:first-child { aspect-ratio: 3 / 2; }
}
@media (max-width: 768px) {
  .lst-hero { padding: 8rem 0 3rem; }
  .lst-controls { position: static; }
  #lst-filters { gap: 1rem 1.25rem; }
  .lst-grid { grid-template-columns: 1fr; gap: 1.25rem; }
}


/* §6 footer notice on the listings routes (IDX 6.3(i)/(k)); same size and
   weight as .footer-legal beneath it — present, not de-emphasised. */
.footer-idx-notice { font-size: 0.6875rem; font-weight: 300; color: rgba(255,255,255,0.55); line-height: 1.7; margin: 0 0 0.75rem; }

/* Query service in flight (listings.js): the grid dims until the answer lands. */
.lst-grid[aria-busy="true"] { opacity: 0.5; transition: opacity 0.15s ease; }

/* The filter layer toggles these with the hidden attribute; it must beat the
   display rules above (two pagination rows showed at once — Sept 21 2026). */
.lst-pagination[hidden], .lst-grid[hidden], .lst-empty[hidden] { display: none !important; }
