.hdp__home_mosaique {
    display: flex;
    flex-direction: column;
    gap: 16px;

    @media (min-width: 768px) {
        height: 560px;
        display: grid;
        grid-template-columns: 3fr 2fr;
        grid-template-rows: 1fr 1fr;
    }

    .hdp__home_mosaique_item {
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;

        &:not(.first) {
            &>a {
                padding: 20px;
                height: 100%;
                display: flex;
                width: 100%;
                align-items: end;
                text-decoration: none !important;
                position: relative;
                transition: all 0.3s ease;

                &:after {
                    content: "";
                    position: absolute;
                    top: 0;
                    left: 0;
                    width: 100%;
                    height: 100%;
                    background: linear-gradient(180deg, rgba(89, 165, 208, 0) 0%, rgba(0, 56, 103, 0.9) 100%);
                    transition: opacity 0.3s ease;
                    opacity: 1;
                }

                &:hover {
                    &:after {
                        opacity: 0.7;
                    }

                    span {
                        &.btnorange {
                            background-color: #fff !important;
                            color: #003867 !important;
                            border-color: #003867 !important;
                            font-weight: 600;
                        }
                    }
                }

                .hdp__home_mosaique_item_content {
                    * {
                        position: relative;
                        z-index: 2;

                        &:not(.btnorange) {
                            color: #fff;
                        }

                        &.btnorange {
                            padding: 5px 12px;
                        }
                    }

                    h3 {
                        margin: 5px 0 13px 0;
                        font-size: 16px;
                        line-height: 18px;
                    }

                    span {
                        &:not(.btnorange) {
                            font-weight: 300;
                            font-size: 14px;
                            line-height: 16px;
                        }
                    }
                }
            }
        }

        &.first {
            grid-column: 1;
            grid-row: 1;
            height: fit-content;

            &>h2 {
                margin: 0;

                @media (min-width: 1200px) {
                    font-size: 32px;
                    line-height: 36px;
                    padding-right: 15px;
                }
            }
        }

        &:not(.hdp__home_mosaique_item--main) {
            &>a {
                @media (min-width: 768px) {
                    padding: 32px !important;
                }
            }
        }

        &.hdp__home_mosaique_item--main {
            grid-row: 1 / span 2;
            position: relative;
            grid-column: 1;

            @media (min-width: 768px) {
                margin-top: 90px;

                &>a {
                    padding: 40px;
                }

                .hdp__home_mosaique_item_content {
                    h3 {
                        font-size: 24px !important;
                        line-height: 26px !important;
                    }

                    span {
                        &:not(.btnorange) {
                            font-size: 16px !important;
                            line-height: 20px !important;
                        }
                    }
                }
            }
        }
    }
}

#event {
    padding: 0 !important;
}

#resultat {
    z-index: 9999;
    position: relative;
    margin-bottom: 40px;
}

.linkedin_afu_feed {
    /* background-color: #F0F2F5 !important;
        height: 400px; */
    width: 100%;

    @media only screen and (min-width: 320px) {
        margin: 20px auto 0;
    }

    @media only screen and (min-width: 600px) {
        margin: 30px auto 0;
    }

    @media only screen and (min-width: 600px) {
        margin: 20px auto 0;
    }

    @media only screen and (min-width: 1200px) {
        margin: 30px auto 0;
    }

    @media only screen and (min-width: 1600px) {
        margin: 50px auto 0;
    }
}

#afu_tv {
    .hdp__home_mosaique_item {
        height: 300px;
        width: 100%;
        display: block;
        position: relative;
        background-size: cover;
        background-position: center;
        text-decoration: none;

        @media (min-width: 768px) {
            height: 500px;
        }

        a {
            height: 100%;
            width: 100%;
            display: flex;
            align-items: flex-end;
            text-decoration: none !important;
            position: relative;

            &:before {
                content: "";
                position: absolute;
                inset: 0;
                background: linear-gradient(180deg, rgba(89, 165, 208, 0.47) 0%, rgba(0, 56, 103, 0.9) 100%);
                opacity: 1;
                transition: opacity 0.3s ease;
                z-index: 0;
            }

            &:hover {
                &:before {
                    opacity: 0.8;
                }

                .btnorange {
                    background-color: #fff !important;
                    color: #003867 !important;
                    border-color: #003867 !important;
                    font-weight: 600;
                }
            }

            .hdp__home_mosaique_item_content {
                position: relative;
                z-index: 2;
                height: 100%;
                width: 100%;
                display: flex;
                align-items: end;
                padding: 0 10px;

                @media (min-width: 992px) {
                    padding: 40px 60px;
                }

                .title_content {
                    position: relative;
                    z-index: 5;
                }

                * {
                    color: #fff;
                }

                h3 {
                    margin: 5px 0 13px;
                    font-weight: 700;

                    @media (min-width: 1200px) {
                        font-size: 32px;
                        line-height: 36px;
                    }
                }

                .type {
                    display: inline-block;
                    padding: 5px 12px;
                    font-size: 12px;
                    margin: 0 0 10px 0;
                }

                .btnorange {
                    margin-top: 10px;
                    display: inline-block;
                    padding: 5px 12px;
                }

                &:after {
                    @media (max-width: 992px) {
                        top: 15px !important;
                        left: unset !important;
                        right: 15px !important;
                    }
                }
            }
        }
    }
}

