/* ============================================================
   Properties section
   ============================================================ */
.properties {
  padding-block: 120px;
  background: var(--paper);
}

.properties__inner {
  width: 100%;
  padding-inline: 100px;
}

/* FIX 9 (design audit), real root cause: this used to be grouped into an
   earlier @media (max-width: 640px) block (shared with .hero__body etc.)
   that reduced padding-inline to 24px, but with equal selector
   specificity, this unconditional rule appearing LATER in the file always
   won regardless of viewport, so .properties__inner never actually
   shrank on mobile at all. At a 390px viewport that left ~190px of
   actual content width (390 - 100*2), which is what was squeezing the
   property card, and its address text, into an unreasonably narrow
   column; the wrap itself was a symptom, not the bug. Placed here, after
   the base rule, so source order can't undo it again. */
@media (max-width: 640px) {
  .properties__inner {
    padding-inline: 24px;
  }
}

/* ============================================================
   Property cards
   ============================================================ */
.properties-grid {
  --grid-gap: clamp(24px, 3vw, 20px);
  --grid-cols: 3;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--grid-gap);
}

.properties__cta {
  display: flex;
  justify-content: center;
  margin-top: 48px;
}

.property-card {
  flex: 1 1 calc((100% - (var(--grid-cols) - 1) * var(--grid-gap)) / var(--grid-cols));
  max-width: calc((100% - (var(--grid-cols) - 1) * var(--grid-gap)) / var(--grid-cols));
  display: flex;
  flex-direction: column;
  gap: 28px;
  background: var(--paper-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
}

.property-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius-md);
}

.property-card__media-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: url(../cover_3.avif) center/cover no-repeat;
}

.property-card__media--1 .property-card__media-img { background-position: 30% 40%; }
.property-card__media--2 .property-card__media-img { background-position: 70% 20%; }
.property-card__media--3 .property-card__media-img { background-position: 50% 75%; }
.property-card__media--4 .property-card__media-img { background-position: 15% 60%; }
.property-card__media--5 .property-card__media-img { background-position: 85% 45%; }

.property-card__badge {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, var(--glass-bg-top), var(--glass-bg-bottom));
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  color: var(--accent-contrast);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.property-card__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 10px 10px;
}

.property-card__row {
  display: flex;
  /* flex-start, not center: a long address can wrap to 2-3 lines on a
     narrow card, and center-aligning against that variable-height sibling
     stranded the rating pill (and the location pin icon within its own
     span) in the vertical middle of the wrapped text instead of anchored
     to the first line. */
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.property-card__location {
  /* FIX 9 (design audit): with no flex-basis/grow of its own, this shrank
     down toward its min-content width whenever its sibling rating pill
     (fixed width, white-space: nowrap) took any meaningful space in the
     row: on narrow cards that meant the address wrapping to one or two
     words per line instead of using the width actually available to it.
     flex: 1 claims the row's remaining space after the pill; min-width: 0
     is required alongside it so the box can actually shrink to fit that
     space rather than flexbox's default min-width: auto (content-based
     floor) fighting the very wrap this is meant to make less cramped. */
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.property-card__location .icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  /* Nudge down to sit on the first line's cap-height instead of the
     span's own top edge, now that align-items is flex-start not center. */
  margin-top: 2px;
}

.property-card__rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.property-card__rating .icon--solid {
  width: 13px;
  height: 13px;
  fill: var(--dusk-glow);
  stroke: none;
  margin-right: 1px;
}

.property-card__reviews {
  font-weight: 400;
  color: var(--ink-soft);
}

.property-card__title {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.55rem;
  line-height: 1.15;
  letter-spacing: normal;
  color: var(--ink);
}

.property-card__amenities {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.property-card__amenities-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.amenity-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--paper);
  border: 1px solid var(--border-soft);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.amenity-chip .icon {
  width: 14px;
  height: 14px;
}

.amenity-chip--more {
  align-self: flex-start;
  color: var(--ink);
  font-weight: 600;
  border-style: dashed;
}

.property-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
}

.property-card__price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink);
}

.property-card__price span {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.btn-view {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: 0.86rem;
  font-weight: 600;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}

.btn-view:hover {
  background: var(--dusk-deep);
  transform: translateY(-1px);
}

@media (max-width: 980px) {
  .properties-grid {
    --grid-cols: 2;
  }

  /* A single card still sized itself as one slot of a fully-populated
     --grid-cols row: half-width at this 2-column tablet breakpoint,
     narrower than the single-column *mobile* card below it, which is
     backwards, and cramped the address/amenity chips into far more wrap
     lines than the card's actual available width justified. Scoped to
     this breakpoint (not applied unconditionally) because the desktop
     3-column lone-card case was checked separately and already centers
     at a deliberately narrower, proportional width; this rule would
     blow it up to full row width instead, which isn't the same bug. */
  .properties-grid:has(.property-card:only-child) {
    --grid-cols: 1;
  }
}

@media (max-width: 620px) {
  .properties-grid {
    --grid-cols: 1;
  }
}

