/* Contact page: person card with photo + WeChat QR. */
.contact-person {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
}
.contact-person-id {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.contact-person-avatar {
  width: 240px;
  height: 240px;
  border-radius: 24px;
  object-fit: cover;
  object-position: center 22%;
  flex: 0 0 auto;
  background: #f3f5fb;
  border: 3px solid #fff;
  box-shadow: 0 20px 44px -18px rgba(10, 17, 34, .55);
}
/* The portrait opens the full-resolution photo in a lightbox. */
.contact-person-photo {
  display: block;
  flex: 0 0 auto;
  border-radius: 24px;
  transition: transform .2s var(--ease, ease), box-shadow .2s;
}
.contact-person-photo:hover { transform: translateY(-2px); }
.contact-person-photo:hover .contact-person-avatar { box-shadow: 0 26px 54px -18px rgba(10, 17, 34, .6); }
.contact-person-photo:active { transform: scale(.985); }
.contact-person-photo img { display: block; }
.contact-person-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.contact-person-meta b { font-size: 19px; letter-spacing: -.015em; }
.contact-person-role { font-size: 13px; color: var(--brand, #3b6bff); font-weight: 600; }
.contact-person-org { font-size: 12.5px; color: var(--muted, #5d6880); }

.contact-wechat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(16, 26, 51, .09);
  border-radius: 14px;
  background: #fff;
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.contact-wechat:hover {
  transform: translateY(-2px);
  border-color: rgba(7, 193, 96, .55);
  box-shadow: 0 14px 30px -18px rgba(7, 193, 96, .9);
}
.contact-wechat img {
  width: 96px;
  height: 96px;
  display: block;
  border-radius: 8px;
  image-rendering: pixelated;
}
.contact-wechat-cap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #07a352;
  white-space: nowrap;
}
.contact-wechat-cap svg { width: 13px; height: 13px; }

.contact-person-links {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding-top: 12px;
  border-top: 1px dashed rgba(16, 26, 51, .1);
}
.contact-person-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.2px;
  color: inherit;
  text-decoration: none;
  font-weight: 500;
}
.contact-person-links a:hover { color: var(--brand, #3b6bff); }
.contact-person-links svg { width: 14px; height: 14px; color: var(--muted, #5d6880); }

/* Full-size QR overlay */
.contact-qr-modal {
  position: fixed;
  inset: 0;
  z-index: 980;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 17, 34, .62);
  backdrop-filter: blur(3px);
  animation: contact-qr-in .2s ease;
}
@keyframes contact-qr-in { from { opacity: 0 } to { opacity: 1 } }
.contact-qr-modal img {
  width: min(320px, 76vw);
  height: auto;
  padding: 14px;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .7);
  image-rendering: pixelated;
}

/* Full-photo lightbox: opens from the portrait. */
.contact-photo-modal {
  display: grid;
  place-items: center;
  padding: 24px;
}
.contact-photo-modal figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: contact-qr-in .22s ease;
}
.contact-photo-modal img {
  width: min(560px, 86vw);
  max-height: 76vh;
  height: auto;
  object-fit: contain;
  border-radius: 20px;
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, .8);
  background: #fff;
}
.contact-photo-modal figcaption {
  color: rgba(255, 255, 255, .86);
  font-size: 13.5px;
  letter-spacing: .01em;
}
.contact-photo-modal figcaption span { opacity: .65; }

@media (max-width: 900px) {
  /* Narrower columns: scale the portrait down so the name and role keep room. */
  .contact-person-avatar { width: 172px; height: 172px; border-radius: 20px; }
}

@media (max-width: 520px) {
  .contact-person { grid-template-columns: 1fr; }
  .contact-wechat { flex-direction: row; justify-content: center; width: 100%; }
  .contact-wechat img { width: 84px; height: 84px; }
  /* Full-width portrait: still generous, but never wider than the card. */
  .contact-person-id { flex-direction: column; align-items: flex-start; gap: 14px; }
  .contact-person-photo { width: 100%; }
  .contact-person-avatar {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    max-height: 320px;
    border-radius: 18px;
    object-fit: cover;
    object-position: center 18%;
  }
  .contact-person-meta b { font-size: 17px; }
}
