/* ============================================================
   Slideshow Pro — Public CSS  v1.0.0
   ============================================================ */

/* ---- Wrapper & viewport ---------------------------------- */

.sp-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #111;
    -webkit-user-select: none;
    user-select: none;
    /* 3D context for flip/cube transitions */
    transform-style: preserve-3d;
}

/* Ratio mode — intrinsic aspect ratio */
.sp-wrapper.sp-ratio .sp-viewport {
    padding-top: var(--sp-ratio-pad, 56.25%); /* default 16:9 */
    height: 0;
    position: relative;
}

/* Custom height mode */
.sp-wrapper.sp-custom-h .sp-viewport {
    height: var(--sp-custom-h, 500px);
    position: relative;
}

/* ---- Slides ---------------------------------------------- */

.sp-viewport {
    width: 100%;
}

.sp-slide {
    position: absolute;
    inset: 0;
    display: none;
    overflow: hidden;
}

.sp-slide.sp-active {
    display: block;
    z-index: 1;
}

/* ---- Background image ------------------------------------ */

.sp-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    will-change: transform;
}

/* ---- Colour overlay -------------------------------------- */

.sp-color-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

/* ---- Superposed image ------------------------------------ */

.sp-overlay-img {
    position: absolute;
    z-index: 6;              /* au-dessus du color overlay (2) et du texte (5) */
    pointer-events: none;
    display: block !important;
    visibility: visible !important;
}

.sp-overlay-img img {
    display: block !important;
    width: var(--sp-oi-w, 120px);
    height: auto;
    max-width: 50%;
}

/* Positions */
.sp-oi-top-left     { top: 16px;    left: 16px; }
.sp-oi-top-right    { top: 16px;    right: 16px; }
.sp-oi-bottom-left  { bottom: 16px; left: 16px; }
.sp-oi-bottom-right { bottom: 16px; right: 16px; }
.sp-oi-center       { top: 50%; left: 50%; transform: translate(-50%,-50%); }

/* ---- Text layer ------------------------------------------ */

.sp-text {
    position: absolute;
    z-index: 5;
    padding: clamp(14px, 4%, 40px);
    max-width: min(680px, 90%);
    pointer-events: none;
}

.sp-text a { pointer-events: auto; }

/* Text positions */
.sp-text-top-left     { top: 0;    left: 0; }
.sp-text-top-center   { top: 0;    left: 50%; transform: translateX(-50%); text-align: center; }
.sp-text-top-right    { top: 0;    right: 0;  text-align: right; }
.sp-text-center       { top: 50%;  left: 50%; transform: translate(-50%,-50%); text-align: center; }
.sp-text-bottom-left  { bottom: 0; left: 0; }
.sp-text-bottom-center{ bottom: 0; left: 50%; transform: translateX(-50%); text-align: center; }
.sp-text-bottom-right { bottom: 0; right: 0;  text-align: right; }

.sp-title {
    margin: 0 0 .35em;
    font-weight: 700;
    line-height: 1.15;
    color: inherit !important;   /* empêche Divi/thème d'écraser la couleur */
    text-shadow: 0 2px 12px rgba(0,0,0,.45);
    opacity: 0;
}

.sp-subtitle {
    margin: 0 0 .9em;
    line-height: 1.5;
    font-weight: 400;
    color: inherit !important;   /* idem */
    text-shadow: 0 1px 6px rgba(0,0,0,.4);
    opacity: 0;
}

/* ---- CTA button ------------------------------------------ */

.sp-cta {
    display: inline-block;
    padding: .55em 1.5em;
    border-radius: 3px;
    font-weight: 600;
    font-size: .95em;
    text-decoration: none;
    cursor: pointer;
    transition: opacity .2s, transform .2s;
    opacity: 0;
}

.sp-cta:hover { opacity: .85 !important; transform: translateY(-1px); }

.sp-cta-solid {
    background: currentColor;
    color: inherit;
}

/* trick: inner span carries text so background uses currentColor */
.sp-cta-solid {
    background: rgba(255,255,255,.9);
    color: #111;
}

.sp-cta-outline {
    background: transparent;
    border: 2px solid currentColor;
    color: inherit;
}

.sp-cta-text {
    background: transparent;
    padding-left: 0;
    padding-right: 0;
    text-decoration: underline;
    color: inherit;
}

/* ---- Navigation arrows ----------------------------------- */

.sp-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(0,0,0,.35);
    border: none;
    color: #fff;
    font-size: clamp(24px, 4vw, 42px);
    width: clamp(36px, 5vw, 56px);
    height: clamp(36px, 5vw, 56px);
    border-radius: 50%;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, opacity .2s;
    opacity: 0;
    padding: 0;
}

.sp-wrapper:hover .sp-arrow { opacity: 1; }
.sp-arrow:hover { background: rgba(0,0,0,.62); }

.sp-prev { left: clamp(8px, 2%, 20px); }
.sp-next { right: clamp(8px, 2%, 20px); }

