/* =====================================================
   Fullscreen Slider — styles fixes
   ===================================================== */

/* ── Wrapper — référence de positionnement pour le titre ── */
.cb-slideshow-wrapper {
    position: relative;
    width: 100%;
    height: 100vh;
}

.cb-slideshow {
    position: relative;
    width: 100%;
    height: 100%;
    top: 0px;
    left: 0px;
    z-index: 0;
    list-style: none;
    margin: 0;
    padding: 0;
}

.cb-slideshow:after {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0px;
    left: 0px;
    z-index: 2;
    content: '';
    background: transparent url('../img/pattern.png') repeat top left;
    pointer-events: none;
}

.cb-slideshow li {
    list-style: none;
}

.cb-slideshow li span {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0px;
    left: 0px;
    color: transparent;
    background-size: cover;
    background-position: 50% 50%;
    background-repeat: no-repeat;
    opacity: 0;
    z-index: 0;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-animation: imageAnimation 36s linear infinite 0s;
    -moz-animation: imageAnimation 36s linear infinite 0s;
    -o-animation: imageAnimation 36s linear infinite 0s;
    -ms-animation: imageAnimation 36s linear infinite 0s;
    animation: imageAnimation 36s linear infinite 0s;
}

/* ── Div titre unique — positionné par rapport au wrapper ── */
.cb-slideshow-title {
    position: absolute;
    bottom: 10px;
    left: 0px;
    width: 100%;
    display: flex;
    justify-content: flex-end;
    z-index: 1000;
    pointer-events: none; /* le conteneur est inerte */
    opacity: 0;
    transform: translateX(200px);
}

/* Classe ajoutée par JS au changement de slide */
.cb-slideshow-title.cb-title-visible {
    animation: titleAnimation 6s linear forwards;
}

.cb-slideshow-title h3 {
    margin: 0;
    padding: 0 1rem;
    font-size: 1rem;
    line-height: 2rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: bold;
    text-transform: uppercase;
}

.cb-slideshow-title h3 a {
    font-size: 1rem;
    line-height: 2rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: bold;
    text-transform: uppercase;
    text-decoration: none;
    display: inline-block;
    pointer-events: auto; /* toujours cliquable — un seul lien existe */
}

.cb-slideshow-title h3 a:hover {
    color: var(--yellow);
}

/* ── Keyframes images (valeurs originales pour 6s/slide)
      Écrasées par le CSS dynamique si $time != 6 ── */

@-webkit-keyframes imageAnimation {
    0%   { opacity: 0; -webkit-animation-timing-function: ease-in; }
    8%   { opacity: 1; -webkit-transform: scale(1.05); -webkit-animation-timing-function: ease-out; }
    17%  { opacity: 1; -webkit-transform: scale(1.1) rotate(3deg); }
    25%  { opacity: 0; -webkit-transform: scale(1.1) rotate(3deg); }
    100% { opacity: 0; }
}
@keyframes imageAnimation {
    0%   { opacity: 0; animation-timing-function: ease-in; }
    8%   { opacity: 1; transform: scale(1.05); animation-timing-function: ease-out; }
    17%  { opacity: 1; transform: scale(1.1) rotate(3deg); }
    25%  { opacity: 0; transform: scale(1.1) rotate(3deg); }
    100% { opacity: 0; }
}

/* ── Keyframe titre — entrée depuis la droite, sortie vers la gauche ── */
@keyframes titleAnimation {
    0%   { opacity: 0; transform: translateX(200px); }
    8%   { opacity: 1; transform: translateX(0px); }
    82%  { opacity: 1; transform: translateX(0px); }   /* visible jusqu'à 6.56s */
    97%  { opacity: 0; transform: translateX(-400px); } /* disparition en 1.2s */
    100% { opacity: 0; transform: translateX(-400px); }

}

/* ── Cas 1 seul slide ── */
.cb-slideshow.fsl-single li span {
    -webkit-animation: imageAnimationSingle 20s ease-out forwards;
    animation: imageAnimationSingle 20s ease-out forwards;
}
@keyframes imageAnimationSingle {
    0%   { opacity: 0; animation-timing-function: ease-in; }
    8%   { opacity: 1; transform: scale(1.05); animation-timing-function: ease-out; }
    100% { opacity: 1; transform: scale(1.1) rotate(3deg); }
}
.cb-slideshow.fsl-single + .cb-slideshow-title {
    animation: titleAnimationSingle 20s ease-out forwards;
    opacity: 0;
}
@keyframes titleAnimationSingle {
    0%   { opacity: 0; transform: translateX(200px); }
    8%   { opacity: 1; transform: translateX(0px); }
    100% { opacity: 1; transform: translateX(0px); }
}

/* ── Mobile ── */
@media screen and (max-width: 768px) {
    .cb-slideshow-title {
        display: none;
    }
}
