/* ==============================================
   ÚLTIMAS NOVEDADES - ESTILOS MODERNOS
   OPTIMIZADO para imágenes 600x600px
   ============================================== */

.latest-news {
  padding: 80px 0;
  position: relative;
  overflow: hidden;
}

.latest-news::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="%23000" opacity="0.02"/><circle cx="75" cy="75" r="1" fill="%23000" opacity="0.02"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grain)"/></svg>');
  pointer-events: none;
}

.latest-news .container {
  position: relative;
  z-index: 2;
}

.latest-news-title {
  text-align: center;
  margin-bottom: 60px;
}

.latest-news-title h1,
.latest-news-title h2 {
  font-size: 2.5rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 20px;
  position: relative;
  display: inline-block;
}

.latest-news-title h1::after,
.latest-news-title h2::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: #24bcb5;
  border-radius: 2px;
}

.latest-news-title p {
  color: #6c757d;
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Tarjetas de posts - OPTIMIZADAS */
.news-card {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  height: 100%;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.news-card:hover {
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.news-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(36, 188, 181, 0.05) 0%,
    rgba(40, 167, 69, 0.05) 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
  pointer-events: none;
}

.news-card:hover::before {
  opacity: 1;
}

/* IMAGEN OPTIMIZADA para 600x600px */
.news-card-image {
  position: relative;
  width: 100%;
  height: 280px; /* Aumentado de 250px para mejor proporción con imágenes cuadradas */
  overflow: hidden;
  background: linear-gradient(45deg, #f8f9fa, #e9ecef);
}

.news-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center; /* Centrado para mejor recorte */
  transition: transform 0.4s ease;
}

.news-card:hover .news-card-image img {
  transform: scale(1.08); /* Reducido de 1.1 para menos distorsión */
}

.news-card-date {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(0, 0, 0, 0.75); /* Más contraste */
  color: white;
  padding: 6px 14px; /* Ligeramente más padding */
  border-radius: 20px; /* Más redondeado */
  font-size: 0.85rem;
  font-weight: 500;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1); /* Sutil borde */
}

.news-card-content {
  padding: 30px 25px;
  position: relative;
  z-index: 2;
  background: white;
  flex-grow: 1; /* Para que ocupe el espacio disponible */
  display: flex;
  flex-direction: column;
}

.news-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 15px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 60px;
}

.news-card-excerpt {
  color: #6c757d;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 25px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 72px;
  flex-grow: 1; /* Ocupa espacio disponible */
}

/* Estilos para formato básico dentro del excerpt */
.news-card-excerpt strong,
.news-card-excerpt b {
  font-weight: 600;
  color: #495057;
}

.news-card-excerpt em,
.news-card-excerpt i {
  font-style: italic;
}

.news-card-excerpt u {
  text-decoration: underline;
}

.news-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid #f1f3f4;
  margin-top: auto; /* Empuja hacia abajo */
}

.news-card-btn {
  border: solid 1px var(--primary-color);
  border-radius: 3px;
  color: var(--primary-color);
  padding: 12px 24px;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.news-card-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.news-card-btn:hover {
  color: white;
  background: var(--primary-color);
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(36, 188, 181, 0.3);
}

.news-card-btn:hover::before {
  left: 100%;
}

.news-card-btn i {
  transition: transform 0.3s ease;
}

.news-card-btn:hover i {
  transform: translateX(3px);
}

/* Placeholder para imagen - MEJORADO */
.news-card-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
  color: #b9beca;
  font-size: 3rem;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Animaciones de entrada */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.news-card {
  animation: fadeInUp 0.6s ease-out;
}

.news-card:nth-child(2) {
  animation-delay: 0.1s;
}

.news-card:nth-child(3) {
  animation-delay: 0.2s;
}

/* Enlaces de título y imagen - NUEVO */
.news-card-title-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

.news-card-title-link:hover {
  color: #24bcb5;
  text-decoration: none;
}

.news-card-image a {
  display: block;
  color: #b9beca;
  position: relative;
  overflow: hidden;
  border-radius: 0; /* Sin border-radius para que coincida con el card */
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.news-card-image a::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.3s ease;
  pointer-events: none;
}

.news-card-image a:hover::after {
  background: rgba(0, 0, 0, 0.1);
}

/* Responsive - AJUSTADO para mejor visualización */
@media (max-width: 768px) {
  .latest-news {
    padding: 60px 0;
  }

  .latest-news-title h2 {
    font-size: 2rem;
  }

  .news-card {
    margin-bottom: 30px;
  }

  /* ALTURA OPTIMIZADA para móvil */
  .news-card-image {
    height: 240px; /* Reducido para móviles */
  }

  .news-card-content {
    padding: 25px 20px;
  }

  .news-card-title {
    font-size: 1.1rem;
    min-height: auto;
  }

  .news-card-excerpt {
    min-height: auto;
  }
}

@media (max-width: 576px) {
  .latest-news-title h2 {
    font-size: 1.8rem;
  }

  .news-card-content {
    padding: 20px 15px;
  }

  .news-card-btn {
    padding: 10px 20px;
    font-size: 0.85rem;
  }

  /* ALTURA MÍNIMA para móviles pequeños */
  .news-card-image {
    height: 220px;
  }
}

/* Estados vacíos */
.news-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #6c757d;
}

.news-empty-state i {
  font-size: 4rem;
  margin-bottom: 20px;
  opacity: 0.5;
}

.news-empty-state h3 {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: #495057;
}

.news-empty-state p {
  font-size: 1rem;
  max-width: 400px;
  margin: 0 auto;
  line-height: 1.6;
}
