/**
 * Carrousel derniers articles - styles v1.3.
 * Cartes 1140x240 max, fond transparent, layout 2 colonnes (image 400 cover + texte).
 * Pattern card-link : le ::after du lien titre couvre toute la carte, le bouton Stackable reste au-dessus.
 */

.cda-swiper {
    position: relative;
    max-width: 1140px;
    margin: 0 auto;
    overflow: hidden;
    background: transparent;
    box-shadow: none;
    border: none;
    border-radius: 0;
}

.cda-slide {
    box-sizing: border-box;
    height: auto;
}

/* Carte : position relative pour servir de reference au ::after du lien */
.cda-card {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    width: 100%;
    max-width: 1140px;
    min-height: 240px;
    background: transparent;
    margin: 0 auto;
}

/* Colonne image gauche : 400 large, hauteur de la carte, image cover */
.cda-card-image {
    flex: 0 0 400px;
    width: 400px;
    height: 240px;
    overflow: hidden;
    background: transparent;
}

.cda-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Colonne texte droite */
.cda-card-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 0 1.5rem;
    min-width: 0;
    position: relative;
}

.cda-card-title {
    margin: 0 0 0.5rem;
    font-size: clamp(1.15rem, 1.6vw, 1.5rem);
    line-height: 1.3;
    color: var(--theme-headings-color, #1a1a1a);
}

/* Lien titre : etendu sur toute la carte via ::after, sans changer l'apparence visuelle */
.cda-card-link {
    color: inherit;
    text-decoration: none;
    background-image: none;
    transition: color 0.2s ease;
}

.cda-card-link::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
}

.cda-card:hover .cda-card-link {
    color: var(--theme-palette-color-1, #1a1a1a);
    text-decoration: underline;
}

.cda-card:hover {
    cursor: pointer;
}

.cda-card-date {
    font-size: 0.9rem;
    color: var(--theme-font-color, #666);
    margin-bottom: 0.75rem;
    font-style: italic;
    text-transform: capitalize;
}

.cda-card-excerpt {
    color: var(--theme-font-color, #555);
    line-height: 1.5;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    /* Securite supplementaire si le PHP n'a pas tronque comme attendu */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* Bouton en bas a droite : z-index > 1 pour passer AU-DESSUS du ::after du lien card */
.cda-card-button {
    margin-top: auto;
    margin-left: auto;
    padding-top: 0.5rem;
    position: relative;
    z-index: 2;
}

/* Cacher les chevrons et la pagination, supprimer le curseur grab */
.cda-swiper .swiper-button-next,
.cda-swiper .swiper-button-prev,
.cda-swiper .swiper-pagination {
    display: none !important;
}

.cda-swiper,
.cda-swiper .swiper-slide {
    cursor: default;
}

/* Responsive : stack vertical en dessous de 600 px */
@media (max-width: 600px) {
    .cda-card {
        flex-direction: column;
        min-height: 0;
    }

    .cda-card-image {
        flex: 0 0 auto;
        width: 100%;
        height: 200px;
    }

    .cda-card-body {
        padding: 1rem 0.5rem;
    }

    .cda-card-excerpt {
        white-space: normal;
    }

    .cda-card-button {
        margin-left: 0;
        margin-top: 1rem;
    }
}