/* ==========================================================================
   Researchers listing (candidates.html)

   Card grid: circular portrait, name, role, research interests and contact
   buttons, on a white card that lifts on hover. Laid out with CSS grid so the
   columns reflow by available width rather than a fixed 4-per-row.

   Scoped under .team-grid-section, and uses its own class names, so the
   .single-team-content rules in css/style.css - shared with alumni.html and
   the team-candidate pages - are left alone.
   ========================================================================== */

.team-grid-section {
  --tg-brand: #005BAC;
  --tg-ink: #222222;
  --tg-muted: #6d7278;
  --tg-line: #e5e7ea;

  position: relative;
  padding: 90px 0px 100px 0px;
  background: #ffffff;
}

.team-grid-section .group-title {
  font-family: 'Hind', sans-serif;
  font-size: 26px;
  line-height: 34px;
  font-weight: 600;
  color: var(--tg-ink);
  letter-spacing: 0.5px;
  margin: 0px 0px 26px 0px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--tg-line);
}

.team-grid-section .group-block {
  margin-bottom: 60px;
}

.team-grid-section .group-block:last-child {
  margin-bottom: 0;
}

/* Columns reflow by width; cards never get narrower than 240px. */
.team-grid-section .team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 26px;
}

/* ------------------------------------------------------------------- card */

.team-grid-section .member-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: #ffffff;
  border: 1px solid var(--tg-line);
  border-radius: 10px;
  padding: 28px 22px 24px 22px;
  box-shadow: 0 2px 6px rgba(34, 34, 34, 0.04);
  transition: transform 300ms ease, box-shadow 300ms ease, border-color 300ms ease;
}

.team-grid-section .member-card:hover {
  transform: translateY(-5px);
  border-color: rgba(0, 91, 172, 0.35);
  box-shadow: 0 10px 26px rgba(34, 34, 34, 0.10);
}

/* The photo shows as-is in a rounded panel - the whole portrait, uncropped,
   standing on the base of the panel. Same treatment as the profile page.
   Per-person tuning is available from the JSON as --ph-scale / --ph-shift:
   scale below 1 makes the subject smaller, a negative shift moves it up. */
.team-grid-section .member-photo {
  width: 100%;
  height: 260px;
  margin-bottom: 18px;
  border-radius: 50%;   /* matches the profile page photo panel */
  overflow: hidden;
  background: linear-gradient(155deg, #f7fbfe 0%, #e9f3fb 45%, #d5e8f7 100%);
}

.team-grid-section .member-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  transform: scale(var(--ph-scale, 1)) translateY(var(--ph-shift, 0));
}

.team-grid-section .member-name {
  font-family: 'Hind', sans-serif;
  font-size: 19px;
  line-height: 27px;
  font-weight: 600;
  color: var(--tg-ink);
  margin: 0px 0px 4px 0px;
}

.team-grid-section .member-name a {
  color: var(--tg-ink);
  transition: color 300ms ease;
}

.team-grid-section .member-card:hover .member-name a {
  color: var(--tg-brand);
}

/* Full-card click target. It has to be a real element rather than a pseudo
   on the name link: the name is inline, so an absolutely positioned ::after
   there sizes itself to the text, not to the card. */
.team-grid-section .card-link {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

/* The name and the contact buttons sit above the overlay so they keep their
   own behaviour - the name stays focusable, the buttons stay clickable. */
.team-grid-section .member-name a,
.team-grid-section .member-links {
  position: relative;
  z-index: 2;
}

.team-grid-section .member-name-kr {
  font-size: 15px;
  font-weight: 400;
  color: var(--tg-muted);
}

/* Shown in full - no truncation, so a list never ends in a stray ellipsis. */
.team-grid-section .member-interests {
  margin: 8px 0px 18px 0px;
}

.team-grid-section .member-interests .interests-label {
  display: block;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--tg-brand);
  margin-bottom: 5px;
}

.team-grid-section .member-interests .interests-list {
  font-size: 13.5px;
  line-height: 22px;
  color: var(--tg-ink);
  margin: 0;
}

/* Pushes the buttons to the bottom so they line up across a row. */
.team-grid-section .member-links {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: auto;
  padding-top: 4px;
}

.team-grid-section .member-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  font-size: 16px;
  color: var(--tg-ink);
  background: #ffffff;
  border: 1px solid var(--tg-line);
  border-radius: 50%;
  transition: all 300ms ease;
}

.team-grid-section .member-links a:hover {
  color: #ffffff;
  background: var(--tg-brand);
  border-color: var(--tg-brand);
}

.team-grid-section .member-links a:focus-visible {
  outline: 2px solid var(--tg-brand);
  outline-offset: 2px;
}

/* ------------------------------------------------------------- responsive */

@media only screen and (max-width: 767px) {
  .team-grid-section {
    padding: 60px 0px 70px 0px;
  }
  .team-grid-section .team-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 18px;
  }
  .team-grid-section .member-card {
    padding: 22px 16px 20px 16px;
  }
  .team-grid-section .member-photo {
    height: 210px;
  }
  .team-grid-section .group-title {
    font-size: 22px;
  }
}
