/**
 * WS Booster - ScrollExpandMedia
 */

.ws-sem {
    position: relative;
    background: #000;
    color: #fff;
    overflow: hidden;
}

.ws-sem__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.5;
    z-index: 1;
}

/* Stage : hauteur calculee depuis intro_distance + effect_duration + 100vh
   (pour que le sticky ait du scroll a parcourir). Variable posee en PHP. */
.ws-sem__stage {
    position: relative;
    height: var(--ws-sem-stage-h, 300vh);
    z-index: 2;
}

.ws-sem__media {
    position: sticky;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Image/video : taille initiale posee par les controles em_initial_width/height/radius.
   GSAP anime width/height vers 100vw/100vh + border-radius vers 0 au scroll.
   !important sur max-* pour override theme WP (bible 9.13). */
.ws-sem__image,
.ws-sem__video {
    width: 60vw;
    height: 60vh;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    border-radius: 24px;
    will-change: width, height, border-radius;
    transition: none;
    transform: translateZ(0);
}

/* Overlay DANS .ws-sem__media (qui est sticky 100vh) pour qu'il reste
   centre dans le viewport pendant tout le scrub. */
.ws-sem__overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 3;
    pointer-events: none;
    width: 90%;
    max-width: 800px;
}

/* Placeholder visible quand aucune image n'est configuree.
   Memes dimensions initiales que .ws-sem__image (60vw 60vh par defaut).
   Affiche un gradient + icone + message pour eviter l'ecran noir. */
.ws-sem__placeholder {
    width: 60vw;
    height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    padding: 32px;
    box-sizing: border-box;
    border-radius: 24px;
}

.ws-sem__placeholder svg {
    width: 64px !important;
    height: 64px !important;
    max-width: none !important;
    max-height: none !important;
}

.ws-sem__placeholder p {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.ws-sem__date {
    margin: 0 0 12px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    opacity: 0.85;
}

.ws-sem__title {
    margin: 0 0 20px;
    font-size: clamp(36px, 6vw, 72px);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.05;
}

.ws-sem__hint {
    margin: 0;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    opacity: 0.7;
}

.ws-sem--blend .ws-sem__title {
    mix-blend-mode: difference;
    color: #fff;
}

.ws-sem__body {
    position: relative;
    z-index: 4;
    padding: 80px 32px;
    max-width: 900px;
    margin: 0 auto;
    background: #000;
    color: #fff;
}

.ws-sem__body > *:first-child { margin-top: 0; }
.ws-sem__body > *:last-child { margin-bottom: 0; }

@media (max-width: 800px) {
    .ws-sem__image,
    .ws-sem__video {
        width: 80%;
        height: 50%;
    }
}
