/**
 * Модуль «Команда» (#team) — Kapital77
 * Док: docs/kapital77/MODUL_KOMANDA.md
 * Канон: Swiss Private Banking (открытые реальные лица, высота 220px, стеклянные бейджи, изумрудные акценты, подложка фактов #FAF9F6)
 */

.section-team {
  position: relative;
  overflow: hidden;
  /* Мост между objections (#faf9f8) и advantages: slate + лёгкий primary */
  background-color: #f8fafc;
  background-image:
    radial-gradient(ellipse 55% 55% at 12% 18%, rgba(37, 99, 235, 0.08) 0%, transparent 52%),
    radial-gradient(ellipse 50% 60% at 92% 78%, rgba(92, 111, 234, 0.06) 0%, transparent 50%),
    linear-gradient(
      180deg,
      rgba(250, 249, 248, 1) 0%,
      rgba(248, 250, 252, 0.98) 38%,
      rgba(247, 250, 253, 1) 100%
    );
  background-repeat: no-repeat;
}

html[data-theme="dark"] .section-team {
  background-color: #0f172a;
  background-image:
    radial-gradient(ellipse 50% 50% at 20% 15%, rgba(37, 99, 235, 0.09) 0%, transparent 55%),
    radial-gradient(ellipse 45% 55% at 85% 85%, rgba(59, 130, 246, 0.06) 0%, transparent 50%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(15, 23, 42, 1) 100%);
}

.section-team .container {
  position: relative;
  z-index: 1;
}

.section-team .section__lead-in {
  max-width: 38rem;
  color: rgba(15, 23, 42, 0.78);
  margin-bottom: 0.65rem;
}

@media (min-width: 1200px) {
  .section-team .section__lead-in {
    font-size: 1.0625rem;
    line-height: 1.55;
    max-width: 36rem;
    margin-bottom: 0.75rem;
  }

  .section-team .section__title {
    max-width: 22em;
    letter-spacing: -0.02em;
    line-height: 1.18;
    margin-bottom: 0.5rem;
  }

  .section-team .section__subtitle {
    max-width: 36rem;
    font-size: 1.0625rem;
    line-height: 1.55;
    color: rgba(15, 23, 42, 0.72);
  }
}

html[data-theme="dark"] .section-team .section__lead-in {
  color: rgba(226, 232, 240, 0.88);
}

html[data-theme="dark"] .section-team .section__subtitle {
  color: rgba(203, 213, 225, 0.9);
}

.section-team .section__subtitle {
  max-width: 40rem;
  line-height: 1.5;
}

.section-team .section-badges {
  margin-bottom: 0.65rem;
}

@media (min-width: 1200px) {
  .section-team .section-badges {
    margin-bottom: 0.75rem;
  }
}

/* --- Сетка специалистов: 1 колонка → 2×2 → 4 в ряд --- */
.team-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 20px;
}

@media (min-width: 520px) {
  .team-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }
}

@media (min-width: 1200px) {
  .team-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-top: 24px;
  }
}

/* --- Карточка специалиста --- */
.team-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: var(--radius-md, 12px);
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(15, 23, 42, 0.05));
  background: var(--color-bg-light, #ffffff);
  transition: box-shadow 0.22s ease, transform 0.22s ease;
}

.team-card:hover {
  box-shadow: var(--shadow-md, 0 8px 24px rgba(15, 23, 42, 0.09));
  transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
  .team-card:hover {
    transform: none;
  }
}

html[data-theme="dark"] .team-card {
  border-color: rgba(148, 163, 184, 0.14);
  background: rgba(30, 41, 59, 0.45);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}

/* --- Фотография: чистый открытый портрет без затемнений лица --- */
.team-card__visual {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  background-color: #f1f5f9;
  flex-shrink: 0;
}

.team-card__photo {
  width: 100%;
  height: 220px;
  object-fit: cover;
  object-position: center 15%;
  display: block;
}

/* Скрываем старый тяжелый затемняющий scrim */
.team-card__scrim {
  display: none !important;
}

/* --- Стеклянный бейдж со статусом --- */
.team-card__badge {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: #0f172a;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px) saturate(160%);
  -webkit-backdrop-filter: blur(10px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius-pill, 999px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
  pointer-events: none;
}

.team-card__badge::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-accent, #059669);
  flex-shrink: 0;
}

