/* team-details.html ONLY — 3D tray + slab (mirrors USER APPROVED team.html member card) */

html[data-team-details-page] .team-details-page-detail-section .team-details-page-profile-card {
  --stack-tray-radius: 24px;
  --stack-card-radius: 18px;
  --stack-gap: 6px;
  --stack-purple-shadow: rgba(46, 12, 94, 0.28);
  --stack-purple-mid: rgba(72, 27, 130, 0.18);
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: var(--stack-gap);
  padding: 20px 18px 24px;
  border-radius: var(--stack-tray-radius);
  overflow: visible !important;
  background:
    radial-gradient(circle at 12% 0%, rgba(250, 204, 21, 0.08), transparent 38%),
    radial-gradient(circle at 88% 8%, rgba(99, 17, 222, 0.1), transparent 42%),
    linear-gradient(165deg, rgba(237, 232, 248, 0.72) 0%, rgba(228, 220, 242, 0.58) 100%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 52px 100px var(--stack-purple-shadow),
    0 24px 48px var(--stack-purple-mid),
    0 8px 20px rgba(46, 12, 94, 0.1),
    inset 0 2px 0 rgba(255, 255, 255, 0.65),
    inset 0 -3px 8px rgba(46, 12, 94, 0.08);
  height: auto;
}

html[data-team-details-page] .team-details-page-detail-section .team-details-page-profile-card::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 6px;
  height: calc(100% - 14px);
  border-radius: calc(var(--stack-tray-radius) - 4px);
  background: linear-gradient(180deg, rgba(46, 12, 94, 0.06), rgba(46, 12, 94, 0.14));
  box-shadow: 0 28px 56px rgba(46, 12, 94, 0.22);
  transform: translateY(10px) scale(0.98);
  z-index: 0;
  pointer-events: none;
}

html[data-team-details-page] .team-details-page-detail-section .team-details-page-profile-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.35) 0%, transparent 42%, rgba(46, 12, 94, 0.04) 100%);
  pointer-events: none;
  z-index: 1;
}

/* Layer 1 — photo media slab (img directly inside, same as team list) */
html[data-team-details-page] .team-details-page-detail-section .team-details-page-profile-card__media {
  position: relative;
  z-index: 3;
  display: block;
  margin: 0;
  padding: 12px;
  flex-shrink: 0;
  line-height: 0;
  overflow: hidden;
  border-radius: var(--stack-card-radius);
  background:
    radial-gradient(circle at top right, rgba(250, 248, 255, 0.9), transparent 40%),
    linear-gradient(180deg, #ffffff 0%, #f8f6fc 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 1) inset,
    0 -2px 0 rgba(46, 12, 94, 0.07) inset,
    0 28px 52px rgba(46, 12, 94, 0.26),
    0 12px 24px rgba(46, 12, 94, 0.16),
    0 4px 8px rgba(46, 12, 94, 0.1);
  transform: translateY(-2px);
}

html[data-team-details-page] .team-details-page-detail-section .team-details-page-profile-card__media::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 42%;
  border-radius: var(--stack-card-radius) var(--stack-card-radius) 0 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), transparent);
  pointer-events: none;
  z-index: 1;
}

html[data-team-details-page] .team-details-page-detail-section .team-details-page-profile-card__media img,
html[data-team-details-page] .team-details-page-detail-section .team-details-page-profile-card__media #member-photo {
  position: relative;
  z-index: 0;
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center top;
  border-radius: 12px;
  box-shadow:
    0 10px 24px rgba(46, 12, 94, 0.14),
    0 3px 8px rgba(46, 12, 94, 0.08);
}

/* Photo column — media slab grows; image fills slab (fixes squashed/reduced man height) */
html[data-team-details-page] .team-details-page-detail-section .team-details-page-profile-card--photo .team-details-page-profile-card__body {
  flex: 0 0 auto;
  justify-content: flex-start;
}

html[data-team-details-page] .team-details-page-detail-section .row.g-5.align-items-stretch {
  align-items: flex-start !important;
}

@media (min-width: 992px) {

  html[data-team-details-page] .team-details-page-detail-section .row > [class*="col-"] {
    display: flex;
    flex-direction: column;
  }

  html[data-team-details-page] .team-details-page-detail-section .row > [class*="col-"] > .team-details-page-profile-card {
    width: 100%;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    flex: none !important;
    align-self: flex-start;
  }

  /* Photo card — 20% shorter via spacing + square image (no stretch) */
  html[data-team-details-page] .team-details-page-detail-section .team-details-page-profile-card--photo {
    --stack-gap: 4.8px;
    padding: 16px 14.4px 19.2px;
  }

  html[data-team-details-page] .team-details-page-detail-section .team-details-page-profile-card--photo .team-details-page-profile-card__media {
    flex: 0 0 auto;
    display: block;
    padding: 9.6px;
    min-height: 0;
    height: auto;
    overflow: hidden;
  }

  html[data-team-details-page] .team-details-page-detail-section .team-details-page-profile-card--photo .team-details-page-profile-card__body {
    padding: 14.4px 16px 16px;
  }

  html[data-team-details-page] .team-details-page-detail-section .team-details-page-profile-card--photo .team-details-page-profile-card__media img,
  html[data-team-details-page] .team-details-page-detail-section .team-details-page-profile-card--photo .team-details-page-profile-card__media #member-photo {
    flex: none;
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: center top;
  }

}

/* Layer 1 — body slab (name pill below photo, or copy pill on right) */
html[data-team-details-page] .team-details-page-detail-section .team-details-page-profile-card__body {
  position: relative;
  z-index: 4;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 18px 20px 20px;
  margin-top: 0;
  overflow: visible !important;
  border-radius: var(--stack-card-radius);
  background:
    radial-gradient(circle at top left, rgba(99, 17, 222, 0.06), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(250, 248, 255, 0.94) 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.92);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 1) inset,
    0 -2px 0 rgba(46, 12, 94, 0.06) inset,
    0 24px 48px rgba(46, 12, 94, 0.22),
    0 10px 22px rgba(46, 12, 94, 0.14),
    0 4px 8px rgba(46, 12, 94, 0.08);
  transform: translateY(2px);
}

html[data-team-details-page] .team-details-page-detail-section .team-details-page-profile-card__body::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 38%;
  border-radius: var(--stack-card-radius) var(--stack-card-radius) 0 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), transparent);
  pointer-events: none;
  z-index: 0;
}

html[data-team-details-page] .team-details-page-detail-section .team-details-page-profile-card__body > * {
  position: relative;
  z-index: 1;
}

html[data-team-details-page] .team-details-page-detail-section .team-details-page-profile-card--copy .team-details-page-profile-card__body {
  flex: 0 0 auto;
  align-items: stretch;
  text-align: left;
  padding: 16px 18px 18px;
}

html[data-team-details-page] .team-details-page-detail-section .team-details-page-profile-card--copy {
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  align-self: flex-start;
  zoom: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html[data-team-details-page] .team-details-page-detail-section .team-details-page-profile-card__media,
  html[data-team-details-page] .team-details-page-detail-section .team-details-page-profile-card__body {
    transition: none !important;
    transform: none !important;
  }
}