body {
  display: flex !important;
  flex-direction: column;
  min-height: 100dvh; 
}

.contenedor,
.news-page {
  flex: 1;          
  min-width: 0;      
  margin-bottom: 3rem !important;
}

.news-header {
  margin-bottom: 2.5rem;
  border-bottom: 2px solid var(--paleta-principal-isologo-1, #57A5DB);
  padding-bottom: 1rem;
}

.news-header__title {
  font-size: 2.25rem;
  color: var(--paleta-principal-isologo-4, #1274A1);
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  color: #333;
}

.btn-cargar-mas {
  display: block;
  cursor: pointer;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  /* border: 1px solid var(--paleta-principal-isologo-3, #1898C6); */
  border: none;
  background-color: transparent;
  color: var(--paleta-principal-isologo-3, #1898C6);
  font-weight: 600;
  transition: all 0.2s ease;
}

/* .btn-cargar-mas:hover {
  background-color: var(--paleta-principal-isologo-3, #1898C6);
  color: #fff;
} */

/* ==================================================
   GRILLA PRINCIPAL FLEXBOX (Adaptativa & Autocentreda)
   ================================================== */
.news-grid {
  /* display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center; 
  width: 100%;
  margin-bottom: 4rem; */
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:24px;
  align-items:stretch;
}
/* @media(min-width: 768px){
  .news-grid{
    padding: 2rem;
  }
} */

@media(max-width:1080px){
  .news-grid{grid-template-columns:1fr 1fr;}
}
@media(max-width:600px){
  .news-grid{grid-template-columns:1fr;}
}

.news-card {
  /* background: #fff; */
  /*border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); */
  background: var(--dsg-navy-900);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
  will-change: transform; /* GPU Acceleration */

  border-radius:var(--radius-lg);
  overflow:hidden;
  box-shadow:var(--shadow-soft);
  height:100%;
  
  /* flex: 1 1 280px; */
  /* max-width: 100%; */
  width: 100%;
  display: flex;
  flex-direction: column;
}

.news-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.news-card__link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.news-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: #f0f0f0;
}

.news-card__media picture {
  display: block;
  width: 100%;
  height: 100%;
}

/* Regla unificada para TODAS las imágenes de las tarjetas */
.news-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.25s ease;
  backface-visibility: hidden; /* Evita parpadeos en Chrome */
}

.news-card--hero .news-card__media img {
  object-position: 80% top; 
}

.news-card:hover .news-card__media img {
  transform: scale(1.04);
}

.news-card__body {
  /* padding: 1.25rem; */
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.news-card__top{
  background:var(--white);
  padding:28px 26px 20px; 
  flex-basis:150px;
  display:flex;
  flex-direction: column;
  justify-content: space-evenly;
}
.news-card-compact__body,.news-card__bottom{background:var(--dsg-navy-900);color:var(--white);padding:20px 26px 26px;font-size:13.8px;flex:1;display:flex;flex-direction:column;justify-content:space-between;}
.news-card__bottom p{color:var(--gray-300);margin-bottom:16px;}

.news-card__date {
  font-size: 1.2rem;
  color: #777;
  /* color:var(--dsg-heading-blue); */
  margin-bottom: 0.5rem;
}

.news-card__title {
  /* font-size: 1.8rem;
  line-height: 1.3;
  color: #1a1a1a; */
  margin-bottom: 0.75rem;
  font-weight:700;
  font-size:21px;
  line-height:1.25;
  color:var(--dsg-heading-blue);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.8rem; 
}

.news-card__excerpt {
  font-size: 1.6rem;
  color: #555;
  line-height: 1.5;
  margin-bottom: 1rem;

  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 4.5rem; 
}

.news-card__more {
  font-weight: 600;
  font-size: 1.4rem;
  margin-top: auto;
  display: inline-flex;
  justify-content: flex-end; 
  /* color: var(--paleta-principal-isologo-3, #1898C6); */
}

/* ==================================================
   REGLAS DESKTOP (>= 992px)
   ================================================== */
/* @media (min-width: 992px) {
  .news-card {
    max-width: 65%;
  }

  .news-card--hero {
    flex: 1 1 100%;
    max-width: 100% !important;
  }

  .news-card--hero .news-card__link {
    flex-direction: row;
  }
  .news-card--hero .news-card__media {
    width: 50%;
    aspect-ratio: auto;
  }
  .news-card--hero .news-card__body {
    width: 50%;
    padding: 2rem;
  }
} */

.badge--destacado {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: var(--paleta-principal-isologo-4, #1274A1);
  color: #fff;
  font-size: 1rem;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: bold;
}

/* --------------------------------------------------
   SECCIÓN HISTÓRICO: Fila Horizontal de Cards Pequeñas
   -------------------------------------------------- */
.news-archive {
  background-color: #f8fafc;
  padding: 2rem 1.5rem;
  /* border-radius: 12px; */
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.news-archive__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.news-scroll-row {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  width: 100%;
  min-width: 0;
  -webkit-overflow-scrolling: touch;
}

.news-card-compact {
  flex: 0 0 220px;
  min-width: 220px;
  /* background: #fff; */
  background:var(--dsg-navy-900);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: transform 0.2s ease;
  will-change: transform;
}

.news-card-compact:hover {
  transform: translateY(-3px);
}

.news-card-compact__link {
  text-decoration: none;
  color: inherit;
  max-width: 30rem;
}

.news-card-compact__media {
  width: 100%;
  height: 15rem;
}

.news-card-compact__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 80% top; 
}

.news-card-compact__body {
  padding: 0.85rem;
}

.news-card-compact__date {
  font-size: 0.75rem;
  /* color: #888; */
  display: block;
  margin-bottom: 0.3rem;
}

.news-card-compact__title {
  font-size: 0.9rem;
  line-height: 1.3;
  /* color: #222; */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==================================================
   GRILLA DE ARCHIVO HISTÓRICO (Al hacer clic en "Ver todas")
   ================================================== */
.news-grid-archive {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: center;
  width: 100%;
}

.news-grid-archive .news-card-compact {
  flex: 1 1 250px;
  max-width: 100%;
}
@media(min-width: 1024px){
 .news-grid-archive .news-card-compact{
    max-width: 30%;
  }
}

/* ==================================================
   RESPONSIVE & BREAKPOINTS
   ================================================== */
.news-page {
    width: 100%;
    /* max-width: 100%; */
    min-width: 0;
    box-sizing: border-box;
}
   
/* @media (max-width: 767px) {
  .news-grid {
    gap: 2rem;
  }
  .news-card {
    flex: 1 1 100%;
    max-width: 100%;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .news-card {
    flex: 1 1 calc(50% - 1rem);
    max-width: calc(65% - 1rem);
  }

  .news-card--hero {
    flex: 1 1 100%;
    max-width: 100%;
  }
  
  .news-card--hero .news-card__link {
    flex-direction: row;
  }
  .news-card--hero .news-card__media {
    width: 50%;
    aspect-ratio: auto;
  }
  .news-card--hero .news-card__body {
    width: 50%;
    padding: 2rem;
  }
}

@media (min-width: 1025px) {
  .news-card {
    flex: 1 1 calc(33.333% - 1rem);
    max-width: calc(50% - 0.75rem); 
  }
  
  .news-card--hero {
    flex: 1 1 calc(66.666% - 1rem) !important;
    max-width: calc(66.666% - 1rem) !important;
  }

  .news-card--hero .news-card__link {
    flex-direction: row;
  }
  
  .news-card--hero .news-card__media {
    width: 48%;
    aspect-ratio: auto;
  }
  
  .news-card--hero .news-card__body {
    width: 52%;
    padding: 2rem;
  }
} */

.btn-cargar-mas {
  display: block;
  width: 100%;
  cursor: pointer;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  /* border: 1px solid var(--paleta-principal-isologo-1, #1898C6); */
  /* background-color: #fff; */
  color: var(--paleta-principal-isologo-1, #1898C6);
  font-weight: 600;
  transition: all 0.2s ease;
}
@media(min-width:768px){
    .btn-cargar-mas{
        width: auto;
    }
}

.btn-cargar-mas:hover {
  /* background-color: var(--paleta-principal-botones, #1898C6);
  color: #fff; */
  transform: scale(1.1);
}