/* =========================================================
   SHORTCODE [events]
   Rangée de cartes : badge date coloré + image + type + titre
   ========================================================= */
.ca-events__heading {
    margin: 0 0 24px;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
}

.ca-events__grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 24px;
}

.ca-event-card {
    display: flex;
    flex-direction: column;
}

/* Zone image + badge superposé (lien vers l'événement) */
.ca-event-card__media {
    position: relative;
    display: block;
    text-decoration: none;
    color: inherit;
}

.ca-event-card__img {
    display: block;
    aspect-ratio: 3 / 4;
    overflow: hidden;
}

.ca-event-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Badge date en haut à gauche */
.ca-event-card__badge {
    position: absolute;
    top: -20px;
    left: -14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #fff;
    text-align: center;
    justify-content: space-around;
    line-height: 1.1;
    z-index: 2;
    gap: 2px;
    width: 123px;
    padding: 12px 30px;
}

.ca-event-card__weekday {
    font-size: 14px;
}

.ca-event-card__day {
    font-size: 54px;
    font-weight: 600;
}

.ca-event-card__month, .ca-event-card__year  {
    font-size: 16px;
    font-weight: 500;
}

/* Textes sous l'image */
.ca-event-card__type {
    display: block;
    margin-top: 12px;
    font-weight: 700;
    color: inherit;
    text-decoration: none;
}

/* Le type est cliquable (vers la liste de la catégorie) */
a.ca-event-card__type:hover,
a.ca-event-card__type:focus-visible {
    text-decoration: underline;
}

.ca-event-card__title {
    display: block;
    margin-top: 4px;
    font-weight: 400;
    color: #555;
    line-height: 1.35;
    text-decoration: none;
}

a.ca-event-card__title:hover,
a.ca-event-card__title:focus-visible {
    text-decoration: underline;
}

/* Contrôles du carrousel (pastilles + flèche) — masqués sur desktop */
.ca-events__controls {
    display: none;
}

.ca-events__dots {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ca-events__dot {
    width: 9px;
    height: 9px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #cbd5d0;
    cursor: pointer;
    transition: background-color .2s ease;
}

.ca-events__dot.is-active {
    background: #1c7a2f; /* vert Provence Verte */
}

.ca-events__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    border: none;
    background: none;
    color: #1a1a1a;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.ca-events__arrow:focus, .ca-events__arrow:hover{
    background-color: transparent !important;
    text-decoration: none;
    color: #1a1a1a;
    
}

.ca-events__arrow:focus-visible {
    outline: 2px solid #1c7a2f;
    outline-offset: 2px;
}

/* Responsive */
@media (max-width: 1024px) {
    .ca-events__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mobile : la grille devient un carrousel horizontal (scroll-snap) */
@media (max-width: 767px) {
    .ca-events__grid {
        display: flex;
        grid-template-columns: none;
        gap: 30px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        /* Marge intérieure pour ne pas rogner le badge qui déborde (haut/gauche) */
        padding: 26px 16px 4px;
        scroll-padding-left: 16px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;         /* Firefox */
    }
    .ca-events__grid::-webkit-scrollbar {
        display: none;                 /* Chrome / Safari */
    }

    .ca-event-card {
        flex: 0 0 82%;                 /* une carte + aperçu de la suivante */
        scroll-snap-align: start;
    }

    .ca-event-card__day {
        font-size: 40px;
    }

    .ca-events__controls {
        display: flex;
        align-items: center;
        justify-content: center;       /* pastilles + flèche centrées */
        gap: 20px;
        margin-top: 18px;
    }
}

/* Accessibilité : pas de défilement animé si mouvement réduit */
@media (prefers-reduced-motion: reduce) {
    .ca-events__grid {
        scroll-behavior: auto;
    }
}