/* Titres */
.post-viewer-container h2,
.post-adder-container h2 {
    color: #000;
    /* rendre les h2 visibles */
    font-size: 1.8em;
}

/* Loader */
.loader {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.8);
    padding: 20px;
    z-index: 10000;
    border-radius: 5px;
}

/* Conteneur principal des posts */
.post-viewer-container {
    background: #fff;
    padding: 20px;
    margin: 20px auto;
    max-width: 1200px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Liste des articles en flex pour 2 colonnes sur ordi */
.post-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

/* Chaque article */
.post-item {
    width: calc(50% - 10px);
    /* 2 articles par ligne */
    margin-bottom: 20px;
    background: #fff;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    display: flex;
    align-items: center;
}

/* Conteneur de l'image (agrandit) */
.post-thumbnail {
    flex: 0 0 250px;
    margin-right: 15px;
}

.post-thumbnail img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Taille du titre d'article réduite */
.post-item h3 {
    font-size: 1.2em;
    margin: 0 0 10px 0;
}

/* Boutons pour actions sur articles et formulaires (hors pagination) */
.post-viewer-container button,
.popup-buttons input[type="submit"],
.popup-buttons button,
.post-adder-form input[type="submit"] {
    background: #1DA8A5;
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 10px 15px;
    margin: 5px 0;
    /* espace vertical minimal */
    cursor: pointer;
}

/* S'assurer qu'il n'y ait pas trop d'espace à droite sur les boutons dans les articles */
.post-viewer-container button {
    margin-right: 5px;
}

/* Popup modal */
.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.popup-content {
    background: #fff;
    width: 80%;
    max-width: 500px;
    margin: 10% auto;
    padding: 20px;
    border-radius: 8px;
    position: relative;
}

.close-popup {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
}

.close-popup:hover {
    color: white;
}

.popup-form label {
    display: block;
    margin-top: 10px;
}

.popup-form input[type="text"],
.popup-form textarea,
.popup-form input[type="file"] {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.popup-buttons {
    margin-top: 15px;
}

/* Conteneur du formulaire d'ajout d'article */
.post-adder-container {
    background: #fff;
    padding: 20px;
    margin: 20px auto;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.post-adder-form label {
    display: block;
    margin-top: 10px;
}

.post-adder-form input[type="text"],
.post-adder-form textarea,
.post-adder-form input[type="file"] {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.post-adder-form input[type="submit"] {
    background: #1DA8A5;
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 10px 15px;
    margin-top: 15px;
    cursor: pointer;
}

/* Pagination : affichage uniquement de chiffres */
/* Les boutons de pagination (dans #pagination-controls) auront :
   - fond noir par défaut,
   - fond bleu et texte blanc au survol et quand actif */
.pagination-controls {
    text-align: center;
    margin-top: 20px;
}

.pagination-controls button {
    background: #000;
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 8px 12px;
    margin: 0 3px;
    cursor: pointer;
}

.pagination-controls button:hover {
    background: #1DA8A5;
}

.pagination-controls button.active {
    background: #1DA8A5;
}

@media (max-width: 768px) {
    .post-thumbnail img {
        width: 100% !important;
    }
}

/* Responsive : sur mobile, un article par ligne */
@media (max-width: 1250px) {
    .post-item {
        width: 100%;
        flex-direction: column;
        align-items: center;
    }

    .post-thumbnail {
        width: 100%;
        margin-right: 0;
        margin-bottom: 10px;
        display: flex;
        justify-content: center;
    }

    .post-thumbnail img {
        width: 60%;
    }

    .article-buttons {
        display: flex;
        justify-content: center;
    }
}

/* Verticaux */
.post-list-vertical {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.post-list-vertical .post-item {
    width: 100%;
}

#post-list-vertical .btn-view-post{
    display: none;
}

#post-list-vertical .post-item {
    flex-direction: column;
}

#post-list-vertical .post-thumbnail{
    flex: 0 0 200px;
}