.sidebar {
    display: flex;
    flex-direction: column;

    &>div {

        &:first-child,
        &:nth-child(2) {
            margin: 0 !important;
        }

        &:empty {
            display: none !important;
        }

        &:has(>.afu_liens_divers) {
            order: -1;
        }
    }

    /* div {
        &:has(.adsidebar) {
            display: none !important;
        }
    } */

    .afu_liens_divers {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin: 0 0 40px 0;

        &.socials {
            margin: 40px 0 0 0 !important;
        }

        .btnorange {
            &.fiches_infos {
                display: flex;
                justify-content: center;
                gap: 8px;
                font-weight: 600;

                &:not(:hover) {
                    background-color: #fff !important;
                    color: #f06450 !important;

                    span {
                        &:before {
                            background-color: #f06450 !important;
                        }
                    }
                }

                &:hover {
                    background-color: #f06450 !important;
                    color: #fff !important;

                    span {
                        &:before {
                            background-color: #fff !important;
                        }
                    }
                }

                span {
                    &:before {
                        content: '';
                        display: inline-block;
                        width: 40px;
                        height: 10px;
                        transition: all 0.3s ease;
                    }
                }
            }

            &.blue {
                border-color: #006BB3 !important;

                &:not(:hover) {
                    background-color: #006BB3 !important;
                }

                &:hover {
                    background-color: #fff !important;
                    color: #006BB3 !important;
                }
            }

            &.blue_two,
            &.red {
                display: flex;
                justify-content: center;
                gap: 8px;
                font-weight: 600;

                span {
                    &:before {
                        content: '';
                        width: 20px;
                        height: 20px;
                        display: inline-block;
                        object-fit: contain;
                    }
                }
            }

            &.blue_two {
                border-color: #0E76A8 !important;

                &:not(:hover) {
                    background-color: #0E76A8 !important;
                }

                &:hover {
                    background-color: #003867 !important;
                    color: #fff !important;
                }

                span {
                    &:before {
                        background-image: url('../img/in_newhome.svg');
                    }
                }
            }

            &.red {
                border-color: #CD201F !important;

                &:not(:hover) {
                    background-color: #CD201F !important;
                }

                &:hover {
                    background-color: #003867 !important;
                    color: #fff !important;
                }

                span {
                    &:before {
                        background-image: url('../img/yt_newhome.svg');
                    }
                }
            }
        }
    }
}


.campagnes_prevention {
    width: 100%;
    position: relative;
    overflow: hidden;
}

.campagnes_prevention ul {
    display: flex;
    padding: 0;
    margin: 0;
    list-style: none;
    transition: transform 0.5s ease-in-out;
    /* Largeur = nb total de slides × (100% / 4 visibles) */
    /* Géré dynamiquement en JS */

    @media (min-width: 992px) {
        height: 240px;
    }
}

.campagnes_prevention ul li {
    /* 4 slides visibles */
    list-style: none;
    padding: 10px;
    /* espacement entre slides, optionnel */
    box-sizing: border-box;
}

.campagnes_prevention ul li img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

/* Nav dots */
#slidenav-prevention {
    display: none !important;
    text-align: center;
    margin-top: 16px;
    height: 40px;
}

#slidenav-prevention .slidenav-prevention {
    display: inline-block;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transform: scale(0.5);
    transition: all 0.4s ease-in-out;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
    cursor: pointer;
    margin: 0 3px;
}

#slidenav-prevention .slidenav-prevention:hover,
#slidenav-prevention .slidenav-prevention.activebtn-prevention {
    background: #f06450;
    transform: scale(1);
}

.btnnavslider-prevention {
    width: 26px;
    height: 26px;
    top: 52%;
    position: absolute;
    z-index: 10;
    text-indent: -9999px;
    cursor: pointer;
    background-color: #f06450;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% auto;
    transition: All 0.4s ease-in-out;
    -webkit-transition: All 0.4s ease-in-out;
    -moz-transition: All 0.4s ease-in-out;
    -o-transition: All 0.4s ease-in-out;
    -ms-transition: All 0.4s ease-in-out;
    transform: translateY(50%);
}

#prev-prevention {
    left: 0;
    border-radius: 0 50% 50% 0;
    background-image: url(../img/prevslidebar.png);
}

#next-prevention {
    right: 0;
    border-radius: 50% 0 0 50%;
    background-image: url(../img/nextslidebar.png);
}

.btnnavslider-prevention:hover {
    background-color: #00365a;
}

#prev-prevention {
    left: 0px;
}

#next-prevention {
    right: 0px;
}

.page-template-home_new .adheader {
    margin: 0 !important;
}

.page-template-home_new:has(.adheader:not(:empty)) .hdp__home_mosaique_wrapper {
    margin-top: 20px;

    @media (min-width: 992px) {
        margin-top: 50px;
    }
}

/* AKN MEP 10/2026 (par Max) : la popup d'accueil doit passer au-dessus de #resultat (z-index 9999) */
.popup__connexion {
    z-index: 100000;
}
