.imagen {
  position: relative;
  width: 100%; /* Ajuste de la anchura */
}

.img {
  position: relative;
  background-size: cover;
  width: 15rem;
  height: 15rem;
  background-repeat: no-repeat;
  border-radius: 21px;
  transition: transform 0.5s; /* Transición suave para la transformación */
  transform-style: preserve-3d; /* Preservar el estilo 3D */
}

.over {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #be6e468c; /* Color del overlay con opacidad */
  opacity: 0.5; /* Opacidad del overlay */
  border-radius: 21px;
}

.profesiones {
  display: grid;
  grid-template-columns: repeat(3, auto);
  column-gap: 3rem;
  row-gap: 3rem;
  margin: 0 auto;
  justify-content: space-evenly;
}

.profesiones .trabajo {
  margin: 0 auto;
  width: fit-content;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.profesiones .trabajo .profesionName {
  font-family: Nimbus Bold;
  font-size: 30px;
  color: #635f5f;
}

.profesiones ul {
  opacity: 0;
  margin: 0;
  padding: 0;
}

.profesiones .img:hover ul {
  position: absolute;
  opacity: 1;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #862d018c;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  text-align: center;
  list-style: none;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: white;
  font-size: 20px;
  gap: 1rem;
  border-radius: 21px;
}

.trabajo {
  perspective: 1000px; /* Ajuste de la perspectiva para el efecto 3D */
}

.trabajo:hover .img {
  transform: rotateY(180deg); /* Voltear la carta al hacer hover */
}

.trabajo:hover .img li {
  transform: rotateY(180deg); /* Voltear la carta al hacer hover */
}

ul li {
  font-family: Nimbus;
  font-size: 16px;
}

@media (max-width: 1100px) {
  .img {
    width: 10rem;
    height: 10rem;
  }
  .profesiones .img:hover ul {
    overflow-y: scroll;
    gap: 0.6rem;
    font-size: 17px;
  }
}

@media(max-width:970px){
    .profesiones {
        grid-template-columns: repeat(2, auto);
      }
}

@media (max-width: 880px) {

  .img {
    width: 20rem;
    height: 20rem;
  }
  .profesiones .img:hover ul {
    font-size: 20px;
  }  
}

@media (max-width: 768px) {
  .profesiones {
    grid-template-columns: repeat(1, auto);
  } 
}

@media (max-width: 375px) {
  .img {
    width: 13rem;
    height: 13rem;
  }
  .profesiones .img:hover ul {
    overflow-y: scroll;
    gap: 0.6rem;
    font-size: 17px;
    padding-top: 0.5rem;
  }
}