/* ---- Bullets --------------------------------------------- */

.sp-bullets {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 8px;
    align-items: center;
}

.sp-bullet {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,.5);
    border: 2px solid rgba(255,255,255,.8);
    cursor: pointer;
    padding: 0;
    transition: background .2s, transform .2s;
}

.sp-bullet.sp-active {
    background: #fff;
    transform: scale(1.3);
}

/* ============================================================
   TEXT ANIMATIONS
   ============================================================ */

/* Fade In */
@keyframes sp-fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Fade In Up */
@keyframes sp-fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Fade In Down */
@keyframes sp-fadeInDown {
    from { opacity: 0; transform: translateY(-24px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Slide In Left */
@keyframes sp-slideInLeft {
    from { opacity: 0; transform: translateX(-40px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Slide In Right */
@keyframes sp-slideInRight {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Zoom In */
@keyframes sp-zoomIn {
    from { opacity: 0; transform: scale(.8); }
    to   { opacity: 1; transform: scale(1); }
}

.sp-anim-fadeIn      { animation: sp-fadeIn       .6s ease forwards; }
.sp-anim-fadeInUp    { animation: sp-fadeInUp      .7s ease forwards; }
.sp-anim-fadeInDown  { animation: sp-fadeInDown    .7s ease forwards; }
.sp-anim-slideInLeft { animation: sp-slideInLeft   .7s ease forwards; }
.sp-anim-slideInRight{ animation: sp-slideInRight  .7s ease forwards; }
.sp-anim-zoomIn      { animation: sp-zoomIn        .7s ease forwards; }

/* ============================================================
   KEN BURNS
   ============================================================ */

@keyframes sp-kenburns {
    0%   { transform: scale(1)    translate(0,  0);    }
    50%  { transform: scale(1.08) translate(-1%,-1%);  }
    100% { transform: scale(1.12) translate(1%, .5%);  }
}

.sp-wrapper[data-transition="kenburns"] .sp-slide.sp-active .sp-bg {
    animation: sp-kenburns var(--sp-kb-dur, 6000ms) ease-in-out forwards;
}

/* ============================================================
   GLITCH — keyframe used by JS
   ============================================================ */

@keyframes sp-glitch-out {
    0%   { clip-path: inset(0 0 100% 0); transform: translate(0); filter: none; }
    10%  { clip-path: inset(30% 0 40% 0); transform: translate(-6px, 2px); filter: hue-rotate(90deg); }
    20%  { clip-path: inset(60% 0 10% 0); transform: translate(6px, -3px); filter: hue-rotate(-90deg); }
    30%  { clip-path: inset(10% 0 70% 0); transform: translate(-4px, 0); filter: brightness(1.6); }
    40%  { clip-path: inset(80% 0 5%  0); transform: translate(4px, 2px); filter: none; }
    50%  { clip-path: inset(20% 0 55% 0); transform: translate(-3px,-2px); filter: hue-rotate(45deg); }
    60%  { clip-path: inset(50% 0 20% 0); transform: translate(5px, 1px); filter: brightness(1.4); }
    70%  { clip-path: inset(5%  0 80% 0); transform: translate(-5px, 3px); filter: none; }
    80%  { clip-path: inset(70% 0 15% 0); transform: translate(3px,-1px); filter: hue-rotate(180deg); }
    90%  { clip-path: inset(40% 0 35% 0); transform: translate(-2px, 0); filter: none; }
    100% { clip-path: inset(0 0 100% 0); transform: translate(0); filter: none; }
}

.sp-glitch-out {
    animation: sp-glitch-out .55s steps(1) forwards;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {

    .sp-oi-top-left,
    .sp-oi-top-right,
    .sp-oi-bottom-left,
    .sp-oi-bottom-right {
        top: 10px;
        left: 10px;
        right: auto;
        bottom: auto;
    }

    .sp-oi-top-right    { left: auto; right: 10px; top: 10px; bottom: auto; }
    .sp-oi-bottom-left  { top: auto; bottom: 10px; left: 10px; right: auto; }
    .sp-oi-bottom-right { top: auto; bottom: 10px; left: auto; right: 10px; }

    .sp-overlay-img img {
        max-width: 25%;
    }

    .sp-title {
        font-size: clamp(.9rem, 5vw, 1.8rem) !important;
    }

    .sp-subtitle {
        font-size: clamp(.75rem, 3.5vw, 1rem) !important;
    }

    .sp-cta {
        padding: .45em 1.1em;
        font-size: .85em;
    }
}

@media (max-width: 480px) {
    .sp-arrow { display: none; }

    .sp-bullets { bottom: 8px; gap: 6px; }
    .sp-bullet  { width: 8px; height: 8px; }
}

/* ============================================================
   FOCUS / ACCESSIBILITY
   ============================================================ */

.sp-arrow:focus-visible,
.sp-bullet:focus-visible,
.sp-cta:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}
