/* ==========================================================================
   Connect 2026 - Person cards (speaker, expert)                         T-13
   --------------------------------------------------------------------------
   Two kinds, one component - both are a circular avatar above a name, role
   and company. They differ only in avatar size and whether a contribution
   count is shown.

     speaker   Webinar reader "Webinar Speakers" row     (p16)
               164px circle, measured. Photo.
     expert    Home "Connect Industry Experts" 4x2 grid  (p1)
               small circle with INITIALS, plus "16 articles - 4 talks"

   Name / role / company use the same three-weight treatment as the card
   author line: name in cyan, role italic muted, company semibold navy.

   Each appears on exactly ONE screen, which is why they were built last.

   DEPENDS ON: tokens.css
   ========================================================================== */

.cn-person {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  /*
     NO gap. The card has exactly two flex children - the avatar and ONE span
     holding name/role/company separated by <br>, so those three lines are
     governed by line-height, not by this gap. The gap only ever applied
     between the avatar and the text, where the artboard wants ~35px, not 12.
     That space now lives on the avatar so the two kinds can differ.
  */
  gap: 0;
}

/*
   The disc, with initials under the photo - see personCard.tag. The wrap is
   the circle and takes the size rules below in place of the avatar; the
   initials fill it; the image covers them absolutely when present.
*/
.cn-person__avatar-wrap {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: var(--cn-radius-pill);
  background: var(--cn-panel-blue);
}

.cn-person__avatar {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--cn-radius-pill);
  object-fit: cover;
  background: var(--cn-band-grey);
}

/*
   Artboard state - the black circle standing in for a speaker photo.
   MUST NOT SHIP with real content:
     grep -rn "cn-person__avatar--placeholder" src/main/webapp/WEB-INF/views/connect2026/
   It is rendered by the tag, not the page, so check the tag call sites too.
*/
.cn-person__avatar--placeholder {
  display: block;
  flex: 0 0 auto;
  background: var(--cn-ph-img);
}

/* Initials fallback - the Home experts grid uses initials, not photos. */
.cn-person__initials {
  color: var(--cn-navy);
  font-weight: var(--cn-fw-semibold);
  line-height: 1;
  user-select: none;
}

.cn-person__name   { color: var(--cn-cyan); font-weight: var(--cn-fw-medium); }
.cn-person__role   { color: var(--cn-ink-muted); font-style: italic; }
.cn-person__org    { color: var(--cn-ink); font-weight: var(--cn-fw-semibold); }

.cn-person__stats {
  margin-top: var(--cn-space-2);
  font-size: var(--cn-text-label);
  color: var(--cn-ink-faint);
}

/* ------------------------------------------------------------ speaker -- */
.cn-person--speaker .cn-person__avatar-wrap {
  width: 164px;
  height: 164px;
  margin-bottom: var(--cn-space-8);   /* 32 - artboard 35 */
  font-size: var(--cn-text-h2);
}
/* 12pt line steps on 10pt type = 1.2, measured. --cn-lh-snug (1.3) opened the
   three lines up by 2.4px each and pushed the company clear of the role. */
.cn-person--speaker .cn-person__name,
.cn-person--speaker .cn-person__role,
.cn-person--speaker .cn-person__org { font-size: var(--cn-text-section); line-height: 1.2; }

/* ------------------------------------------------------------- expert -- */
.cn-person--expert .cn-person__avatar-wrap { margin-bottom: var(--cn-space-3); }

.cn-person--expert {
  padding: var(--cn-space-5);
  border: 1px solid var(--cn-border);
  border-radius: var(--cn-radius-card);
}
.cn-person--expert .cn-person__avatar-wrap { width: 48px; height: 48px; font-size: var(--cn-text-meta); }
.cn-person--expert .cn-person__name,
.cn-person--expert .cn-person__role,
.cn-person--expert .cn-person__org { font-size: var(--cn-text-label); line-height: var(--cn-lh-snug); }

a.cn-person--expert:hover { border-color: var(--cn-cyan); box-shadow: var(--cn-shadow-card); }

/* =========================================================== RESPONSIVE == */
@media (max-width: 767px) {
  .cn-person--speaker .cn-person__avatar,
  .cn-person--speaker .cn-person__avatar-wrap { width: 110px; height: 110px; }
  .cn-person--speaker .cn-person__name,
  .cn-person--speaker .cn-person__role,
  .cn-person--speaker .cn-person__org { font-size: var(--cn-text-body); }
}
