/* ═══════════════════════════════════════════
   OUR TEAM PAGE — Dedicated Styles
   ═══════════════════════════════════════════ */

/* ── Design Token Overrides ────────────────── */
/*
 * PALETTE NOTE (P2-4):
 * gold/navy are now aligned to the site master tokens:
 *   --gold  = #FFD100 (was muted #C5A55A — reconciled to --ucla-gold)
 *   --navy  = #0B2341 (was lighter #1B2A4A — reconciled to --navy)
 * The linen/sand/taupe warm neutrals are intentional sub-theme accents
 * for the team-page background texture; they do not affect brand-critical
 * text, icons, or borders and are safe to keep.
 */
.team-page {
  --cream: #FAF8F5;
  --warm-white: #FDFCFA;
  --linen: #F4F0EB;
  --sand: #E8E2D9;
  --taupe: #C4B8A8;
  --warm-gray-team: #8A7F72;
  /* Reconciled to master tokens (was #1B2A4A / #C5A55A) */
  --navy: #0B2341;
  --navy-soft: #163A5F;
  --navy-light: #2774AE;
  --gold: #FFD100;
  --gold-light: #FFD100;
  --gold-pale: #FFF8CC;
  /* gold-text: darkened amber for WCAG AA on light surfaces (#B8860B ≈ 7:1 on white) */
  --gold-text: #B8860B;
  --accent-sage: #8FA98B;
  --text-primary: #0B2341;
  --text-secondary: #2D3748;
  --text-muted: #718096;
  --shadow-sm: 0 1px 3px rgba(11,35,65,0.06), 0 1px 2px rgba(11,35,65,0.04);
  --shadow-md: 0 4px 20px rgba(11,35,65,0.08), 0 2px 8px rgba(11,35,65,0.05);
  --shadow-lg: 0 12px 40px rgba(11,35,65,0.10), 0 4px 16px rgba(11,35,65,0.06);
  --shadow-hover: 0 16px 48px rgba(11,35,65,0.13), 0 6px 20px rgba(11,35,65,0.08);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --transition: 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  --transition-slow: 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Page Hero — Warm & Welcoming ──────────── */
.team-page .page-hero {
  position: relative;
  padding: 80px 0 64px;
  background: linear-gradient(165deg, var(--cream) 0%, var(--linen) 40%, var(--gold-pale) 100%);
  overflow: hidden;
}
.team-page .page-hero::before {
  content: '';
  position: absolute;
  top: -120px;
  right: -80px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255,209,0,0.06) 0%, transparent 70%);
  border-radius: 50%;
}
.team-page .page-hero::after {
  content: '';
  position: absolute;
  bottom: -60px;
  left: -40px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(11,35,65,0.04) 0%, transparent 70%);
  border-radius: 50%;
}
.team-page .page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 3.8rem);
  font-weight: 500;
  color: var(--navy);
  line-height: 1.1;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}
.team-page .page-hero-subtitle {
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 560px;
  line-height: 1.6;
  font-weight: 400;
}

/* ── Section Styles ────────────────────────── */
.team-section {
  padding: 80px 0;
}
.team-section:first-of-type { padding-top: 64px; }
.team-section--alt { background: var(--linen); }
.team-section--warm { background: linear-gradient(180deg, var(--warm-white) 0%, var(--linen) 100%); }

.team-section .section-header {
  margin-bottom: 48px;
}
.team-section .section-eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ucla-blue);
  margin-bottom: 12px;
}
.team-section .section-eyebrow::before {
  display: none;
}
.team-section .section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  font-weight: 500;
  color: var(--navy);
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.team-section .section-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin-top: 12px;
  line-height: 1.6;
}

.subsection-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 24px;
  margin-top: 48px;
}
.subsection-label:first-of-type { margin-top: 0; }
.subsection-label::after {
  content: '';
  display: block;
  width: 40px;
  height: 1px;
  background: var(--sand);
}

/* ── Team Grid ─────────────────────────────── */
.team-page .team-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}
@media (min-width: 540px) {
  .team-page .team-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 800px) {
  .team-page .team-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1040px) {
  .team-page .team-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1300px) {
  .team-page .team-grid { grid-template-columns: repeat(5, 1fr); }
}
.team-grid--featured {
  gap: 28px;
}

