/* ============================================================
   UDLA Multiposts - Diseño de Tarjetas de Noticias (Versión Final)
   ============================================================ */

/* --- GRID BASE --- */
.udla-mnp-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  align-items: stretch;
}

/* --- TABLET --- */
@media (max-width: 992px) {
  .udla-mnp-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* Mostrar solo los dos primeros cards en tablet */
  .udla-mnp-grid .card-noticias-wrapper:nth-child(n+3) {
    display: none !important;
  }
}

/* --- MÓVIL --- */
@media (max-width: 600px) {
  .udla-mnp-grid {
    grid-template-columns: 1fr;
  }

  /* Solo mostrar el primer card en móvil */
  .udla-mnp-grid .card-noticias-wrapper:not(:first-child) {
    display: none !important;
  }
}

/* --- CARD --- */
.card-noticias {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card-noticias:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
}

/* --- IMAGEN DESTACADA --- */
.card-noticias-bg {
  position: relative;
  background-size: cover;
  background-position: center;
  height: 450px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

/* --- DEGRADADO OSCURO SOBRE IMAGEN --- */
.card-noticias-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.7) 0%,
    rgba(0, 0, 0, 0.15) 70%,
    transparent 100%
  );
  z-index: 1;
}

/* --- CINTA DE CATEGORÍA DERECHA --- */
.info-tag-card-entrada,
.info-tag-card-entrada-pg {
  position: absolute;
  top: 0;
  right: 0;
  background: #e35205;
  color: #fff;
  font-family: "Roboto", sans-serif;
  font-size: 0.8rem !important;
  font-weight: 700;
  text-transform: uppercase;
  text-align: center;
  padding: 0.5rem 1rem;
  letter-spacing: 0.05rem;
  border-top-right-radius: 1rem;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  line-height: 1.2;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 80%;
  box-sizing: border-box;
}

/* --- CONTENIDO --- */
.card-noticias-content {
  position: relative;
  z-index: 2;
  padding: 1rem;
  color: #fff;
}

.post-date {
  font-size: 0.85rem;
  opacity: 0.9;
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding-bottom: 2rem;
}

/* --- TÍTULO DE ENTRADA --- */
.titulo-entrada-seccion {
  font-size: 1.3rem !important;
  font-weight: 300;
  line-height: 1.6rem !important;
  padding-bottom: 2rem !important;
  color: #fff;
}

.titulo-entrada-seccion a {
  color: inherit;
  font-size: inherit;
  line-height: inherit;
  text-decoration: none;
  display: inline-block;
  transition: none !important; /* evita cualquier animación */
}

.titulo-entrada-seccion a:hover {
  color: inherit;
  font-size: inherit;
  line-height: inherit;
  text-decoration: none;
  transform: none !important; /* evita saltos */
}

/* --- BOTÓN LEER MÁS --- */
.btn-leer-mas {
  display: inline-block;
  margin-top: 0.5rem;
  font-family: "Roboto", sans-serif;
  text-transform: uppercase;
  font-size: 1rem;
  letter-spacing: 0.1rem !important;
  color: #fff;
  text-decoration: none !important;
  padding-bottom: 1rem;
  transition: none !important;
  transform: none !important;
}

.btn-leer-mas:hover {
  opacity: 0.8;
  color: #fff;
}


/* =====================================
   ESTANDARIZACIÓN DE ALTURA ENTRE
   TARJETA HERO Y TARJETA DUO
   ===================================== */

/* El contenedor Elementor debe ser flex y permitir stretch */
.elementor-container,
.elementor-row,
.elementor-column {
    align-items: stretch !important;
}

/* Las tarjetas deben ocupar el 100% disponible del contenedor */
.udla-card-hero,
.udla-card-duo {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Wrapper interno también 100% */
.udla-card-hero .inner,
.udla-card-duo .inner {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Asegurar que las imágenes no deformen la altura */
.udla-card-hero img,
.udla-card-duo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Para la HERO que normalmente tiene imagen de fondo */
.udla-hero--full,
.udla-card-hero.is-fixed-all {
    height: 100%;
    display: flex;
}

/* Títulos y contenido siempre al fondo si es necesario */
.udla-card-hero .content,
.udla-card-duo .content {
    margin-top: auto;
}

/* RESPONSIVE –
   Cuando pasas a una sola columna el alto debe ajustarse automático */
@media(max-width: 768px) {
    .udla-card-hero,
    .udla-card-duo {
        height: auto !important;
    }
}
