/* ATMMIX · Форум 2.1 — блоки «События проекта», «На форуме», «Лучшие» на главной. Подключается в tpl/head.tpl после atmx.css */

@keyframes f2h-line {
  from {
    background-position: -50% 0;
  }

  to {
    background-position: 150% 0;
  }
}

@keyframes f2h-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes f2h-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(69, 221, 154, .6);
  }

  70% {
    box-shadow: 0 0 0 7px rgba(69, 221, 154, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(69, 221, 154, 0);
  }
}

.ac-home-insights.f2-insights.ac-row {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 16px !important;
  align-items: stretch !important;
}

.f2-insights .ac-insight-card {
  grid-column: auto !important;
  display: flex !important;
  flex-direction: column;
  min-height: 0 !important;
  border-radius: 20px !important;
}

.f2-insights .ac-insight-card::after {
  left: 0;
  right: 0;
  height: 2px;
  opacity: 1;
  background: linear-gradient(90deg, transparent, var(--ic1), transparent);
  background-size: 50% 100%;
  background-repeat: no-repeat;
  animation: f2h-line 4.5s linear infinite;
}

.f2-insights .ac-insight-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--ic1) 40%, rgba(255, 255, 255, .08));
  box-shadow: 0 24px 50px -28px color-mix(in srgb, var(--ic1) 60%, #000);
}

.f2-insights .ac-insight-card__head {
  flex: 0 0 auto;
  min-height: 76px;
  padding: 14px 16px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--ic1) 10%, transparent), transparent 60%);
}

.f2-insights .f2-ic__icon {
  flex: 0 0 42px;
  border: 0;
  color: #121212;
  background: linear-gradient(135deg, var(--ic1), var(--ic2));
  box-shadow: 0 8px 22px -8px var(--ic1), inset 0 1px 0 rgba(255, 255, 255, .4);
}

.f2-insights .ac-insight-card__eyebrow {
  color: var(--ic1);
}

.f2-insights .ac-insight-card__title-group h2 {
  font: italic 900 18px/1.15 var(--ac-font-head);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.f2-insights .ac-insight-card__link {
  border-radius: 99px;
}

.f2-insights .ac-insight-card__body,
.f2-insights .ac-insight-card__body--events,
.f2-insights .ac-insight-card__body--top {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  height: auto !important;
  overflow-y: auto !important;
  overflow-x: hidden;
  padding: 8px !important;
  gap: 4px;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--ic1) 30%, transparent) transparent;
}

.f2-insights .ac-insight-card__foot {
  flex: 0 0 auto;
  min-height: 40px;
  font-size: 11px;
}

.f2-ic__live {
  color: #45dd9a;
  letter-spacing: .08em;
}

.f2-insights .ac-insight-live-dot {
  animation: f2h-pulse 2s infinite;
}

.f2-insights .empty-element,
.f2-insights .ac-insight-empty {
  margin: auto;
}

.f2-insights .ac-event.f2-ev {
  position: relative;
  display: flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 10px;
  min-height: 54px;
  padding: 8px 10px !important;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, .018);
  opacity: 0;
  animation: f2h-in .5s ease forwards;
  transition: background .2s, border-color .2s;
}

.f2-insights .f2-ev:nth-child(2) {
  animation-delay: .05s;
}

.f2-insights .f2-ev:nth-child(3) {
  animation-delay: .1s;
}

.f2-insights .f2-ev:nth-child(4) {
  animation-delay: .15s;
}

.f2-insights .f2-ev:nth-child(n+5) {
  animation-delay: .2s;
}

.f2-insights .f2-ev:hover {
  background: color-mix(in srgb, var(--ev, var(--ic1)) 7%, transparent);
  border-color: color-mix(in srgb, var(--ev, var(--ic1)) 20%, transparent);
}

.f2-ev {
  --ev: #ffac1c;
}

.f2-ev.is-reg {
  --ev: #3ddc84;
}

.f2-ev.is-answer {
  --ev: #4da3ff;
}

.f2-ev.is-buy {
  --ev: #ffac1c;
}

.f2-ev.is-topic {
  --ev: #a86bff;
}

.f2-ev.is-money {
  --ev: #ffd166;
}

.f2-ev__ava {
  position: relative;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  padding: 2px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--ev), transparent);
}

.f2-ev__ava img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}

.f2-ev__kind {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid #121317;
  background: var(--ev);
  color: #111;
  font-size: 10px;
}

