/* ===== BLOG STYLES ===== */

/* Usar variables del base.css para consistencia */

/* Ajustar el padding-top para compensar el menú fijo */
.page-hero {
    padding-top: 2rem; /* Solo padding adicional, el main ya tiene padding-top */
    margin-top: 0;
}

/* Blog Filters */
.blog-filters {
    background: var(--bg-secondary);
    padding: 24px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 32px;
}

.filters-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.search-container {
    display: flex;
    justify-content: center;
}

.search-form {
    display: flex;
    gap: 12px;
    max-width: 500px;
    width: 100%;
}

.search-input {
    position: relative;
    flex: 1;
}

.search-input i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--blog-text-light);
}

.search-input input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.search-input input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.category-filter {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    transition: all 0.3s ease;
    background: var(--bg-primary);
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.filter-btn i {
    font-size: 14px;
}

/* Featured Articles */
.featured-articles {
    padding: 32px 0;
    background: var(--bg-secondary);
    margin-bottom: 32px;
}

.section-header {
    text-align: center;
    margin-bottom: 32px;
}

.section-header h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 18px;
    max-width: 600px;
    margin: 0 auto;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
}

.featured-article {
    background: var(--bg-primary);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.featured-article:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.article-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

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

.featured-article:hover .article-image img {
    transform: scale(1.05);
}

.article-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--blog-primary), var(--blog-accent));
    display: flex;
    align-items: center;
    justify-content: center;
}

.article-placeholder i {
    font-size: 48px;
    color: white;
}

.article-category {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.article-content {
    padding: 24px;
}

.article-content h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.4;
}

.article-content h3 a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.article-content h3 a:hover {
    color: var(--primary-color);
}