/* ── Team Card ─────────────────────────────── */
/*
 * CARD ELEVATION (P1-3):
 * Added a 1px hairline border (#E2E0DC) + shadow-md baseline so each card
 * reads as a lifted surface against the white/linen background. Initials
 * cards especially needed this — they were invisible without a border.
 * Hover lifts 3px + steps up to shadow-hover (ease-out, 220ms).
 */
.team-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow 0.22s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: var(--shadow-md);
  border: 1px solid #E2E0DC;
  position: relative;
  text-align: left;
  padding: 0;
}
/* Scroll reveal — JS-gated so the grid stays visible if JS or the observer fails.
   js/main.js observes .team-card and adds .revealed on scroll / at load. */
.js-loaded .team-card {
  opacity: 0;
  transform: translateY(24px);
}
.team-card.revealed {
  opacity: 1;
  transform: translateY(0);
}
.team-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}
.team-card.revealed:hover {
  transform: translateY(-3px);
}

/* Photo */
/*
 * PHOTO FRAMING (P1-3):
 * object-fit: cover + object-position: center 20% normalises every headshot
 * so faces sit in a consistent upper-centre position across the grid.
 * The inline style="object-position:center 10%" on einstein.jpg overrides
 * for that specific photo — all others use the default 20%.
 */
.team-card__photo {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3.2;
  overflow: hidden;
  background: linear-gradient(145deg, var(--linen) 0%, var(--sand) 100%);
  flex-shrink: 0;
}
.team-card__photo picture {
  width: 100%;
  height: 100%;
  display: block;
}
.team-card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.team-card:hover .team-card__photo img {
  transform: scale(1.03);
}

/*
 * INITIALS FALLBACK (P1-3):
 * Intentional, uniform avatar: a navy-to-blue diagonal gradient field with
 * the initials set in Playfair Display (cream, large). Matches the brand
 * palette and reads as deliberate rather than missing.
 * TODO(maintainer): replace each initials card with a real headshot when
 * available — see list in docs/design-audit-handoff-2026-06-03.md §Brief E.
 */
.team-card__initials {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  /* brand gradient: navy → ucla-blue diagonal */
  background: linear-gradient(140deg, #0B2341 0%, #1B5583 55%, #2774AE 100%);
  color: rgba(255, 255, 255, 0.88);
  /* subtle inner texture so it doesn't read as a flat block */
  position: relative;
  overflow: hidden;
  user-select: none;
}
/* A faint gold arc in the lower-right corner — warmth without distraction */
.team-card__initials::after {
  content: '';
  position: absolute;
  bottom: -24px;
  right: -24px;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,209,0,0.14) 0%, transparent 70%);
  pointer-events: none;
}

/* Card Body */
.team-card__body {
  padding: 16px 20px 20px;
}
.team-card__name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.25;
  margin-bottom: 4px;
}
.team-card__role {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
  font-weight: 400;
}

/* Clickable card (has bio) */
.team-card--has-bio {
  cursor: pointer;
}

/* Bio Toggle — small chevron indicator */
.team-card__bio-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--gold-text);
  letter-spacing: 0.02em;
  transition: all 0.2s;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}
.team-card__bio-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform 0.3s;
}
.team-card__bio-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

