/* Земельный Практикум — hover v2.
   Только transform / shadow. Геометрия и размеры элементов не меняются. */

body[data-role="student"][data-active="home"] .home-community-topic-compact,
body[data-role="student"][data-active="home"] .mentor-card .mentor-training-context.group,
body[data-role="student"][data-active="home"] .mentor-card .mentor-training-context.individual,
body[data-role="student"][data-active="home"] .mentor-card button[data-open-teacher-mentor-dialog],
body[data-role="student"][data-active="home"] .mentor-card button[data-page="profile"] {
  position: relative !important;
  z-index: 1 !important;
  transform: translateY(0) scale(1) !important;
  transform-origin: center !important;
  backface-visibility: hidden !important;
  -webkit-font-smoothing: antialiased;
  will-change: transform, box-shadow, filter;
  transition:
    transform 230ms cubic-bezier(.2,.82,.2,1),
    box-shadow 230ms ease,
    border-color 230ms ease,
    filter 230ms ease !important;
}

body[data-role="student"][data-active="home"] .home-community-topic-avatar-compact,
body[data-role="student"][data-active="home"] .home-community-topic-tag-compact {
  transform: translateY(0) scale(1);
  transition: transform 230ms cubic-bezier(.2,.82,.2,1) !important;
}

/* Карточки тем сообщества */
body[data-role="student"][data-active="home"] .home-community-topic-compact:hover,
body[data-role="student"][data-active="home"] .home-community-topic-compact:focus-within {
  transform: translateY(-5px) scale(1.009) !important;
  border-color: color-mix(in srgb, var(--hc-green) 38%, transparent) !important;
  box-shadow:
    0 15px 30px rgba(28,74,43,.17),
    inset 0 1px 0 rgba(255,255,255,.32) !important;
  filter: saturate(1.04) !important;
}

body[data-theme="dark"][data-role="student"][data-active="home"] .home-community-topic-compact:hover,
body[data-theme="dark"][data-role="student"][data-active="home"] .home-community-topic-compact:focus-within {
  box-shadow:
    0 16px 34px rgba(0,0,0,.34),
    0 0 0 1px rgba(87,197,108,.10),
    inset 0 1px 0 rgba(255,255,255,.05) !important;
}

body[data-role="student"][data-active="home"] .home-community-topic-compact:hover .home-community-topic-avatar-compact,
body[data-role="student"][data-active="home"] .home-community-topic-compact:focus-within .home-community-topic-avatar-compact {
  transform: translateY(-2px) rotate(-2deg) scale(1.055) !important;
}

body[data-role="student"][data-active="home"] .home-community-topic-compact:hover .home-community-topic-tag-compact,
body[data-role="student"][data-active="home"] .home-community-topic-compact:focus-within .home-community-topic-tag-compact {
  transform: translateX(-3px) scale(1.015) !important;
}

/* Плашка «Ваша группа» / «Формат обучения» */
body[data-role="student"][data-active="home"] .mentor-card .mentor-training-context.group:hover,
body[data-role="student"][data-active="home"] .mentor-card .mentor-training-context.individual:hover {
  z-index: 3 !important;
  transform: translateY(-7px) scale(1.012) !important;
  border-color: rgba(103,168,226,.90) !important;
  box-shadow:
    0 20px 38px rgba(38,82,120,.22),
    inset 0 1px 0 rgba(255,255,255,.88) !important;
  filter: brightness(1.025) saturate(1.05) !important;
}

body[data-theme="dark"][data-role="student"][data-active="home"] .mentor-card .mentor-training-context.group:hover,
body[data-theme="dark"][data-role="student"][data-active="home"] .mentor-card .mentor-training-context.individual:hover {
  box-shadow:
    0 22px 42px rgba(0,0,0,.38),
    0 0 0 1px rgba(69,191,218,.13),
    inset 0 1px 0 rgba(255,255,255,.07) !important;
}

/* Точные кнопки карточки наставника. Селекторы по data-атрибутам обходят старые hover-правила mentor-модулей. */
body[data-role="student"][data-active="home"] .mentor-card button[data-open-teacher-mentor-dialog]:hover,
body[data-role="student"][data-active="home"] .mentor-card button[data-open-teacher-mentor-dialog]:focus-visible,
body[data-role="student"][data-active="home"] .mentor-card button[data-page="profile"]:hover,
body[data-role="student"][data-active="home"] .mentor-card button[data-page="profile"]:focus-visible {
  z-index: 4 !important;
  transform: translateY(-6px) scale(1.018) !important;
  filter: brightness(1.055) saturate(1.06) !important;
}

body[data-role="student"][data-active="home"] .mentor-card button[data-open-teacher-mentor-dialog]:hover,
body[data-role="student"][data-active="home"] .mentor-card button[data-open-teacher-mentor-dialog]:focus-visible {
  box-shadow:
    0 20px 34px rgba(47,90,141,.34),
    inset 0 1px 0 rgba(255,255,255,.30) !important;
}

body[data-role="student"][data-active="home"] .mentor-card button[data-page="profile"]:hover,
body[data-role="student"][data-active="home"] .mentor-card button[data-page="profile"]:focus-visible {
  box-shadow:
    0 18px 32px rgba(44,67,79,.18),
    inset 0 1px 0 rgba(255,255,255,.92) !important;
}

body[data-theme="dark"][data-role="student"][data-active="home"] .mentor-card button[data-page="profile"]:hover,
body[data-theme="dark"][data-role="student"][data-active="home"] .mentor-card button[data-page="profile"]:focus-visible {
  box-shadow:
    0 20px 36px rgba(0,0,0,.38),
    0 0 0 1px rgba(54,207,224,.10),
    inset 0 1px 0 rgba(255,255,255,.06) !important;
}

body[data-role="student"][data-active="home"] .home-community-topic-compact:active {
  transform: translateY(-1px) scale(.995) !important;
  transition-duration: 90ms !important;
}

body[data-role="student"][data-active="home"] .mentor-card button[data-open-teacher-mentor-dialog]:active,
body[data-role="student"][data-active="home"] .mentor-card button[data-page="profile"]:active {
  transform: translateY(-1px) scale(.985) !important;
  transition-duration: 90ms !important;
}

/* На устройствах без настоящего hover эффект не фиксируется после касания. */
@media (hover: none) {
  body[data-role="student"][data-active="home"] .mentor-card .mentor-training-context.group:hover,
  body[data-role="student"][data-active="home"] .mentor-card .mentor-training-context.individual:hover,
  body[data-role="student"][data-active="home"] .mentor-card button[data-open-teacher-mentor-dialog]:hover,
  body[data-role="student"][data-active="home"] .mentor-card button[data-page="profile"]:hover {
    transform: translateY(0) scale(1) !important;
  }
}