html[data-theme="dark"] .team-card__badge {
  background: rgba(15, 23, 42, 0.82);
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .team-card__badge::before {
  background-color: #10b981;
}

/* --- Тело карточки --- */
.team-card__body {
  display: flex;
  flex-direction: column;
  padding: 18px 18px 14px;
  flex: 1 1 auto;
  gap: 6px;
}

@media (min-width: 1200px) {
  .team-card__body {
    padding: 16px 16px 12px;
    gap: 5px;
  }
}

/* Изумрудный кикер департамента */
.team-card__kicker {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent, #059669);
  line-height: 1.3;
}

@media (min-width: 1200px) {
  .team-card__kicker {
    font-size: 0.625rem;
    letter-spacing: 0.07em;
  }
}

html[data-theme="dark"] .team-card__kicker {
  color: #10b981;
}

/* Название функциональной роли */
.team-card__role {
  margin: 0;
  font-family: var(--font-family-heading, "Manrope", "Inter", sans-serif);
  font-size: clamp(0.9375rem, 0.88rem + 0.3vw, 1.0625rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--color-text, #0f172a);
}

@media (min-width: 1200px) {
  .team-card__role {
    font-size: 0.9375rem;
    line-height: 1.25;
  }
}

html[data-theme="dark"] .team-card__role {
  color: #f8fafc;
}

/* Зона ответственности */
.team-card__lead {
  margin: 0;
  font-size: 0.84375rem;
  line-height: 1.5;
  color: var(--color-text-light, #475569);
}

@media (min-width: 1200px) {
  .team-card__lead {
    font-size: 0.78125rem;
    line-height: 1.45;
  }
}

html[data-theme="dark"] .team-card__lead {
  color: #94a3b8;
}

/* --- Факты внизу карточки на подложке #FAF9F6 --- */
.team-card__facts {
  list-style: none;
  margin: auto 0 0 0;
  padding: 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8125rem;
  line-height: 1.42;
  color: #334155;
  background: #FAF9F6;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

@media (min-width: 1200px) {
  .team-card__facts {
    padding: 10px 14px;
    gap: 5px;
    font-size: 0.75rem;
    line-height: 1.38;
  }
}

.team-card__facts li {
  position: relative;
  padding-left: 1rem;
}

.team-card__facts li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-accent, #059669);
}

html[data-theme="dark"] .team-card__facts {
  background: rgba(15, 23, 42, 0.5);
  border-top-color: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

html[data-theme="dark"] .team-card__facts li::before {
  background: #10b981;
}

/* --- Нижняя статусная панель: плашка + CTA кнопка --- */
.team-footer-bar {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 20px;
  background: #FAF9F6;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-md, 12px);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(15, 23, 42, 0.05));
}

.team-footer-bar .team-section-note {
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(0.875rem, 0.84rem + 0.15vw, 0.9375rem);
  font-weight: 500;
  line-height: 1.45;
  color: var(--color-text, #0f172a);
  max-width: none;
}

.team-section-note__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(5, 150, 105, 0.12);
  color: var(--color-accent, #059669);
  flex-shrink: 0;
}

.team-footer-bar .section-cta {
  margin: 0;
  flex-shrink: 0;
}

.team-footer-bar .section-cta .btn {
  white-space: nowrap;
}

html[data-theme="dark"] .team-footer-bar {
  background: rgba(15, 23, 42, 0.65);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

html[data-theme="dark"] .team-footer-bar .team-section-note {
  color: #e2e8f0;
}

html[data-theme="dark"] .team-section-note__icon {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
}

/* Fallback для одиночной .team-section-note, если используется без обертки .team-footer-bar */
.team-section-note {
  margin-top: 20px;
  padding: 14px 18px;
  font-size: clamp(0.8125rem, 0.78rem + 0.1vw, 0.875rem);
  line-height: 1.5;
  color: var(--color-text, #0f172a);
  background: #FAF9F6;
  border-radius: var(--radius-sm, 8px);
  border: 1px solid rgba(15, 23, 42, 0.08);
  max-width: 48rem;
}

html[data-theme="dark"] .team-section-note {
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.65);
  border-color: rgba(255, 255, 255, 0.1);
}

.section-team .section-cta {
  margin-top: 20px;
}

/* Mobile адаптив */
@media (max-width: 767px) {
  .team-footer-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 14px 16px;
    margin-top: 18px;
  }

  .team-footer-bar .team-section-note {
    align-items: flex-start;
    font-size: 0.875rem;
  }

  .team-section-note__icon {
    margin-top: 2px;
  }

  .team-footer-bar .section-cta .btn {
    width: 100%;
  }
}

@media (max-width: 519px) {
  .team-grid {
    gap: 14px;
  }

  .team-card__visual {
    height: 220px;
  }

  .team-card__photo {
    height: 220px;
    object-position: center 15%;
  }

  .team-card__body {
    padding: 16px 14px 12px;
  }

  .team-card__facts {
    padding: 10px 14px 12px;
  }
}
