/* ==============================================================
   Vistaarly · components/card-listing.css
   ---------------------------------------------------------------
   Square (1:1) card. ~70% image, ~30% details (spec points 10-14,
   widened slightly to fit the followers/engagement stats row added
   below the name). Uses object-fit: contain on foreground + blurred
   bg fill for any aspect ratio (points 33-34). Four rows in details:
     line 1: name + niche
     line 2: followers + engagement rate (only if data present)
     line 3: price + rating
     line 4: view-details button
   ============================================================== */

.v-card {
  display: flex;
  flex-direction: column;
  /* CHANGE: min-height: 372px -> min-height: auto
     Fixed 372px was forcing the grid's 1fr spacer row (in
     .v-card-body) to stretch and fill leftover space whenever a
     card had less content (e.g. missing rating), which showed up
     as extra empty gap stretching below the "View details" button. */
  min-height: auto;
  background: var(--color-bg, #fff);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: transform .28s cubic-bezier(.2,.8,.2,1), box-shadow .28s ease, border-color .28s ease;
  position: relative;
  isolation: isolate;
}
.v-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(11,15,25,0.12);
  border-color: var(--color-primary, #0b0f19);
}

/* ---------------- Square image area (~70% of card height) ---------------- */
.v-card-cover {
  position: relative;
  aspect-ratio: 1 / 1;                        /* Square image, any ratio contained */
  width: 100%;
  overflow: hidden;
  background: #111827;
  isolation: isolate;
  display: block;
}
.v-card-cover-bg {
  position: absolute;
  inset: -8%;
  width: 116%;
  height: 116%;
  object-fit: cover;
  filter: blur(28px) saturate(1.15) brightness(0.85);
  transform: scale(1.15);
  z-index: 0;
  pointer-events: none;
}
.v-card-cover-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(11,15,25,0.15);
}
.v-card-cover-fg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 1;
  transition: transform .5s ease;
  padding: 8px;
  box-sizing: border-box;
}
.v-card:hover .v-card-cover-fg { transform: scale(1.03); }

.v-card-badges {
  position: absolute;
  top: 10px; left: 10px;
  display: flex; gap: 6px; flex-wrap: wrap;
  z-index: 2;
}
.v-card-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(255,255,255,0.94);
  color: var(--color-primary, #0b0f19);
  font-size: 0.68rem; font-weight: 600;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.v-card-badge.is-verified { background: #059669; color: #fff; }
.v-card-badge.is-featured { background: linear-gradient(135deg,#f59e0b,#d97706); color: #fff; }
.v-card-badge.is-premium { background: linear-gradient(135deg,#4c1d95,#7c3aed); color: #fff; }

/* ---------------- ~30%: details ---------------- */
.v-card-body {
  /* CHANGE: height: 30% -> height: auto
     30% of a flex column with no fixed parent height was also
     contributing to the forced stretch below the button. */
  height: auto;
  padding: 10px 14px 12px;
  display: grid;
  /* CHANGE: grid-template-rows: auto auto 1fr auto -> auto auto auto auto
     The middle 1fr row was a flexible spacer that absorbed all
     leftover vertical space to hit the old min-height — that's
     exactly the "extra height/stretch under View details" bug.
     All four rows now size strictly to their own content. */
  grid-template-rows: auto auto auto auto;
  gap: 4px;
  background: #fff;
  border-top: 1px solid var(--color-border, #e5e7eb);
}

/* Row 1 · name + niche */
.v-card-row-1 {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; min-width: 0;
}
.v-card-name {
  font-family: var(--display, 'Fraunces', serif);
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--color-primary, #0b0f19);
  margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0; flex: 1;
  letter-spacing: -0.01em;
}
.v-card-niche {
  font-size: 0.68rem;
  color: var(--color-text-muted, #6b7280);
  background: var(--color-bg-alt, #f7f7f5);
  padding: 2px 8px; border-radius: 999px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 45%;
  font-family: var(--mono, 'IBM Plex Mono', monospace);
  text-transform: uppercase; letter-spacing: 0.04em;
}

/* Row · followers + engagement (new — only rendered when data present) */
.v-card-row-stats {
  display: flex; align-items: center; gap: 10px;
  min-width: 0;
}
.v-card-stat {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.72rem; font-weight: 500;
  color: var(--color-text-muted, #6b7280);
  font-family: var(--mono, 'IBM Plex Mono', monospace);
  white-space: nowrap;
}
.v-card-stat i { font-size: 0.68rem; color: var(--accent, #f59e0b); }

/* Row 2 · price + rating */
.v-card-row-2 {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.v-card-price {
  font-family: var(--mono, 'IBM Plex Mono', monospace);
  font-weight: 600; font-size: 0.86rem;
  color: var(--color-primary, #0b0f19);
  line-height: 1;
  white-space: nowrap;
}
.v-card-price small { color: var(--color-text-muted, #6b7280); font-weight: 400; font-size: 0.65rem; margin-left: 2px; }
.v-card-rating {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.76rem; color: var(--color-text, #111827); font-weight: 500;
  white-space: nowrap;
}
.v-card-rating .fa-star { color: #f59e0b; font-size: 0.72rem; }
.v-card-rating .count { color: var(--color-text-muted); font-size: 0.68rem; }

/* Row 3 · view details button */
.v-card-row-3 { display: flex; align-items: center; }
.v-card-cta {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 6px 10px;
  border-radius: 8px; border: 1px solid var(--color-primary, #0b0f19);
  background: transparent; color: var(--color-primary, #0b0f19);
  font-size: 0.78rem; font-weight: 600; text-decoration: none;
  transition: all .18s ease;
}
.v-card-cta:hover {
  background: var(--color-primary, #0b0f19); color: #fff;
}
.v-card-cta .fa-solid { font-size: 0.72rem; transition: transform .18s ease; }
.v-card-cta:hover .fa-solid { transform: translateX(3px); }

/* Locked (quota-exhausted) shade — kept in code so free users see zero
   listings beyond the 25 quota per spec point 16 (removed from render);
   but if you want to soft-lock instead of hide, add class is-locked. */
.v-card.is-locked { filter: grayscale(0.6); opacity: 0.55; pointer-events: none; }
.v-card.is-locked::after {
  content: '\f023  Locked · Upgrade';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(11,15,25,0.55); color: #fff;
  font-family: 'Font Awesome 6 Free', var(--display); font-weight: 900;
  z-index: 3; border-radius: 18px;
}