/* Blog Styles - Intégration avec le thème UnitySoftConnect */

:root {
    --primary: #6366f1;
    --secondary: #8b5cf6;
    --accent: #0ea5e9;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1e293b;
    --light: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --border: #e2e8f0;
}

/* Variables pour le thème sombre */
[data-theme="dark"] {
    --dark: #f8fafc;
    --light: #1e293b;
    --gray-100: #0f172a;
    --gray-200: #1e293b;
    --gray-300: #334155;
    --gray-400: #475569;
    --gray-500: #64748b;
    --gray-600: #94a3b8;
    --gray-700: #cbd5e1;
    --gray-800: #e2e8f0;
    --gray-900: #f1f5f9;
    --border: #334155;
}

/* Styles généraux du blog */
.blog-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Typographie cohérente */
.blog-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.2;
}

.blog-subtitle {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    color: var(--gray-600);
    line-height: 1.6;
}

/* Cards du blog */
.blog-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
}

[data-theme="dark"] .blog-card {
    background: var(--gray-800);
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.15);
}

.blog-card-image {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.05);
}

.blog-category-tag {
    position: absolute;
    top: 15px;
    left: 15px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 0.35rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.blog-card-content {
    padding: 1.75rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.blog-card-meta {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
    color: var(--gray-500);
}

.blog-card-meta span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.blog-card-meta i {
    font-size: 0.9rem;
}

.blog-card-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    line-height: 1.4;
    color: var(--dark);
}

.blog-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.blog-card-title a:hover {
    color: var(--primary);
}

.blog-card-excerpt {
    color: var(--gray-600);
    line-height: 1.7;
    margin-bottom: 1.75rem;
    flex-grow: 1;
}

.blog-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.read-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.read-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
    color: white;
    gap: 0.75rem;
}

.post-stats {
    display: flex;
    gap: 1.25rem;
    color: var(--gray-500);
    font-size: 0.9rem;
}

.post-stats span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Filtrage et navigation */
.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.875rem;
    justify-content: center;
    margin-bottom: 2.5rem;
}

.filter-btn {
    padding: 0.875rem 1.75rem;
    border-radius: 50px;
    background: white;
    color: var(--dark);
    text-decoration: none;
    font-weight: 500;
    border: 2px solid var(--border);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.95rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

[data-theme="dark"] .filter-btn {
    background: var(--gray-800);
    border-color: var(--gray-700);
    color: var(--gray-200);
}

.filter-btn:hover, .filter-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-color: transparent;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

/* Hero section du blog */
.blog-hero {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 5rem 0 3rem;
    position: relative;
    overflow: hidden;
    margin-bottom: 3rem;
}

.blog-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 30%, rgba(255,255,255,0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 70%, rgba(255,255,255,0.08) 0%, transparent 50%);
}

.blog-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.blog-hero-title {
    font-size: 3.25rem;
    font-weight: 800;
    margin-bottom: 1.25rem;
    font-family: 'Space Grotesk', sans-serif;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.blog-hero-subtitle {
    font-size: 1.35rem;
    opacity: 0.95;
    margin-bottom: 2.5rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 300;
}

.blog-stats-bar {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 500;
}

.stat-item i {
    font-size: 1.4rem;
    background: rgba(255,255,255,0.2);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Pagination */
.blog-pagination {
    display: flex;
    justify-content: center;
    margin: 3rem 0 2rem;
}

.pagination {
    display: flex;
    gap: 0.5rem;
    padding: 0;
    margin: 0;
    list-style: none;
}

.page-item {
    margin: 0;
}

.page-link {
    display: block;
    padding: 0.875rem 1.25rem;
    background: white;
    border: 1px solid var(--border);
    color: var(--primary);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

[data-theme="dark"] .page-link {
    background: var(--gray-800);
    border-color: var(--gray-700);
    color: var(--accent);
}

.page-link:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
}

.page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.4);
}

/* Article individuel */
.blog-post-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.post-category-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 0.6rem 1.75rem;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 1.75rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.post-category-badge:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
    color: white;
}

.post-main-title {
    font-size: 2.75rem;
    font-weight: 800;
    margin-bottom: 2.25rem;
    line-height: 1.3;
    color: var(--dark);
    font-family: 'Space Grotesk', sans-serif;
}

.post-meta-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 1.75rem;
    background: var(--light);
    border-radius: 15px;
    margin: 2rem 0;
}

[data-theme="dark"] .post-meta-info {
    background: var(--gray-800);
}

.author-section {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.author-avatar-wrapper {
    width: 65px;
    height: 65px;
}

.author-avatar,
.author-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: var(--gray-500);
}

[data-theme="dark"] .author-avatar,
[data-theme="dark"] .author-placeholder {
    background: var(--gray-700);
    color: var(--gray-400);
}

.author-name {
    font-weight: 700;
    font-size: 1.15rem;
    display: block;
    margin-bottom: 0.3rem;
    color: var(--dark);
}

.post-dates-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.95rem;
    color: var(--gray-600);
}

.post-dates-info span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.post-social-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1.25rem;
}

.views-counter {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
    color: var(--primary);
    font-size: 1.1rem;
}

