.post [contenteditable] {
    border: 3px dashed #ccc;
    outline: 0;
}

/* Conteneur Flexbox */
.blog-posts-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem; /* Réduit l'espace entre les cartes */
    justify-content: flex-start; /* Aligne les cartes depuis le début */
    padding: 2rem 0;
    width: 100%;
    margin: 0 auto;
}

main .post.card {
    flex: 0 1 calc(50% - 0.75rem); /* Ajuste la largeur pour 2 cartes par ligne avec l'espace correct */
    margin-bottom: 1.5rem; /* Espace vertical entre les cartes */
    background-color: rgba(255, 255, 255, 0.05);
    box-shadow: var(--box-shadow);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 250px; /* Hauteur minimale pour uniformité */
    cursor: pointer;
    position: relative;
    padding: 1rem;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

main .post.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--box-shadow), 0 5px 15px rgba(0, 0, 0, 0.3);
    background-color: rgba(255, 255, 255, 0.08);
}

main .post.card .card-link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

main .post.card .btn-container {
    padding: 1rem 1.25rem;
    text-align: right;
    margin-top: auto;
}

main .post.card .btn-more {
    display: inline-block;
    background-color: var(--secondary-color);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    height: 50px;
    line-height: 50px;
    border-radius: 25px;
    transition: background 0.3s, color 0.3s, box-shadow 0.3s, transform 0.3s;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(69, 186, 1, 0.3);
    padding: 0 25px;
    border: none;
    cursor: pointer;
    text-align: center;
}
 
main .post.card .btn-more:hover {
    text-decoration: underline;
}

main .post.card h3 {
    color: #fff;
    font-size: 1.5em;
    margin: 0;
    padding: 1.25rem;
    line-height: 1.3;
}

main .post.card .meta {
    padding: 0 1.25rem 1rem;
    margin-bottom: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9em;
    color: #bbb;
}

main .post.card .description {
    padding: 1.25rem;
    margin: 0;
    flex-grow: 1;
}

main .post.card a {
    padding: 1rem 1.25rem;
    text-align: right;
    color: #fff;
    font-weight: bold;
    margin-top: auto; /* Pousse le lien vers le bas */
}

/* Responsive */
@media (max-width: 768px) {
    .blog-posts-container {
        gap: 1rem;
    }
    
    main .post.card {
        flex: 0 1 100%; /* Une carte par ligne */
        margin-bottom: 1rem;
    }
}

/* Pour les très petits écrans */
@media (max-width: 480px) {
    main .post.card {
        min-height: 200px;
    }
    
    main .post.card h3 {
        font-size: 1.3em;
        padding: 1rem;
    }
    
    main .post.card .description {
        padding: 1rem;
    }
}

/* Style pour le bouton de création d'article */
.btn-create-post {
    background-color: var(--secondary-color);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    display: inline-block;
    margin-bottom: 1rem;
    transition: all 0.2s ease-in-out;
    border: none;
}

/* Fil d'Ariane */
.breadcrumb-nav {
    margin-bottom: 2rem;
    padding: 0 0.5rem;
}

