/* ========================================
   BLOG STYLES - Courses Hippiques SaaS
   ======================================== */

/* Variables CSS */
:root {
    --primary-color: #2c5aa0;
    --secondary-color: #f39c12;
    --text-color: #333;
    --text-light: #666;
    --bg-light: #f8f9fa;
    --border-color: #e0e0e0;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-hover: 0 5px 20px rgba(0,0,0,0.15);
    --transition: all 0.3s ease;
}

/* ========================================
   HERO SECTION
   ======================================== */
.blog-hero {
    background: linear-gradient(135deg, var(--primary-color), #1e3a6e);
    color: var(--white);
    padding: 4rem 0;
    text-align: center;
}

.blog-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.blog-hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Search Bar */
.blog-search {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    gap: 0.5rem;
}

.blog-search input {
    flex: 1;
    padding: 0.875rem 1.25rem;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
}

.blog-search button {
    padding: 0.875rem 2rem;
    background: var(--secondary-color);
    color: var(--white);
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.blog-search button:hover {
    background: #e67e22;
    transform: translateY(-2px);
}

/* ========================================
   FEATURED POSTS
   ======================================== */
.featured-posts {
    padding: 3rem 0;
    background: var(--bg-light);
}

.featured-posts h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

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

.featured-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

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

.featured-link {
    text-decoration: none;
    color: inherit;
}

.featured-image {
    position: relative;
    overflow: hidden;
    height: 250px;
}

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

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

.category-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--primary-color);
    color: var(--white);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.featured-content {
    padding: 1.5rem;
}

.featured-content h3 {
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
    color: var(--text-color);
    line-height: 1.4;
}

.featured-content .excerpt {
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured-content .meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-light);
}

/* ========================================
   BLOG CONTAINER
   ======================================== */
.blog-container {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 3rem;
    padding: 3rem 0;
}

.blog-content {
    min-width: 0; /* Fix pour overflow */
}

/* ========================================
   POSTS GRID
   ======================================== */
.posts-section h2 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.post-card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

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

.post-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.post-image {
    height: 200px;
    overflow: hidden;
}

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

.post-card:hover .post-image img {
    transform: scale(1.08);
}

.post-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.post-category {
    margin-bottom: 0.75rem;
}

.post-category a {
    display: inline-block;
    background: var(--primary-color);
    color: var(--white);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.post-category a:hover {
    background: #1e3a6e;
}

.post-body h3 {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    color: var(--text-color);
    line-height: 1.4;
}

.post-body .excerpt {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-light);
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    margin-bottom: 0.75rem;
}

