/* =========================================
   IANOVACODE GLOBAL DESIGN SYSTEM
   Base de tokens, tipografías y reseteo.
   ========================================= */

/* 1. TIPOGRAFÍAS AUTO-ALOJADAS (R2) */
@font-face {
    font-family: 'Poppins';
    src: url('https://multimedia.ianovacode.com/fonts/poppins-600.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Poppins';
    src: url('https://multimedia.ianovacode.com/fonts/poppins-800.woff2') format('woff2');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('https://multimedia.ianovacode.com/fonts/inter-300.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('https://multimedia.ianovacode.com/fonts/inter-400.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Inter';
    src: url('https://multimedia.ianovacode.com/fonts/inter-500.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

/* 2. DESIGN TOKENS (UHQ) */
:root {
    /* Colores Base */
    --bg-dark: #05050A;
    --bg-darker: #020205;
    --text-main: #FFFFFF;
    --text-muted: #A0A0B0;
    --text-article: rgba(255, 255, 255, 0.85);

    /* Acentos Vibrantes */
    --accent-gold: #F5A623;
    --accent-gold-glow: rgba(245, 166, 35, 0.4);
    --accent-blue: #00E5FF;
    --accent-blue-glow: rgba(0, 229, 255, 0.4);
    --accent-red: #FF0055;

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.15);

    /* Tipografía */
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Estructura */
    --radius-sm: 12px;
    --radius-md: 24px;
    --radius-lg: 32px;
    --radius-pill: 100px;

    /* Transiciones */
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-bounce: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 3. RESET & BASE (GPU Optimized) */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    overflow-x: clip;
    text-wrap: pretty;
    scroll-padding-top: 100px; /* Espacio para el menú fijo */
}

body {
    position: relative;
    overflow-x: clip;
}

/* 4. ULTRA PRO SCROLLBAR (Discreto) */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-blue);
    box-shadow: 0 0 10px var(--accent-blue-glow);
}


/* 4. UTILITIES (Globales) */
.fixed-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    pointer-events: none;
    transform: translateZ(0);
    background: radial-gradient(circle at 50% 0%, rgba(0, 229, 255, 0.05) 0%, transparent 60%);
}

.text-gradient-blue {
    background: linear-gradient(135deg, var(--accent-blue) 0%, #00B4D8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Spinner de carga Ultra */
.loader {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(0, 229, 255, 0.1);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* --- NEURAL NEWS ENGINE LAYOUTS --- */
.bento-news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

.bento-item:first-child {
    grid-column: span 2;
    grid-row: span 1;
}

@media (max-width: 1024px) {
    .bento-news-grid {
        grid-template-columns: 1fr 1fr;
    }
    .bento-item:first-child {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .bento-news-grid {
        grid-template-columns: 1fr;
    }
    .bento-item:first-child {
        grid-column: span 1;
    }
}

.related-news-container {
    margin-top: 8rem;
    padding: 5rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    width: 100%;
    position: relative;
    clear: both;
}

.related-header {
    margin-bottom: 2.5rem;
    text-align: center;
}

.related-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fff 0%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.related-news-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
    margin-top: 2rem;
}

.related-item {
    min-height: 450px;
}

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

/* Botones con Brillo en Tarjetas */
.btn-glow-action {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-article);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-glow-action:hover {
    background: rgba(0, 229, 255, 0.1);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 229, 255, 0.2);
}

.btn-glow-action svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

/* --- SISTEMA DE DISEÑO GLASSMORPHISM PARA NOTICIAS --- */
.glass-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.4s, border-color 0.4s, box-shadow 0.4s;
    display: flex;
    flex-direction: column;
}

@media (min-width: 1024px) {
    .glass-card {
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
    }
}

.glass-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(0, 229, 255, 0.3);
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 229, 255, 0.1);
}

.card-image {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.bento-item:first-child .card-image {
    height: 300px;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.glass-card:hover .card-image img {
    transform: scale(1.1);
}

.glass-card .badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 229, 255, 0.9);
    color: #000;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 2;
    box-shadow: 0 5px 15px rgba(0, 229, 255, 0.3);
}

.card-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.meta {
    font-size: 0.85rem;
    color: var(--accent-blue);
    margin-bottom: 0.8rem;
    font-family: 'Space Mono', monospace;
}

.card-title {
    font-size: 1.4rem;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: #fff;
    font-weight: 700;
}

.card-excerpt {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.author-row {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.author-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.author-info img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 2px solid var(--accent-blue);
}

.author-info span {
    font-size: 0.9rem;
    color: #fff;
    font-weight: 500;
}

.action-controls {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.read-icon {
    font-size: 0.9rem;
    color: var(--accent-blue);
    font-weight: 600;
    margin-left: 0.5rem;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.glass-card:hover .read-icon {
    opacity: 1;
}

/* Animaciones Reveal */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1), transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transition-delay: var(--delay, 0s);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}
