/* IJWestern — the projects index.
   Prefix: px-  ·  zero collisions with styles.css or project.css.
   Depends on styles.css for the tokens, .shell, .topbar, .footer,
   .filter-row/.chip and the .reveal system. Nothing is redefined here
   that already exists there. */

.px-page {
  padding: calc(var(--topbar-gap) + var(--topbar-h) + clamp(40px, 5vw, 76px))
           0 clamp(64px, 8vw, 120px);
}

/* ─── Head ─────────────────────────────────────────────────────── */
.px-head {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 72px);
  align-items: end;
  padding-bottom: clamp(28px, 3.4vw, 44px);
}
.px-title {
  font-size: clamp(38px, 5vw, 72px);
  font-weight: var(--fw-display);
  line-height: var(--lh-display);
  letter-spacing: var(--ls-display);
  margin: 0;
}
.px-lead {
  margin: 0;
  font-size: clamp(17px, 1.25vw, 19px);
  line-height: 1.62;
  color: color-mix(in oklab, var(--survey-ink) 72%, transparent);
  max-width: 42ch;
  padding-bottom: 6px;
  font-weight: var(--fw-body);
}

.px-filters {
  margin-bottom: clamp(24px, 3vw, 40px);
  padding-bottom: clamp(20px, 2.4vw, 28px);
  border-bottom: var(--rule);
}

/* ─── Grid ─────────────────────────────────────────────────────── */
.px-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(20px, 2.4vw, 36px);
}

.px-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-media);
  overflow: hidden;
  background: var(--ground-white);
  border: 1px solid color-mix(in oklab, var(--survey-ink) 10%, transparent);
  box-shadow: 0 1px 2px rgba(26, 25, 22, 0.04);
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1),
              border-color 0.4s ease,
              box-shadow 0.5s ease;
}
.px-card:hover {
  transform: translateY(-6px);
  border-color: color-mix(in oklab, var(--laterite-gold) 48%, transparent);
  box-shadow: 0 26px 50px -30px rgba(26, 25, 22, 0.42);
}

/* ─── Media ────────────────────────────────────────────────────── */
.px-media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--stone-surface);
  flex: none;
}
.px-media img,
.px-media svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 1.1s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.px-card:hover .px-media img,
.px-card:hover .px-media svg,
.px-card:hover .px-media .hover-video { transform: scale(1.05); }