.meta-left,
.meta-right {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-link {
    font-size: 0.8rem;
    color: var(--secondary-color);
    text-decoration: none;
    transition: var(--transition);
}

.tag-link:hover {
    color: #e67e22;
}

/* ========================================
   PAGINATION
   ======================================== */
.pagination {
    margin-top: 3rem;
}

.pagination-list {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
}

.pagination-list li a {
    display: block;
    padding: 0.6rem 1rem;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

.pagination-list li a:hover {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.pagination-list li.active a {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

/* ========================================
   SIDEBAR
   ======================================== */
.blog-sidebar {
    position: sticky;
    top: 2rem;
    align-self: start;
}

.sidebar-widget {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.sidebar-widget h3 {
    font-size: 1.3rem;
    margin-bottom: 1.25rem;
    color: var(--text-color);
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-color);
}

.popular-posts-list,
.recent-posts-list {
    list-style: none;
    padding: 0;
}

.popular-posts-list li,
.recent-posts-list li {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.popular-posts-list li:last-child,
.recent-posts-list li:last-child {
    border-bottom: none;
}

.popular-posts-list li a,
.recent-posts-list li a {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: var(--transition);
}

.popular-posts-list li a:hover h4,
.recent-posts-list li a:hover h4 {
    color: var(--primary-color);
}

.popular-posts-list h4,
.recent-posts-list h4 {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    transition: var(--transition);
}

.popular-posts-list .views,
.recent-posts-list time {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Newsletter Widget */
.newsletter-widget {
    background: linear-gradient(135deg, var(--primary-color), #1e3a6e);
    color: var(--white);
}

.newsletter-widget h3 {
    color: var(--white);
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.newsletter-widget p {
    margin-bottom: 1rem;
    opacity: 0.9;
}

.newsletter-widget form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.newsletter-widget input {
    padding: 0.75rem;
    border: none;
    border-radius: 5px;
    font-size: 0.95rem;
}

.newsletter-widget button {
    padding: 0.75rem;
    background: var(--secondary-color);
    color: var(--white);
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.newsletter-widget button:hover {
    background: #e67e22;
}

/* ========================================
   POST DETAIL
   ======================================== */
.breadcrumb {
    background: var(--bg-light);
    padding: 1rem 0;
}

.breadcrumb ol {
    display: flex;
    list-style: none;
    padding: 0;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.breadcrumb li {
    display: flex;
    align-items: center;
}

.breadcrumb li:not(:last-child)::after {
    content: '›';
    margin-left: 0.5rem;
    color: var(--text-light);
}

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

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

.post-detail {
    padding: 3rem 0;
}

.post-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 3rem;
}

.post-header .post-category {
    margin-bottom: 1rem;
}

.post-header .post-category a {
    display: inline-block;
    background: var(--primary-color);
    color: var(--white);
    padding: 0.5rem 1.25rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
}

.post-header h1 {
    font-size: 2.5rem;
    line-height: 1.3;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.post-header .post-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.social-share {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.social-share a,
.social-share button {
    padding: 0.5rem 1rem;
    background: var(--bg-light);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.social-share a:hover,
.social-share button:hover {
    background: var(--primary-color);
    color: var(--white);
}

.featured-image {
    margin: 0 0 3rem;
    text-align: center;
}

.featured-image img {
    width: 100%;
    max-height: 600px;
    object-fit: cover;
    border-radius: 10px;
}

.featured-image figcaption {
    margin-top: 0.75rem;
    color: var(--text-light);
    font-size: 0.9rem;
    font-style: italic;
}

.post-content {
    max-width: 800px;
    margin: 0 auto 3rem;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-color);
}

.post-content h2 {
    font-size: 2rem;
    margin: 2.5rem 0 1rem;
    color: var(--text-color);
}

.post-content h3 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
    color: var(--text-color);
}

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

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

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

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2rem 0;
}

.post-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--text-light);
}

.post-content code {
    background: var(--bg-light);
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
}

.post-content pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 2rem 0;
}

.post-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.post-detail .post-tags {
    max-width: 800px;
    margin: 0 auto 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.post-detail .post-tags h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tag-badge {
    display: inline-block;
    background: var(--bg-light);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition);
}

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

/* Author Bio */
.author-bio {
    max-width: 800px;
    margin: 0 auto 3rem;
    padding: 2rem;
    background: var(--bg-light);
    border-radius: 10px;
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.author-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.author-info h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.author-info p {
    color: var(--text-light);
    line-height: 1.6;
}

/* Related Posts */
.related-posts {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 3rem;
}

.related-posts h2 {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    text-align: center;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.related-card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

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

.related-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.related-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.related-card h3 {
    padding: 1rem;
    font-size: 1.1rem;
    line-height: 1.4;
}

.related-card time {
    display: block;
    padding: 0 1rem 1rem;
    font-size: 0.85rem;
    color: var(--text-light);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1024px) {
    .blog-container {
        grid-template-columns: 1fr;
    }
    
    .blog-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .blog-hero h1 {
        font-size: 2rem;
    }
    
    .blog-search {
        flex-direction: column;
    }
    
    .blog-search button {
        width: 100%;
    }
    
    .featured-grid,
    .posts-grid,
    .related-grid {
        grid-template-columns: 1fr;
    }
    
    .post-header h1 {
        font-size: 2rem;
    }
    
    .post-header .post-meta {
        font-size: 0.9rem;
    }
    
    .post-content {
        font-size: 1rem;
    }
    
    .author-bio {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    .blog-hero {
        padding: 2rem 0;
    }
    
    .post-header h1 {
        font-size: 1.75rem;
    }
    
    .sidebar-widget {
        padding: 1rem;
    }
}
