
/* Styles pour le bloc JSON Posts */
.json-posts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.json-posts-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 20px 0;
}

.json-post-item {
    border: 1px solid #ddd;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    background: #fff;
}

.json-post-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.json-post-list-item {
    display: flex;
    flex-direction: row;
    min-height: 150px;
    position: relative;
}

.json-post-list-item .json-post-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 20%;
    height: 100%;
    object-fit: cover;
}

.json-post-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.json-post-content {
    padding: 15px;
    flex: 1;
}

.json-post-list-item .json-post-content {
    margin-left: 20%;
    padding: 15px;
}

.json-post-title {
    margin: 0 0 10px 0;
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
}

.json-post-date {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.json-post-list-item .json-post-date {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #7F95D1;
    color: white;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 500;
    margin-bottom: 10px;
}

.json-post-list-item .json-post-date i {
    color: white;
    font-size: 1em;
}

.json-post-list-item .json-post-date span {
    color: white;
}

.json-post-description-short {
    color: #555;
    line-height: 1.5;
}

.json-post-description {
    color: #555;
    line-height: 1.5;
    margin-bottom: 10px;
}

.json-post-description p {
    margin: 0 0 10px 0;
}

/* Style spécial pour le lien "En savoir plus" */
.json-post-read-more-link {
    color: #0073aa !important;
    text-decoration: none !important;
    font-weight: 500;
    font-size: 0.9em;
    cursor: pointer;
    transition: color 0.2s ease;
}

.json-post-read-more-link:hover {
    color: #005a87 !important;
    text-decoration: underline !important;
}

.json-post-file {
    margin: 10px 0;
}

.json-post-file-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    background: #0073aa;
    color: white !important;
    text-decoration: none !important;
    font-size: 0.9em;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.json-post-file-link:hover {
    background: #005a87;
    color: white !important;
}

.json-post-video {
    margin: 10px 0;
}

.json-post-video-player {
    max-width: 100%;
    height: auto;
}

/* Styles pour la modal */
.json-posts-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px;
}

.json-posts-modal-container {
    background: white;
    max-width: 800px;
    max-height: 90vh;
    width: 100%;
    overflow-y: auto;
    position: relative;
}

.json-posts-modal-header {
    position: sticky;
    top: 0;
    background: white;
    padding: 15px 20px 0;
    text-align: right;
    border-bottom: 1px solid #eee;
}

.json-posts-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.json-posts-modal-close:hover {
    background: #f0f0f0;
}

.json-posts-modal-body {
    padding: 20px;
}

.json-posts-modal-image {
    width: 100%;
    height: 400px;
    max-height: 400px;
    object-fit: cover;
    margin-bottom: 20px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.json-posts-modal-title {
    margin: 0 0 15px 0;
    font-size: 1.5em;
    font-weight: bold;
    color: #333;
}

.json-posts-modal-date {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 15px;
}

.json-posts-modal-description {
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
}

.json-posts-modal-description p {
    margin: 0 0 15px 0;
}

.json-posts-modal-file {
    margin: 20px 0;
}

.json-posts-modal-file-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #0073aa;
    color: white !important;
    text-decoration: none !important;
    font-size: 1em;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.json-posts-modal-file-link:hover {
    background: #005a87;
    color: white !important;
}

.json-posts-modal-video {
    margin: 20px 0;
}

.json-posts-modal-video-player {
    width: 100%;
    max-height: 400px;
}

/* Styles d'erreur et de chargement */
.json-posts-error {
    background: #ffe6e6;
    border: 1px solid #ff9999;
    padding: 15px;
    color: #cc0000;
}

.json-posts-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.json-posts-placeholder {
    background: #f0f0f0;
    border: 2px dashed #ccc;
    padding: 20px;
    text-align: center;
    color: #666;
}

/* Bouton Afficher plus */
.json-posts-load-more-wrapper {
    text-align: center;
    margin: 30px 0;
}

.json-posts-load-more {
    background-color: #7F95D1;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.json-posts-load-more:hover {
    background-color: #6B81C7;
    transform: translateY(-2px);
}

.json-posts-load-more:active {
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .json-posts-container {
        grid-template-columns: 1fr;
    }
    
    .json-post-list-item {
        flex-direction: column;
        min-height: auto;
    }
    
    .json-post-list-item .json-post-image {
        position: relative;
        width: 100%;
        height: 200px;
        object-fit: cover;
    }
    
    .json-post-list-item .json-post-content {
        margin-left: 0;
        padding: 15px;
    }
    
    .json-posts-modal-container {
        margin: 10px;
        max-height: 95vh;
    }
    
    .json-posts-modal-body {
        padding: 15px;
    }
}
