body {
  font-family: 'Montserrat', 'Segoe UI', sans-serif;
  background: #fffbe6;
  display: grid;
  min-height: 100dvh;
}

.title {
  text-align: center;
  font-size: 2.5rem;
  color: #5a4100;
  margin-top: 5rem;
  font-weight: 600;
  line-height: 1.2;
}

.title .highlight {
  font-weight: 700;
  color: #3c2c00;
}

.title .gold {
  font-weight: 800;
  color: #f9a825;
}

.title-line {
  width: 5rem;
  height: 0.25rem;
  background: #f9a825;
  margin: 0.75rem auto 0;
  border-radius: 0.25rem;
}

main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  margin: 3.73rem 0;

}

/* Contenedor Grid centrado y con ancho máximo */
.cards-container {
  display: flex;
  flex-wrap: wrap;
  max-width: 68.75rem;
  gap: 4rem;
  justify-content: center;
}

/* Estructura general de la tarjeta */
.card {
  perspective: 1200px;
  height: 350px;
  width: 230px;
  cursor: pointer;

}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s ease-in-out;
  transform-style: preserve-3d;
}

.card:hover .card-inner {
  transform: rotateY(180deg);
}

/* Caras frontal y trasera */
.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  padding: 1rem;
  border-radius: 16px;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 16px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.card-front {
  background: #f3e5ab;
  color: #3e2f00;
  box-shadow: 0 3px rgba(31, 24, 3, 0.2);
}


.card-back {
  background: #fffbe6;
  color: #3e2723;
  transform: rotateY(180deg);
  position: relative;
  padding-bottom: 2rem;

}

/* Imágenes */
.card-front img {
  background: linear-gradient(135deg, #f9e8a2, #e1c370);
  max-width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 0.5rem;
}

/* Tipografía */
h1 {
  font-size: 2rem;
  color: rgb(161, 106, 42);
  margin-bottom: 0.5rem;
}

.card h2 {
  font-size: 1.4rem;
  margin-top: 2rem;
  color: rgb(161, 106, 42);
}

.card h3 {
  font-size: 1.2rem;
  color: rgb(161, 106, 42);
}

.card p {
  font-size: 0.875rem;
  font-weight: 400;

}

.card-back-descr {
  font-size: 1rem;
  line-height: 1.5;
  margin: 1rem;
  overflow: auto;
  overflow-x: hidden;
  text-align: left;

}

/* Efecto al pasar el cursor */
.card:hover {
  filter: brightness(1.03);
  box-shadow: 0 0 15px rgba(100, 255, 200, 0.2);
  transform: scale(1.25);
  transition: transform 0.3s ease, filter 0.3s ease, box-shadow 0.3s ease;
}

.card-back a {
  margin: 5px 0px;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  text-decoration: none;
  font-weight: bold;
  color: #3e2f00;
  background-color: #f9a825;
  transition: background-color 0.3s ease;
}

.card-back a:hover {
  background-color: #1f1803;
  color: #fff5d8;
}



/* Media Queries para Responsividad */
@media (max-width: 600px) {

  /* Ajusta el tamaño de la fuente de los títulos h1 para pantallas pequeñas */
  h1 {
    font-size: 1.5rem;
  }

  /* Estilos para la tarjeta (card) en pantallas pequeñas */
  .card {
    height: 350px;
    max-width: 350px;
    margin: 0 auto;
  }


  .card-front,
  .card-back {
    padding: 0.8rem;
  }

  .card-front img,
  .card-back img,
  .vertical-image {
    height: 120px;
    /* igual que la versión click */
  }

  /* Cambia la navegación de versiones para que cada enlace ocupe una línea y tenga margen vertical */
  .version-nav a {
    display: block;
    margin: 0.3rem 0;
  }

  /* Reduce el padding general del contenedor principal (main) para pantallas pequeñas */
  main {
    padding: 1rem;
  }

  /* Ajustes para el contenedor de tarjetas */
  .cards-container {
    gap: 1.5rem;
    grid-template-columns: 1fr;
    max-width: 360px;
    margin: 0 auto;
  }

  /* Elimina transformaciones y transiciones en las tarjetas al pasar el cursor en móviles */
  .card:hover {
    transform: none;
    transition: none;
  }
}