.img-section {
  margin-bottom: 2rem;
  max-width: 1440px;
  margin-inline: auto;
  text-align: center;
}

/* bottom */
.img-section .bottom {
  display: flex;
  justify-content: space-between;
  margin-block: 3rem 2rem;
  padding-inline: 2rem;
  gap: 2rem;
}

/* cards */
.card__article {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  background-color: #f8f8f8;
}

.card__img {
  width: 100%;
  object-fit: contain;
  border-radius: 8px;
}

.card__data {
  background-color: var(--bg);
  padding: 1.5rem 2rem;
  box-shadow: 0 8px 24px hsla(0, 0%, 0%, 0.15);
  border-radius: 4px;
  position: absolute;
  bottom: -9rem;
  left: 0;
  right: 0;
  width: 316px;
  margin-inline: auto;
  opacity: 0;
  transition: opacity 1s;
}

.card__title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.card__para {
  font-size: 1rem;
  color: #888;
  font-weight: 500;
}

/* using Animations */
.card__article:hover .card__data {
  animation: show-data 1s forwards;
  opacity: 1;
  transition: opacity 0.3s;
}

.card__article:hover {
  animation: remove-overflow 2s forwards;
}

.card__article:not(:hover) {
  animation: show-overflow 2s forwards;
}

.card__article:not(:hover) .card__data {
  animation: remove-data 1s forwards;
}

/* Defining Animations */
@keyframes show-data {
  50% {
    transform: translateY(-10rem);
  }

  100% {
    transform: translateY(-7rem);
  }
}

@keyframes remove-overflow {
  to {
    overflow: initial;
  }
}

@keyframes remove-data {
  0% {
    transform: translateY(-7rem);
  }

  50% {
    transform: translateY(-10rem);
  }

  100% {
    transform: translateY(5rem);
  }
}

@keyframes show-overflow {
  0% {
    overflow: initial;
    pointer-events: none;
  }

  50% {
    overflow: hidden;
  }
}

/*=============== BREAKPOINTS ===============*/

@media (width <= 1200px) {
  .card__data {
    width: 250px;
    padding: 1rem;
  }

  .card__title {
    font-size: 1rem;
  }

  .card__para {
    font-size: 0.875rem;
  }
}

@media (width <= 980px) {
  .img-section .bottom {
    flex-direction: column;
    align-items: center;
    gap: 4rem;
  }

  .card__article {
    width: min(320px, 70vw);
  }
}

@media (width <= 400px) {
  .img-section .bottom {
    gap: 6rem;
  }
  .card__data {
    max-width: min(60vw, 220px);
  }
}
