/**
 * 📰 BLOG CONSOLIDATED - Estilos unificados y optimizados
 * 
 * Versión consolidada que reemplaza:
 * - blog.css (1512 líneas)
 * - blog-enhanced.css (937 líneas) 
 * - blog-enhanced-v2.css (1015 líneas)
 * 
 * @package Xacobeos
 * @version 3.0.0
 * @since 2025
 */

/* ==========================================================================
   BASE STYLES - Estilos fundamentales del blog
   ========================================================================== */

/* Container principal del blog */
.blog-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--padding-container);
}

/* Layout principal */
.blog-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 1024px) {
    .blog-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/*--------------------------------------------------------------
# Blog Archive Layout
--------------------------------------------------------------*/
.blog-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

@media (min-width: 992px) {
    .blog-layout {
        grid-template-columns: 2fr 1fr;
    }
}

.archive-header {
    margin-bottom: 3rem;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, rgba(44, 90, 160, 0.05) 0%, rgba(255, 208, 2, 0.05) 100%);
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-200);
    position: relative;
    overflow: hidden;
}

.archive-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--xacobeos-blue), var(--camino-yellow));
}

.archive-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--xacobeos-blue);
    font-family: var(--font-headings);
    font-weight: 700;
}

.archive-description {
    font-size: 1.1rem;
    color: var(--gray-600);
    line-height: 1.6;
}

/* Filters */
.archive-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1.5rem;
    background: linear-gradient(135deg, rgba(248, 249, 250, 0.8), rgba(255, 255, 255, 0.8));
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    backdrop-filter: blur(10px);
}

/* Post Grid */
.posts-grid-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .posts-grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Post Card Design */
.blog-post-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
}

.blog-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.post-card-thumbnail {
    display: block;
}

.post-card-thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
}

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

.post-card-category {
    display: inline-block;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    color: #007cba;
    text-decoration: none;
}

.entry-title {
    font-size: 1.3rem;
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.entry-title a {
    color: #333;
    text-decoration: none;
}

.entry-title a:hover {
    color: #007cba;
}

.entry-summary {
    color: #6c757d;
    font-size: 0.95rem;
    line-height: 1.6;
    flex-grow: 1;
    margin-bottom: 1.5rem;
}

.entry-footer {
    border-top: 1px solid #e9ecef;
    padding-top: 1rem;
    margin-top: auto;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    font-size: 0.85rem;
    color: #6c757d;
}

.post-meta span {
    display: inline-flex;
    align-items: center;
}

/* ==========================================================================
   BLOG HEADER - Cabecera de la página blog
   ========================================================================== */

.blog-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, rgba(44, 90, 160, 0.05) 0%, rgba(255, 208, 2, 0.05) 100%);
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-200);
    position: relative;
    overflow: hidden;
}

.blog-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--xacobeos-blue), var(--camino-yellow));
}

.blog-title {
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 700;
    color: var(--xacobeos-blue);
    margin: 0 0 1rem 0;
    font-family: var(--font-headings);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.blog-description {
    font-size: 1.125rem;
    color: var(--gray-600);
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

/* ==========================================================================
   POST CARDS - Cards de artículos
   ========================================================================== */

.posts-grid {
    display: grid;
    gap: 2rem;
}

.post-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--gray-200);
    position: relative;
}

.post-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--xacobeos-blue), var(--camino-yellow));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.post-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
    border-color: var(--camino-yellow);
}

.post-card:hover::before {
    opacity: 1;
}

/* Post thumbnail */
.post-thumbnail {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/9;
}

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

.post-card:hover .post-thumbnail img {
    transform: scale(1.05);
}

/* Post content */
.post-content {
    padding: 1.5rem;
}

.post-title {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 0.75rem 0;
    font-family: var(--font-headings);
}

.post-title a {
    color: var(--gray-900);
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-title a:hover {
    color: var(--camino-blue);
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: var(--gray-500);
}

.post-date,
.post-author,
.post-reading-time {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

/* Mejora visual para iconos Font Awesome en metadata */
.post-meta i,
.post-meta [data-eva] {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.post-meta .fa,
.post-meta .fas,
.post-meta .far {
    font-size: 14px;
    color: var(--gray-500);
    transition: color 0.3s ease;
}

.post-card:hover .post-meta .fa,
.post-card:hover .post-meta .fas,
.post-card:hover .post-meta .far {
    color: var(--xacobeos-blue);
}

.post-excerpt {
    color: var(--gray-600);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.post-read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--xacobeos-blue);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(44, 90, 160, 0.05), rgba(255, 208, 2, 0.05));
    border-radius: var(--radius-md);
    border: 1px solid transparent;
}

.post-read-more:hover {
    color: var(--white);
    background: linear-gradient(135deg, var(--xacobeos-blue), var(--xacobeos-blue-light));
    border-color: var(--xacobeos-blue);
    transform: translateX(2px);
}

.post-read-more::after {
    content: "→";
    transition: transform 0.3s ease;
}

.post-read-more:hover::after {
    transform: translateX(4px);
}

/* ==========================================================================
   SINGLE POST - Artículo individual
   ========================================================================== */

.single-post-container {
    max-width: 800px;
    margin: 0 auto;
}

.single-post-header {
    text-align: center;
    margin-bottom: 2rem;
}

.single-post-title {
    font-size: clamp(1.875rem, 4vw, 2.5rem);
    font-weight: 700;
    line-height: 1.2;
    color: var(--gray-900);
    margin: 0 0 1rem 0;
    font-family: var(--font-headings);
}

.single-post-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: var(--gray-600);
    margin-bottom: 1.5rem;
}

