/* ============================================
   MODAL COMPACT & LISIBLE - OPTIMISÉ
   Remplace modal-moderne.css
   ============================================ */

/* Overlay */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;        /* Centré verticalement */
    justify-content: center;
    opacity: 1;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(3px);
}

/* Container COMPACT */
.modal-content {
    position: relative;
    background: #ffffff;
    border-radius: 20px;           /* Arrondi partout car centré */
    width: 100%;
    max-width: 500px;              /* ← RÉDUIT de 600px à 500px */
    max-height: 75vh;              /* ← RÉDUIT de 85vh à 75vh */
    overflow-y: auto;
    padding: 1.25rem;              /* ← RÉDUIT de 1.5rem */
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    animation: scaleUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10000;
}

@keyframes scaleUp {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Barre de fermeture */
.modal-handle {
    width: 40px;
    height: 4px;
    background: #d1d5db;
    border-radius: 2px;
    margin: 0 auto 0.75rem auto;
    cursor: pointer;
}

/* Bouton close */
.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: #374151;
    transition: all 0.2s;
    z-index: 10;
}

.modal-close:active {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
    transform: scale(0.95);
}

/* ============================================
   IMAGE HEADER COMPACT
   ============================================ */
.modal-image-header {
    width: calc(100% + 2.5rem);
    margin: -1.25rem -1.25rem 0.75rem -1.25rem;
    height: 160px;                /* ← RÉDUIT de 220px à 160px */
    position: relative;
    overflow: hidden;
    border-radius: 20px 20px 0 0;  /* Arrondi seulement en haut */
}

.modal-image-header img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================
   CONTENU ÉVÉNEMENT - LISIBLE
   ============================================ */
.modal-event-title {
    font-size: 1.3rem;            /* ← RÉDUIT de 1.5rem */
    font-weight: 700;
    color: #111827;               /* ← PLUS FONCÉ */
    margin-bottom: 0.75rem;
    line-height: 1.3;
    padding-right: 2rem;
}

.modal-event-meta {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.modal-event-meta-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;           /* ← RÉDUIT */
    color: #1f2937;               /* ← PLUS FONCÉ pour lisibilité */
    background: #f9fafb;
    padding: 0.4rem 0.65rem;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.modal-event-meta-item svg {
    width: 14px;
    height: 14px;
    color: #D97706;
    flex-shrink: 0;
}

.modal-event-description {
    font-size: 0.9rem;            /* ← RÉDUIT de 0.95rem */
    line-height: 1.6;
    color: #1f2937;               /* ← PLUS FONCÉ */
    margin-bottom: 1rem;
    max-height: 300px;            /* ← Limité en hauteur */
    overflow-y: auto;
}

.modal-event-description h2,
.modal-event-description h3 {
    font-size: 1rem;              /* ← RÉDUIT */
    margin: 0.75rem 0 0.4rem 0;
    color: #111827;               /* ← TRÈS FONCÉ */
    font-weight: 600;
}

.modal-event-description p {
    margin-bottom: 0.5rem;
    color: #374151;
}

.modal-event-description ul,
.modal-event-description ol {
    margin-left: 1.25rem;
    margin-bottom: 0.5rem;
}

.modal-event-description li {
    color: #374151;
    margin-bottom: 0.25rem;
}

.modal-event-description strong {
    color: #D97706;
    font-weight: 600;
}

/* ============================================
   BOUTONS COMPACTS
   ============================================ */
.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.modal-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;        /* ← RÉDUIT */
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.875rem;          /* ← RÉDUIT */
    text-decoration: none;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.modal-action-primary {
    background: linear-gradient(135deg, #D97706, #F59E0B);
    color: white;
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.3);
}

.modal-action-primary:active {
    transform: scale(0.97);
}

.modal-action-secondary {
    background: white;
    color: #374151;
    border: 1.5px solid #d1d5db;
}

.modal-action-secondary:active {
    background: #f9fafb;
}

/* Badge COMPACT */
.modal-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;     /* ← RÉDUIT */
    background: #D1FAE5;
    color: #065F46;
    border-radius: 16px;
    font-size: 0.75rem;           /* ← RÉDUIT */
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.modal-badge::before {
    content: '●';
    color: #10B981;
    font-size: 1rem;
}

/* ============================================
   SCROLLBAR DISCRÈTE
   ============================================ */
.modal-content::-webkit-scrollbar {
    width: 4px;
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}

.modal-event-description::-webkit-scrollbar {
    width: 3px;
}

.modal-event-description::-webkit-scrollbar-thumb {
    background: #d1d5db;
}

/* ============================================
   RESPONSIVE DESKTOP
   ============================================ */
@media (min-width: 769px) {
    .modal.active {
        align-items: center;
    }
    
    .modal-content {
        border-radius: 20px;
        max-width: 480px;         /* ← COMPACT sur desktop aussi */
        max-height: 80vh;
        padding: 1.5rem;
    }
    
    .modal-image-header {
        width: calc(100% + 3rem);
        margin: -1.5rem -1.5rem 1rem -1.5rem;
        height: 200px;            /* ← Un peu plus grand sur desktop */
        border-radius: 20px 20px 0 0;
    }
    
    .modal-handle {
        display: none;
    }
    
    .modal-actions {
        flex-direction: row;
    }
    
    .modal-action-btn {
        flex: 1;
    }
}

/* ============================================
   MOBILE TRÈS PETIT
   ============================================ */
@media (max-width: 400px) {
    .modal-content {
        padding: 1rem;
        max-height: 80vh;
    }
    
    .modal-image-header {
        height: 140px;
    }
    
    .modal-event-title {
        font-size: 1.2rem;
    }
    
    .modal-event-description {
        font-size: 0.85rem;
    }
}

/* ============================================
   CONTENU BLOG - MÊME STYLE
   ============================================ */
.modal-blog-header {
    margin-bottom: 0.75rem;
}

.modal-blog-category {
    display: inline-block;
    background: linear-gradient(135deg, #D97706, #F59E0B);
    color: white;
    padding: 0.3rem 0.75rem;
    border-radius: 16px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.modal-blog-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.4rem;
    line-height: 1.3;
    padding-right: 2rem;
}

.modal-blog-date {
    color: #6b7280;
    font-size: 0.8rem;
}

.modal-blog-content {
    font-size: 0.9rem;
    line-height: 1.7;
    color: #374151;
    max-height: 350px;
    overflow-y: auto;
}

.modal-blog-content h2,
.modal-blog-content h3 {
    font-size: 1.1rem;
    margin: 1rem 0 0.5rem 0;
    color: #111827;
}

.modal-blog-content p {
    margin-bottom: 0.75rem;
    color: #374151;
}

.modal-blog-content img {
    width: 100%;
    border-radius: 10px;
    margin: 0.75rem 0;
}
