/* ─────────────────────────────────────────────────────
   RESIDENCES PAGE — Warmlyn design system
   ───────────────────────────────────────────────────── */

:root {
  --page-bg:       #FAF7F2;
  --text:          #191311;
  --muted:         #5E5048;
  --gold:          #C9A96E;
  --gold-deep:     #A8883D;
  --gold-pale:     #F5EDD8;
  --cream-border:  #E5DDD3;
  --btn:           #3A2F2A;

  --divider:       rgba(94,80,72,0.14);

  --radius-card:   18px;
  --radius-img:    14px;

  --pad-x:         80px;
  --pad-top:       100px;
}

body {
  font-family: "Geist", system-ui, -apple-system, Segoe UI, sans-serif;
  background: var(--page-bg);
  color: var(--text);
}

/* ── PAGE WRAPPER ──────────────────────────────────── */
.residences {
  padding-top: var(--pad-top);
}

.residences__inner {
  padding-left:  var(--pad-x);
  padding-right: var(--pad-x);
  padding-bottom: 120px;
  max-width: 1360px;
  margin: 0 auto;
}

/* ── PAGE HEADER ───────────────────────────────────── */
.residences__head {
  max-width: 700px;
  padding-bottom: 52px;
  border-bottom: 1px solid var(--cream-border);
  margin-bottom: 56px;
}

.residences__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 16px;
}

.residences__eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--gold);
}

.residences__title {
  font-size: 42px;
  letter-spacing: -0.04em;
  line-height: 1.1;
  font-weight: 600;
  margin: 0 0 16px;
  color: var(--text);
}

.residences__subtitle {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.01em;
  line-height: 1.65;
  color: var(--muted);
  max-width: 520px;
}

.residences__meta {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: -0.01em;
}

.residences__meta svg {
  flex-shrink: 0;
  opacity: 0.6;
}

/* ── LISTINGS LIST ─────────────────────────────────── */
.residences__list {
  display: flex;
  flex-direction: column;
}

/* ── DIVIDER ───────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--divider);
  width: 100%;
}

/* ── ROW ───────────────────────────────────────────── */
.row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}

/* ── CARD ──────────────────────────────────────────── */
.card {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  padding: 28px 24px;
  background: transparent;
  border-radius: 0;
  transition: background 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  position: relative;
}

/* subtle inner border between adjacent cards in a row */
.row .card:first-child:not(:last-child) {
  border-right: 1px solid var(--divider);
}

.card::after {
  display: none;
}

.card:hover {
  background: var(--btn);
}

.card:hover .card__name {
  color: #FAF7F2;
}

.card:hover .card__meta,
.card:hover .card__desc,
.card:hover .card__per {
  color: rgba(250, 247, 242, 0.62);
}

.card:hover .card__price {
  color: #FAF7F2;
}

.card:hover .card__label {
  color: rgba(250, 247, 242, 0.82);
}

/* ── CARD IMAGE ────────────────────────────────────── */
.card__img-wrap {
  border-radius: var(--radius-img);
  overflow: hidden;
  height: 240px;
  flex-shrink: 0;
  background: var(--cream-border);
  align-self: center;
}

.card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}

.card:hover .card__img {
  transform: scale(1.04);
}

/* ── CARD RIGHT ────────────────────────────────────── */
.card__right {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 4px 0 4px 24px;
  min-height: 240px;
}

.card__stack {
  display: flex;
  flex-direction: column;
  gap: 0;
  height: 100%;
  justify-content: space-between;
}