.single-post-content {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--gray-700);
}

.single-post-content h2,
.single-post-content h3,
.single-post-content h4 {
    color: var(--gray-900);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-family: var(--font-headings);
}

.single-post-content h2 {
    font-size: 1.5rem;
    border-bottom: 2px solid var(--camino-yellow);
    padding-bottom: 0.5rem;
}

.single-post-content h3 {
    font-size: 1.25rem;
}

.single-post-content h4 {
    font-size: 1.125rem;
}

.single-post-content p {
    margin-bottom: 1.5rem;
}

.single-post-content blockquote {
    border-left: 4px solid var(--camino-yellow);
    background: var(--gray-50);
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    font-style: italic;
}

.single-post-content ul,
.single-post-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.single-post-content li {
    margin-bottom: 0.5rem;
}

/* ==========================================================================
   BLOG SIDEBAR - Barra lateral
   ========================================================================== */

.blog-sidebar {
    position: sticky;
    top: 2rem;
}

.sidebar-widget {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--gray-200);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.sidebar-widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--xacobeos-blue), var(--camino-yellow));
}

.sidebar-widget:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.widget-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--xacobeos-blue);
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--camino-yellow);
    font-family: var(--font-headings);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.widget-title i {
    font-size: 1.2rem;
    color: var(--camino-yellow);
}

/* Widget de posts recientes */
.recent-posts {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.recent-post-item {
    display: flex;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-200);
}

.recent-post-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.recent-post-thumb {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
}

.recent-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recent-post-content {
    flex: 1;
    min-width: 0;
}

.recent-post-title {
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.3;
    margin: 0 0 0.25rem 0;
}

.recent-post-title a {
    color: var(--gray-800);
    text-decoration: none;
    transition: color 0.3s ease;
}

.recent-post-title a:hover {
    color: var(--camino-blue);
}

.recent-post-date {
    font-size: 0.8rem;
    color: var(--gray-500);
}

/* Widget de categorías */
.categories-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.category-item {
    list-style: none;
}

.category-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--gray-700);
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.category-link:hover {
    background: var(--camino-blue);
    color: var(--white);
    border-color: var(--camino-blue);
}

.category-count {
    background: var(--gray-200);
    color: var(--gray-600);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.category-link:hover .category-count {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
}

/* ==========================================================================
   PAGINATION - Paginación
   ========================================================================== */

.blog-pagination {
    margin-top: 3rem;
    text-align: center;
}

.pagination-list {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    background: var(--white);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.page-numbers:hover,
.page-numbers.current {
    background: var(--camino-blue);
    color: var(--white);
    border-color: var(--camino-blue);
}

.page-numbers.prev,
.page-numbers.next {
    font-weight: 600;
}

/* ==========================================================================
   SEARCH FORM - Formulario de búsqueda
   ========================================================================== */

.blog-search-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    background: var(--white);
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--camino-blue);
    box-shadow: 0 0 0 3px rgba(30, 74, 140, 0.1);
}

.search-button {
    padding: 0.75rem 1rem;
    background: var(--camino-blue);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.search-button:hover {
    background: var(--camino-blue-light);
}

/* ==========================================================================
   RESPONSIVE DESIGN - Diseño responsive
   ========================================================================== */

@media (max-width: 768px) {
    .blog-container {
        padding: 0 1rem;
    }
    
    .blog-header {
        margin-bottom: 2rem;
    }
    
    .blog-title {
        font-size: 2rem;
    }
    
    .posts-grid {
        gap: 1.5rem;
    }
    
    .post-content {
        padding: 1.25rem;
    }
    
    .post-title {
        font-size: 1.125rem;
    }
    
    .post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .single-post-title {
        font-size: 1.75rem;
    }
    
    .single-post-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .single-post-content {
        font-size: 1rem;
    }
    
    .blog-sidebar {
        position: static;
        order: -1;
    }
    
    .sidebar-widget {
        padding: 1.25rem;
    }
}

@media (max-width: 480px) {
    .blog-container {
        padding: 0 0.75rem;
    }
    
    .post-content {
        padding: 1rem;
    }
    
    .sidebar-widget {
        padding: 1rem;
    }
    
    .recent-post-item {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .recent-post-thumb {
        width: 100%;
        height: 120px;
    }
}

/* ==========================================================================
   UTILITIES - Utilidades específicas del blog
   ========================================================================== */

/* Estados de loading */
.blog-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Badges y etiquetas */
.post-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    background: linear-gradient(135deg, var(--camino-yellow), rgba(255, 208, 2, 0.8));
    color: var(--gray-900);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(255, 208, 2, 0.2);
}

.post-category-badge i {
    font-size: 12px;
}

.post-category-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 208, 2, 0.3);
    background: var(--camino-yellow);
}

.post-tag {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    background: var(--gray-100);
    color: var(--gray-600);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    text-decoration: none;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
    transition: all 0.3s ease;
}

.post-tag:hover {
    background: var(--camino-blue);
    color: var(--white);
}

/* Mensajes de estado */
.no-posts {
    text-align: center;
    padding: 3rem 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--gray-300);
}

.no-posts-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-700);
    margin: 0 0 0.5rem 0;
}

.no-posts-message {
    color: var(--gray-600);
    margin: 0;
}

/* Print styles */
@media print {
    .blog-sidebar,
    .blog-pagination {
        display: none;
    }
    
    .blog-layout {
        grid-template-columns: 1fr;
    }
    
    .post-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid var(--gray-300);
    }
}