.article-excerpt {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.article-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.article-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tag {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

/* All Articles */
.all-articles {
    padding: 32px 0;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.article-card {
    background: var(--bg-primary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.article-card .article-image {
    height: 180px;
}

.article-card .article-content {
    padding: 20px;
}

.article-card .article-content h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.article-card .article-meta {
    margin-bottom: 12px;
}

.article-card .article-tags {
    margin-bottom: 16px;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 32px;
}

.page-link {
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.page-link:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-link.current {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-ellipsis {
    padding: 10px 16px;
    color: var(--text-secondary);
}

/* No Posts */
.no-posts {
    text-align: center;
    padding: 60px 20px;
}

.no-posts-icon {
    width: 80px;
    height: 80px;
    background: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.no-posts-icon i {
    font-size: 32px;
    color: var(--text-secondary);
}

.no-posts h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.no-posts p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* Newsletter */
.newsletter {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    padding: 60px 0;
    margin: 60px 0;
}

.newsletter-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.newsletter-icon {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.newsletter-icon i {
    font-size: 32px;
}

.newsletter h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
}

.newsletter p {
    font-size: 18px;
    margin-bottom: 32px;
    opacity: 0.9;
}

.newsletter-form {
    display: flex;
    gap: 12px;
    max-width: 400px;
    margin: 0 auto;
}

.newsletter-form .form-group {
    display: flex;
    gap: 12px;
    width: 100%;
}

.newsletter-form input {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
}

.newsletter-form button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    background: white;
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.newsletter-form button:hover {
    background: var(--bg-primary);
    transform: translateY(-2px);
}

/* Newsletter Success */
.newsletter-success {
    text-align: center;
}

.newsletter-success .newsletter-icon {
    background: rgba(16, 185, 129, 0.2);
}

.newsletter-success .newsletter-icon i {
    color: #10b981;
}

/* CTA Section */
.cta {
    background: var(--bg-secondary);
    padding: 60px 0;
    text-align: center;
}

.cta-content h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.cta-content p {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Blog Post Individual */
.blog-post {
    padding: 32px 0;
}

/* Hero del post individual también necesita padding-top */
.blog-post .page-hero {
    padding-top: calc(60px + var(--spacing-3xl)); /* Compensar navbar fijo (60px) + padding adicional */
    margin-top: 0;
}

/* Layout de dos columnas para post y sidebar */
.blog-post .container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 32px;
    align-items: start;
}

.post-content {
    max-width: none; /* Remover max-width para que funcione con grid */
    margin: 0;
}

.post-featured-image {
    margin-bottom: 32px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--blog-shadow-lg);
}

.post-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.post-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.post-excerpt {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 32px;
    font-size: 18px;
    line-height: 1.6;
    color: var(--text-primary);
    border-left: 4px solid var(--primary-color);
}

.post-body {
    line-height: 1.8;
    color: var(--text-primary);
    font-size: 16px;
}

.post-body h1,
.post-body h2,
.post-body h3,
.post-body h4,
.post-body h5,
.post-body h6 {
    color: var(--text-primary);
    margin: 32px 0 16px 0;
    font-weight: 600;
}

.post-body h1 { font-size: 28px; }
.post-body h2 { font-size: 24px; }
.post-body h3 { font-size: 20px; }
.post-body h4 { font-size: 18px; }
.post-body h5 { font-size: 16px; }
.post-body h6 { font-size: 14px; }

.post-body p {
    margin-bottom: 16px;
}

.post-body ul,
.post-body ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.post-body li {
    margin-bottom: 8px;
}

.post-body blockquote {
    background: var(--bg-secondary);
    border-left: 4px solid var(--primary-color);
    padding: 16px 20px;
    margin: 24px 0;
    font-style: italic;
    color: var(--blog-text-light);
}

.post-body code {
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.post-body pre {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 24px 0;
    border: 1px solid var(--border-color);
}

.post-body pre code {
    background: none;
    padding: 0;
}

.post-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.post-author {
    display: flex;
    align-items: center;
    gap: 16px;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar {
    width: 48px;
    height: 48px;
    background: var(--blog-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.author-avatar i {
    font-size: 20px;
    color: white;
}

.author-details {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: 600;
    color: var(--blog-text);
}

.author-role {
    font-size: 14px;
    color: var(--blog-text-light);
}

.post-actions {
    display: flex;
    gap: 12px;
}

/* Post Sidebar */
.post-sidebar {
    max-width: 300px;
    margin-left: 0; /* Remover margin ya que grid se encarga del espaciado */
    position: sticky;
    top: 80px; /* Mantener sidebar visible al hacer scroll */
}

/* Responsive design para móviles */
@media (max-width: 768px) {
    .blog-post .container {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .post-sidebar {
        position: static;
        max-width: none;
    }
    
    .sidebar-section {
        margin-bottom: 16px;
    }
}

.sidebar-section {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.sidebar-section h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.related-posts {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.related-post {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.related-post:hover {
    background: var(--bg-secondary);
}

.related-post-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.related-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-post-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    display: flex;
    align-items: center;
    justify-content: center;
}

.related-post-placeholder i {
    font-size: 20px;
    color: white;
}

.related-post-content h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.4;
}

.related-post-content h4 a {
    color: var(--text-primary);
    text-decoration: none;
}

.related-post-content h4 a:hover {
    color: var(--primary-color);
}

.related-post-content p {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.4;
}

.related-post-meta {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: var(--text-secondary);
}

.category-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.category-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-icon i {
    font-size: 20px;
    color: white;
}

.category-details h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.category-details p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.newsletter-sidebar {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
}

.newsletter-sidebar h3,
.newsletter-sidebar p {
    color: white;
}

.newsletter-sidebar input {
    border: none;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
    width: 100%;
    margin-bottom: 12px;
}

.newsletter-sidebar button {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 6px;
    background: white;
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.newsletter-sidebar button:hover {
    background: var(--bg-primary);
}

/* Post Navigation */
.post-navigation {
    background: var(--bg-secondary);
    padding: 40px 0;
    margin: 40px 0;
}

.post-nav-links {
    display: flex;
    justify-content: space-between;
    gap: 24px;
}

.post-nav-link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-primary);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    flex: 1;
    max-width: 400px;
}

.post-nav-link:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    color: var(--primary-color);
}

.post-nav-link.prev {
    text-align: left;
}

.post-nav-link.next {
    text-align: right;
    flex-direction: row-reverse;
}

.post-nav-arrow {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.post-nav-arrow i {
    color: white;
    font-size: 16px;
}

.post-nav-content {
    flex: 1;
}

.post-nav-label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-nav-content h4 {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb .separator {
    color: var(--text-secondary);
}

.breadcrumb .current {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Responsive */
@media (max-width: 1024px) {
    .blog-post .container {
        display: block;
    }
    
    .post-sidebar {
        margin-left: 0;
        margin-top: 32px;
        max-width: none;
    }
}

@media (max-width: 768px) {
    .featured-grid {
        grid-template-columns: 1fr;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .category-filter {
        justify-content: center;
    }
    
    .filter-btn {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    .post-footer {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .nav-links {
        flex-direction: column;
    }
    
    .nav-link {
        max-width: none;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .newsletter-form .form-group {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .section-header h2 {
        font-size: 24px;
    }
    
    .section-header p {
        font-size: 16px;
    }
    
    .article-content {
        padding: 16px;
    }
    
    .article-meta {
        flex-direction: column;
        gap: 8px;
    }
}
