/* ===== VARIABLES Y ESTILOS BASE ===== */
:root {
  --azul_oscuro: #033A61;
  --azul_oficial: #0565A8;
  --blanco: #ffffff;
  --negro: #000000;
}

/* ===== ESTRUCTURA PRINCIPAL ===== */
.principal {
  display: grid;
  grid-template-columns: 340px 1fr 260px;
  gap: 25px;
  padding: 20px;
  max-width: 1500px;
  margin: 0 auto;
  align-items: start;
  min-height: 80vh;
}

/* ===== ALERTAS VIALES (IZQUIERDA) - MÁS ANCHA ===== */
.alertas {
  background-color: var(--azul_oscuro);
  border-radius: 12px;
  padding: 20px;
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--azul_oficial) rgba(255,255,255,0.1);
}

/* Personalización del scroll para Chrome/Safari */
.alertas::-webkit-scrollbar {
  width: 6px;
}

.alertas::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
}

.alertas::-webkit-scrollbar-thumb {
  background-color: var(--azul_oficial);
  border-radius: 3px;
}

.alertas h1 {
  color: var(--blanco);
  margin: 0 0 20px 0;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.2);
}

.icon_alerta {
  width: 24px;
  height: 24px;
}

/* ===== CONTENIDO CENTRAL (CORREGIDO) ===== */
.contenido-central {
  display: flex;
  flex-direction: column;
  gap: 30px;
  min-width: 0;
}

/* ===== BANNER PRINCIPAL Y NOTICIAS DESTACADAS ===== */
.banner-contenedor {
  display: grid;
  grid-template-columns: 70% 30%;
  gap: 25px;
  align-items: start;
}

/* BANNER PRINCIPAL */
.banner-principal {
  height: 400px;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
  width: 100%;
}

.banner-carrusel {
  width: 100%;
  height: 100%;
  position: relative;
}

.banner-slide {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.banner-slide.active {
  opacity: 1;
}

.banner-imagen {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.banner-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a237e 0%, #1a73e8 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--blanco);
  font-size: 1.5rem;
  font-weight: 600;
  border: 3px dashed rgba(255,255,255,0.3);
  border-radius: 12px;
  text-align: center;
  padding: 20px;
}

.banner-controls {
  position: absolute;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 10;
}

.banner-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: all 0.3s;
  border: 1px solid rgba(255,255,255,0.3);
}

.banner-dot.active {
  background: var(--azul_oficial);
  transform: scale(1.3);
  box-shadow: 0 0 10px rgba(26, 115, 232, 0.5);
}

.banner-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.7);
  color: white;
  border: none;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  transition: all 0.3s;
}

.banner-nav:hover {
  background: rgba(0,0,0,0.9);
  transform: translateY(-50%) scale(1.15);
}

.banner-prev {
  left: 20px;
}

.banner-next {
  right: 20px;
}

/* ===== NOTICIAS DESTACADAS AL LADO DEL BANNER ===== */
.noticias-destacadas {
  display: flex;
  flex-direction: column;
  gap: 15px;
  height: 400px;
}

.noticia-destacada-item {
  background: var(--blanco);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  border: 1px solid rgba(0,0,0,0.08);
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

.noticia-destacada-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Badge de categoría */
.noticia-destacada-categoria {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
}

.noticia-categoria-badge {
  background-color: var(--azul_oficial);
  color: var(--blanco);
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-block;
}

/* Contenedor de la noticia */
.noticia-destacada {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

/* Imagen */
.noticia-destacada-thumb {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.noticia-destacada-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  display: block;
}

.noticia-destacada-item:hover .noticia-destacada-thumb img {
  transform: scale(1.05);
}

/* Overlay para texto */
.noticia-destacada-thumb::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: linear-gradient(to top, 
    rgba(0,0,0,0.7) 0%, 
    rgba(0,0,0,0.4) 50%, 
    rgba(0,0,0,0) 100%);
  z-index: 1;
}

/* Título sobre la imagen */
.noticia-destacada-title-container {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 15px;
  z-index: 2;
  color: var(--blanco);
}

.noticia-destacada-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
  text-shadow: 0 2px 5px rgba(0,0,0,0.7);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.noticia-destacada-title a {
  color: var(--blanco);
  text-decoration: none;
  transition: color 0.3s ease;
}

.noticia-destacada-title a:hover {
  color: #ffeb3b;
  text-decoration: underline;
}

/* Primera noticia un poco más destacada */
.noticia-destacada-item:first-child .noticia-destacada-title {
  font-size: 1.1rem;
}

/* Placeholder para cuando no hay imagen */
.noticia-destacada-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
  font-size: 0.9rem;
  font-weight: 500;
}

