/* ============================================================
   Biodata Listing — Card Grid
   5 columns on desktop → 3 → 2 → 1 on narrow viewports
   ============================================================ */

/* ── Grid container ─────────────────────────────────────── */
.biodata-listing-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  padding: 20px 0;
}

@media (max-width: 1200px) {
  .biodata-listing-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 900px) {
  .biodata-listing-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 600px) {
  .biodata-listing-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

@media (max-width: 380px) {
  .biodata-listing-grid { grid-template-columns: 1fr; }
}

/* ── Card base ──────────────────────────────────────────── */
.biodata-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  position: relative;
}

.biodata-card:hover,
.biodata-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.16);
  outline: none;
}

/* ── Flag header (nationality banner) ───────────────────── */
.biodata-card__flag-header {
  width: 100%;
  height: 72px;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, #4a6fa5 0%, #7ba7d0 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Flag image fills the header; gradient shows as fallback */
.biodata-card__flag-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.biodata-card__flag-text {
  position: relative;
  z-index: 1;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.45);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Agency short display name overlay, right side of the flag-header */
.biodata-card__agency-name {
  position: absolute;
  top: 50%;
  right: 8px;
  z-index: 2;
  transform: translateY(-50%);
  max-width: 60%;
  font-size: 0.65rem;
  font-weight: 700;
  color: #000;
  text-align: right;
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Circular photo ──────────────────────────────────────── */
.biodata-card__photo-wrap {
  margin-top: -48px;
  margin-bottom: 8px;
  margin-left: 16px;
  align-self: flex-start;
  flex-shrink: 0;
  z-index: 1;
}

/* Views-rendered <img> from the image formatter */
.biodata-card__photo-wrap img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  display: block;
}

/* Avatar placeholder (when no photo / Search API view) */
.biodata-card__photo--avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  background: #5B7FA6 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='rgba(255,255,255,0.7)'%3E%3Cpath d='M12 12c2.7 0 5-2.3 5-5s-2.3-5-5-5-5 2.3-5 5 2.3 5 5 5zm0 2c-3.3 0-10 1.7-10 5v1h20v-1c0-3.3-6.7-5-10-5z'/%3E%3C/svg%3E") center 35%/55% no-repeat;
  display: block;
}

/* ── Card body ───────────────────────────────────────────── */
.biodata-card__body {
  width: 100%;
  padding: 0 12px 14px;
  text-align: center;
}

.biodata-card__name {
  font-size: 0.85rem;
  font-weight: 700;
  margin: 0 0 8px;
  line-height: 1.25;
  color: #1a1a2e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Meta list ───────────────────────────────────────────── */
.biodata-card__meta {
  list-style: none;
  margin: 0;
  padding: 0;
  text-align: left;
}

.biodata-card__meta li {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #444;
  padding: 3px 0;
  border-bottom: 1px solid #f0f0f0;
}

.biodata-card__meta li:last-child {
  border-bottom: none;
}

/* Icons via CSS pseudo-elements (data URI SVGs) */
.biodata-card__meta li::before {
  content: '';
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  background: no-repeat center/contain;
  opacity: 0.6;
}

.biodata-card__meta li.meta-nationality::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cline x1='2' y1='12' x2='22' y2='12'/%3E%3Cpath d='M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z'/%3E%3C/svg%3E");
}

.biodata-card__meta li.meta-age::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
}

.biodata-card__meta li.meta-type::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E");
}

.biodata-card__meta li.meta-religion::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v15'/%3E%3Cpath d='M8 5c-1.5 2-2 5-2 8 0 4 1.5 7 3 9'/%3E%3Cpath d='M16 5c1.5 2 2 5 2 8 0 4-1.5 7-3 9'/%3E%3C/svg%3E");
}

.biodata-card__meta li.meta-marital::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='6' width='14' height='18' rx='2' ry='2'/%3E%3Crect x='8' y='2' width='14' height='18' rx='2' ry='2'/%3E%3C/svg%3E");
}

.biodata-card__meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
