/* Contenedor General */
.edu-portal-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  font-family: 'Arial', Roboto, sans-serif;
}

/* Encabezado */
.section-header {
	text-align: center;
  margin-bottom: 30px;
}

.main-title-excelencia {
	text-align: center;
  font-size: clamp(2.5rem, 10vw, 8.1rem);
  color: #20315C;
  margin-bottom: 8px;
  text-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  font-weight: 800;
}

.sub-phrase {
  font-size: 2.1rem;
  color: #666;
  max-width: 800px;
  line-height: 1.4;
}

/* Grid de Tarjetas */
.cards-container {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.edu-card {
  flex: 1;
  min-width: 300px;
  height: 400px;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  display: block;
  text-decoration: none;
}

.card-image-wrapper, .card-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

/* Efecto Hover Overlay */
.card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end; /* Texto abajo por defecto */
  padding: 30px;
  box-sizing: border-box;
  transition: all 0.4s ease-in-out;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
}

.overlay-content h3 {
  color: #fff;
  font-size: 1.8rem;
  margin: 0;
  transition: transform 0.4s ease;
}

.motivation-text {
  color: #fff;
  font-size: 1rem;
  font-style: italic;
  opacity: 0; /* Oculto inicialmente */
  transform: translateY(20px);
  transition: all 0.4s ease;
}

/* Estados Hover por color */
.card-blue:hover .card-overlay {
  background: rgba(32, 49, 92, 0.85); /* Azul institucional */
}

.card-gold:hover .card-overlay {
  background: rgba(219, 165, 20, 0.85); /* Dorado institucional */
}

.edu-card:hover .motivation-text {
  opacity: 1;
  transform: translateY(0);
}

.edu-card:hover .card-image-wrapper {
  transform: scale(1.1);
}

.edu-card:hover .overlay-content {
  align-self: center; /* Centra el texto al hacer hover */
  text-align: center;
  width: 100%;
}

/* Responsive */
@media (max-width: 768px) {
  .edu-card {
    height: 300px;
  }
}

/* --- ACTUALIZACIÓN PARA RESPONSIVIDAD --- */

/* Ajustes para Tablets (iPad, tablets Android) */
@media (max-width: 1024px) {
  .main-title {
    font-size: 1.8rem;
  }
  .edu-card {
    height: 350px; /* Un poco más cortas para no saturar el scroll */
  }
}

/* Ajustes para Móviles (Smartphones) */
@media (max-width: 768px) {
  .edu-portal-section {
    padding: 20px 15px; /* Menos margen lateral en móviles */
  }

  .section-header {
    text-align: center; /* Centramos el texto para mejor lectura en móvil */
  }

  .main-title {
    font-size: 1.5rem;
  }

  .sub-phrase {
    font-size: 0.95rem;
    margin: 0 auto 20px;
  }

  .cards-container {
    flex-direction: column; /* Las fotos se apilan una debajo de la otra */
    gap: 15px;
  }

  .edu-card {
    flex: 1 1 auto;
    width: 100%; /* Ocupa todo el ancho disponible */
    height: 280px; /* Altura ideal para móviles */
  }

  /* En móviles, hacemos que el texto motivador se vea un poco más pronto */
  .overlay-content h3 {
    font-size: 1.3rem;
  }
  
  .motivation-text {
    font-size: 0.9rem;
    opacity: 0.9; /* En móviles el hover es tacto, mejor que se vea casi siempre */
    transform: translateY(0);
  }
}

/* Ajuste para pantallas muy pequeñas */
@media (max-width: 480px) {
  .edu-card {
    height: 220px;
  }
  .main-title {
    font-size: 1.3rem;
  }
}