.f2-ev__text {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0 !important;
  font-size: 12.5px !important;
  line-height: 1.4 !important;
  color: var(--ac-text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.f2-ev__text a:first-child {
  font-weight: 800;
}

.f2-ev__text a:not(:first-child) {
  color: var(--ac-text);
}

.f2-ev__date {
  flex: 0 0 auto;
  align-self: center;
  margin: 0 !important;
  padding: 2px 8px !important;
  border-radius: 99px;
  background: rgba(255, 255, 255, .06);
  color: var(--ac-muted);
  font-size: 10px !important;
  white-space: nowrap;
}

.f2-ev__del {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 20px !important;
  height: 20px !important;
  min-width: 0 !important;
  padding: 0 !important;
  display: grid;
  place-items: center;
  border-radius: 6px;
  border: 0;
  background: rgba(255, 77, 94, .15);
  color: var(--ac-red);
  font-size: 14px;
  cursor: pointer;
  opacity: 0;
  transform: scale(.8);
  transition: all .2s;
}

.f2-ev:hover .f2-ev__del {
  opacity: 1;
  transform: scale(1);
}

.f2-ev__del:hover {
  background: var(--ac-red);
  color: #fff;
}

.f2-insights .ac-user-row {
  display: flex !important;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 8px 10px !important;
  border-radius: 12px;
  border: 1px solid transparent;
  color: var(--ac-text);
  text-decoration: none;
  opacity: 0;
  animation: f2h-in .5s ease forwards;
  transition: background .2s, border-color .2s, transform .25s;
}

.f2-insights .ac-user-row:nth-child(2) {
  animation-delay: .05s;
}

.f2-insights .ac-user-row:nth-child(3) {
  animation-delay: .1s;
}

.f2-insights .ac-user-row:nth-child(4) {
  animation-delay: .15s;
}

.f2-insights .ac-user-row:nth-child(n+5) {
  animation-delay: .2s;
}

.f2-insights .ac-user-row:hover {
  transform: translateX(3px);
  background: color-mix(in srgb, var(--ic1) 6%, transparent);
  border-color: color-mix(in srgb, var(--ic1) 20%, transparent);
}

.f2-la__ava,
.f2-insights .ac-ava-wrap {
  width: 36px !important;
  height: 36px !important;
  flex: 0 0 36px !important;
  border-radius: 11px;
  overflow: hidden;
}

.f2-la__ava .gc-playground-avatar,
.f2-la__ava img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  border-radius: 11px;
}

.f2-la__main {
  flex: 1;
  min-width: 0;
}

.f2-la__title {
  display: block !important;
  font-size: 13px !important;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color .2s;
}

.f2-la:hover .f2-la__title {
  color: var(--ic1);
}

.f2-la__sub {
  display: block;
  margin-top: 2px !important;
  font-size: 11px !important;
  color: var(--ac-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.f2-la__pill {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 99px;
  background: color-mix(in srgb, var(--ic1) 14%, transparent);
  color: var(--ic1);
  font-size: 14px;
}

.f2-la__arrow {
  flex: 0 0 auto;
  color: var(--ic1);
  font-size: 18px;
  opacity: 0;
  transform: translateX(-6px);
  transition: all .25s;
}

.f2-la:hover .f2-la__arrow {
  opacity: 1;
  transform: none;
}

.f2-insights .ac-insight-card--top .ac-pane.is-active {
  display: flex !important;
  flex-direction: column;
  gap: 4px;
  counter-reset: f2top;
}

.f2-insights .ac-insight-card--top .ac-user-row {
  height: auto !important;
  background: rgba(255, 255, 255, .018) !important;
  overflow: visible;
}

.f2-insights .f2-top .f2-medal {
  flex: 0 0 24px;
}

.f2-insights .f2-top:nth-child(1) {
  background: linear-gradient(90deg, rgba(255, 197, 61, .14), transparent) !important;
  box-shadow: 0 0 0 1px rgba(255, 197, 61, .35), 0 0 24px -8px rgba(255, 197, 61, .5);
}

.f2-insights .f2-top__name {
  font-size: 13px !important;
}

.f2-insights .f2-top__val {
  font-size: 17px !important;
}

@media (max-width: 1100px) {
  .ac-home-insights.f2-insights.ac-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .f2-insights .ac-insight-card--top {
    grid-column: 1 / -1 !important;
  }
}

@media (max-width: 720px) {
  .ac-home-insights.f2-insights.ac-row {
    grid-template-columns: 1fr !important;
  }
}

@media (prefers-reduced-motion: reduce) {

  .f2-insights .ac-insight-card::after,
  .f2-insights .ac-insight-live-dot {
    animation: none !important;
  }

  .f2-insights .f2-ev,
  .f2-insights .ac-user-row {
    animation: none !important;
    opacity: 1 !important;
  }
}