/* Опишите в этом файле все keyframes для проекта и стили анимаций иконки Like.

Будьте внимательны! Для корректной работы скриптов на этом сайте нужно, чтобы в HTML некоторые классы были названы особым образом:
✦ like-icon — для svg-иконки анимированного сердца
✦ card__like-button — для кнопки Like рядом с иконкой
✦ card__icon-button — для кнопки, оборачивающей иконку
✦ card__icon-button — для кнопки, оборачивающей иконку
✦ is-liked — для обозначения состояния лайкнутой иконки в виде сердца
✦ button__text — для обозначения текстового элемента внутри кнопки

*/

@keyframes heart-scale {
  to {
    scale: 1.25;
  }
}

@keyframes heart-sparks {
  to {
    fill: var(--icon-like-color, #ff0000);
  }
}

.card__icon-button {
  max-height: 38px;
  border: 2px solid transparent;
  padding: 0;
  background-color: transparent;
  transition: border-color 0.3s ease;
}

/*=====================Начальное состояние=====================*/
.core {
  fill: transparent;
  transition: fill 0.3s ease 0.05s;
}

.main-body {
  fill: transparent;
  transition: fill 0.3s ease;
}

.contour {
  fill: var(--accent-color, #000);
  transition: fill 0.1s linear;
}

.sparks {
  fill: transparent;
}

/*=====================Анимация hover=====================*/
.card__icon-button:hover .core {
  fill: var(--accent-color, #000);
  transition: fill 0.3s ease;
}

.card__icon-button:hover .main-body {
  fill: var(--accent-color, #000);
  transition: fill 0.3s ease 0.05s;
}

/*=====================Анимация active=====================*/
.card__icon-button:active .core {
  fill: var(--icon-like-color, #ff0000);
  transition: fill 0.3s ease;
}

.card__icon-button:active .main-body {
  fill: var(--icon-like-color, #ff0000);
  transition: fill 0.3s ease 0.05s;
}

/*=====================Анимация наличие ЛАЙК=====================*/
.is-liked .core {
  fill: var(--icon-like-color, #ff0000);
  transition: fill 0.3s ease;
}

.is-liked .main-body {
  fill: var(--icon-like-color, #ff0000);
  transition: fill 0.3s ease 0.05s;
}

.is-liked .contour {
  fill: var(--icon-like-color, #ff0000);
  transition: fill 0.3s ease 0.06s;
}

.is-liked .sparks {
  transform-origin: center;
  animation: heart-sparks 0.3s ease-in 0.3s alternate;
}

.is-liked .heart {
  transform-origin: center;
  animation: heart-scale 0.3s ease-in 0.1s alternate;
}
