/* ── LISTING CARDS — MANOR ── */

.listings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}

.listing-card {
  background: var(--surface);
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid var(--hairline);
  cursor: pointer;
  transition: transform var(--trans-med), border-color var(--trans-med);
  position: relative;
  /* Cards in a row stay identical even when one has fewer tags — the body
     takes the slack so every footer lands on the same line. */
  display: flex; flex-direction: column; height: 100%;
}
.listing-card .card-body { flex: 1 1 auto; }
.listing-card .card-footer { margin-top: auto; }
.listing-card .card-tags { align-content: flex-start; }

.listing-card:hover {
  transform: translateY(-4px);
  border-color: var(--bronze);
}

/* Image */
.card-img {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  position: relative;
}

.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.listing-card:hover .card-img img { transform: scale(1.06); }

/* Placeholder colors — bronze-tinted neutrals */
.card-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.6s var(--ease);
}
.listing-card:hover .card-img-placeholder { transform: scale(1.04); }

.card-img.warm  .card-img-placeholder { background: linear-gradient(135deg,#3A3031,#161213); }
.card-img.sage  .card-img-placeholder { background: linear-gradient(135deg,#383029,#161213); }
.card-img.dusk  .card-img-placeholder { background: linear-gradient(135deg,#352B2C,#0D0B0B); }
.card-img.ocean .card-img-placeholder { background: linear-gradient(135deg,#3C332B,#161213); }
.card-img.terra .card-img-placeholder { background: linear-gradient(135deg,#43302A,#161213); }
.card-img.sand  .card-img-placeholder { background: linear-gradient(135deg,#3E362C,#161213); }

.placeholder-icon { opacity: 0.25; }

/* Save / favourite button */
.card-fav {
  position: absolute;
  bottom: 12px; right: 12px;
  width: 38px; height: 38px;
  border-radius: 2px;
  background: rgba(13,11,11,0.62);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--hairline);
  display: flex; align-items: center; justify-content: center;
  z-index: 3;
  transition: transform var(--trans-fast), background var(--trans-fast);
  min-height: 0;
  /* On a touch screen, tapping save used to flash the whole card (the button
     sits inside the card's <a>) and could start a text selection. Keep the tap
     on the button itself. */
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}
body.dv .card-fav { right: auto; left: 12px; }
.card-fav:hover { transform: scale(1.1); background: rgba(13,11,11,0.85); }
.card-fav svg { width: 19px; height: 19px; stroke: #F4F1EC; fill: none; stroke-width: 1.8; transition: all var(--trans-fast); }
.card-fav.saved svg { fill: var(--teal); stroke: var(--teal); }
/* the card is a link, so suppress the mobile tap flash across the whole tile */
.listing-card, .pcard { -webkit-tap-highlight-color: transparent; }
.card-fav.saved { animation: favPop 0.35s var(--ease); }
@keyframes favPop { 0%{transform:scale(1);} 45%{transform:scale(1.28);} 100%{transform:scale(1);} }

/* Card badges */
.card-badges {
  position: absolute;
  top: 14px; left: 14px; right: 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  z-index: 2;
}

/* Card body */
.card-body { padding: 20px 22px 22px; }

.card-price-row {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-bottom: 6px;
}

.card-price-num {
  /* An amount never breaks across lines — "MVR 15,420" split over two rows
     reads as two numbers. The row wraps between amounts, never inside one. */
  white-space: nowrap;
  font-family: 'Newsreader', serif;
  font-style: italic;
  font-weight: 500;
  font-size: 23px;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.card-price-unit {
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
}

/* ── Two currencies, two amounts ───────────────────────────────────
   A home priced in USD shows the USD price, then the MVR its
   landlord will actually accept underneath it — quieter, but not a footnote:
   it is a real price somebody typed, not a conversion. */
.card-price-alt {
  margin-top: -2px;
}
.card-price-alt .card-price-num {
  font-size: 17px;
  color: var(--muted);
}
.card-price-alt .card-price-unit { font-size: 12px; }

/* Said once per card, only where both currencies are on it. */
.card-price-note {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 14px;
}

/* Room in Apartment — the arrangement, in one line, without opening it */
.card-room {
  font-size: 13px;
  color: var(--teal-ink);
  margin-bottom: 8px;
  line-height: 1.5;
}

.card-deposit-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--muted);
  font-family: var(--font-data); font-variant-numeric: tabular-nums;
  flex-wrap: wrap;
}
/* Two deposits sit side by side, separated rather than run together */
.card-deposit-amt { white-space: nowrap; }
.card-deposit-amt + .card-deposit-amt { padding-left: 8px; }

.deposit-pill {
  background: transparent;
  border: 1px solid var(--hairline);
  color: var(--bronze);
  font-family: 'Instrument Sans', sans-serif;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 2px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.card-divider {
  height: 1px;
  background: var(--hairline);
  margin-bottom: 14px;
}

.card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ctag {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--hairline);
  padding: 4px 12px;
  border-radius: 2px;
}

/* Card footer (landlord row) */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-top: 1px solid var(--hairline);
  background: rgba(13,11,11,0.4);
}

.card-landlord {
  display: flex;
  align-items: center;
  gap: 8px;
}

.landlord-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(126,123,120,0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  overflow: hidden;
  flex-shrink: 0;
}

.landlord-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.landlord-verified {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-ink);
  background: var(--teal-bg);
  border: 1px solid var(--teal-border);
  padding: 3px 8px;
  border-radius: 2px;
}

/* Responsive */
@media (max-width: 900px) {
  .listings-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 540px) {
  .listings-grid { grid-template-columns: 1fr; gap: 18px; }
  .card-price-num{ font-size:21px; }
  .card-body{ padding:18px 20px 20px; }
  .card-deposit-row{ font-size:13px; }
}
