/* Sistema de Blog - Estilos */

/* Contenedor principal del blog */
.blog-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    margin: 2rem 0;
}

.blog-main {
    min-width: 0; /* Evita desbordamiento en grid */
}

/* Grid de artículos */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

/* Tarjeta de artículo */
.blog-post {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e5e7eb;
}

.blog-post:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.blog-post-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.blog-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-post:hover .blog-post-image img {
    transform: scale(1.05);
}

.blog-post-content {
    padding: 1.5rem;
}

.blog-post-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.blog-post-date {
    background: #f3f4f6;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 500;
}

.blog-post-category {
    background: #dbeafe;
    color: #1d4ed8;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 500;
}

.blog-post h2 {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    line-height: 1.4;
}

.blog-post h2 a {
    color: #1f2937;
    text-decoration: none;
    transition: color 0.2s ease;
}

.blog-post h2 a:hover {
    color: #3b82f6;
}

.blog-post p {
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.blog-post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag {
    background: #f3f4f6;
    color: #374151;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.tag:hover {
    background: #e5e7eb;
}

.read-more {
    display: inline-flex;
    align-items: center;
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.read-more:hover {
    color: #1d4ed8;
}

/* Barra lateral */
.blog-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sidebar-widget {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.sidebar-widget h3 {
    margin: 0 0 1rem 0;
    font-size: 1.125rem;
    color: #1f2937;
    border-bottom: 2px solid #f3f4f6;
    padding-bottom: 0.5rem;
}

.recent-posts {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recent-posts li {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f3f4f6;
}

.recent-posts li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.recent-posts a {
    color: #374151;
    text-decoration: none;
    font-size: 0.875rem;
    line-height: 1.4;
    transition: color 0.2s ease;
}

.recent-posts a:hover {
    color: #3b82f6;
}

.categories {
    list-style: none;
    padding: 0;
    margin: 0;
}

.categories li {
    margin-bottom: 0.5rem;
}

.categories a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #374151;
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.categories a:hover,
.categories a.active {
    background: #f3f4f6;
    color: #3b82f6;
}

/* Formulario de búsqueda */
.search-form {
    display: flex;
    gap: 0.5rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-btn {
    padding: 0.75rem 1rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.search-btn:hover {
    background: #1d4ed8;
}

/* Paginación */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    background: #fff;
    color: #374151;
    text-decoration: none;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.pagination-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.pagination-btn.current {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.pagination-btn.prev,
.pagination-btn.next {
    min-width: auto;
}

.pagination-ellipsis {
    color: #6b7280;
    padding: 0 0.5rem;
}

/* Información de filtros */
.search-results-info,
.category-filter-info {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 2rem;
}

.search-results-info p,
.category-filter-info p {
    margin: 0 0 0.5rem 0;
    color: #0c4a6e;
}

.clear-search,
.clear-filter {
    color: #0369a1;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.clear-search:hover,
.clear-filter:hover {
    text-decoration: underline;
}

/* Sin resultados */
.no-results {
    text-align: center;
    padding: 3rem 1rem;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.no-results h2 {
    color: #6b7280;
    margin-bottom: 1rem;
}

.no-results p {
    color: #9ca3af;
    margin-bottom: 1rem;
}

.no-results a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

.no-results a:hover {
    text-decoration: underline;
}

/* Artículos relacionados */
.related-articles {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.related-articles h3 {
    margin-bottom: 1.5rem;
    color: #1f2937;
}

.related-articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.related-article {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    transition: transform 0.2s ease;
}

.related-article:hover {
    transform: translateY(-2px);
}

.related-article-image {
    height: 120px;
    overflow: hidden;
}

.related-article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-article-content {
    padding: 1rem;
}

.related-article-content h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    line-height: 1.4;
}

.related-article-content h4 a {
    color: #1f2937;
    text-decoration: none;
    transition: color 0.2s ease;
}

.related-article-content h4 a:hover {
    color: #3b82f6;
}

.related-article-category {
    background: #f3f4f6;
    color: #6b7280;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 1024px) {
    .blog-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .blog-sidebar {
        order: -1;
    }
}

@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .blog-post-content {
        padding: 1rem;
    }
    
    .pagination {
        gap: 0.25rem;
    }
    
    .pagination-btn {
        min-width: 36px;
        height: 36px;
        font-size: 0.8rem;
    }
    
    .related-articles-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .blog-post-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .search-btn {
        width: 100%;
    }
}
