/* =============================================================
   Ataxia Machado-Joseph — Hoja de estilos
   Edita los valores de la sección VARIABLES para personalizar
   colores, tipografía y espaciado sin tocar el resto del código
   ============================================================= */

/* --- VARIABLES: edita aquí para personalizar --- */
:root {
    --color-fondo:        #f7f9fc;
    --color-fondo-card:   #ffffff;
    --color-header-fondo: #1a3a5c;
    --color-header-texto: #ffffff;
    --color-acento:       #2563a8;
    --color-acento-hover: #1a4a8a;
    --color-texto:        #1e2a38;
    --color-texto-suave:  #5a6a7a;
    --color-borde:        #dce4ef;
    --color-es-fondo:     #e8f4e8;
    --color-es-texto:     #1a5c1a;
    --color-en-fondo:     #e8eef8;
    --color-en-texto:     #1a3a7a;
    --color-footer-fondo: #1a3a5c;
    --color-footer-texto: #c8d8e8;

    --fuente-titulos:     'Georgia', 'Times New Roman', serif;
    --fuente-cuerpo:      system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;

    --radio-borde:        8px;
    --sombra-card:        0 2px 8px rgba(26, 58, 92, 0.08);
    --sombra-card-hover:  0 4px 16px rgba(26, 58, 92, 0.15);
    --ancho-maximo:       860px;
}

/* --- RESET Y BASE --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 18px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--fuente-cuerpo);
    background-color: var(--color-fondo);
    color: var(--color-texto);
    line-height: 1.65;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- ACCESIBILIDAD --- */
:focus-visible {
    outline: 3px solid var(--color-acento);
    outline-offset: 3px;
    border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* --- CABECERA --- */
header {
    background-color: var(--color-header-fondo);
    color: var(--color-header-texto);
    padding: 2rem 1.5rem;
}

.header-inner {
    max-width: var(--ancho-maximo);
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.header-simbolo {
    font-size: 2.8rem;
    opacity: 0.6;
    flex-shrink: 0;
    line-height: 1;
}

.header-texto h1 {
    font-family: var(--fuente-titulos);
    font-size: clamp(1.4rem, 4vw, 2rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.header-subtitulo {
    font-size: 0.95rem;
    opacity: 0.82;
    margin-top: 0.3rem;
    font-style: italic;
}

/* --- CONTENIDO PRINCIPAL --- */
main {
    flex: 1;
    max-width: var(--ancho-maximo);
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.25rem;
}

/* --- INTRODUCCIÓN --- */
.intro {
    background-color: var(--color-fondo-card);
    border: 1px solid var(--color-borde);
    border-left: 4px solid var(--color-acento);
    border-radius: var(--radio-borde);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.75rem;
    font-size: 0.97rem;
    color: var(--color-texto-suave);
    line-height: 1.7;
}

.intro strong {
    color: var(--color-texto);
}



/* --- ESTADO DE CARGA --- */
.estado-carga {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-texto-suave);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-borde);
    border-top-color: var(--color-acento);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: girar 0.8s linear infinite;
}

@keyframes girar {
    to { transform: rotate(360deg); }
}

.error {
    color: #c0392b;
    font-weight: 500;
}

/* --- SIN RESULTADOS --- */
.sin-resultados {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-texto-suave);
    font-size: 1rem;
}

/* --- TARJETAS DE NOTICIAS --- */
#lista-noticias {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.noticia {
    background-color: var(--color-fondo-card);
    border: 1px solid var(--color-borde);
    border-radius: var(--radio-borde);
    padding: 1.1rem 1.4rem;
    box-shadow: var(--sombra-card);
    transition: box-shadow 0.2s, transform 0.2s;
}

.noticia:hover {
    box-shadow: var(--sombra-card-hover);
    transform: translateY(-1px);
}

.noticia-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.55rem;
    flex-wrap: wrap;
}



.noticia-fuente {
    font-size: 0.82rem;
    color: var(--color-texto-suave);
    font-weight: 500;
}

.noticia-fecha {
    font-size: 0.82rem;
    color: var(--color-texto-suave);
    margin-left: auto;
}

.noticia-titulo {
    font-family: var(--fuente-titulos);
    font-size: clamp(1rem, 2.5vw, 1.12rem);
    font-weight: 700;
    line-height: 1.35;
}

.noticia-titulo a {
    color: var(--color-acento);
    text-decoration: none;
    transition: color 0.15s;
}

.noticia-titulo a:hover {
    color: var(--color-acento-hover);
    text-decoration: underline;
}

/* --- ÚLTIMA ACTUALIZACIÓN --- */
.ultima-actualizacion {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.82rem;
    color: var(--color-texto-suave);
}

/* --- PIE DE PÁGINA --- */
footer {
    background-color: var(--color-footer-fondo);
    color: var(--color-footer-texto);
    text-align: center;
    padding: 1.5rem 1.25rem;
    font-size: 0.88rem;
    line-height: 1.7;
    margin-top: auto;
}

footer strong {
    color: #ffffff;
}

footer a {
    color: #90b8d8;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.footer-aviso {
    font-size: 0.78rem;
    opacity: 0.65;
    margin-top: 0.4rem;
}

/* --- RESPONSIVE MÓVIL --- */
@media (max-width: 600px) {
    html {
        font-size: 16px;
    }

    .header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .header-simbolo {
        font-size: 2rem;
    }

    .controles {
        flex-direction: column;
        align-items: stretch;
    }

    .busqueda {
        min-width: unset;
    }

    .noticia-fecha {
        margin-left: 0;
        width: 100%;
    }

    .noticia {
        padding: 1rem 1rem;
    }
}
