/* --- 1. RESET Y BASES --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
    font-family: 'Roboto', sans-serif; 
    background-color: #f4f4f4; 
    color: #333; 
    line-height: 1.6;
}

h1, h2, h3 { font-family: 'Poppins', sans-serif; font-weight: 700; color: #1a1a1a; }
a { text-decoration: none; color: inherit; transition: 0.3s; }

/* --- 2. HEADER Y NAVEGACIÓN --- */
.main-header {
    /* Fondo con 85% de opacidad para que se intuya lo que hay detrás */
    background: rgba(30, 41, 59, 0.85); 
    /* El truco del blur: empaña el fondo para mejorar la lectura */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); 
    padding: 1rem 5%;
    color: white;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    padding: 0 15px;
    /* Fondo transparente (0) porque ya hereda el del main-header */
    background: transparent; 
    border-bottom: 3px solid #ff3e3e; /* Rojo Nitro */
    box-sizing: border-box;
}

/* Logo siempre centrado */
.logo {
    flex: 1 1 0; /* Ocupa exactamente el mismo tercio que los otros */
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo img {
    height: 50px;
    width: auto;
}

/* --- 3. CLIMA STRIP --- */
.clima-strip {
    background: #1e5a38;
    color: #fff;
    padding: 5px 5%;
    font-size: 0.8rem;
    text-align: right;
}

/* --- 4. LAYOUT PRINCIPAL (GRILLA) --- */
.container {
    max-width: 1300px;
    margin: 20px auto;
    padding: 0 15px;
    display: grid;
    grid-template-columns: 1fr 300px; /* Nota principal + Sidebar */
    gap: 30px;
}

/* --- 5. NOTICIA DESTACADA (PINNED) --- */
.noticia-destacada {
    grid-column: 1 / -1; /* Ocupa todo el ancho en la Home */
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.noticia-destacada img {
    width: 100%;
    height: 450px;
    object-fit: cover;
    display: block;
}

.info-destacada {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 40px 20px 20px;
    color: white;
}

.info-destacada h2 { font-size: 2.5rem; color: white; line-height: 1.2; }

/* --- 6. GRILLA DE NOTICIAS SECUNDARIAS --- */
.grilla-noticias {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.card-nota {
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.card-nota img { width: 100%; height: 200px; object-fit: cover; }
.card-nota h3 { padding: 15px; font-size: 1.2rem; }

.badge {
    display: inline-block;
    padding: 3px 10px;
    color: white;
    font-size: 0.7rem;
    text-transform: uppercase;
    margin: 10px 15px 0;
    border-radius: 3px;
}

/* --- 7. FOOTER --- */
.main-footer {
    background: #1a1a1a;
    color: #ccc;
    padding: 40px 5% 20px;
    margin-top: 50px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    border-bottom: 1px solid #333;
    padding-bottom: 30px;
}

.footer-logo { height: 40px; margin-bottom: 15px; filter: brightness(0) invert(1); }

/* --- 8. RESPONSIVE (CELULARES) --- */
@media (max-width: 768px) {
    .container { grid-template-columns: 1fr; } /* Sidebar pasa abajo */
    .noticia-destacada img { height: 250px; }
    .info-destacada h2 { font-size: 1.5rem; }
    .header-container { justify-content: center; gap: 15px; }
}

/* --- ESTILOS INSTITUCIONAL --- */
.institucional-card {
    background-color: #2E8B57; /* Verde VRN */
    color: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    margin: 20px 0;
}

.institucional-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 20px;
    align-items: center;
}

.inst-col {
    flex: 1;
    min-width: 250px;
}

.inst-highlight {
    color: #B5B56A; /* El color original que tenías */
    font-weight: bold;
    font-size: 1.1rem;
    display: block;
}

.inst-url {
    font-size: 0.8rem;
    opacity: 0.8;
    letter-spacing: 1px;
}

.inst-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    margin-bottom: 5px;
    color: #B5B56A;
}

.contacto a {
    display: block;
    color: white;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.inst-whatsapp {
    background: #25d366; /* Verde WhatsApp */
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    margin-top: 10px;
    font-size: 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

@media (max-width: 600px) {
    .institucional-content { text-align: center; }
}

/* --- MEJORA DEL MENÚ NAV --- */
.menu-noticias {
    background: #1e5a38; /* Un verde un poco más oscuro */
    width: 100%;
}

.menu-noticias ul {
    display: flex;
    flex-wrap: wrap; /* Si no entran, pasan abajo, pero no ocupan todo */
    justify-content: center;
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-noticias li {
    margin: 0;
}

.menu-noticias a {
    display: block;
    padding: 12px 15px;
    color: white;
    font-size: 0.9rem;
    font-family: 'Poppins', sans-serif;
    text-transform: uppercase;
    font-weight: 600;
    transition: background 0.3s;
}

.menu-noticias a:hover {
    background: #2E8B57;
    color: #fff;
}

/* --- AJUSTE PARA MÓVILES --- */
@media (max-width: 768px) {
    .menu-noticias ul {
        display: grid;
        grid-template-columns: repeat(3, 1fr); /* 3 columnas de categorías para que no sea tan largo */
        text-align: center;
    }
    
    .menu-noticias a {
        font-size: 0.7rem;
        padding: 10px 5px;
        border: 0.5px solid rgba(255,255,255,0.1);
    }
}


.embed-container {
    position: relative;
    padding-bottom: 56.25%; /* Proporción 16:9 */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    margin: 20px 0;
}
.embed-container iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}


/* --- DISEÑO DE NOTICIA INTERNA --- */
.noticia-full {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.noticia-header {
    margin-bottom: 25px;
    text-align: left;
}

.noticia-header h1 {
    font-size: 2.8rem;
    line-height: 1.2;
    margin: 15px 0;
    color: #1a1a1a;
    font-family: 'Poppins', sans-serif;
    font-weight: 900;
}

.metadatos {
    display: flex;
    flex-wrap: wrap; /* Si no cabe, baja a la siguiente línea prolijamente */
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: #777;
    margin-bottom: 25px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 15px;
}
.visitas-box {
    display: inline-flex;
    align-items: center;
    color: #e31e24; /* Rojo de VRN para resaltar las visitas */
    font-weight: 700;
}

.separador {
    color: #ccc;
}

.fecha-box, .visitas-box {
    display: inline-flex;
    align-items: center;
}

.autor strong {
    color: #333;
}

.foto-principal {
    margin: 20px 0;
    width: 100%;
}

.foto-principal img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
}

.cuerpo-noticia {
    font-size: 1.25rem; /* Letra un poco más grande para leer mejor */
    line-height: 1.8;
    color: #333;
    font-family: 'Roboto', sans-serif;
}

/* Para que en el celular se vea perfecto */
@media (max-width: 768px) {
    .noticia-header h1 { font-size: 2rem; }
    .cuerpo-noticia { font-size: 1.1rem; }
}

/* Botón Hamburguesa */
/* Botones de acción (Menú y Lupa) */
.menu-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0; /* Limpiamos padding para control total */
    width: 45px;
    height: 45px;
    display: flex;
    
    /* SOLUCIÓN: Cambiamos a columna y centramos */
    flex-direction: column; 
    justify-content: center;
    align-items: center;
    gap: 5px; /* Este es el espacio entre las 3 rayitas */
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: #fff;
    border-radius: 2px;
    display: block; /* Aseguramos que se comporten como bloques */
}

/* El buscador se mantiene igual */
.search-trigger {
    background: none;
    border: none;
    cursor: pointer;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-trigger svg {
    width: 24px;
    height: 24px;
    color: #fff;
}



/* Buscador oculto que aparece por encima */
.search-overlay {
    display: none; /* Oculto por defecto */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    z-index: 100;
    align-items: center;
    padding: 0 15px;
}

.search-overlay.active {
    display: flex;
}

/* Sidebar (Menú oculto) */
.nav-sidebar {
    position: fixed;
    top: 0;
    right: -300px; /* Escondido */
    width: 300px;
    height: 100vh; /* ¡IMPORTANTE! Debe ser 100vh, no 200 */
    background: #fff;
    z-index: 2000;
    transition: 0.3s ease-in-out;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    
    /* Agregamos esto para manejar el scroll interno */
    display: flex;
    flex-direction: column;
     padding: 20px;
}
.nav-sidebar.active { right: 0; }

.sidebar-content {
    flex-grow: 1; /* Ocupa todo el espacio restante */
    overflow-y: auto; /* Activa el scroll vertical solo si es necesario */
    padding-bottom: 30px; /* Espacio extra al final para que no quede pegado */
    
    /* Opcional: Personalización de la barra de scroll para que sea más fina */
    scrollbar-width: thin;
    scrollbar-color: #ff3e3e rgba(255,255,255,0.1);
}

/* Personalización para Chrome/Safari/Edge */
.sidebar-content::-webkit-scrollbar {
    width: 6px;
}
.sidebar-content::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
}
.sidebar-content::-webkit-scrollbar-thumb {
    background-color: #ff3e3e;
    border-radius: 10px;
}

/* Fondo oscuro cuando el menú está abierto */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    z-index: 1500;
}
.menu-overlay.active { display: block; }

.sidebar-list { list-style: none; padding: 20px 0; }
.sidebar-list li a {
    display: block;
    padding: 15px 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
}


/******BUSQUEDA*/

.search-bar {
    position: relative; /* Para que el #display se posicione respecto a esto */
}

#display {
    display: none;
    position: absolute;
    top: 100%; /* Justo debajo del input */
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    z-index: 9999;
    max-height: 400px;
    overflow-y: auto;
}

.display_box {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
}

.display_box:last-child { border-bottom: none; }

.display_box a {
    text-decoration: none;
    color: #333;
    font-size: 0.95rem;
    display: block;
    line-height: 1.3;
}

.display_box:hover { background: #f9f9f9; }

.display_box mark {
    background: #fff3cd; /* Resaltado amarillo suave */
    color: #856404;
    padding: 0 2px;
}

.search-results-header {
    padding: 10px 15px;
    font-size: 0.8rem;
    color: #999;
    background: #fafafa;
    text-transform: uppercase;
}

.search-bar {
    position: relative;
    display: flex;
    align-items: center;
    background: #f4f4f4;
    border-radius: 20px;
    padding: 5px 15px;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.search-bar:focus-within {
    background: #fff;
    border-color: #e31e24; /* Rojo VRN */
    box-shadow: 0 0 8px rgba(227, 30, 36, 0.2);
}

#searchbox {
    flex: 1;
    border: none;
    font-size: 1.1rem;
    padding: 10px;
    outline: none;
}

#search-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 10px;
}

/* Agregamos una lupa con CSS puro o un emoji simple si no usas FontAwesome */
.search-bar::before {
    content: '🔍';
    font-size: 0.8rem;
    margin-right: 5px;
    opacity: 0.6;
}


/*SECCION.PHP*/

/* Anulamos el comportamiento lateral */
.seccion-full, 
.seccion-full .container-grid {
    display: block !important; /* IMPORTANTE: Rompe el flexbox lateral */
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    clear: both;
}

.seccion-header {
    display: block !important;
    width: 100% !important;
    margin-bottom: 30px;
}

.seccion-header h1 {
    display: block;
    width: 100%;
    font-size: 2rem;
    padding: 15px;
    background: #f8f9fa;
    margin: 0;
}

/* La Grilla: Ahora sí ocupará todo el ancho */
.grilla-noticias {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important; /* 3 columnas iguales */
    gap: 20px;
    width: 100% !important;
}

/* Ajustes para que no se vea angosto en tablets/móviles */
@media (max-width: 992px) {
    .grilla-noticias {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 600px) {
    .grilla-noticias {
        grid-template-columns: 1fr !important;
    }
    .seccion-header h1 {
        font-size: 1.5rem;
    }
}

/* Estilo de las cards para que ocupen su lugar */
.card-nota {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.card-img-container img {
    width: 100%;
    aspect-ratio: 16 / 9; /* Mantiene la proporción de las fotos de VRN */
    object-fit: cover;
}

.banner-top img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.share-box { display: flex; gap: 10px; margin: 15px 0; flex-wrap: wrap; }
.btn-sha { 
    padding: 8px 15px; 
    border-radius: 5px; 
    color: #fff; 
    text-decoration: none; 
    font-weight: bold; 
    font-size: 14px; 
}
.btn-sha.wa { background: #25D366; }
.btn-sha.fb { background: #1877F2; }
.btn-sha.tw { background: #000; }


/*SIDEBAR*/

.sidebar-principal {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.widget {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.widget-title {
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    color: #e31e24;
    border-bottom: 2px solid #e31e24;
    margin-bottom: 15px;
    padding-bottom: 5px;
}

.item-destacado {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.ranking-num {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 900;
    color: #ddd; /* Estilo sutil de ranking */
    line-height: 1;
}

.item-destacado a {
    text-decoration: none;
    color: #333;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.3;
}

.item-destacado a:hover { color: #e31e24; }

@media (max-width: 768px) {
    .layout-principal {
        flex-direction: column !important;
    }
    .columna-derecha {
        width: 100%;
    }
}


/*PAGINACION*/

.btn-pagi {
    background: #fff;
    border: 1px solid #ddd;
    padding: 10px 20px;
    text-decoration: none;
    color: #333;
    font-weight: bold;
    border-radius: 5px;
    transition: 0.3s;
}

.btn-pagi:hover {
    background: #e31e24;
    color: #fff;
    border-color: #e31e24;
}

.pagi-info {
    padding: 10px;
    color: #777;
    font-size: 0.9rem;
}


/* Contenedor principal de la marquesina */
.breaking-news-container {
    display: flex;
    align-items: center;
    background: #222;
    color: #fff;
    /* 1. Quitamos bordes redondeados */
    border-radius: 0; 
    /* 2. Achicamos el espacio con la nota principal (ajusta a gusto) */
    margin-bottom: 5px; 
    overflow: hidden;
    height: 40px;
    width: 100%; /* Aseguramos que ocupe todo el ancho si está fuera del container */
}

/* Etiqueta roja de "Último Momento" */
.ticker-title {
    background: #e31e24;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    font-weight: bold;
    font-size: 0.8rem;
    white-space: nowrap;
    position: relative;
    z-index: 2;
}

/* El envoltorio del movimiento */
.ticker-wrap {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    padding-left: 20px;
}

.ticker {
    display: inline-block;
    padding-right: 100%;
    animation: ticker 60s linear infinite; /* Ajusta los segundos para más o menos velocidad */
}

.ticker__item {
    display: inline-block;
    padding: 0 30px;
    font-size: 0.95rem;
    font-family: 'Roboto', sans-serif;
}

/* Separador entre mensajes */
.ticker__item::after {
    content: "•";
    margin-left: 30px;
    color: #e31e24;
}

/* Animación infinita */
@keyframes ticker {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-100%, 0, 0); }
}

/* Pausar al pasar el mouse para que el usuario pueda leer tranquilo */
.ticker-wrap:hover .ticker {
    animation-play-state: paused;
}

/*ETIQUETAS TAGS*/

.tag-item {
    background: #f1f5f9;
    color: #4a5568;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 1px solid #e2e8f0;
}

.tag-item:hover {
    background: #004a8d; /* Tu color de header azul */
    color: #ffffff;
    border-color: #004a8d;
    transform: translateY(-2px);
}

/*FOOTER*/

.main-footer {
    background: #1a202c; /* Un tono oscuro profundo */
    color: #e2e8f0;
    padding: 60px 0 20px;
    margin-top: 50px;
}

.footer-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    padding: 0 20px;
}

.footer-column h4 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 1.1rem;
    position: relative;
}

.footer-column h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 30px;
    height: 2px;
    background: #004a8d; /* Tu azul del header */
}

.footer-column ul {
    list-style: none;
    padding: 0;
}

.footer-column ul li {
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.footer-column ul li a {
    color: #a0aec0;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-column ul li a:hover {
    color: #fff;
}

.footer-logo {
    max-width: 150px;
    margin-bottom: 15px;
    filter: brightness(0) invert(1); /* Si el logo es oscuro, esto lo pone blanco */
}

/* Redes Sociales */
.footer-social {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-icon {
    width: 35px;
    height: 35px;
    background: #2d3748;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s;
}

.social-icon:hover {
    transform: translateY(-3px);
    background: #004a8d;
}

/* Bottom bar */
.footer-bottom {
    text-align: center;
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid #2d3748;
    font-size: 0.8rem;
    color: #718096;
}

.footer-bottom a { color: #cbd5e0; text-decoration: none; }


.vrn-ad {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 20px 0;
    overflow: hidden;
}

.vrn-ad img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.label-publi {
    display: block;
    font-size: 10px;
    color: #999;
    text-align: center;
    text-transform: uppercase;
    margin-bottom: 5px;
}


/* Seleccionamos las imágenes que están DENTRO del cuerpo de la noticia */
.cuerpo-noticia img {
    max-width: 100% !important; /* Nunca más ancha que el texto */
    height: auto !important;    /* Mantiene la proporción para que no se estire feo */
    display: block;
    margin: 20px auto;          /* Las centra automáticamente */
    border-radius: 8px;         /* Opcional: un toque estético para VRN */
}