.fancybox__container {
    --fancybox-bg: #27272a;

    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(100px, 44vw, 1000px) 46px;
    grid-template-rows: minmax(0, 1fr);
}

.fancybox__container.is-opening {
    --f-transition-duration: 0.25s;
    --f-transition-easing: ease-out;
    --f-transition-delay: 0.1s;
}

.fancybox__container.is-closing {
    --f-transition-duration: 0.1s;
}

.fancybox__toolbar {
    --f-button-color: #353639;
    --f-button-hover-color: #1285b3;
    --f-button-bg: #e6ca17;
    --f-button-hover-bg: #e6ca17;
    --f-button-active-bg: #444;

    grid-column: 3 / 3;
    grid-row: 1 / 3;

    background: #e6ca17;
}

.fancybox__caption {
    grid-column: 2 / 3;
    grid-row: 1 / 3;

    height: 100%;
    overflow: auto;

    padding: 1rem 1.5rem;
    background: #ffffff;
    color: #353639;

    display: flex;
    align-items: center;   /* centrage vertical */
}

.fancybox__caption_content{
    display: block;
}
.fancybox__caption h4 {
    color: #353639;
}

/* Ajouts perso */

.fancy__title {
    display: flex;
    align-items: center; /* alignement vertical */
    justify-content: center; /* alignement horizontal */
    gap: 15px;            /* espace entre image et texte */
    padding-bottom: 20px;
}


/* resize du logo-texte  */


/*.fancybox__caption .mil-scale-img {
    transform: scale(0.2) !important;
    width: 100%;
}*/
.fancybox__caption .mil-hero-1 {
    transform: scale(0.2); /* Ajustez cette valeur : 0.3, 0.4, 0.5, etc. */
    transform-origin: center;
    /* Réduit l'espace vertical réservé - ajustez cette valeur */
    margin-top: -350px;
    margin-right: 0;
    margin-left: 0;
    margin-bottom: -180px;
}

.mil-hero-1 .mil-hero-main {
    height: 65vh ;
}
/* Empêcher les retours à la ligne dans le logo */
.fancybox__caption .mil-hero-text {
    width: max-content; /* Garde tout sur une ligne */
}

.fancybox__caption .mil-word-frame {
    white-space: nowrap; /* Force les mots à rester sur une ligne */
}
/* Réduire l'écart entre le logo et le titre suivant */
.fancy__title:first-child {
    padding-bottom: 5px; /* Réduit de 20px à 5px */
    margin-bottom: -10px; /* Ajoute une marge négative pour rapprocher */
}

.fancy__text {

}

/* n'existe pas en v5 */
.fancybox-light {
    --fancybox-bg: #ffffff;
    --fancybox-color: #111111;

    --fancybox-toolbar-bg: #f5f5f5;
    --fancybox-toolbar-color: #111111;

    --fancybox-caption-bg: #ffffff;
    --fancybox-caption-color: #111111;

    --fancybox-button-bg: transparent;
    --fancybox-button-color: #111111;

    --fancybox-button-hover-bg: rgba(0,0,0,.05);
    --fancybox-button-hover-color: #000;

    --fancybox-backdrop-bg: rgba(255,255,255,0.95);
}

/* ============================================
   RESPONSIVE : Mobile (<800px)
   ============================================ */
@media (max-width: 800px) {
    .fancybox__container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    /* Carousel en premier (en haut) */
    .fancybox__carousel {
        grid-column: 1 / 2;
        grid-row: 1 / 2;
        width: 100%;
        max-height: 40vh;
        overflow: hidden;
    }

    /* S'assurer que l'image dans le carousel s'adapte */
    .fancybox__carousel img {
        width: 100% !important;
        height: auto !important;
        max-height: 40vh;
        object-fit: contain;
    }

    /* Caption en dessous */
    .fancybox__caption {
        grid-column: 1 / 2;
        grid-row: 2 / 3;
        width: 100%;
        height: auto;
        max-height: 60vh;
        padding: 1rem;
        overflow-y: auto;
        align-items: flex-start; /* Alignement en haut au lieu du centre */
        justify-content: flex-start; /* Justification en haut */
    }

    /* S'assurer que le contenu du caption prend toute la largeur */
    .fancybox__caption_content {
        width: 100%;
        max-width: 100%;
    }

    /* Masquer toolbar et footer sur mobile */
    /*.fancybox__toolbar,*/
    .fancybox__footer {
        display: none;
    }

    /* Ajustements pour le titre sur mobile */
    .fancy__title {
        flex-direction: column;
        gap: 10px;
    }

    .fancy__title img {
        display: none; /* Cache le logo sur mobile */
    }

    .fancy__title h4 {
        font-size: 1.2rem;
        text-align: center;
    }

    /* Ajuster les paragraphes pour mobile */
    .fancybox__caption p {
        font-size: 0.9rem;
        line-height: 1.5;
        word-wrap: break-word;
    }

    /* pas de logo dans la presentation des colistiers*/
    #logo {
        display: none !important;
    }
}

/* pas de logo sur les écrans de faible hauteur */
@media (max-height: 950px) {
    /* pas de logo dans la presentation des colistiers*/
    #logo {
        display: none !important;
    }
}

/* =========================
   Fancybox vidéo
   ========================= */

.fancybox-video {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
}

.fancybox-video .fancybox__carousel {
    grid-column: 1 / -1;
    grid-row: 1 / -1;
}

.fancybox-video .fancybox__caption,
.fancybox-video .fancybox__toolbar,
.fancybox-video .fancybox__footer {
    display: none;
}

.fancybox-video .fancybox__slide {
    padding: 24px;
}

.fancybox-video .fancybox__content {
    background: transparent;
    padding: 0;
}

.fancy-video-modal {
    position: relative;
    width: min(92vw, 900px);
    max-width: 900px;
    padding: 52px 16px 16px 16px;
    box-sizing: border-box;
    background: #ffffff;
    border-radius: 16px;
}

.fancy-video-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
}

.fancy-video-wrap video {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    background: #000;
}

.fancy-video-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 20;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 999px;
    background: #e6ca17;
    color: #353639;
    font-size: 26px;
    line-height: 38px;
    text-align: center;
    cursor: pointer;
}

.fancy-video-close:hover {
    opacity: 0.9;
}

@media (max-width: 800px) {
    .fancybox-video .fancybox__slide {
        padding: 12px;
    }

    .fancy-video-modal {
        width: 96vw;
        padding: 48px 10px 10px 10px;
    }

    .fancy-video-wrap video {
        max-height: 70vh;
    }
}