.breadcrumb {
    background: rgba(255, 255, 255, 0.05) !important;
    border-radius: 8px !important;
    padding: 0.75rem 1rem !important;
    margin: 0;
    list-style: none !important;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.breadcrumb-item {
    display: flex !important;
    align-items: center;
    font-size: 0.9em;
}

/* .breadcrumb-item:not(:last-child)::after {
    content: "›";
    margin-left: 0.5rem;
    color: #bbb;
    font-weight: bold;
} */

.breadcrumb-item+.breadcrumb-item::before{
    color: #bbb !important;
}

.breadcrumb-item a {
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: color 0.2s ease;
}

.breadcrumb-item a:hover {
    color: var(--secondary-color);
    text-decoration: none;
}

.breadcrumb-item.active {
    color: #bbb;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.breadcrumb-item i {
    font-size: 0.9em;
}

/* Responsive pour le fil d'Ariane */
@media (max-width: 480px) {
    .breadcrumb {
        padding: 0.5rem 0.75rem;
        font-size: 0.85em;
    }
    
    .breadcrumb-item {
        font-size: 0.85em;
    }
}

.btn-create-post:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Style pour le corps de l'article */
.post hr {
    margin-bottom: 0.5rem;
}

.post .body { 
    margin-top: 0.5rem;
}

/* --- Amélioration de la page de modification d'article --- */
.edit-article-card {
    background: rgba(255,255,255,0.97);
    border-radius: 18px;
    box-shadow: 0 4px 32px rgba(0,0,0,0.13), 0 1.5px 6px rgba(0,0,0,0.07);
    padding: 2.5rem 2rem 2rem 2rem;
    max-width: 700px;
    margin: 2.5rem auto 2rem auto;
    position: relative;
    color: #222;
}
.edit-article-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
    gap: 1.5rem;
}
@media (max-width: 600px) {
    .edit-article-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.7rem;
    }
    .btn-delete-article {
        margin-left: 0;
        margin-top: 0.7rem;
    }
}
.edit-article-title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 2rem;
    font-weight: 700;
    color: var(--secondary-color, #2a7ae2);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5em;
}
.btn-delete-article {
    flex: 0 0 auto;
    margin-left: auto;
    background: #e74c3c;
    color: #fff !important;
    border-radius: 6px;
    padding: 0.5rem 1.2rem;
    font-weight: 600;
    border: none;
    transition: background 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.4em;
}
.btn-delete-article:hover {
    background: #c0392b;
    color: #fff;
}
.edit-article-section {
    margin-bottom: 1.7rem;
}
.edit-article-label {
    display: block;
    font-size: 1.08em;
    font-weight: 600;
    color: #888;
    margin-bottom: 0.4em;
    letter-spacing: 0.02em;
}
.edit-article-input {
    background: #f7f9fa;
    border-radius: 7px;
    padding: 1.1em 1.2em;
    min-height: 2.5em;
    font-size: 1.1em;
    border: 1.5px solid #e0e0e0;
    margin-bottom: 0.2em;
    transition: border 0.2s;
}
.edit-article-input[contenteditable]:focus {
    border: 1.5px solid var(--secondary-color, #2a7ae2);
    outline: none;
    background: #fff;
}
.edit-article-footer {
    text-align: left;
    margin-top: 2.5rem;
}
.btn-back-article {
    background: #f1f1f1;
    color: #2a7ae2;
    border-radius: 6px;
    padding: 0.5rem 1.2rem;
    font-weight: 600;
    border: none;
    transition: background 0.2s;
    text-decoration: none;
}
.btn-back-article:hover {
    background: #e3e9f6;
    color: #205a99;
}
@media (max-width: 800px) {
    .edit-article-card {
        padding: 1.2rem 0.5rem 1.5rem 0.5rem;
    }
}

/* --- Images d'illustration pour les cartes d'article --- */
.blog-card-img-wrapper {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}
.blog-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-bottom: 1px solid #eee;
    transition: transform 0.3s;
}
.post.card:hover .blog-card-img {
    transform: scale(1.04);
}

/* --- Image large en haut de l'article --- */
.blog-article-img-wrapper {
    width: 100%;
    max-height: 350px;
    overflow: hidden;
    background: #f5f5f5;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.blog-article-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

/* --- Tags visuels pour les mots-clés --- */
.blog-tag {
    display: inline-block;
    background: var(--secondary-color, #2a7ae2);
    color: #fff;
    font-size: 0.85em;
    font-weight: 500;
    border-radius: 12px;
    padding: 0.2em 0.8em;
    margin: 0 0.2em 0.2em 0;
    letter-spacing: 0.02em;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    transition: background 0.2s;
}
.blog-tag:hover {
    background: #174a8b;
}

.blog-tags-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.2em;
}

.blog-article-date {
    margin-left: 1em;
    color: #bbb;
    font-size: 0.95em;
}

@media (max-width: 600px) {
    .blog-card-img-wrapper {
        height: 120px;
    }
    .blog-article-img-wrapper {
        max-height: 180px;
    }
}
.post .title {
    margin-bottom: 10px;
}
.post .meta {
    color: #bbb; 
}
.post .body ul li, .note-editing-area ul li {
    list-style-type: disc;
    margin-left: 1.5em;
}
.note-editing-area p {
    color: #222;
}

/* Header de la carte avec tag et date */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    border: none;
}

.card-tag {
    background-color: var(--secondary-color);
    color: #fff;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-date {
    color: #bbb;
    font-size: 0.85em;
    font-weight: 500;
}