

/*=============== VARIABLES CSS ===============*/
:root {
  --first-color: hsl(82, 60%, 28%);
  --title-color: hsl(0, 0%, 15%);
  --text-color: hsl(0, 0%, 35%);
  --body-color: hsl(0, 0%, 95%);
  --container-color: hsl(0, 0%, 100%);
  --h2-font-size: 1.25rem;
  --small-font-size: 0.813rem;
}

@media screen and (min-width: 1120px) {
  :root {
    --h2-font-size: 1.5rem;
    --small-font-size: 0.875rem;
  }
}

/*=============== BASE ===============*/


/*=============== CARD ===============*/

.card__container {
  display: grid;
  row-gap: 3.5rem;
}

.card__article {
  position: relative;
  overflow: hidden;
}

.card__img {
  width: 308px;
  height: 400px; /* Adjusted height */
  object-fit: cover;
}

.card__data {
  width: 280px;
  background-color: var(--container-color);
  padding: 1.5rem 2rem;
  box-shadow: 0 8px 24px hsla(0, 0%, 0%, 0.15);
  position: absolute;
  bottom: -9rem;
  left: 0;
  right: 0;
  margin-inline: auto;
  opacity: 0;
  transition: opacity 1s 1s;
}

.card__description {
  display: block;
  font-size: var(--small-font-size);
  margin-bottom: 0.25rem;
}

.card__title {
  font-size: var(--h2-font-size);
  font-weight: 500;
  color: var(--title-color);
  margin-bottom: 0.75rem;
}

.card__data p{
  text-align: left;
}

.card__button {
  text-decoration: none;
  font-size: var(--small-font-size);
  font-weight: 500;
  color: var(--first-color);
}

.card__button:hover {
  text-decoration: underline;
}


.card__img-text {
  position: absolute;
  bottom: 0; /* Position at the bottom of the image */
  left: 0; /* Align text to the left */
  width: 100%; /* Ensure the text box spans the entire width of the image */
  background-color: rgba(255, 255, 255, 0.8); /* Semi-transparent white background */
  color: #000000; /* Text color */
  text-align: center; /* Center the text */
  padding: 10px; /* Add some padding */
  box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.1); /* Optional: Add a shadow to give a layered effect */
}

.card__img-text h2 {
  font-weight: 400; /* Remove default margin */
}


.linkedin-link {
  display: inline-flex;
  align-items: center;
  margin-top: 10px;
  font-size: 1.2rem;
  color: #000000; /* LinkedIn blue color */
  text-decoration: none;
}

.linkedin-link i {
  margin-right: 5px; /* Space between icon and text */
}

.linkedin-link:hover {
  color: #005582; /* Darker blue on hover */
}



/* Hover Effect */
.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;
}

/* Card animation */
@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(0.5rem);
  }
}

@keyframes show-overflow {
  0% {
    overflow: initial;
    pointer-events: none;
  }
  50% {
    overflow: hidden;
  }
}

/*=============== BREAKPOINTS ===============*/
@media screen and (max-width: 340px) {

  .card__data {
    width: 250px;
    padding: 1rem;
  }
}

@media screen and (min-width: 768px) {
  .card__container {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 1.5rem;
  }
}

@media screen and (min-width: 1120px) {

  .card__container {
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: 3rem;
  }
  .card__img {
    width: 348px;
  }
  .card__data {
    width: 316px;
    padding-inline: 2.5rem;
  }
}

/* From Uiverse.io by SmookyDev */ 
.tooltip {
  position: relative;
  display: inline-block;
  cursor: pointer;
  font-family: "Arial", sans-serif;
  margin-left: 5px;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

.tooltiptext {
  visibility: hidden;
  width: 70px;
  background-color: #333333b1;
  color: #fff;
  text-align: center;
  border-radius: 5px;
  padding: 10px;
  position: absolute;
  z-index: 1;
  top: 125%;
  left: 50%;
  margin-right: -100px;
  opacity: 0;
  transition: opacity 0.3s;
}

.tooltiptext::after {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  margin-left: -10px;
  border-width: 10px;
  border-style: solid;
  border-color: transparent transparent #333 transparent;
}

.tooltip .icon {
  display: inline-block;
  width: 10px;
  height: 10px;
  background-color: #000000;
  color: #fff;
  border-radius: 50%;
  text-align: center;
  font-size: 10px;
  line-height: 10px;
}
