:root {
    --color-green: #95bb20;
    --color-blue: #005775;
    /* --color-green: #cd061e;
    --color-blue: #006a94; */
}

/* Styles pour le conteneur global */
.rfd-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Styles pour les boutons de filtre */
.rfd-filters {
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 20px;
    /* flex-wrap: wrap; */
    padding: 30px 0;
}

.rfd-filter-button {
    background-color: transparent;
    padding: 10px 20px;
    margin: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    color: var(--color-blue);
    border-left: none;
    border-right: none;
    border-top: 1px solid rgba(0, 88, 117, 0.2);
    border-bottom: none;
}

.rfd-filter-button:hover,
.rfd-filter-button.active {
    color: var(--color-green);
    /* border-color: var(--color-green); */
    border-top: 2px solid var(--color-green);
    border-bottom: 1px solid var(--color-green);
}

/* Grille des formations (desktop) */
.rfd-formations-grid {
    display: flex;
    /* grid-template-columns: repeat(4, 1fr); */
    /* 4 par ligne sur desktop */
    flex-wrap: wrap;
    gap: 10px;
}

/* Indicateur de chargement pour la grille */
.rfd-formations-grid.loading {
    opacity: 0.5;
    /* Rendre la grille semi-transparente pendant le chargement */
    pointer-events: none;
    /* Empêcher les clics pendant le chargement */
}

/* Carte de formation */
.rfd-formation-card {
    display: block;
    position: relative;
    border: 1px solid #eee;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-height: 280px;
    min-width: min(100%, 250px) !important;
}

.rfd-formation-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.rfd-card-image {
    width: 100%;
    height: 100%;
    /* Hauteur fixe pour l'image */
    background-size: cover;
    background-position: center;
    filter: grayscale(100%);
    transition: filter 0.5s ease;
}

.rfd-formation-card:hover .rfd-card-image {
    filter: grayscale(0%) brightness(70%);
}



.rfd-card-image.rfd-no-image {
    background-image: url('/wp-content/uploads/2022/02/gsf-vision2.jpg');
    background-repeat: no-repeat;
    background-position: center;
}

.rfd-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    /* height: 100%; */
    background-color: rgba(255, 255, 255, 0.8) !important;
    color: #333;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    opacity: 0;
    /* Caché par défaut */
    transition: opacity 0.3s ease;
    padding: 15px;
    box-sizing: border-box;
}

.rfd-formation-card:hover .rfd-card-overlay {
    opacity: 1;
    /* Apparaît au survol */
}

.rfd-card-title {
    margin: 0 0 10px 0;
    text-align: center;
    font-size: 18px;
    line-height: 20px;
    font-weight: normal;
    color: #333;
    font-weight: 600;
}

.rfd-card-description {
    font-size: 0.9em;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    /* Limite la description à 3 lignes */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Styles pour la pagination */
.rfd-pagination {
    margin-top: 30px;
    text-align: center;
}

.rfd-pagination.loading {
    opacity: 0.5;
    pointer-events: none;
}

.rfd-pagination .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 4px;
    border: 1px solid var(--color-blue);
    color: var(--color-blue);
    text-decoration: none;
    transition: all 0.3s ease;
    min-width: 50px;
}

.rfd-pagination .page-numbers:hover {
    background-color: transparent;
    color: var(--color-green);
}

.rfd-pagination .page-numbers.current {
    background-color: transparent;
    color: var(--color-green);
    border-color: var(--color-green);
}

/*
 * Styles pour le shortcode [ranc-categorie]
 */

.ranc-categories-wrapper {
    text-align: center;
    margin-bottom: 40px;
}

.ranc-categories-title {
    font-size: 2em;
    color: var(--color-blue);
    /* Adapte la couleur à ta charte graphique */
    margin-bottom: 30px;
}

.ranc-categories-container {
    padding: 30px 0;
    display: flex;
    /* justify-content: center;  */
    align-items: flex-start;
    /* Aligne les éléments en haut */
    flex-wrap: wrap;
    /* Permet aux éléments de passer à la ligne sur petits écrans */
    gap: 20px;
    /* Espace entre les éléments */
}

.ranc-category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #333;
    /* Couleur du texte par défaut */
    width: min(100%, 220px);
    /* Largeur fixe pour chaque élément */
    transition: transform 0.3s ease, color 0.3s ease;
}

.ranc-category-item:hover {
    transform: translateY(-5px);
    /* Effet de lévitation au survol */
    color: var(--color-blue);
    /* Change la couleur du texte au survol */
}

.ranc-category-icon {
    height: 60px;
    /* Hauteur fixe pour les icônes */
    width: auto;
    /* Largeur automatique pour garder les proportions */
    margin-bottom: 15px;
    object-fit: contain;
}

.ranc-category-title {
    font-size: 1em;
    font-weight: 600;
    line-height: 1.1;
}

.rfd-home-grid .category-img {
    height: 100%;
    width: auto;
}

.rfd-home-grid .rfd-card-overlay {
    height: 100%;
    opacity: 1 !important;
    background-color: #0000007a !important;
}

.rfd-home-grid .round-card {
    height: 80px;
    width: 80px;
    background-color: #fff;
    border-radius: 50%;
    padding: 10px;
    margin-bottom: 30px;
}

.rfd-home-grid .rfd-card-title {
    color: #fff;
}

.rfd-home-grid .fiche-btn {
    background-color: var(--color-green);
    color: #fff;
    padding: 5px 15px;
    text-decoration: none;
    border-radius: 50px;
    margin-top: 15px;
    border: 1px solid var(--color-green);
    cursor: pointer;
    display: none;
    transition: 0.5s all ease;
    font-size: 14px;
}

.rfd-home-grid .fiche-btn:hover {
    background-color: #fff;
    color: var(--color-green);
    border: 1px solid var(--color-green)
}

.rfd-home-grid {
    transition: 0.5s all ease;
}

.rfd-home-grid>a:hover .fiche-btn {
    display: inline-block;
}

.rfd-home-grid>a:hover .round-card {
    display: none;
}

.rfd-home-grid>a:hover .rfd-card-image {
    filter: grayscale(0%) brightness(60%);
}

/* .rfd-home-grid > a{
    transition: 0.5s all ease-in-out;
}

.rfd-home-grid > a:hover{
    transform: rotateY(360deg);

} */

.rfd-home-grid .rfd-card-image {
    filter: grayscale(0%) brightness(100%);
}

/* Media Queries pour la responsivité */

/* Tablette (2 par ligne) */
@media (max-width: 992px) {

    .rfd-formations-grid {
        display: grid;
    }

    .rfd-formations-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .rfd-filters {
        flex-wrap: wrap;
    }

    .ranc-categories-container{
        justify-content: center;
    }
}

/* Mobile (1 par ligne) */
@media (max-width: 576px) {
    .rfd-formations-grid {
        grid-template-columns: 1fr;
    }

    .rfd-filter-button {
        display: block;
        width: calc(100% - 10px);
        margin: 5px auto;
    }
}