/* ─────────────────────────────────────────────────
   Team Page
   ───────────────────────────────────────────────── */

/* Section header ─── label + optional sub-label */
.team-section-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 0 2px 12px;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 26px;
}

.team-section-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink);
}

.team-section-sub {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-dim);
  letter-spacing: 0.04em;
}

/* Department block */
.team-department {
  padding: 32px 0 8px;
}

/* Person grid */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--gap, 16px);
}

/* Person card */
.person-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  transition:
    box-shadow 160ms ease,
    transform 160ms ease;
}

/* Photo area */
.person-photo {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--navy-faint, rgba(15, 30, 60, 0.07));
  flex-shrink: 0;
  position: relative;
}

.person-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

/* Initials fallback */
.person-photo--initials {
  background: linear-gradient(145deg, var(--navy) 0%, #1a3a7a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.person-photo__initials {
  font-size: 2.8rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.18);
  letter-spacing: 0.04em;
  user-select: none;
}

/* Body */
.person-body {
  padding: 18px 20px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.person-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 6px;
  line-height: 1.25;
}

.person-pronouns {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--ink-dim);
  margin-left: 4px;
  white-space: nowrap;
}

/* Position tags */
.person-positions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}

.position-tag {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
  background: var(--navy-faint, rgba(15, 30, 60, 0.07));
  border-radius: 40px;
  padding: 2px 9px;
  white-space: nowrap;
  text-wrap: balance;
}

/* Quote */
.person-quote {
  font-size: 0.82rem;
  font-style: italic;
  color: var(--ink-soft);
  border-left: 2px solid var(--border);
  padding-left: 10px;
  margin: 0 0 10px;
  line-height: 1.5;
}

/* Bio */
.person-bio {
  font-size: 0.82rem;
  color: var(--ink-dim);
  line-height: 1.6;
  margin: 0 0 10px;
  flex: 1;
}

/* Contact links */
.person-contacts {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 40px;
  padding: 5px 11px;
  background: var(--card);
  border: 1.5px solid var(--border);
  color: var(--ink);
  background: transparent;
  transition:
    color 150ms,
    background 150ms,
    border-color 150ms;
  white-space: nowrap;
}

.contact-link svg {
  flex-shrink: 0;
  width: 13px;
  height: 13px;
}

.contact-link:hover,
.contact-link:focus-visible {
  color: var(--ink);
  background: var(--navy-faint, rgba(15, 30, 60, 0.07));
  border-color: var(--ink-soft);
}

.contact-link.--email:hover,
.contact-link.--email:focus-visible {
  border-color: var(--ink-dim);
  color: var(--ink);
}

.contact-link.--linkedin:hover,
.contact-link.--linkedin:focus-visible {
  color: #0a66c2;
  border-color: #0a66c2;
  background: rgba(10, 102, 194, 0.07);
}

.contact-link.--instagram:hover,
.contact-link.--instagram:focus-visible {
  color: #c13584;
  border-color: #c13584;
  background: rgba(193, 53, 132, 0.07);
}

/* Wide card — spans full row width */
.person-card--wide {
  grid-column: 1 / -1;
  flex-direction: row;
}

.person-card--wide .person-photo {
  width: 260px;
  aspect-ratio: auto;
  flex-shrink: 0;
}

.person-card--wide .person-photo--initials {
  height: 100%;
}

.person-card--wide .person-body {
  padding: 24px 26px 20px;
}

.person-card--wide .person-name {
  font-size: 1.05rem;
}

/* ── Responsive ──────────────────────────────────── */

@media (max-width: 900px) {
  .person-card--wide {
    grid-column: 1 / -1;
    flex-direction: column;
  }

  .person-card--wide .person-photo {
    width: 100%;
    aspect-ratio: 4 / 3;
  }

  .card {
    padding: 18px !important;
  }
}

@media (max-width: 580px) {
  .team-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  .person-card--wide {
    flex-direction: column;
  }

  .person-card--wide .person-photo {
    width: 100%;
    aspect-ratio: 4 / 3;
  }
}

/* ════════════════════════════════════════════════════════════════════════════
   CONTACT UNLOCK BUTTON
   Replaces the plain contact links div until the user passes ALTCHA.
════════════════════════════════════════════════════════════════════════════ */

.person-contacts--locked {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: auto;
  display: flex;
}

