/* Variables ya definidas en :root del CSS general */

/* MAIN CONTENT */
main {
  max-width: 1200px;
  margin: 0 auto 4rem;
  padding: var(--espacio-grande) var(--espacio-medio);
  flex-grow: 1;
}

/* Contenedor de todas las tarjetas */
.cursos-container {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  justify-content: center;
  margin-top: var(--espacio-grande);
}

/* Tarjeta individual */
.curso {
  background-color: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: var(--radio-bordes);
  padding: 1.5rem;
  max-width: 520px;
  flex: 1 1 480px;
  min-height: 620px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
  box-sizing: border-box;
  box-shadow: 0 0 10px rgba(0,0,0,0.05);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  cursor: default;
}

.curso:hover,
.curso:focus-within {
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  transform: translateY(-5px);
}

/* Títulos dentro de cada tarjeta */
.curso-content h2 {
  font-size: clamp(1.6rem, 1.5vw + 1rem, 2rem);
  color: var(--color-primario);
  margin-bottom: 1rem;
  font-family: var(--font-titulo);
}

/* Párrafos */
.curso-content p {
  text-align: justify;
  font-size: 1.15rem;
  line-height: 1.7;
  color: #333;
}

/* Imagen del curso */
.curso-imagen {
  display: block;
  max-width: 100%;
  max-height: 260px;
  height: auto;
  aspect-ratio: 16 / 9;           /* Mantiene proporción estándar */
  object-fit: contain;            /* Evita recorte, sin deformar */
  margin: 1rem auto;
  border-radius: 6px;
  background-color: #ffffff;      /* Relleno si la imagen no ocupa todo */
}


.curso-imagen:hover,
.curso-imagen:focus {
  transform: scale(1.03);
  cursor: pointer;
}

/* Botones */
.boton-container {
  margin-top: 1.5rem;
  text-align: center;
}

.boton {
  background-color: var(--color-primario);
  color: white;
  padding: 0.8rem 1.8rem;
  border-radius: calc(var(--radio-bordes) / 1.5);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  display: inline-block;
}

.boton:hover,
.boton:focus-visible {
  background-color: #005f99;
  box-shadow: 0 6px 14px rgba(0,95,153,0.6);
  outline: none;
  cursor: pointer;
}

/* Responsive para móviles */
@media screen and (max-width: 768px) {
  main {
    max-width: 95%;
    padding: var(--espacio-medio) var(--espacio-medio);
  }

  .cursos-container {
    flex-direction: column;
    align-items: center;
    gap: 1.8rem;
  }

  .curso {
    max-width: 90%;
    padding: 1.3rem;
    min-height: auto;
  }

  .curso-content h2 {
    font-size: 1.7rem;
  }

  .curso-content p {
    font-size: 1.1rem;
  }

  .curso-imagen {
    height: 260px;
  }

  .boton {
    font-size: 1rem;
    padding: 0.7rem 1.5rem;
  }
}
