/* --- GRILLE --- */
.cards-grid-wrapper {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    position: relative;
    z-index: 2;
    margin-bottom: 50px;
}

@media (max-width: 900px) {
    .cards-grid-wrapper {
        grid-template-columns: 1fr;
    }
}

/* --- 1. LES CARTES (NOUVELLE STRUCTURE BUTTON) --- */

/* Reset du style bouton par défaut */
.card-trigger {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    text-align: left;
    width: 100%;
    cursor: pointer;
    font-family: inherit;

    /* Ton style de carte */
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Important pour le radius */
}

/* Effet de levitation global au survol */
.card-trigger:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.card-article {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: white;
    width: 100%;
}

/* --- IMAGE & ANIMATIONS --- */
.swiper-slide-container-image {
    width: 100%;
    height: 250px;
    position: relative;
    overflow: hidden;
}

.image_slide {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card-trigger:hover .image_slide {
    transform: scale(1.1);
}

/* Overlay sombre au survol */
.swiper-slide-container-image::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(29, 39, 49, 0.6);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.card-trigger:hover .swiper-slide-container-image::before {
    opacity: 1;
}

/* Icône Plus (+) */
.plus-icon-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.plus-icon {
    width: 50px;
    height: 50px;
}

.card-trigger:hover .plus-icon-wrapper {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* --- CONTENU TEXTE --- */
.swiper-slide-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.category-title span {
    font-family: 'Afacad', sans-serif;
    font-size: 1.6rem;
    font-weight: bold;
    color: var(--dark-blue-color);
    /* Ton animation de soulignement jaune */
    background-image: linear-gradient(transparent calc(100% - 3px), var(--yellow-site) 0.09em);
    background-repeat: no-repeat;
    background-size: 0 100%;
    transition: background-size 0.3s ease;
    line-height: 1.3;
}

.card-trigger:hover .category-title span {
    background-size: 100% 100%;
}

.swiper-slide-content p {
    font-family: 'Work Sans', sans-serif;
    font-size: 1rem;
    margin-top: 10px;
    line-height: 1.5;
    margin-bottom: 20px;
}

/* Faux lien "En savoir plus" */
.fake-link {
    font-family: 'Work Sans', sans-serif;
    font-weight: 600;
    color: var(--dark-blue-color);
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s ease;
}

.card-trigger:hover .fake-link {
    color: var(--light-blue-color);
    /* Changement de couleur au hover */
}

/* --- 2. MODALES MODERNES (GLASSMORPHISM) --- */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(29, 39, 49, 0.85);
    /* Fond bleu sombre transparent */
    backdrop-filter: blur(8px);
    /* Effet de flou moderne */
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.modal-wrapper {
    background: white;
    width: 100%;
    max-width: 950px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    position: relative;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.modal-overlay.is-visible .modal-wrapper {
    transform: scale(1) translateY(0);
}

/* Bouton Fermer (X) */
.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: white;
    border: 2px solid var(--dark-blue-color);
    color: var(--dark-blue-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    z-index: 20;
}

.modal-close:hover {
    background: var(--dark-blue-color);
    color: white;
}

.modal-close span {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
}

.modal-close span::before,
.modal-close span::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60%;
    height: 2px;
    border-radius: 999px;
    background-color: var(--dark-blue-color);
    transition: all 0.3s ease;
}

.modal-close span::before {
    transform: translate(-50%, -50%) rotate(45deg);
}


.modal-close span::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.modal-close:hover span::before,
.modal-close:hover span::after {
    background-color: white;
}


/* Layout Interne */
.modal-split {
    display: flex;
    flex-direction: row;
    min-height: 450px;
}

.modal-visual {
    width: 45%;
    background-size: cover;
    background-position: center;
    position: relative;
}

.modal-info {
    width: 55%;
    padding: 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.modal-info h3 {
    font-family: 'Afacad', sans-serif;
    font-size: 2.2rem;
    color: var(--dark-blue-color);
    margin-bottom: 20px;
    line-height: 1.1;
}

.modal-body-txt {
    font-family: 'Work Sans', sans-serif;
    font-size: 1.1rem;
    color: #444;
    line-height: 1.6;
    margin-bottom: 30px;
}

/* Crédit Photo Modale */
.img-credit {
    position: absolute;
    bottom: 15px;
    right: 15px;
    font-size: 0.75rem;
    color: white;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    padding: 5px 12px;
    border-radius: 20px;
    font-family: 'Work Sans', sans-serif;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .modal-split {
        flex-direction: column;
    }

    .modal-visual {
        width: 100%;
        height: 200px;
    }

    .modal-info {
        width: 100%;
        padding: 30px 20px;
    }

    .modal-info h3 {
        font-size: 1.8rem;
    }

    /* On cache le crédit sur mobile si l'image est petite, sinon ça gêne */
    .img-credit {
        display: none;
    }
}