/*
 * Agenda BM Plugin Styles
 * Version: 1.0
 */

/*------------------------------------------------------------------
  Styles pour le shortcode [agenda_bm]
-------------------------------------------------------------------*/
.abm-event-item.past-event {
    opacity: 0.6;
    /* Vous pouvez ajouter d'autres styles, par exemple :
    background-color: #f0f0f0;
    border-left: 3px solid #ccc;
    */
}

.abm-event-item.past-event h4 a {
    /* Optionnel: changer la couleur du lien pour les événements passés si nécessaire */
    /* color: #555; */
}

.abm-event-list {
    list-style: none;
    margin-left: 0;
    padding-left: 0;
}

.abm-event-list .abm-event-item {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #ddd;
}

.abm-event-list .abm-event-date-column {
    flex: 0 0 120px; /* Largeur fixe pour la date */
    margin-right: 1.5rem;
    font-size: 1.1rem;
    font-weight: bold;
    text-align: center;
    color: #333;
}

.abm-event-list .abm-event-date-column .abm-event-month {
    display: block;
    text-transform: uppercase;
    font-size: 0.9rem;
    color: #777;
}

.abm-event-list .abm-event-content-column {
    flex: 1;
    min-width: 200px; /* Pour éviter que le contenu ne soit trop écrasé */
}

.abm-event-list .abm-event-title a {
    text-decoration: none;
    color: #111;
}

.abm-event-list .abm-event-title a:hover {
    text-decoration: underline;
}

.abm-event-list .abm-event-excerpt {
    margin-top: 0.5rem;
    color: #555;
}

.abm-event-list .abm-read-more-btn {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background-color: #0073aa; /* Couleur standard de WordPress */
    color: #fff;
    text-decoration: none;
    border-radius: 3px;
    transition: background-color 0.2s ease-in-out;
}

.abm-event-list .abm-read-more-btn:hover {
    background-color: #005177;
    color: #fff;
}

/* Responsive pour le shortcode */
@media (max-width: 600px) {
    .abm-event-list .abm-event-item {
        flex-direction: column;
    }

    .abm-event-list .abm-event-date-column {
        flex-basis: auto; /* La date prend toute la largeur */
        margin-bottom: 1rem;
        text-align: left;
    }
}

/*------------------------------------------------------------------
  Styles pour la page d'événement unique (single-bm_event.php)
-------------------------------------------------------------------*/

/*------------------------------------------------------------------
  Styles pour l'affichage en grille de cartes (Shortcode [agenda_bm])
-------------------------------------------------------------------*/
.abm-calendar h2 {
    clear: both; /* Ensure month headers are not affected by floated cards if any */
    margin-top: 2em;
    margin-bottom: 1em;
    font-size: 1.8em; /* Make month headers a bit larger */
}

.abm-event-grid {
    list-style: none;
    padding: 0;
    margin: 0 -10px; /* Negative margin to counteract card padding for edge alignment */
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 columns */
    gap: 20px; /* Space between cards */
}

.abm-event-card {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    display: flex; 
    flex-direction: column; 
    transition: box-shadow 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.abm-event-card:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    transform: translateY(-3px);
}

.abm-event-card.past-event {
    background-color: #f5f5f5; /* Lighter background for past events */
    opacity: 0.8; /* Slightly more visible than default past-event */
}

.abm-event-card.past-event:hover {
    transform: none; /* No lift on hover for past events */
    box-shadow: 0 4px 10px rgba(0,0,0,0.08); /* Keep original shadow */
}

.abm-event-card .abm-card-content-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%; /* Make wrapper take full height of card */
}

.abm-event-card .abm-card-date {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 0.75em;
    font-weight: 500;
}

.abm-event-card h4 {
    font-size: 1.25em;
    margin-top: 0;
    margin-bottom: 0.75em;
    line-height: 1.3;
}

.abm-event-card h4 a {
    text-decoration: none;
    color: #222;
}

.abm-event-card h4 a:hover {
    color: #007bff; /* Bootstrap primary color for hover */
}

.abm-event-card .abm-event-excerpt {
    font-size: 0.95em;
    color: #444;
    margin-bottom: 1.5em;
    flex-grow: 1; /* Allows excerpt to take available space, pushing button down */
    line-height: 1.6;
}

.abm-event-card .abm-read-more {
    /* Bootstrap classes .btn .btn-primary .btn-sm are applied in PHP */
    margin-top: auto; /* Pushes button to the bottom */
    align-self: flex-start; 
}

/* Responsive: 1 column on smaller screens */
@media (max-width: 768px) {
    .abm-event-grid {
        grid-template-columns: 1fr;
        margin-left: 0;
        margin-right: 0;
        gap: 15px;
    }
    .abm-event-card {
        padding: 15px;
    }
    .abm-event-card h4 {
        font-size: 1.15em;
    }
    .abm-event-card .abm-event-excerpt {
        font-size: 0.9em;
    }
}

/* Override some general .past-event styles if they conflict */
.abm-event-item.past-event {
    /* This specific selector might be from old list view. */
    /* If .abm-event-card.past-event is sufficient, this can be removed or adjusted. */
    /* For now, ensure card styles take precedence or are not broken */
}

/* Remove or comment out old list-specific styles if they are no longer needed */
/*
.abm-event-list .abm-event-item {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #ddd;
}

.abm-event-list .abm-event-date-column {
    flex: 0 0 120px; 
    margin-right: 1.5rem;
    font-size: 1.1rem;
    font-weight: bold;
    text-align: center;
    color: #333;
}

.abm-event-list .abm-event-date-column .abm-event-month {
    display: block;
    text-transform: uppercase;
    font-size: 0.9rem;
    color: #777;
}

.abm-event-list .abm-event-content-column {
    flex: 1;
    min-width: 200px; 
}
*/

/*------------------------------------------------------------------
  Styles pour la page d'événement unique (single-bm_event.php)
-------------------------------------------------------------------*/
.abm-single-event-header {
    text-align: center; /* Centrer le header */
    margin-bottom: 2rem;
}

.abm-event-dates-meta {
    margin-top: 1rem;
    font-size: 1rem;
    color: #555;
}

.abm-event-dates-meta strong {
    color: #111;
}

.abm-event-start-date,
.abm-event-end-date {
    display: block;
    margin-bottom: 0.5rem;
}

.abm-single-event-content {
    margin-top: 2rem;
}

/* Ribbon for Past Events */
.abm-event-card {
    /* Ensure these are set if not already, or verify they are inherited */
    position: relative; /* Needed for absolute positioning of the ribbon */
    overflow: hidden;   /* To clip the ribbon to the card's bounds */
}

.abm-past-event-ribbon {
    position: absolute;
    width: 120px;
    height: 120px;
    overflow: hidden;
    z-index: 1;
    top: -16px;
    right: -38px;
    text-align: center;
}

.abm-past-event-ribbon span {
    position: absolute;
    display: block;
    width: 180px;   /* Adjusted width for the 100px container */
    padding: 4px 0;
    /* background-color: #6c757d; */ /* Color set dynamically */
    color: #fff;
    font-size: 0.75em; /* Slightly smaller font for better fit */
    font-weight: bold;
    text-align: center;
    text-transform: uppercase;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
    /* Rotation and positioning for centering text */
    left: -30px;  /* (160-100)/2 = 30. -30px centers it. Adjust if needed. */
    top: 22px;    /* This value often needs tweaking. It positions the unrotated text vertically. */
                  /* Try adjusting this by a few pixels up/down to center 'PASSÉ' perfectly. */
    transform: rotate(45deg);
    transform-origin: center center;
    letter-spacing: 0.5px;
}

