/* Reset y Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #3b82f6;
    --secondary: #8b5cf6;
    --accent: #f59e0b;
    --dark: #1e293b;
    --light: #f8fafc;
    --text: #334155;
    --border: #e2e8f0;
    --success: #10b981;
    --gradient-main: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-accent: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text);
    background: var(--light);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Principal */
.site-header {
    background: white;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    position: sticky;
    top: 0;
    z-index: 1000;
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
}

.site-header h1 {
    font-size: 2rem;
    font-weight: 800;
}

.site-header h1 a {
    text-decoration: none;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: transform 0.3s ease;
    display: inline-block;
}

.site-header h1 a:hover {
    transform: scale(1.05);
}

.site-header nav {
    display: flex;
    gap: 30px;
    align-items: center;
}

.site-header nav a {
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    font-size: 0.95rem;
    position: relative;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.site-header nav a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--gradient-main);
    transition: width 0.3s ease;
}

.site-header nav a:hover {
    color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.site-header nav a:hover::before {
    width: 80%;
}

/* Main Content */
main {
    padding: 60px 20px;
    min-height: calc(100vh - 300px);
}

/* Grid de Noticias */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

/* Card de Noticia */
.card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.12);
}

.card img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card:hover img {
    transform: scale(1.08);
}

.card h2 {
    padding: 20px 20px 10px;
    font-size: 1.35rem;
    line-height: 1.4;
}

.card h2 a {
    text-decoration: none;
    color: var(--dark);
    transition: color 0.3s ease;
    display: block;
}

.card h2 a:hover {
    color: var(--primary);
}

.card .meta {
    padding: 0 20px;
    font-size: 0.85rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.card .meta::before {
    content: '';
    width: 30px;
    height: 2px;
    background: var(--gradient-accent);
    border-radius: 2px;
}

.card > p {
    padding: 0 20px;
    color: var(--text);
    margin-bottom: 15px;
    line-height: 1.6;
}

.card > p:last-child {
    padding: 0 20px 20px;
}

.card > p:last-child a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: gap 0.3s ease;
}

.card > p:last-child a:hover {
    gap: 10px;
}

.card > p:last-child a::after {
    content: '→';
    font-size: 1.2rem;
}

/* Paginación */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 50px 0;
    flex-wrap: wrap;
}

.pagination a {
    padding: 12px 20px;
    text-decoration: none;
    background: white;
    color: var(--text);
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    min-width: 50px;
    text-align: center;
}

.pagination a:hover {
    background: var(--gradient-main);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.pagination a.active {
    background: var(--gradient-main);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* Footer */
.site-footer {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
    padding: 60px 20px 30px;
    margin-top: 80px;
}

.site-footer .container {
    text-align: center;
    font-size: 0.95rem;
    opacity: 0.9;
}

/* Responsive Design */
@media (max-width: 768px) {
    .site-header .container {
        flex-direction: column;
        gap: 20px;
    }

    .site-header nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }

    .site-header nav a {
        font-size: 0.9rem;
        padding: 6px 12px;
    }

    .grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .card img {
        height: 200px;
    }

    main {
        padding: 40px 15px;
    }

    .pagination a {
        padding: 10px 16px;
        min-width: 45px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .site-header h1 {
        font-size: 1.5rem;
    }

    .card h2 {
        font-size: 1.2rem;
    }

    .pagination {
        gap: 8px;
    }

    .pagination a {
        padding: 8px 14px;
        min-width: 40px;
    }
}

/* Animaciones adicionales */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Efectos de hover mejorados */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-accent);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.card:hover::before {
    transform: scaleX(1);
}

/* Estilos para estados de carga */
.loading {
    animation: pulse 2s infinite;
}