/* ==========================================================================
   Команда: указатель специалистов и профили (/komanda/, блок на «О компании»)
   Подключается только на этих страницах — btm_team_enqueue() в inc/team-data.php
   ========================================================================== */

/* вводный текст над указателем — на всю ширину контейнера, как текстовые блоки сайта */
.tm-head{max-width:none}
.tm-head .lead{max-width:none}

/* ---------- указатель: аватар + имя + должность ---------- */
.tm-roster{
  list-style:none;margin:0;padding:0;
  display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px 20px;
}
.tm-roster__item{
  display:flex;flex-direction:column;align-items:flex-start;gap:14px;height:100%;
  padding:12px;border-radius:var(--r-sm);color:var(--ink);
  transition:background-color .18s ease;
}
.tm-roster__item:hover{background:var(--tint-2)}
.tm-roster__item:hover .tm-roster__name{color:var(--blue)}
.tm-roster__item:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
.tm-roster__ava{
  flex:none;width:88px;height:88px;border-radius:var(--r-sm);
  object-fit:cover;background:var(--line);
}
.tm-roster__txt{display:flex;flex-direction:column;gap:5px;min-width:0}
.tm-roster__name{font-family:var(--ff-head);font-size:16px;font-weight:700;line-height:1.25;color:var(--navy);transition:color .18s ease}
.tm-roster__role{font-size:13.5px;line-height:1.42;color:var(--ink-2)}
.sec--bg .tm-roster__item:hover{background:#fff}

/* блок на «О компании»: указатель + кнопка на страницу команды */
.tm-teaser .tm-roster{margin-bottom:clamp(28px,3vw,40px)}

/* ---------- профили ---------- */
.tm-list{display:flex;flex-direction:column;gap:20px}
.tm-card{
  display:grid;
  grid-template-columns:minmax(220px,320px) minmax(0,1fr);
  grid-template-areas:"photo head" "photo text";
  grid-template-rows:auto 1fr;
  column-gap:clamp(28px,4vw,60px);
  padding:clamp(24px,3.2vw,44px);
  background:#fff;border-radius:var(--r);
  scroll-margin-top:110px;
}
/* переход из указателя: карточка коротко подсвечивается, чтобы было видно, куда пришли */
.tm-card:target{animation:tm-arrive 1.8s cubic-bezier(.16,1,.3,1)}
@keyframes tm-arrive{
  from{box-shadow:0 0 0 3px var(--brand),0 18px 40px -24px rgba(0,59,97,.45)}
  to{box-shadow:0 0 0 3px rgba(0,138,228,0),0 18px 40px -24px rgba(0,59,97,0)}
}

.tm-card__photo{
  grid-area:photo;align-self:start;margin:0;
  position:sticky;top:110px;
}
.tm-card__photo img{
  display:block;width:100%;height:auto;aspect-ratio:4/5;object-fit:cover;
  border-radius:var(--r-sm);background:var(--line);
}

.tm-card__head{grid-area:head}
.tm-card__name{
  margin:0;font-family:var(--ff-head);font-weight:700;
  font-size:clamp(22px,2vw,30px);line-height:1.14;letter-spacing:-0.015em;color:var(--navy);
  text-wrap:balance;
}
.tm-card__role{margin:10px 0 0;font-size:16px;line-height:1.45;font-weight:600;color:var(--blue)}

.tm-card__text{grid-area:text;margin-top:22px}
.tm-card__bio p{margin:0;font-size:16px;line-height:1.68;color:var(--ink-2)}
.tm-card__bio p + p{margin-top:12px}

/* факты — строками «подпись — значение», как реквизиты на «О компании» */
.tm-card__facts{margin:26px 0 0;padding:0;border-top:1px solid var(--line)}
.tm-card__facts > div{
  display:grid;grid-template-columns:minmax(150px,210px) minmax(0,1fr);gap:4px 24px;
  padding:12px 0;border-bottom:1px solid var(--line);
}
.tm-card__facts dt{font-size:14px;line-height:1.45;color:var(--ink-2)}
.tm-card__facts dd{margin:0;font-family:var(--ff-head);font-size:15px;line-height:1.45;font-weight:600;color:var(--ink)}

/* ---------- адаптив ---------- */
@media(max-width:900px){
  /* плитки в строку: аватар слева, подпись справа */
  .tm-roster{grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 16px}
  .tm-roster__item{flex-direction:row;align-items:center;padding:10px 8px}
  .tm-roster__ava{width:64px;height:64px}
  .tm-card{grid-template-columns:200px minmax(0,1fr)}
}
@media(max-width:760px){
  .tm-roster{grid-template-columns:1fr;gap:2px}
  .tm-roster__item{padding:8px 6px}
  .tm-roster__ava{width:56px;height:56px}
  .tm-roster__name{font-size:15px}

  /* на телефоне фото уходит в шапку карточки рядом с именем, текст — на всю ширину */
  .tm-card{
    grid-template-columns:96px minmax(0,1fr);
    grid-template-areas:"photo head" "text text";
    grid-template-rows:auto auto;
    column-gap:16px;padding:20px;scroll-margin-top:84px;
  }
  .tm-card__photo{position:static;align-self:center}
  .tm-card__head{align-self:center}
  .tm-card__name{font-size:19px}
  .tm-card__role{margin-top:6px;font-size:14px}
  .tm-card__text{margin-top:18px}
  .tm-card__bio p{font-size:15.5px;line-height:1.65}
  .tm-card__facts{margin-top:20px}
  .tm-card__facts > div{grid-template-columns:1fr;padding:10px 0}
  .tm-card__facts dt{font-size:13px}
}
@media(prefers-reduced-motion:reduce){
  .tm-card:target{animation:none}
}