.social-sharing {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.social-sharing span {
    font-size: 0.95rem;
    color: var(--gray-600);
}

.share-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.share-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.share-facebook { background: #1877f2; }
.share-twitter { background: #1da1f2; }
.share-linkedin { background: #0077b5; }
.share-whatsapp { background: #25D366; }

/* Contenu de l'article */
.post-content-wrapper {
    font-size: 1.15rem;
    line-height: 1.85;
    color: var(--gray-800);
    max-width: 800px;
    margin: 0 auto;
}

[data-theme="dark"] .post-content-wrapper {
    color: var(--gray-300);
}

.post-lead {
    font-style: italic;
    color: var(--gray-600);
    border-left: 4px solid var(--primary);
    padding: 1.5rem 0 1.5rem 2rem;
    margin: 2rem 0;
    background: var(--light);
    border-radius: 0 8px 8px 0;
}

[data-theme="dark"] .post-lead {
    background: var(--gray-800);
    color: var(--gray-400);
}

.post-body-content {
    margin-top: 2.5rem;
}

.post-body-content p {
    margin-bottom: 1.75rem;
}

.post-body-content h2 {
    font-size: 2rem;
    margin: 2.5rem 0 1.5rem;
    color: var(--dark);
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    scroll-margin-top: 100px;
}

[data-theme="dark"] .post-body-content h2 {
    color: var(--gray-200);
}

.post-body-content h3 {
    font-size: 1.65rem;
    margin: 2rem 0 1.25rem;
    color: var(--dark);
    font-weight: 600;
}

[data-theme="dark"] .post-body-content h3 {
    color: var(--gray-300);
}

.post-body-content ul, 
.post-body-content ol {
    padding-left: 2.25rem;
    margin-bottom: 1.75rem;
}

.post-body-content li {
    margin-bottom: 0.6rem;
    line-height: 1.7;
}

.post-body-content code {
    background: var(--gray-100);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.95rem;
}

[data-theme="dark"] .post-body-content code {
    background: var(--gray-700);
}

.post-body-content pre {
    background: var(--gray-900);
    color: var(--gray-100);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.75rem 0;
}

/* Articles similaires */
.related-posts-section {
    background: var(--light);
    padding: 4rem 0 3rem;
    margin-top: 4rem;
}

[data-theme="dark"] .related-posts-section {
    background: var(--gray-900);
}

.section-heading {
    text-align: center;
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 3rem;
    position: relative;
    font-family: 'Space Grotesk', sans-serif;
}

.section-heading::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 4px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 2px;
}

.related-post-card {
    background: white;
    padding: 1.75rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    height: 100%;
}

[data-theme="dark"] .related-post-card {
    background: var(--gray-800);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.related-post-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.related-post-title {
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
    line-height: 1.45;
}

.related-post-title a {
    color: var(--dark);
    text-decoration: none;
    transition: color 0.2s ease;
    font-weight: 600;
}

[data-theme="dark"] .related-post-title a {
    color: var(--gray-200);
}

.related-post-title a:hover {
    color: var(--primary);
}

.related-post-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--gray-600);
}

.related-post-category {
    background: var(--primary);
    color: white;
    padding: 0.15rem 0.85rem;
    border-radius: 15px;
    font-size: 0.8rem;
}

/* Responsive design */
@media (max-width: 992px) {
    .blog-hero-title {
        font-size: 2.5rem;
    }
    
    .blog-hero-subtitle {
        font-size: 1.15rem;
    }
    
    .post-main-title {
        font-size: 2.25rem;
    }
    
    .post-meta-info {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }
    
    .post-social-stats {
        align-items: flex-start;
        width: 100%;
        padding-top: 1.25rem;
        border-top: 1px solid var(--border);
    }
    
    .social-sharing {
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .blog-hero {
        padding: 3rem 0 2rem;
    }
    
    .blog-hero-title {
        font-size: 2rem;
    }
    
    .blog-hero-subtitle {
        font-size: 1rem;
    }
    
    .blog-stats-bar {
        flex-direction: column;
        gap: 1rem;
    }
    
    .category-filters {
        justify-content: flex-start;
    }
    
    .filter-btn {
        font-size: 0.85rem;
        padding: 0.65rem 1.25rem;
    }
    
    .post-main-title {
        font-size: 1.75rem;
    }
    
    .post-content-wrapper {
        font-size: 1.05rem;
    }
    
    .post-body-content h2 {
        font-size: 1.5rem;
    }
    
    .post-body-content h3 {
        font-size: 1.25rem;
    }
    
    .section-heading {
        font-size: 1.75rem;
    }
}

@media (max-width: 576px) {
    .blog-card-content {
        padding: 1.25rem;
    }
    
    .blog-card-title {
        font-size: 1.15rem;
    }
    
    .blog-category-tag {
        font-size: 0.7rem;
        padding: 0.25rem 0.75rem;
    }
    
    .read-more-btn {
        font-size: 0.8rem;
        padding: 0.5rem 1rem;
    }
    
    .page-link {
        padding: 0.65rem 1rem;
        font-size: 0.9rem;
    }
}