/* =========================================================
   KYMAYA — J'AIME / PARTAGER
   CSS COMMUN
   Animation inspirée Instagram Reels
   ========================================================= */

.kym-social,
.kym-social *,
.kym-social *::before,
.kym-social *::after {
  box-sizing: border-box;
}

.kym-social {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 2px;
  margin: 0;
  font-family: inherit;
}

.kym-social__row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
}


/* =========================================================
   BOUTONS
   ========================================================= */

.kym-social-like,
.kym-social-share {
  position: relative;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  margin: 0;
  padding: 4px 2px;

  appearance: none;
  -webkit-appearance: none;

  background: transparent;
  border: 0;

  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;

  color: #666666;

  cursor: pointer;

  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}


@media (hover:hover) {

  .kym-social-like:hover,
  .kym-social-share:hover {
    opacity: .58;
  }

  .kym-social-like.is-liked:hover {
    opacity: 1;
  }

}


.kym-social-like:focus-visible,
.kym-social-share:focus-visible {
  outline: 2px solid #0095f6;
  outline-offset: 3px;
  border-radius: 6px;
}


/* =========================================================
   CONTENEUR DU COEUR
   ========================================================= */

.kym-social-heart-wrap {
  position: relative;

  width: 26px;
  height: 26px;

  display: flex;
  align-items: center;
  justify-content: center;

  flex: 0 0 26px;

  overflow: visible;
}


/* =========================================================
   COEUR PRINCIPAL
   ========================================================= */

.kym-social-heart-main {
  position: relative;
  z-index: 2;

  width: 26px;
  height: 26px;

  display: block;

  overflow: visible;

  transform-origin: center center;
}


.kym-social-heart {
  fill: transparent;

  stroke: #262626;
  stroke-width: 18;

  stroke-linecap: round;
  stroke-linejoin: round;

  transition:
    fill .16s ease,
    stroke .16s ease;
}


.kym-social-like.is-liked .kym-social-heart {
  fill: #EB4649;
  stroke: #EB4649;
}


/* =========================================================
   PETIT REBOND FINAL DU COEUR PRINCIPAL
   ========================================================= */

.kym-social-like.like-settle
.kym-social-heart-main {
  animation:
    kymSocialMainHeartSettle
    .28s
    cubic-bezier(.17,.89,.32,1.45)
    both;
}


@keyframes kymSocialMainHeartSettle {

  0% {
    transform: scale(.82);
  }

  55% {
    transform: scale(1.13);
  }

  100% {
    transform: scale(1);
  }

}


/* =========================================================
   COEUR VOLANT — ANIMATION INSTAGRAM
   ========================================================= */

.kym-social-flying-heart {
  position: absolute;

  left: 50%;
  top: 50%;

  width: 30px;
  height: 30px;

  z-index: 10;

  pointer-events: none;

  opacity: 0;

  transform:
    translate(-50%, -50%)
    translateY(0)
    scale(.15);

  transform-origin: center center;

  will-change:
    transform,
    opacity;
}


.kym-social-flying-heart svg {
  width: 100%;
  height: 100%;

  display: block;

  overflow: visible;
}


.kym-social-like.is-animating
.kym-social-flying-heart {
  animation:
    kymSocialInstagramFlyingHeart
    .82s
    cubic-bezier(.22,.72,.26,1)
    both;
}


@keyframes kymSocialInstagramFlyingHeart {

  0% {
    opacity: 0;

    transform:
      translate(-50%, -50%)
      translateY(0)
      scale(.18);
  }

  7% {
    opacity: .65;

    transform:
      translate(-50%, -50%)
      translateY(-7px)
      scale(.48);
  }

  18% {
    opacity: 1;

    transform:
      translate(-50%, -50%)
      translateY(-31px)
      scale(1.15);
  }

  34% {
    opacity: 1;

    transform:
      translate(-50%, -50%)
      translateY(-57px)
      scale(2.05);
  }

  43% {
    opacity: 1;

    transform:
      translate(-50%, -50%)
      translateY(-60px)
      scale(2.18);
  }

  55% {
    opacity: 1;

    transform:
      translate(-50%, -50%)
      translateY(-51px)
      scale(1.84);
  }

  69% {
    opacity: .95;

    transform:
      translate(-50%, -50%)
      translateY(-34px)
      scale(1.28);
  }

  82% {
    opacity: .78;

    transform:
      translate(-50%, -50%)
      translateY(-17px)
      scale(.82);
  }

  92% {
    opacity: .42;

    transform:
      translate(-50%, -50%)
      translateY(-6px)
      scale(.48);
  }

  100% {
    opacity: 0;

    transform:
      translate(-50%, -50%)
      translateY(0)
      scale(.22);
  }

}


/* =========================================================
   PETIT MOUVEMENT LATÉRAL
   ========================================================= */

.kym-social-flying-heart-inner {
  width: 100%;
  height: 100%;

  display: block;

  transform-origin: center;
}


.kym-social-like.is-animating
.kym-social-flying-heart-inner {
  animation:
    kymSocialInstagramHeartSway
    .82s
    ease-in-out
    both;
}


@keyframes kymSocialInstagramHeartSway {

  0% {
    transform: translateX(0) rotate(0deg);
  }

  24% {
    transform: translateX(-2px) rotate(-2deg);
  }

  45% {
    transform: translateX(2px) rotate(1.5deg);
  }

  70% {
    transform: translateX(-1px) rotate(-1deg);
  }

  100% {
    transform: translateX(0) rotate(0deg);
  }

}


/* =========================================================
   PARTAGER
   ========================================================= */

.kym-social-share svg {
  width: 26px;
  height: 26px;

  display: block;
  flex-shrink: 0;

  fill: none;
  stroke: #262626;

  stroke-width: 16;
  stroke-linecap: round;
  stroke-linejoin: round;

  transform-origin: center;

  transition:
    transform .14s ease,
    opacity .14s ease;
}


.kym-social-share:active svg {
  transform: scale(.88);
}


/* =========================================================
   COMPTEURS
   ========================================================= */

.kym-social-count {
  color: #666666;

  font-family: inherit;
  font-size: 14px;
  font-weight: 700;

  font-variant-numeric: tabular-nums;

  line-height: 1;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width:600px) {

  .kym-social {
    padding: 8px 2px 18px;
  }

  .kym-social__row {
    gap: 16px;
  }

  .kym-social-heart-wrap {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
  }

  .kym-social-heart-main,
  .kym-social-share svg {
    width: 24px;
    height: 24px;
  }

  .kym-social-flying-heart {
    width: 29px;
    height: 29px;
  }

  .kym-social-count {
    font-size: 13px;
  }

}


/* =========================================================
   ACCESSIBILITÉ
   ========================================================= */

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

  .kym-social-like.is-animating
  .kym-social-flying-heart,

  .kym-social-like.is-animating
  .kym-social-flying-heart-inner,

  .kym-social-like.like-settle
  .kym-social-heart-main {

    animation: none !important;

  }

}