:root {
    --primary: #6366f1;
    --primary-light: #eef2ff;
    --primary-gradient: linear-gradient(90deg, #4f46e5, #9333ea);
    --bg: #f3f4f6;
    --white: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --radius: 24px;
}

/* Blog général */
.blog-container { max-width: 1200px; margin: 32px auto; padding: 0 24px; }

/* Articles et cards */
.featured-post, .post-card { background: var(--white); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; cursor: pointer; transition: 0.3s; }
.featured-post:hover, .post-card:hover { transform: translateY(-4px); border-color: var(--primary); }

/* Grille */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; margin-bottom: 48px; }

/* =========================================================
   MISE EN FORME DU TEXTE RICHE (PROSE) POUR LA VUE ET L'ÉDITEUR
   ========================================================= */
.prose {
    color: var(--text-main);
    line-height: 1.7;
    font-size: 16px;
}
.prose h2 {
    font-size: 24px;
    font-weight: 800;
    margin-top: 32px;
    margin-bottom: 16px;
    color: var(--primary);
}
.prose h3 {
    font-size: 20px;
    font-weight: 700;
    margin-top: 24px;
    margin-bottom: 12px;
}
.prose p {
    margin-bottom: 16px;
}
.prose ul {
    margin-bottom: 16px;
    padding-left: 24px;
    list-style-type: disc;
}
.prose li {
    margin-bottom: 8px;
}
.prose b, .prose strong {
    font-weight: 700;
}
.prose i, .prose em {
    font-style: italic;
}

/* =========================================================
   STYLE SPÉCIFIQUE À L'ÉDITEUR (PAGE CREATE)
   ========================================================= */
.content-area[contenteditable="true"] {
    width: 100%;
    min-height: 400px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--white);
    outline: none;
    transition: 0.2s;
    overflow-y: auto;
}
.content-area[contenteditable="true"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
.content-area[contenteditable="true"]:empty:before {
    content: attr(placeholder);
    color: var(--text-muted);
    pointer-events: none;
    display: block; /* For Firefox */
}

/* =========================================================
   VUE ARTICLE (SHOW.PHP) - CORRECTION DU MANQUE DE STYLES
   ========================================================= */
.article-wrapper {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 24px;
}

.article-header {
    text-align: center;
    margin-bottom: 32px;
}

.article-title {
    font-size: 36px;
    font-weight: 900;
    color: var(--text-main);
    margin: 16px 0;
    line-height: 1.2;
}

.article-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    margin-top: 24px;
}

.meta-author {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    text-decoration: none;
}

.meta-author img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-light);
}

.meta-author-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.meta-name {
    font-weight: 800;
    color: var(--text-main);
    font-size: 15px;
}

.meta-details {
    font-size: 13px;
    color: var(--text-muted);
}

.article-cover {
    width: 100%;
    max-height: 450px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 40px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}

.author-box {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--white);
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-top: 48px;
    margin-bottom: 48px;
}

.author-box img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.author-box-content {
    flex: 1;
}

.author-box-name {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text-main);
}

.author-box-bio {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Responsive pour mobile */
@media (max-width: 768px) {
    .article-title { font-size: 28px; }
    .author-box { flex-direction: column; text-align: center; }
    .article-meta { flex-direction: column; gap: 16px; align-items: flex-start; }
    .meta-actions { width: 100%; display: flex; justify-content: flex-end; }
}

/* =========================================================
   PAGE INDEX DU BLOG (GRILLE, HERO, FILTRES)
   ========================================================= */

.section-title { margin-bottom: 32px; font-size: 28px; font-weight: 900; }

/* --- Article à la une (Featured) --- */
.featured-post {
    display: flex;
    flex-direction: row;
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 40px;
    overflow: hidden;
    cursor: pointer;
    transition: 0.3s ease;
    min-height: 350px;
}
.featured-post:hover { border-color: var(--primary); box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1); }

.featured-image {
    flex: 1;
    min-height: 100%;
}
.featured-content {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.post-badge, .card-tag {
    background: var(--primary-light);
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 800;
    width: fit-content;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.featured-title { font-size: 28px; font-weight: 900; color: var(--text-main); margin-bottom: 12px; line-height: 1.3; }
.featured-excerpt { font-size: 16px; color: var(--text-muted); line-height: 1.6; margin-bottom: 24px; }

/* --- Méta infos (Auteur & Date) --- */
.post-meta { display: flex; align-items: center; gap: 12px; margin-top: auto; }
.author-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.author-avatar-sm { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.meta-info { display: flex; flex-direction: column; }
.author-name { font-weight: 800; font-size: 14px; color: var(--text-main); }
.post-date { font-size: 12px; color: var(--text-muted); font-weight: 500; }

/* --- Filtres --- */
.blog-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none; /* Firefox */
}
.blog-filters::-webkit-scrollbar { display: none; } /* Chrome/Safari */

.filter-pill {
    padding: 8px 20px;
    border-radius: 99px;
    background: var(--white);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: 0.2s;
}
.filter-pill:hover { border-color: var(--text-main); color: var(--text-main); }
.filter-pill.active { background: var(--text-main); border-color: var(--text-main); color: var(--white); }

/* --- Grille d'articles --- */
.post-card { display: flex; flex-direction: column; height: 100%; }
.card-image { width: 100%; height: 200px; object-fit: cover; }
.card-content { padding: 24px; display: flex; flex-direction: column; flex: 1; }
.card-title { font-size: 18px; font-weight: 800; margin-bottom: 8px; line-height: 1.4; color: var(--text-main); }
.card-excerpt { font-size: 14px; color: var(--text-muted); line-height: 1.5; margin-bottom: 20px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* --- Call To Action Footer --- */
.cta-banner {
    background: var(--primary-gradient);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    color: white;
    margin-top: 48px;
}
.cta-title { font-size: 28px; font-weight: 900; margin-bottom: 12px; }
.cta-desc { font-size: 16px; opacity: 0.9; margin-bottom: 24px; max-width: 600px; margin-left: auto; margin-right: auto; line-height: 1.6; }
.btn-white { background: var(--white); color: var(--primary); border: none; padding: 14px 28px; border-radius: 12px; font-weight: 800; font-size: 16px; cursor: pointer; transition: 0.2s; display: inline-flex; align-items: center; gap: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.btn-white:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,0.15); }

/* --- Responsive Mobile --- */
@media (max-width: 768px) {
    .featured-post { flex-direction: column; }
    .featured-image { min-height: 250px; }
    .featured-content { padding: 24px; }
    .featured-title { font-size: 22px; }
    .cta-banner { padding: 32px 16px; }
    .cta-title { font-size: 22px; }
}