.px-tag {
  position: absolute;
  top: 14px; left: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: var(--fs-label);
  font-weight: var(--fw-strong);
  letter-spacing: 0.03em;
  white-space: nowrap;
  color: var(--ground-white);
  background: color-mix(in oklab, var(--survey-ink) 62%, transparent);
  border: 1px solid color-mix(in oklab, var(--ground-white) 22%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.px-tag .dot { width: 6px; height: 6px; border-radius: 999px; flex: none; }
.px-tag.is-selling .dot { background: #6FBF7F; }
.px-tag.is-progress .dot { background: var(--laterite-gold); }

.px-nophoto {
  position: absolute;
  bottom: 14px; left: 14px;
  z-index: 2;
  font-size: var(--fs-label);
  letter-spacing: 0.02em;
  color: color-mix(in oklab, var(--ground-white) 82%, transparent);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
  font-weight: var(--fw-strong);
}

/* ─── Body ─────────────────────────────────────────────────────── */
.px-body {
  display: flex;
  flex-direction: column;
  padding: clamp(20px, 1.8vw, 26px);
  flex: 1 1 auto;
}
.px-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.px-title-row .buy { flex: none; }
.px-name {
  font-family: var(--font-display);
  font-size: clamp(24px, 2vw, 30px);
  font-weight: var(--fw-display);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
  margin: 0;
  color: var(--survey-ink);
  transition: color 0.35s ease;
}
.px-card:hover .px-name { color: var(--laterite-gold-deep); }
.px-place {
  margin: 8px 0 0;
  font-size: var(--fs-meta);
  color: color-mix(in oklab, var(--survey-ink) 58%, transparent);
  font-weight: var(--fw-strong);
}
.px-intro {
  margin: 14px 0 0;
  font-size: var(--fs-body-s);
  line-height: 1.6;
  color: color-mix(in oklab, var(--survey-ink) 74%, transparent);
  /* Three lines keeps every card's figure strip on the same baseline
     without cutting any of these intros mid-thought at 2. Step 2 took
     this from 14px to 16px, which fits fewer words per line, so below
     1100 — where the column narrows too — it takes a fourth line
     rather than losing the end of the sentence. Every card in a row
     clamps to the same count, so the strips still align. */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: var(--fw-body);
}

.px-figs {
  margin-top: auto;
  padding-top: clamp(18px, 2vw, 24px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.px-fig .v {
  font-size: clamp(17px, 1.35vw, 20px);
  font-weight: var(--fw-display);
  letter-spacing: var(--ls-card);
  line-height: var(--lh-card);
  color: var(--survey-ink);
  font-variant-numeric: tabular-nums slashed-zero;
  white-space: nowrap;
}
.px-fig .v .unit {
  font-size: var(--fs-label);
  font-weight: var(--fw-body);
  margin-left: 3px;
  color: color-mix(in oklab, var(--survey-ink) 52%, transparent);
}
.px-fig .k {
  margin-top: 3px;
  font-size: var(--fs-micro);
  letter-spacing: 0.02em;
  color: color-mix(in oklab, var(--survey-ink) 50%, transparent);
  font-weight: var(--fw-strong);
}

.px-foot {
  margin-top: clamp(18px, 2vw, 22px);
  padding-top: 16px;
  border-top: var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.px-approval {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-label);
  color: color-mix(in oklab, var(--survey-ink) 60%, transparent);
  font-weight: var(--fw-strong);
}
.px-approval .tick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px; height: 17px;
  border-radius: 999px;
  flex: none;
  background: color-mix(in oklab, var(--laterite-gold) 18%, transparent);
  color: var(--laterite-gold-deep);
}
.px-go {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: var(--fs-meta);
  font-weight: var(--fw-bold);
  letter-spacing: 0.01em;
  color: var(--survey-ink);
  white-space: nowrap;
}
.px-go .arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* Up from 24px now that it stands alone without its label. */
  width: 32px; height: 32px;
  border-radius: 999px;
  flex: none;
  background: color-mix(in oklab, var(--survey-ink) 10%, transparent);
  transition: background 0.35s ease, transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.px-go .arrow svg { color: var(--survey-ink); transition: color 0.35s ease; }
.px-card:hover .px-go .arrow {
  background: var(--laterite-gold);
  /* Turns from ↗ to →, "go in". Rotating the other way pointed it
     straight up (client, 3 Nov). */
  transform: rotate(45deg);
}
.px-card:hover .px-go .arrow svg { color: var(--ground-white); }

/* ─── Responsive ───────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .px-head { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .px-lead { padding-bottom: 0;
  font-weight: var(--fw-body);
}
}
@media (max-width: 860px) {
  .px-grid { grid-template-columns: minmax(0, 1fr); }
  .px-media { aspect-ratio: 16 / 9; }
}
@media (max-width: 420px) {
  /* Four figure columns put "₹5,00,000" on two lines here. */
  .px-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
  .px-foot { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .px-card, .px-media img, .px-media svg, .px-name,
  .px-go .arrow, .px-go .arrow svg { transition: none !important; }
  .px-card:hover { transform: none; }
  .px-card:hover .px-media img,
  .px-card:hover .px-media svg { transform: none; }
  .px-card:hover .px-go .arrow { transform: none; }
}

/* ─── The odd card takes the row ───────────────────────────────────
   Five projects in a two-up grid leaves a hole. The last card of an
   odd set turns sideways and spans both columns, which reads as a
   deliberate close to the grid rather than a gap. */
@media (min-width: 861px) {
  .px-card.is-wide {
    grid-column: 1 / -1;
    flex-direction: row;
  }
  .px-card.is-wide .px-media {
    width: 42%;
    flex: none;
    aspect-ratio: 4 / 3;
  }
  /* `margin-top: auto` on the figures is what keeps the two-up cards'
     figure strips on a shared baseline. Sideways there is no row to
     align to, and it opened a hole under the intro — so the cluster
     sits centred with its normal rhythm instead. */
  .px-card.is-wide .px-body {
    padding: clamp(26px, 2.4vw, 40px);
    justify-content: center;
  }
  .px-card.is-wide .px-figs { margin-top: clamp(22px, 2.4vw, 30px); }
  .px-card.is-wide .px-name { font-size: clamp(28px, 2.4vw, 36px); }
  .px-card.is-wide .px-intro { -webkit-line-clamp: 4; max-width: 62ch; }
  .px-card.is-wide .px-figs { max-width: 620px; }
  .px-card.is-wide .px-foot { max-width: 620px; }
}

@media (max-width: 1100px) {
  .px-intro { -webkit-line-clamp: 4; }
}
