/* Video de presentation de l'espace eleve (popup + bouton d'en-tete). */
/* La remise a zero globale `* { margin: 0 }` de main.css annule le `margin: auto` natif
   des <dialog> modales : on le retablit pour que la popup soit centree dans la fenetre. */
.cl-video-dialog {
    position: fixed;
    inset: 0;
    margin: auto;
    height: fit-content;
    border: 0;
    padding: 0;
    background: transparent;
    width: min(960px, calc(100vw - 24px));
    max-width: none;
    max-height: calc(100vh - 24px);
    overflow: visible;
}
.cl-video-dialog::backdrop {
    background: rgba(13, 31, 51, 0.62);
    transition: opacity 0.6s ease;
}
.cl-video-dialog.is-closing::backdrop {
    opacity: 0;
}
.cl-video-dialog[open] .cl-video-dialog__panel {
    animation: cl-video-in 0.28s ease-out;
}
.cl-video-dialog__panel {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(13, 31, 51, 0.35);
    overflow: hidden;
    transform-origin: center center;
    will-change: transform, opacity;
}
.cl-video-dialog__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0.75rem 0.75rem 1.25rem;
}
.cl-video-dialog__title {
    margin: 0;
    font-size: 1.15rem;
    line-height: 1.3;
    color: #0d1f33;
}
.cl-video-dialog__close {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: #f1f4f8;
    color: #0d1f33;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
}
.cl-video-dialog__close:hover,
.cl-video-dialog__close:focus-visible {
    background: #e2e8f0;
    outline: 2px solid #1d4e93;
    outline-offset: 2px;
}
.cl-video-dialog__body {
    background: #000;
}
.cl-video-dialog__video {
    display: block;
    width: 100%;
    height: auto;
    max-height: calc(100vh - 160px);
    aspect-ratio: 16 / 9;
    background: #000;
}
.cl-video-dialog__hint {
    margin: 0;
    padding: 0.7rem 1.25rem 0.9rem;
    font-size: 0.85rem;
    color: #5f7390;
}

/* Le bouton pulse apres la fermeture pour montrer ou retrouver la video. */
.cl-video-btn--pulse {
    animation: cl-video-pulse 0.85s ease-in-out 3;
    border-color: #ef7027 !important;
    color: #ef7027 !important;
}

@keyframes cl-video-in {
    from { transform: translateY(16px) scale(0.97); opacity: 0; }
    to { transform: none; opacity: 1; }
}
@keyframes cl-video-pulse {
    0% { box-shadow: 0 0 0 0 rgba(239, 112, 39, 0.55); transform: scale(1); }
    50% { box-shadow: 0 0 0 10px rgba(239, 112, 39, 0); transform: scale(1.08); }
    100% { box-shadow: 0 0 0 0 rgba(239, 112, 39, 0); transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .cl-video-dialog[open] .cl-video-dialog__panel,
    .cl-video-btn--pulse {
        animation: none;
    }
}

/* Accueil : bouton play pose sur la photo du bloc "Professeurs & IA" (ajoute par presentation-video.js).
   Le bouton couvre toute la photo (toute l'image est cliquable) avec un voile sombre pour faire ressortir
   la pastille, centree exactement au milieu de l'image ; le libelle est place juste en dessous. */
.cl-video-play-host {
    position: relative;
}
/* Le bloc texte blanc reste toujours au-dessus de la photo et de son voile. */
.about-section-8 .about-content-8 {
    z-index: 3;
}
.cl-video-play {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: inherit;
    background: radial-gradient(circle at center, rgba(13, 31, 51, 0.25) 0%, rgba(13, 31, 51, 0.55) 100%);
    color: #fff;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.cl-video-play::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(13, 31, 51, 0.15);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}
.cl-video-play:hover::before,
.cl-video-play:focus-visible::before {
    opacity: 1;
}
.cl-video-play__icon {
    position: relative;
    width: 116px;
    height: 116px;
    border-radius: 50%;
    background: #ef7027;
    border: 4px solid #fff;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7), 0 14px 36px rgba(0, 0, 0, 0.45);
    transition: transform 0.2s ease;
    animation: cl-video-play-ring 2s ease-out infinite;
}
.cl-video-play__icon::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    margin-left: 5px;
    transform: translate(-50%, -50%);
    border-style: solid;
    border-width: 20px 0 20px 32px;
    border-color: transparent transparent transparent #fff;
}
.cl-video-play__label {
    position: absolute;
    left: 50%;
    top: calc(50% + 76px);
    transform: translateX(-50%);
    padding: 0.6rem 1.35rem;
    border-radius: 999px;
    background: #fff;
    color: #0d1f33;
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
}
.cl-video-play:hover .cl-video-play__icon,
.cl-video-play:focus-visible .cl-video-play__icon {
    transform: scale(1.1);
}
.cl-video-play:focus-visible {
    outline: 4px solid #fff;
    outline-offset: -10px;
}
/* Apres fermeture, c'est la pastille qui pulse. */
.cl-video-play.cl-video-btn--pulse {
    animation: none;
    border-color: transparent !important;
    color: #fff !important;
}
.cl-video-play.cl-video-btn--pulse .cl-video-play__icon {
    animation: cl-video-pulse 0.85s ease-in-out 3;
}
@media (max-width: 575.98px) {
    .cl-video-play__icon {
        width: 80px;
        height: 80px;
        border-width: 3px;
    }
    .cl-video-play__icon::after {
        margin-left: 4px;
        border-width: 14px 0 14px 22px;
    }
    .cl-video-play__label {
        top: calc(50% + 54px);
        padding: 0.45rem 1rem;
        font-size: 0.9rem;
    }
}
@keyframes cl-video-play-ring {
    0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7), 0 14px 36px rgba(0, 0, 0, 0.45); }
    70% { box-shadow: 0 0 0 26px rgba(255, 255, 255, 0), 0 14px 36px rgba(0, 0, 0, 0.45); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0), 0 14px 36px rgba(0, 0, 0, 0.45); }
}
@media (prefers-reduced-motion: reduce) {
    .cl-video-play__icon,
    .cl-video-play.cl-video-btn--pulse .cl-video-play__icon {
        animation: none;
        transition: none;
    }
}
