/* css/evenements.css */

/* Section Événements */
.evenements-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 2rem;
}

.section-subtitle {
    text-align: center;
    color: var(--color-text-secondary);
    font-size: 1.1rem;
    margin-top: -1rem;
    margin-bottom: 2.5rem;
}

.evenements-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.evenement-card {
    background: var(--color-surface);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    position: relative;
}

.evenement-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.evenement-card.perime {
    opacity: 1;
    margin-bottom: 8px;
    filter: grayscale(0.3);
}

.evenement-image {
    width: 100%;
    /* height: 480px; Hauteur fixe, adaptée aux images en portrait */
    /* aspect-ratio: 9/16; */
    height: 100%;
    object-fit: cover;
    display: block;
}

.evenement-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--color-error);
    color: var(--color-white);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.evenement-info {
    padding: 1rem;
    text-align: center;
    background: var(--color-gray-light);
}

.evenement-titre {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.evenement-date {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
}

.evenements-actions {
    text-align: center;
    margin-top: 2rem;
}

/* Modal Événements */
.modal-evenements {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    overflow-y: auto;
    padding: 2rem 1rem;
}

.modal-evenements.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.modal-evenements-content {
    background: var(--color-surface);
    border-radius: 12px;
    max-width: 900px; /* CORRECTION : Largeur réduite */
    width: 100%;
    margin: auto;
    position: relative;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.modal-evenements-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: var(--color-surface);
    z-index: 10;
    border-radius: 12px 12px 0 0;
}

.modal-evenements-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--color-text); /* CORRECTION : Texte bien visible */
}

.modal-close {
    background: var(--color-error); /* CORRECTION : Fond rouge visible */
    border: none;
    font-size: 1.75rem;
    cursor: pointer;
    color: var(--color-white); /* CORRECTION : Croix blanche */
    transition: all 0.3s ease;
    padding: 0;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    line-height: 1;
}

.modal-close:hover {
    background: #a01530; /* CORRECTION : Rouge plus foncé au survol */
    transform: rotate(90deg) scale(1.1);
}

.modal-evenements-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
    background: var(--color-surface);
}

.modal-evenements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); /* CORRECTION : Colonnes adaptées */
    gap: 1.5rem;
}

/* Modal détail événement agrandi */
.modal-detail-evenement .modal-evenements-content {
    max-width: 650px; /* CORRECTION : Largeur optimisée pour affichage vertical */
}

.modal-detail-evenement .modal-evenements-header {
    background: var(--color-surface);
}

.modal-detail-evenement .modal-evenements-body {
    padding: 0;
    background: var(--color-surface);
}

.modal-detail-info {
    padding: 1.5rem;
    text-align: center;
    background: var(--color-surface);
}

.modal-detail-info p {
    color: var(--color-text);
    font-size: 1.1rem;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .evenements-container {
        padding: 1.5rem 1rem;
        margin: 3rem auto;
    }

    .evenements-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .modal-evenements-content {
        margin: 0.5rem;
        max-height: 95vh;
        max-width: 100%;
    }

    .modal-evenements-header {
        padding: 1rem 1.5rem;
    }

    .modal-evenements-header h2 {
        font-size: 1.25rem;
    }

    .modal-close {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .modal-evenements-body {
        padding: 1.5rem;
    }

    .modal-evenements-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .section-subtitle {
        font-size: 1rem;
    }

    .evenement-titre {
        font-size: 1rem;
    }

    .evenement-date {
        font-size: 0.875rem;
    }

    .modal-evenements-header {
        padding: 1rem;
    }

    .modal-evenements-body {
        padding: 1rem;
    }
}
