/**
 * Shared profile cards for PUBLIC site (home, search.php) + member panel.
 * Self-contained — no dependency on body.member-app.
 * Keep in sync with the .sv-profile-card block in member-app.css
 */
:root {
  --sv-brand: #800020;
  --sv-brand-dark: #600018;
  --sv-muted: #6b7280;
  --sv-ink: #1a1a1a;
  --sv-border: #e8e0d8;
  --sv-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
  --sv-shadow-hover: 0 12px 28px rgba(122, 12, 31, 0.12);
}

.sv-profile-card {
  background: #fff;
  border-radius: 18px;
  padding: 1rem;
  box-shadow: var(--sv-shadow);
  border: 1px solid var(--sv-border);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.sv-profile-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sv-shadow-hover);
}

.sv-profile-card .sv-card-media {
  position: relative;
  margin-bottom: 0.9rem;
}

.sv-profile-card .sv-card-media img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  border-radius: 14px;
  display: block;
  background: #eee;
}

.sv-profile-card .sv-badge-premium,
.sv-profile-card .sv-badge-match {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #22c55e;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  z-index: 2;
}

.sv-profile-card .sv-badge-match {
  background: rgba(128, 0, 32, 0.92);
}

.sv-profile-card .sv-card-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1rem;
  border-radius: 0 0 14px 14px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), transparent);
  color: #fff;
}

.sv-profile-card .sv-card-overlay h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
  color: #fff;
}

.sv-profile-card .sv-card-overlay p {
  margin: 2px 0 0;
  font-size: 0.82rem;
  opacity: 0.92;
  color: #fff;
}

.sv-profile-card .sv-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.sv-profile-card .sv-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--sv-muted);
}

.sv-profile-card .sv-card-meta .loc i {
  color: var(--sv-brand);
  margin-right: 4px;
}

.sv-profile-card .sv-match {
  background: #fef2f2;
  color: #ef4444;
  font-weight: 600;
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.sv-profile-card .sv-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.sv-profile-card .sv-stat {
  background: #fff7ed;
  border-radius: 10px;
  padding: 0.5rem 0.6rem;
}

.sv-profile-card .sv-stat span {
  display: block;
  font-size: 0.7rem;
  color: var(--sv-muted);
}

.sv-profile-card .sv-stat p {
  margin: 2px 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--sv-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Profession column: hard visual cap (2nd stat) */
.sv-profile-card .sv-stat:nth-child(2) p {
  max-width: 7.5rem;
}

.sv-profile-card .sv-card-cta {
  display: block;
  width: 100%;
  text-align: center;
  background: linear-gradient(135deg, var(--sv-brand), var(--sv-brand-dark));
  color: #fff !important;
  border: none;
  border-radius: 12px;
  padding: 0.65rem 1rem;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none !important;
  cursor: pointer;
  margin-top: auto;
  box-sizing: border-box;
}

.sv-profile-card .sv-card-cta:hover {
  filter: brightness(1.06);
  color: #fff !important;
}

.sv-card-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1.25rem;
}

@media (min-width: 576px) {
  .sv-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 768px) and (max-width: 991.98px) {
  .sv-card-grid.cols-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 992px) {
  .sv-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* PC: always 4 columns for cols-4 (12 cards = 3 full rows, no empty slots) */
  .sv-card-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