/* Bio Content */
.team-card__bio {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
/* Bios now open in a modal (js/main.js); the hidden .team-card__bio is the data source. */
.team-card__bio-toggle:hover svg { transform: translateX(3px); }

/* ── Bio Modal ─────────────────────────────────────── */
.bio-modal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}
.bio-modal[hidden] { display: none; }
.bio-modal.is-open { opacity: 1; }
.bio-modal__overlay {
  position: absolute; inset: 0;
  background: rgba(11, 35, 65, 0.55);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.bio-modal__panel {
  position: relative;
  width: 100%; max-width: 600px; max-height: 85vh; overflow-y: auto;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 32px;
  transform: scale(0.96) translateY(10px);
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}
.bio-modal.is-open .bio-modal__panel { transform: none; }
.bio-modal__close {
  position: absolute; top: 16px; right: 16px;
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; cursor: pointer;
  background: var(--warm-gray); color: var(--navy);
  border-radius: var(--radius-full);
  transition: background 0.2s;
}
.bio-modal__close:hover { background: var(--border); }
.bio-modal__close svg { width: 18px; height: 18px; }
.bio-modal__header {
  display: flex; align-items: center; gap: 18px;
  margin-bottom: 20px; padding-right: 44px;
}
.bio-modal__photo {
  width: 84px; height: 84px; flex-shrink: 0;
  border-radius: 14px; overflow: hidden;
  background: var(--warm-gray);
}
.bio-modal__photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.bio-modal__photo .team-card__initials { width: 100%; height: 100%; font-size: 1.7rem; }
.bio-modal__name {
  font-family: var(--font-display); font-size: 1.4rem; font-weight: 600;
  color: var(--navy); line-height: 1.2;
}
.bio-modal__role { font-size: 0.9rem; color: var(--slate-light); margin-top: 4px; }
.bio-modal__body { font-size: 0.95rem; color: var(--slate); line-height: 1.7; }
.bio-modal__body p { margin-bottom: 12px; }
.bio-modal__body p:last-child { margin-bottom: 0; }
@media (prefers-reduced-motion: reduce) {
  .bio-modal, .bio-modal__panel { transition-duration: 0.01ms; }
}
@media (max-width: 560px) {
  .bio-modal__panel { padding: 26px 20px; }
  .bio-modal__header { flex-direction: column; align-items: flex-start; padding-right: 0; }
}
.team-card__bio-inner {
  padding-top: 14px;
  border-top: 1px solid var(--linen);
  margin-top: 14px;
}
.team-card__bio-inner p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 10px;
}
.team-card__bio-inner p:last-child { margin-bottom: 0; }
.team-card__bio-inner strong {
  color: var(--text-primary);
  font-weight: 600;
}
.team-card__bio-inner h5 {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--navy);
  margin: 14px 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.team-card__bio-inner ul {
  padding-left: 0;
  list-style: none;
  margin: 0 0 8px;
}
.team-card__bio-inner ul li {
  padding: 2px 0;
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Featured card (Director-level physicians) */
.team-card--featured {
  border: 1px solid rgba(39,116,174,0.22);
  box-shadow: var(--shadow-md), 0 0 0 1px rgba(39,116,174,0.08);
}
.team-card--featured .team-card__photo::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(to top, rgba(11,35,65,0.08), transparent);
  pointer-events: none;
}

/* ── Info Callout ──────────────────────────── */
.info-callout {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-soft) 100%);
  border-radius: var(--radius-xl);
  padding: 40px 48px;
  margin-top: 56px;
  position: relative;
  overflow: hidden;

  opacity: 0;
  transform: translateY(20px);
}
.info-callout.revealed {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.info-callout::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255,209,0,0.10) 0%, transparent 70%);
  border-radius: 50%;
}
/* gold-light on dark navy = #FFD100 at full opacity (>7:1, passes AAA) */
.info-callout h4 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--gold);
  margin-bottom: 12px;
  position: relative;
}
.info-callout p {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.8);
  line-height: 1.7;
  max-width: 700px;
  position: relative;
}
@media (max-width: 640px) {
  .info-callout { padding: 28px 24px; border-radius: var(--radius-lg); }
}

/* ── CTA Banner ────────────────────────────── */
.team-page .cta-banner {
  background: linear-gradient(145deg, var(--navy) 0%, var(--navy-soft) 100%);
  padding: 80px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.team-page .cta-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(255,209,0,0.07) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 80%, rgba(39,116,174,0.06) 0%, transparent 50%);
}
.team-page .cta-banner .container { position: relative; }
.team-page .cta-banner h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  font-weight: 500;
  color: white;
  margin-bottom: 12px;
}
.team-page .cta-banner > .container > p {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.65);
  margin-bottom: 28px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}
.cta-contact-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.cta-phone, .cta-email {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.85);
  font-weight: 500;
  transition: color 0.2s;
}
.cta-phone:hover, .cta-email:hover { color: var(--gold); }
.cta-divider {
  width: 1px;
  height: 20px;
  background: rgba(255,255,255,0.2);
}
.cta-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Mobile Sticky CTA ────────────────────── */
.team-page .mobile-sticky-cta {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: var(--white);
  border-top: 1px solid var(--sand);
  padding: 10px 16px;
  gap: 10px;
}
@media (max-width: 1023px) { .team-page .mobile-sticky-cta { display: flex; } }
.mobile-sticky-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border-radius: 100px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}
.mobile-sticky-call { background: var(--navy); color: white; }
.mobile-sticky-contact { background: var(--linen); color: var(--navy); }

/* ── Scroll Reveal Animation ───────────────── */
@keyframes cardReveal {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
