/* =============================================
   BTECH BLOG STYLES - Optimisé pour SEO Sénégal
   ============================================= */

/* Variables CSS pour cohérence */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --success-color: #25d366;
    --text-dark: #333;
    --text-muted: #666;
    --bg-light: #f8f9fa;
    --border-light: #dee2e6;
    --shadow-light: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-medium: 0 5px 15px rgba(0,0,0,0.1);
    --border-radius: 10px;
    --transition: all 0.3s ease;
}

/* ================= BLOG INDEX ================= */

.blog-hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    position: relative;
    overflow: hidden;
}

.blog-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.1);
    z-index: 1;
}

.blog-hero .container {
    position: relative;
    z-index: 2;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.stat-item {
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.2);
    transition: var(--transition);
}

.stat-item:hover {
    transform: translateY(-5px);
    background: rgba(255,255,255,0.2);
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: white;
    display: block;
}

.stat-label {
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
    margin-top: 5px;
}

/* ================= ARTICLES GRID ================= */

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.article-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    border: 1px solid var(--border-light);
}

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

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

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

.article-category {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--primary-color);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.article-content {
    padding: 25px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

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

.article-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.4;
    margin-bottom: 15px;
}

.article-title a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

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

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

.article-tags {
    margin-bottom: 20px;
}

.article-tag {
    display: inline-block;
    background: var(--bg-light);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    margin: 0 5px 5px 0;
    transition: var(--transition);
}

.article-tag:hover {
    background: var(--primary-color);
    color: white;
}

.read-more-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.read-more-btn:hover {
    background: var(--secondary-color);
    color: white;
    text-decoration: none;
    transform: translateX(5px);
}

/* ================= FEATURED ARTICLE ================= */

.featured-article {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-medium);
    margin-bottom: 50px;
    border: 1px solid var(--border-light);
}

.featured-article .row {
    align-items: center;
}

.featured-image {
    height: 300px;
    overflow: hidden;
}

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

.featured-content {
    padding: 40px;
}

.featured-badge {
    background: linear-gradient(135deg, var(--accent-color) 0%, #f5576c 100%);
    color: white;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 20px;
}

.featured-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.3;
    margin-bottom: 20px;
}

.featured-excerpt {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 25px;
}

/* ================= ARTICLE SHOW PAGE ================= */

.article-hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    position: relative;
}

.breadcrumb {
    background: transparent;
    padding: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: rgba(255,255,255,0.5);
}

.badge-outline-light {
    color: rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.3);
    background: transparent;
}

.article-meta {
    color: rgba(255,255,255,0.8);
}

.social-share {
    background: var(--bg-light);
    padding: 20px;
    border-radius: var(--border-radius);
    text-align: center;
}

.share-buttons .btn {
    margin: 5px;
    border-radius: 25px;
    padding: 8px 16px;
    font-size: 0.9rem;
    transition: var(--transition);
}

.btn-facebook { background: #3b5998; border-color: #3b5998; }
.btn-twitter { background: #1da1f2; border-color: #1da1f2; }
.btn-linkedin { background: #0077b5; border-color: #0077b5; }
.btn-whatsapp { background: var(--success-color); border-color: var(--success-color); }

.share-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
}

/* ================= POST CONTENT STYLING ================= */

.post-content {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--text-dark);
}

.post-content h2 {
    color: var(--text-dark);
    font-size: 1.8rem;
    font-weight: 600;
    margin: 40px 0 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--primary-color);
    position: relative;
}

.post-content h2::before {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--accent-color);
}

.post-content h3 {
    color: var(--text-dark);
    font-size: 1.5rem;
    font-weight: 600;
    margin: 30px 0 15px;
}

.post-content p {
    margin-bottom: 20px;
}

.post-content ul, .post-content ol {
    margin: 20px 0;
    padding-left: 30px;
}

.post-content li {
    margin-bottom: 10px;
}

.post-content strong {
    color: var(--primary-color);
    font-weight: 600;
}

.post-content .cta-box {
    background: linear-gradient(135deg, var(--accent-color) 0%, #f5576c 100%);
    color: white;
    padding: 30px;
    border-radius: var(--border-radius);
    text-align: center;
    margin: 30px 0;
    box-shadow: var(--shadow-medium);
}

.post-content .cta-box h3 {
    color: white;
    border: none;
    margin-bottom: 15px;
}

.post-content .cta-box .btn {
    background: white;
    color: var(--primary-color);
    border: none;
    font-weight: 600;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
}

.post-content table th,
.post-content table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.post-content table th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--text-dark);
}

.post-content table tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

/* ================= SIDEBAR WIDGETS ================= */

.blog-sidebar .widget {
    background: white;
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-light);
}

.widget-title {
    color: var(--text-dark);
    font-weight: 600;
    font-size: 1.2rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
    position: relative;
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--accent-color);
}

.author-widget .author-avatar img {
    border: 3px solid var(--primary-color);
}

.author-stats {
    background: var(--bg-light);
    padding: 10px;
    border-radius: 5px;
    margin-top: 15px;
}

.related-post {
    padding-bottom: 15px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition);
}

.related-post:hover {
    padding-left: 10px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 5px;
}

.related-post:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.related-post h6 a {
    color: var(--text-dark);
    text-decoration: none;
    transition: var(--transition);
}

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

.contact-widget {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%) !important;
}

.contact-widget .btn-light:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

/* ================= NEWSLETTER SECTION ================= */

.newsletter-section {
    background: var(--bg-light);
}

.newsletter-form .form-control {
    border: 2px solid var(--border-light);
    padding: 12px 20px;
    font-size: 1rem;
}

.newsletter-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.newsletter-form .btn {
    padding: 12px 25px;
    font-weight: 600;
}

/* ================= RESPONSIVE DESIGN ================= */

@media (max-width: 768px) {
    .article-hero {
        padding: 80px 0 40px;
    }
    
    .article-hero h1 {
        font-size: 1.8rem;
    }
    
    .featured-article .featured-content {
        padding: 25px;
    }
    
    .featured-title {
        font-size: 1.5rem;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .share-buttons .btn {
        display: block;
        margin-bottom: 10px;
        width: 100%;
    }
    
    .blog-sidebar {
        margin-top: 40px;
    }
    
    .post-content {
        font-size: 1rem;
    }
    
    .post-content h2 {
        font-size: 1.5rem;
    }
    
    .post-content h3 {
        font-size: 1.3rem;
    }
}

@media (max-width: 576px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .featured-article .row {
        flex-direction: column;
    }
    
    .featured-image {
        height: 250px;
    }
    
    .article-content {
        padding: 20px;
    }
    
    .featured-content {
        padding: 20px;
    }
    
    .blog-sidebar .widget {
        padding: 20px;
    }
}

/* ================= ANIMATIONS ================= */

.fadeInUp {
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ================= UTILITIES ================= */

.text-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.btn-gradient {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    color: white;
    transition: var(--transition);
}

.btn-gradient:hover {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.shadow-hover {
    transition: var(--transition);
}

.shadow-hover:hover {
    box-shadow: var(--shadow-medium);
    transform: translateY(-3px);
}

/* ================= PRINT STYLES ================= */

@media print {
    .blog .article-hero,
    .blog .social-share,
    .blog .blog-sidebar,
    .blog .newsletter-section {
        display: none !important;
    }
    
    .post-content {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    .post-content h2,
    .post-content h3 {
        break-after: avoid;
    }
}