.unlock-contacts-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--ink-dim);
  background: var(--ink-faint);
  border: 1px solid var(--border);
  border-radius: 40px;
  padding: 6px 12px;
  cursor: pointer;
  transition:
    color 150ms,
    background 150ms,
    border-color 150ms;
  min-height: 32px;
}

.unlock-contacts-btn svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.unlock-contacts-btn:hover {
  color: var(--ink);
  background: var(--navy-faint);
  border-color: var(--navy-soft);
}

.unlock-contacts-btn:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

/* ════════════════════════════════════════════════════════════════════════════
   TEAM CONTACT MODAL
════════════════════════════════════════════════════════════════════════════ */

.team-contact-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms ease, visibility 0s linear 180ms;
}

.team-contact-modal.is-open {
  pointer-events: all;
  opacity: 1;
  visibility: visible;
  transition: opacity 180ms ease, visibility 0s;
}

.team-contact-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.team-contact-modal__box {
  position: relative;
  z-index: 1;
  background: var(--card);
  border-radius: var(--r);
  border: 1.5px solid var(--border);
  padding: 32px 28px 28px;
  width: min(400px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.16);
  transform: translateY(10px);
  transition: transform 200ms ease;
}

.team-contact-modal.is-open .team-contact-modal__box {
  transform: translateY(0);
}

.team-contact-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--ink-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  color: var(--ink-dim);
  transition:
    background 150ms,
    color 150ms;
  flex-shrink: 0;
}

.team-contact-modal__close:hover {
  background: var(--border);
  color: var(--ink);
}

.team-contact-modal__close:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}

.team-contact-modal__close svg {
  width: 12px;
  height: 12px;
  pointer-events: none;
}

.team-contact-modal__header {
  padding-right: 28px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.team-contact-modal__person {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin: 0;
}

.team-contact-modal__title {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0;
  line-height: 1.2;
}

.team-contact-modal__sub {
  font-size: 0.78rem;
  color: var(--ink-dim);
  line-height: 1.55;
  margin: 0;
}

.team-contact-modal__status {
  font-size: 0.8rem;
  color: var(--ink-dim);
  text-align: center;
  padding: 4px 0;
  margin: 0;
}

.team-contact-modal__status.is-error {
  color: var(--red, #e74e6e);
}

.team-contact-modal__links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Plain submit button shown when ALTCHA plugin is unavailable */
.unlock-contacts-modal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 11px 18px;
  border-radius: 10px;
  background: var(--navy);
  color: var(--card);
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: background 150ms;
}

.unlock-contacts-modal-btn:hover {
  background: var(--navy-mid);
}

/* ── ALTCHA widget theming inside the modal ── (see contact.css for the
   full rationale: the widget themes itself via --altcha-* custom
   properties, which are immune to its own `all: revert-layer` reset —
   the update-proof way to style it, unlike the old per-element
   !important overrides.) */

.team-contact-modal altcha-widget {
  display: block;
}

.team-contact-modal .altcha {
  --altcha-color-base: var(--bg);
  --altcha-color-base-content: var(--ink);
  --altcha-border-color: var(--border);
  --altcha-border-width: 1px;
  --altcha-border-radius: 10px;
  --altcha-padding: 10px 12px;
  --altcha-color-primary: var(--navy);
  --altcha-color-primary-content: var(--text-white);
  --altcha-color-neutral: var(--border);
  --altcha-color-neutral-content: var(--ink-soft);
  --altcha-checkbox-border-color: var(--border);
  --altcha-checkbox-border-radius: 5px;
  --altcha-checkbox-size: 18px;
  --altcha-spinner-color: var(--navy);
  --altcha-input-border-radius: 8px;
  font-family: "Plus Jakarta Sans", sans-serif !important;
}

.team-contact-modal .altcha-checkbox-wrap label {
  font-size: 0.8rem !important;
  font-weight: 500 !important;
  color: var(--ink-soft) !important;
  cursor: pointer;
}

.team-contact-modal .altcha-footer {
  font-size: 0.68rem !important;
  color: var(--ink-dim) !important;
  opacity: 1 !important;
}

.team-contact-modal .altcha-footer a {
  color: inherit !important;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.team-contact-modal .altcha-logo {
  color: var(--ink-dim) !important;
}
