/* Estilos mejorados para la sección Blog */

.blog-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

.blog-header {
    text-align: center;
    margin-bottom: 3.5rem;
    position: relative;
}

.blog-header:after {
    content: "";
    position: absolute;
    bottom: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    border-radius: 2px;
}

.blog-header h1 {
    color: var(--color-primary);
    font-size: 3rem;
    margin-bottom: 1.2rem;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.blog-header p {
    color: var(--color-text-light);
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

.blog-categories {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3.5rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border-radius: 0 0 10px 10px;
}

.category-link {
    padding: 0.6rem 1.2rem;
    border-radius: 30px;
    text-decoration: none;
    color: var(--color-text);
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-link:hover {
    background-color: rgba(30, 58, 138, 0.1);
    color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.category-link.active {
    background: linear-gradient(135deg, var(--color-primary), #2563eb);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.blog-posts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2.5rem;
}

.blog-post {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background-color: white;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.blog-post:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12);
    border-color: rgba(37, 99, 235, 0.2);
}

.post-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-post:hover .post-image {
    transform: scale(1.05);
}

.post-content {
    padding: 1.8rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.post-content h2 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
    font-weight: 700;
}

.post-content h2 a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.3s;
    background: linear-gradient(to right, var(--color-primary), var(--color-primary));
    background-size: 0% 2px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    padding-bottom: 2px;
}

.post-content h2 a:hover {
    color: #2563eb;
    background-size: 100% 2px;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--color-text-light);
    align-items: center;
}

.post-date, .post-author {
    display: flex;
    align-items: center;
}

.post-date:before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z'%3E%3C/path%3E%3C/svg%3E");
    background-size: contain;
    margin-right: 6px;
}

.post-author:before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z'%3E%3C/path%3E%3C/svg%3E");
    background-size: contain;
    margin-right: 6px;
}

.post-excerpt {
    color: var(--color-text);
    margin-bottom: 1.8rem;
    line-height: 1.7;
    flex-grow: 1;
}

.post-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}

.post-category {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.08), rgba(30, 58, 138, 0.15));
    color: var(--color-primary);
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.post-category:hover {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.15), rgba(30, 58, 138, 0.25));
    transform: translateY(-2px);
}

.read-more {
    display: inline-block;
    color: white;
    background: linear-gradient(135deg, var(--color-accent), #e85d04);
    text-decoration: none;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    border-radius: 30px;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 4px 10px rgba(232, 93, 4, 0.2);
    align-self: flex-start;
}

.read-more:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(232, 93, 4, 0.3);
    background: linear-gradient(135deg, #e85d04, #d04e00);
}

/* Estilos para artículos individuales */
.article-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.article-header {
    margin-bottom: 2.5rem;
    position: relative;
}

.article-header:after {
    content: "";
    position: absolute;
    bottom: -1rem;
    left: 0;
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    border-radius: 2px;
}

.article-header h1 {
    color: var(--color-primary);
    font-size: 2.8rem;
    margin-bottom: 1.2rem;
    line-height: 1.2;
    font-weight: 800;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.8rem;
    font-size: 1rem;
    color: var(--color-text-light);
    align-items: center;
}

.article-meta .post-date:before,
.article-meta .post-author:before {
    width: 18px;
    height: 18px;
}

.article-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 2.5rem;
}

.article-categories .post-category {
    font-size: 0.9rem;
    padding: 0.4rem 1rem;
}

.article-content {
    color: var(--color-text);
    line-height: 1.9;
    font-size: 1.1rem;
}

.article-content h2 {
    color: var(--color-primary);
    font-size: 2rem;
    margin: 2.5rem 0 1.2rem;
    font-weight: 700;
    position: relative;
    padding-bottom: 0.8rem;
}

.article-content h2:after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), transparent);
    border-radius: 1.5px;
}

.article-content h3 {
    color: var(--color-primary);
    font-size: 1.6rem;
    margin: 2rem 0 1rem;
    font-weight: 600;
}

.article-content p {
    margin-bottom: 1.8rem;
}

.article-content ul, .article-content ol {
    margin-bottom: 1.8rem;
    padding-left: 1.8rem;
}

.article-content li {
    margin-bottom: 0.8rem;
}

.article-content a {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px dashed var(--color-accent);
    transition: all 0.3s ease;
}

.article-content a:hover {
    color: #e85d04;
    border-bottom: 1px solid #e85d04;
}

.article-content blockquote {
    border-left: 4px solid var(--color-primary);
    padding: 1rem 1.5rem;
    font-style: italic;
    color: var(--color-text-light);
    margin: 2rem 0;
    background: rgba(30, 58, 138, 0.05);
    border-radius: 0 8px 8px 0;
}

.article-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.article-cta {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.05), rgba(30, 58, 138, 0.1));
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(30, 58, 138, 0.1);
}

.article-cta h3 {
    color: var(--color-primary);
    margin-bottom: 1.2rem;
    font-size: 1.8rem;
}

.article-cta p {
    margin-bottom: 1.8rem;
    font-size: 1.1rem;
}

.article-cta .cta-button {
    display: inline-block;
    background: linear-gradient(135deg, var(--color-accent), #e85d04);
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(232, 93, 4, 0.2);
}

.article-cta .cta-button:hover {
    background: linear-gradient(135deg, #e85d04, #d04e00);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(232, 93, 4, 0.3);
}

.related-articles {
    margin-top: 4rem;
}

.related-articles h3 {
    color: var(--color-primary);
    font-size: 1.8rem;
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
    padding-bottom: 1rem;
}

.related-articles h3:after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    border-radius: 1.5px;
}

.related-posts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

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

.blog-post {
    animation: fadeIn 0.6s ease-out forwards;
}

.blog-post:nth-child(2) { animation-delay: 0.1s; }
.blog-post:nth-child(3) { animation-delay: 0.2s; }
.blog-post:nth-child(4) { animation-delay: 0.3s; }
.blog-post:nth-child(5) { animation-delay: 0.4s; }
.blog-post:nth-child(6) { animation-delay: 0.5s; }

/* Responsive */
@media (max-width: 1024px) {
    .blog-posts {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
    
    .blog-header h1 {
        font-size: 2.5rem;
    }
    
    .article-header h1 {
        font-size: 2.4rem;
    }
}

@media (max-width: 768px) {
    .blog-container {
        padding: 2rem 1rem;
    }
    
    .blog-posts {
        grid-template-columns: 1fr;
    }
    
    .blog-header h1 {
        font-size: 2.2rem;
    }
    
    .article-header h1 {
        font-size: 2rem;
    }
    
    .related-posts {
        grid-template-columns: 1fr;
    }
    
    .blog-categories {
        overflow-x: auto;
        justify-content: flex-start;
        padding: 1rem;
    }
    
    .category-link {
        white-space: nowrap;
    }
    
    .article-container {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .blog-header h1 {
        font-size: 1.8rem;
    }
    
    .blog-header p {
        font-size: 1rem;
    }
    
    .post-content h2 {
        font-size: 1.3rem;
    }
    
    .article-header h1 {
        font-size: 1.7rem;
    }
    
    .article-content {
        font-size: 1rem;
    }
    
    .article-content h2 {
        font-size: 1.5rem;
    }
    
    .article-content h3 {
        font-size: 1.3rem;
    }
}