/* ── CARD TOP: name + meta ─────────────────────────── */
.card__top {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card__name {
  font-size: 20px;
  letter-spacing: -0.03em;
  line-height: 1.2;
  font-weight: 600;
  margin: 0;
  color: var(--text);
  transition: color 0.2s;
}

/* name colour is handled by the consolidated hover block below */

.card__meta {
  margin: 6px 0 0;
  font-size: 13px;
  letter-spacing: -0.01em;
  line-height: 1.4;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.card__meta svg {
  flex-shrink: 0;
  opacity: 0.55;
}

/* ── CARD MID: type + desc ─────────────────────────── */
.card__mid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card__label {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0;
  color: var(--text);
}

.card__desc {
  margin: 0;
  font-size: 13.5px;
  letter-spacing: -0.01em;
  line-height: 1.6;
  color: var(--muted);
}

/* ── CARD BOTTOM: price ────────────────────────────── */
.card__bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.card__price-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.card__price {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.1;
  transition: color 0.2s;
}

/* price colour handled by the consolidated hover block */

.card__per {
  font-size: 12px;
  letter-spacing: -0.01em;
  color: var(--muted);
  line-height: 1;
}

/* arrow caret */
.card__arrow {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1.5px solid var(--cream-border);
  background: #fff;
  display: grid;
  place-items: center;
  color: var(--muted);
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
  flex-shrink: 0;
}

.card:hover .card__arrow {
  background: rgba(250, 247, 242, 0.15);
  border-color: rgba(250, 247, 242, 0.28);
  color: #FAF7F2;
  transform: translate(2px, -2px);
}

/* 2-line truncation */
.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── SKELETON ──────────────────────────────────────── */
.card--skel {
  pointer-events: none;
  cursor: default;
}

.card--skel::after {
  display: none;
}

.skel {
  background: rgba(94, 80, 72, 0.07);
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}

.skel::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  100% { transform: translateX(100%); }
}

.skel-img {
  height: 240px;
  border-radius: var(--radius-img);
}

.skel-line {
  height: 14px;
  border-radius: 999px;
}

.skel-line.lg {
  height: 20px;
}

.skel-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── EMPTY / ERROR STATE ───────────────────────────── */
.residences__empty {
  padding: 80px 0;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  letter-spacing: -0.01em;
  line-height: 1.6;
}

/* ── RESPONSIVE ────────────────────────────────────── */

/* Large desktop */
@media (min-width: 1200px) {
  .card {
    grid-template-columns: 260px 1fr;
  }

  .card__img-wrap {
    height: 260px;
  }

  .card__right {
    min-height: 260px;
  }

  .skel-img {
    height: 260px;
  }
}

/* Tablet */
@media (max-width: 1024px) {
  :root {
    --pad-x: 44px;
    --pad-top: 88px;
  }

  .card {
    grid-template-columns: 180px 1fr;
    padding: 22px 18px;
  }

  .card__img-wrap {
    height: 210px;
  }

  .card__right {
    min-height: 210px;
    padding-left: 18px;
  }

  .skel-img {
    height: 210px;
  }

  .residences__title {
    font-size: 36px;
  }
}

/* Stack cards early, single column */
@media (max-width: 900px) {
  :root {
    --pad-x: 28px;
    --pad-top: 84px;
  }

  .row {
    grid-template-columns: 1fr;
  }

  .row .card:first-child:not(:last-child) {
    border-right: none;
    border-bottom: 1px solid var(--divider);
  }

  .residences__head {
    padding-bottom: 40px;
    margin-bottom: 40px;
  }

  .residences__title {
    font-size: 32px;
  }

  .card {
    grid-template-columns: 190px 1fr;
    padding: 20px 16px;
  }

  .card__img-wrap {
    height: 200px;
  }

  .card__right {
    min-height: 200px;
    padding-left: 16px;
  }

  .skel-img {
    height: 200px;
  }
}

/* Mobile — cards go vertical */
@media (max-width: 600px) {
  :root {
    --pad-x: 20px;
    --pad-top: 76px;
  }

  .residences__inner {
    padding-bottom: 88px;
  }

  .residences__head {
    padding-bottom: 32px;
    margin-bottom: 0;
    border-bottom: none;
  }

  .residences__list {
    gap: 0;
  }

  /* on mobile every card is separated by a full-width divider — handled via row */
  .row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  /* each card gets consistent vertical padding top + bottom */
  .card {
    grid-template-columns: 1fr;
    padding: 24px 0;
    gap: 14px;
  }

  /* remove all mid-row border overrides — divider handles separation */
  .row .card:first-child:not(:last-child) {
    border-bottom: none;
    border-right: none;
    padding-bottom: 24px;
  }

  /* put a divider between the two cards inside a row on mobile */
  .row .card:first-child:not(:last-child)::after {
    content: '';
    display: block;
    height: 1px;
    background: var(--divider);
    margin-top: 24px;
    grid-column: 1 / -1;
  }

  .residences__title {
    font-size: 28px; 
  }

  .residences__subtitle {
    font-size: 15px;
  }

  .card__img-wrap {
    height: 230px;
    border-radius: 14px;
  }

  .card__right {
    padding-left: 0;
    min-height: unset;
  }

  .card__stack {
    gap: 14px;
  }

  .card__name {
    font-size: 18px;
  }

  .card__price {
    font-size: 20px;
  }

  .skel-img {
    height: 230px;
  }
}

@media (max-width: 480px) {
  :root {
    --pad-x: 16px;
  }

  .residences__title {
    font-size: 25px;
  }

  .card__img-wrap {
    height: 210px;
  }

  .skel-img {
    height: 210px;
  }
}

/* Touch: no hover effects */
@media (hover: none) and (pointer: coarse) {
  .card:hover {
    background: transparent;
  }

  .card:hover .card__img {
    transform: none;
  }

  .card:hover .card__name,
  .card:hover .card__price {
    color: var(--text);
  }

  .card:hover .card__meta,
  .card:hover .card__desc,
  .card:hover .card__per {
    color: var(--muted);
  }

  .card:hover .card__label {
    color: var(--gold-deep);
  }

  .card:hover .card__arrow {
    background: #fff;
    border-color: var(--cream-border);
    color: var(--muted);
    transform: none;
  }

  /* active/press state mirrors hover inversion */
  .card:active {
    background: var(--btn);
  }

  .card:active .card__name,
  .card:active .card__price {
    color: #FAF7F2;
  }

  .card:active .card__meta,
  .card:active .card__desc,
  .card:active .card__per {
    color: rgba(250, 247, 242, 0.62);
  }

  .card:active .card__label {
    color: rgba(250, 247, 242, 0.82);
  }

  .card:active .card__arrow {
    background: rgba(250, 247, 242, 0.15);
    border-color: rgba(250, 247, 242, 0.28);
    color: #FAF7F2;
  }
}