/* ===== ÚLTIMAS NOTICIAS ===== */
.ultimas-noticias-seccion {
  background: var(--blanco);
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.ultimas-noticias-seccion h1 {
  color: var(--azul_oscuro);
  font-size: 1.8rem;
  margin: 0 0 20px 0;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--azul_oficial);
}

.container {
  width: 100%;
}

.grid_container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 25px;
  margin-top: 25px;
}

.note {
  display: flex;
  flex-direction: column;
  background: var(--blanco);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  height: 100%;
}

.note:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.note__thumb {
  height: 300px;
  overflow: hidden;
}

.note__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.note:hover .note__thumb img {
  transform: scale(1.05);
}

.note__content {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.note__content h2 {
  margin: 0 0 12px 0;
  font-size: 1.4rem;
  line-height: 1.4;
  font-weight: 700;
}

.note__content h2 a {
  color: var(--negro);
  text-decoration: none;
  transition: color 0.3s ease;
}

.note__content h2 a:hover {
  color: var(--azul_oficial);
  text-decoration: underline;
}

.meta {
  font-size: 0.9rem;
  color: var(--azul_oscuro);
  margin-bottom: 12px;
  font-weight: 500;
}

.excerpt {
  font-size: 1rem;
  line-height: 1.5;
  color: #555;
  margin: 0 0 15px 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== BANNERS LATERALES DERECHOS - SIN SCROLL RARO ===== */
.banners-laterales {
  position: relative;
  top: 20px;
  height: fit-content;
  padding: 20px;
  background: var(--blanco);
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.banners-laterales-contenedor {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.banner-lateral-item {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
  border: 1px solid rgba(0,0,0,0.08);
}

.banner-lateral-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.banner-lateral-imagen {
  width: 100%;
  height: auto;
  display: block;
}

.banner-lateral-placeholder {
  min-height: 200px;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--azul_oscuro);
  font-size: 1rem;
  font-weight: 500;
  border: 2px dashed var(--azul_oficial);
  border-radius: 10px;
  text-align: center;
  padding: 25px;
}

/* ===== TICKER DE NOTICIAS ===== */
.news-ticker-container {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(90deg, #0d47a1, #1565c0);
  color: white;
  height: 40px;
  display: flex;
  align-items: center;
  z-index: 1000;
  border-top: 2px solid #ff3d00;
  box-shadow: 0 -2px 15px rgba(0,0,0,0.4);
}

.ticker-label {
  background: #ff3d00;
  color: white;
  height: 100%;
  padding: 0 15px;
  display: flex;
  align-items: center;
  font-weight: bold;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
  min-width: 180px;
}

.ticker-label span {
  animation: blink 2s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.ticker-wrapper {
  flex: 1;
  overflow: hidden;
  height: 100%;
  position: relative;
}

.ticker-content {
  display: flex;
  align-items: center;
  height: 100%;
  position: absolute;
  left: 0;
  transition: transform 0.5s ease;
}

.ticker-item {
  padding: 0 30px;
  font-size: 14px;
  white-space: nowrap;
  border-right: 1px solid rgba(255,255,255,0.2);
  height: 100%;
  display: flex;
  align-items: center;
}

.ticker-item a {
  color: white;
  text-decoration: none;
}

.ticker-item a:hover {
  color: #ffeb3b;
}

/* ===== RESPONSIVE ===== */

/* TABLET GRANDE (1200px - 1025px) */
@media (max-width: 1200px) {
  .principal {
    grid-template-columns: 320px 1fr 240px;
    gap: 22px;
    padding: 18px;
  }
  
  .banner-contenedor {
    grid-template-columns: 68% 32%;
    gap: 22px;
  }
  
  .banner-principal {
    height: 380px;
  }
  
  .noticias-destacadas {
    height: 380px;
  }
  
  .noticia-destacada-title {
    font-size: 0.95rem;
  }
  
  .noticia-destacada-item:first-child .noticia-destacada-title {
    font-size: 1rem;
  }
}

/* TABLET MEDIANA (1024px - 769px) */
@media (max-width: 1024px) {
  .principal {
    grid-template-columns: 280px 1fr 220px;
    gap: 20px;
  }
  
  .banner-contenedor {
    grid-template-columns: 65% 35%;
    gap: 20px;
  }
  
  .banner-principal {
    height: 350px;
  }
  
  .noticias-destacadas {
    height: 350px;
  }
  
  .noticia-destacada-title {
    font-size: 0.9rem;
  }
  
  .noticia-destacada-title-container {
    padding: 12px;
  }
  
  .banner-lateral-placeholder {
    min-height: 180px;
  }
}

/* TABLET PEQUEÑA (768px - 641px) - MODO RETRATO */
@media (max-width: 768px) {
  .principal {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 15px;
  }
  
  /* ALERTAS - MÁS COMPACTAS EN TABLET */
  .alertas {
    position: static;
    max-height: none;
    width: 100%;
    order: 1;
  }
  
  /* CONTENIDO CENTRAL - TOMA TODO EL ANCHO */
  .contenido-central {
    order: 2;
    gap: 20px;
  }
  
  /* BANNER LATERAL - SE OCULTA EN TABLET Y MÓVIL */
  .banners-laterales {
    display: none; /* OCULTAMOS EN DISPOSITIVOS MÓVILES */
  }
  
  /* BANNER PRINCIPAL Y NOTICIAS DESTACADAS - EN COLUMNA */
  .banner-contenedor {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .banner-principal {
    height: 300px;
  }
  
  /* NOTICIAS DESTACADAS - EN FILA EN TABLET */
  .noticias-destacadas {
    height: auto;
    flex-direction: row;
    gap: 15px;
  }
  
  .noticia-destacada-item {
    height: 200px;
  }
  
  .noticia-destacada-title {
    font-size: 0.85rem;
  }
  
  .noticia-destacada-title-container {
    padding: 10px;
  }
  
  /* ÚLTIMAS NOTICIAS - 2 COLUMNAS EN TABLET */
  .grid_container {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  
  .note__thumb {
    height: 200px;
  }
  
  .note__content h2 {
    font-size: 1.2rem;
  }
}

/* MÓVIL GRANDE (640px - 481px) */
@media (max-width: 640px) {
  .principal {
    padding: 12px;
    gap: 15px;
  }
  
  .banner-principal {
    height: 220px;
  }
  
  .banner-nav {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
  
  /* NOTICIAS DESTACADAS - EN COLUMNA EN MÓVIL */
  .noticias-destacadas {
    flex-direction: column;
    gap: 15px;
  }
  
  .noticia-destacada-item {
    height: 180px;
  }
  
  .noticia-destacada-title {
    font-size: 0.9rem;
    -webkit-line-clamp: 3;
  }
  
  /* ÚLTIMAS NOTICIAS - 1 COLUMNA EN MÓVIL */
  .grid_container {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .note__thumb {
    height: 180px;
  }
  
  .note__content {
    padding: 15px;
  }
  
  .note__content h2 {
    font-size: 1.1rem;
  }
  
  .ultimas-noticias-seccion {
    padding: 20px 15px;
  }
  
  .ultimas-noticias-seccion h1 {
    font-size: 1.5rem;
  }
  
  .ticker-label {
    min-width: 150px;
    font-size: 12px;
  }
  
  .ticker-item {
    font-size: 13px;
    padding: 0 20px;
  }
}

/* MÓVIL PEQUEÑO (480px o menos) */
@media (max-width: 480px) {
  .principal {
    padding: 10px;
    gap: 12px;
  }
  
  .alertas {
    padding: 15px;
  }
  
  .alertas h1 {
    font-size: 1.1rem;
    margin-bottom: 15px;
  }
  
  .banner-principal {
    height: 180px;
  }
  
  .banner-nav {
    width: 35px;
    height: 35px;
    font-size: 18px;
  }
  
  .banner-controls {
    bottom: 15px;
  }
  
  .banner-dot {
    width: 10px;
    height: 10px;
  }
  
  .noticia-destacada-item {
    height: 160px;
  }
  
  .noticia-destacada-title {
    font-size: 0.85rem;
  }
  
  .noticia-destacada-categoria {
    top: 8px;
    left: 8px;
  }
  
  .noticia-categoria-badge {
    font-size: 0.6rem;
    padding: 4px 8px;
  }
  
  .note__thumb {
    height: 160px;
  }
  
  .note__content h2 {
    font-size: 1rem;
  }
  
  .excerpt {
    font-size: 0.9rem;
  }
  
  .ticker-label {
    min-width: 130px;
    font-size: 11px;
    padding: 0 10px;
  }
  
  .ticker-item {
    font-size: 12px;
    padding: 0 15px;
  }
  
  .news-ticker-container {
    height: 35px;
  }
}

/* MÓVIL MUY PEQUEÑO (360px o menos) */
@media (max-width: 360px) {
  .banner-principal {
    height: 160px;
  }
  
  .noticia-destacada-item {
    height: 140px;
  }
  
  .noticia-destacada-title {
    font-size: 0.8rem;
  }
  
  .note__thumb {
    height: 140px;
  }
  
  .ultimas-noticias-seccion h1 {
    font-size: 1.3rem;
  }
}