@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&family=Roboto:wght@300;400&display=swap');

/* --- Variables de Color y Estilo --- */
:root {
    --color-fondo: #0c0c1d;
    --color-texto: #e0e0e0;
    --color-titulo-seccion: #ffffff;
    --color-enlace: #82aaff; /* Un azul más eléctrico y moderno */
    --color-enlace-hover: #a8c7ff;
    --color-borde: #2a2a45;
    --color-resplandor: rgba(130, 170, 255, 0.5); /* Resplandor para las tarjetas */
    --fuente-titulos: 'Orbitron', sans-serif; /* Fuente temática "tech/espacial" */
    --fuente-cuerpo: 'Roboto', sans-serif;
}

/* --- Animaciones --- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulseGlow {
    0% { text-shadow: 0 0 8px rgba(255,255,255,0.3); }
    50% { text-shadow: 0 0 16px rgba(255,255,255,0.6); }
    100% { text-shadow: 0 0 8px rgba(255,255,255,0.3); }
}


/* --- Estilo Base y Fondo Estrellado --- */
body {
    background-color: var(--color-fondo);
    background-image:
        radial-gradient(white, rgba(255, 255, 255, .2) 2px, transparent 40px),
        radial-gradient(white, rgba(255, 255, 255, .15) 1px, transparent 30px),
        radial-gradient(white, rgba(255, 255, 255, .1) 2px, transparent 40px),
        radial-gradient(rgba(255, 255, 255, .4), rgba(255, 255, 255, .1) 2px, transparent 30px);
    background-size: 550px 550px, 350px 350px, 250px 250px, 150px 150px;
    background-position: 0 0, 40px 60px, 130px 270px, 70px 100px;
    color: var(--color-texto);
    font-family: var(--fuente-cuerpo);
    margin: 0;
    padding: 0;
}

/* --- Contenedor Principal --- */
.container {
    max-width: 1200px; /* Más ancho para el grid */
    margin: 0 auto;
    padding: 20px;
}

/* --- Cabecera Mejorada --- */
.header-uritorco {
    /*
      INSTRUCCIÓN:
      Para añadir tu foto del Cerro Uritorco, descomenta la línea de abajo
      y reemplaza 'ruta/a/tu/imagen.jpg' por la ruta real de tu foto.
    */
    /* background-image: linear-gradient(to top, rgba(12, 12, 29, 1) 5%, rgba(12, 12, 29, 0.4) 100%), url('ruta/a/tu/imagen.jpg'); */
    background-color: #1a1a2e;
    background-size: cover;
    background-position: center 30%;
    padding: 100px 20px;
    text-align: center;
    border-bottom: 4px solid var(--color-enlace);
    margin-bottom: 50px;
}

.header-uritorco h1 {
    margin: 0;
    font-family: var(--fuente-titulos);
    font-size: 4em;
    color: #fff;
    animation: pulseGlow 4s infinite ease-in-out;
}

.header-uritorco p {
    margin: 10px 0 0;
    font-size: 1.3em;
    color: var(--color-texto);
    font-weight: 300;
    text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.7);
}

/* --- Títulos de Sección --- */
.seccion-rss h2 {
    font-family: var(--fuente-titulos);
    color: var(--color-titulo-seccion);
    border-bottom: 2px solid var(--color-borde);
    padding-bottom: 15px;
    margin-top: 0;
    margin-bottom: 30px;
    font-size: 2em;
}

/* --- Cuadrícula de Noticias (GRID) --- */
.lista-noticias {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    /* Crea columnas flexibles de mínimo 320px */
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px; /* Espacio entre tarjetas */
}

/* --- Tarjeta de Noticia --- */
.lista-noticias li {
    background: rgba(20, 20, 40, 0.7);
    border: 1px solid var(--color-borde);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 25px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeIn 0.6s ease-out forwards;
    opacity: 0; /* Inicia invisible para la animación */
}

/* --- Efecto Hover en Tarjeta --- */
.lista-noticias li:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px var(--color-resplandor);
    border-color: var(--color-enlace);
}

.lista-noticias a {
    color: var(--color-enlace);
    text-decoration: none;
    font-size: 1.2em;
    font-weight: 400;
    transition: color 0.2s ease-in-out;
    margin-bottom: 15px; /* Espacio entre título y metadata */
}

.lista-noticias a:hover {
    color: var(--color-enlace-hover);
}

.info-noticia {
    font-size: 0.85em;
    color: #aaa;
    margin-top: auto; /* Empuja la info hacia abajo */
    padding-top: 15px;
    border-top: 1px solid var(--color-borde);
}

.info-noticia .fuente {
    font-weight: 700;
    color: #ccc;
}

/* --- Pie de Página --- */
footer {
    text-align: center;
    padding: 30px;
    margin-top: 50px;
    color: #888;
    font-size: 0.9em;
    border-top: 1px solid var(--color-borde);
    background: var(--color-fondo);
}

/* --- Diseño Responsivo --- */
@media (max-width: 768px) {
    .header-uritorco h1 {
        font-size: 2.8em;
    }
    .container {
        padding: 15px;
    }
    .lista-noticias {
        grid-template-columns: 1fr; /* Una sola columna en móviles */
    }
}

/* --- Botón Volver Arriba --- */
#back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: none; /* Oculto por defecto */
    background-color: var(--color-enlace);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 24px;
    text-align: center;
    line-height: 50px;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: background-color 0.3s, transform 0.3s;
    z-index: 1000;
}

#back-to-top:hover {
    background-color: var(--color-enlace-hover);
    transform: scale(1.1);
    cursor: pointer;
}
