﻿/* Styles pour le modal d'article */
.article-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    /* backdrop-filter: blur(5px); - Removed for performance */
    animation: fadeIn 0.3s ease-out;
}

.article-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.article-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.4s ease-out;
    overflow: hidden;
}

.article-modal-header {
    padding: 25px 30px 20px;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.article-modal-close {
    position: absolute;
    top: 20px;
    right: 25px;
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    transition: color 0.2s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.article-modal-close:hover {
    color: #333;
    background: #f5f5f5;
}

.article-modal-title {
    margin: 0;
    font-size: 1.8rem;
    color: #333;
    line-height: 1.3;
    padding-right: 50px;
}

.article-modal-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
    font-size: 0.9rem;
    color: #666;
}

.article-modal-category {
    background: #007bff;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.article-modal-category.prestations { background: #28a745; }
.article-modal-category.voyages { background: #17a2b8; }
.article-modal-category.retraites { background: #6f42c1; }
.article-modal-category.evenements { background: #fd7e14; }
.article-modal-category.general { background: #6c757d; }

.article-modal-date {
    display: flex;
    align-items: center;
    gap: 5px;
}

.article-modal-author {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}

.article-modal-body {
    padding: 0 30px 30px;
    max-height: calc(90vh - 120px);
    overflow-y: auto;
    overflow-x: hidden;
}

.article-modal-image {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 8px;
    margin: 20px 0;
}

.article-modal-content-text {
    line-height: 1.7;
    font-size: 1rem;
    color: #333;
}

/* Clean up any remaining problematic inline styles */
.article-modal-content-text span {
    font-size: inherit !important;
    font-family: inherit !important;
}

.article-modal-content-text * {
    max-width: 100%;
}

/* S'assurer que les spans ne bloquent pas les clics sur les liens */
.article-modal-content-text span {
    pointer-events: none;
}

.article-modal-content-text span a {
    pointer-events: auto !important;
}

.article-modal-content-text h1,
.article-modal-content-text h2,
.article-modal-content-text h3 {
    color: #333;
    margin-top: 25px;
    margin-bottom: 15px;
}

.article-modal-content-text p {
    margin-bottom: 15px;
}

.article-modal-content-text img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 15px 0;
}

.article-modal-content-text ul,
.article-modal-content-text ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.article-modal-content-text blockquote {
    border-left: 4px solid #007bff;
    padding-left: 20px;
    margin: 20px 0;
    font-style: italic;
    color: #666;
}

/* Styles pour les liens dans le contenu */
.article-modal-content-text a {
    color: #007bff;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s ease;
    pointer-events: auto !important; /* Force les liens à être cliquables */
    position: relative;
    z-index: 1; /* S'assure que les liens sont au-dessus */
}

.article-modal-content-text a:hover {
    color: #0056b3;
    text-decoration: underline;
}

.article-modal-content-text a:visited {
    color: #6f42c1;
}

.article-modal-content-text a:active {
    color: #004085;
}

/* Scrollbar personnalisée */
.article-modal-body::-webkit-scrollbar {
    width: 8px;
}

.article-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.article-modal-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.article-modal-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .article-modal {
        padding: 10px;
    }
    
    .article-modal-content {
        max-height: 95vh;
        border-radius: 8px;
    }
    
    .article-modal-header {
        padding: 20px 20px 15px;
    }
    
    .article-modal-title {
        font-size: 1.5rem;
        padding-right: 40px;
    }
    
    .article-modal-close {
        top: 15px;
        right: 15px;
        font-size: 24px;
        width: 35px;
        height: 35px;
    }
    
    .article-modal-body {
        padding: 0 20px 25px;
        max-height: calc(95vh - 100px);
    }
    
    .article-modal-meta {
        flex-wrap: wrap;
        gap: 10px;
    }
}

/* Loading state */
.article-modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: #666;
}

.article-modal-loading::before {
    content: "";
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}