/* ============================================================
   P23 Scroll Hero v1.0
   Clip-path scroll reveal + magic text word-by-word
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

/* ── Elementor wrapper reset ── */
.elementor-widget-p23_scroll_hero,
.elementor-widget-p23_scroll_hero > .elementor-widget-container {
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
}

/* ── ROOT — scroll spacer ── */
.p23sh-root {
    position: relative;
    width: 100%;
    /* height set inline: calc(scrollHeight + 100vh) */
}

/* ── STICKY CONTAINER ── */
.p23sh-sticky {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
}

/* ── BG IMAGE ── */
.p23sh-bg {
    position: absolute;
    inset: 0;
    background-color: #000;
    background-size: 170%;
    background-position: center center;
    background-repeat: no-repeat;
    will-change: clip-path, background-size;
    /* clip-path driven by JS */
    clip-path: polygon(20% 20%, 80% 20%, 80% 80%, 20% 80%);
    transition: none; /* JS handles smooth via rAF */
}

/* ── OVERLAY ── */
.p23sh-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

/* ── TEXT WRAP — positioning ── */
.p23sh-text-wrap {
    position: absolute;
    z-index: 2;
    padding: 0 60px 60px;
    pointer-events: none;
}

/* Position variants */
.p23sh-pos-center {
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}
.p23sh-pos-center .p23sh-text { justify-content: center; }

.p23sh-pos-bottom_left {
    bottom: 0; left: 0;
    text-align: left;
}

.p23sh-pos-bottom_center {
    bottom: 0; left: 50%;
    transform: translateX(-50%);
    text-align: center;
}
.p23sh-pos-bottom_center .p23sh-text { justify-content: center; }

.p23sh-pos-bottom_right {
    bottom: 0; right: 0;
    text-align: right;
}
.p23sh-pos-bottom_right .p23sh-text { justify-content: flex-end; }

.p23sh-pos-top_left {
    top: 80px; left: 0;
    text-align: left;
}

.p23sh-pos-top_center {
    top: 80px; left: 50%;
    transform: translateX(-50%);
    text-align: center;
}
.p23sh-pos-top_center .p23sh-text { justify-content: center; }

/* ── TEXT ELEMENT ── */
.p23sh-text {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    line-height: 1.1;
    margin: 0;
    padding: 0;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 42px;
    font-weight: 700;
    letter-spacing: -0.03em;
    max-width: 700px;
}

/* ── WORD ── */
.p23sh-word {
    position: relative;
    display: inline-flex;
    margin-right: 7px;
    margin-top: 10px;
    line-height: inherit;
    vertical-align: baseline;
}

.p23sh-word-ghost {
    color: rgba(255,255,255,0.18);
    display: block;
    user-select: none;
    pointer-events: none;
    white-space: nowrap;
}

.p23sh-word-motion {
    position: absolute;
    inset: 0;
    color: #ffffff;
    display: block;
    white-space: nowrap;
    will-change: opacity;
}

/* ── FADE mode ── */
.p23sh-text[data-mode="fade"] {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}
.p23sh-text[data-mode="fade"].p23sh-fade-in {
    opacity: 1;
    transform: translateY(0);
}
/* For fade mode, all words always visible */
.p23sh-text[data-mode="fade"] .p23sh-word-ghost { display: none; }
.p23sh-text[data-mode="fade"] .p23sh-word-motion { opacity: 1 !important; position: static; }

/* ── STATIC mode ── */
.p23sh-text[data-mode="static"] .p23sh-word-ghost { display: none; }
.p23sh-text[data-mode="static"] .p23sh-word-motion { position: static; opacity: 1 !important; }

/* ── MOBILE ── */
@media (max-width: 768px) {
    /* El tamaño de texto ahora se controla desde Elementor (responsive).
       Aquí solo ajustamos el layout. */
    .p23sh-text-wrap {
        padding: 0 24px 36px;
    }
    .p23sh-text {
        max-width: 100% !important;
    }
    .p23sh-word-ghost,
    .p23sh-word-motion {
        white-space: normal;   /* permitir que palabras largas quepan */
    }
    /* Posiciones top: bajar un poco para no chocar con el header */
    .p23sh-pos-top_left,
    .p23sh-pos-top_center { top: 90px; }
}

@media (max-width: 480px) {
    .p23sh-text-wrap { padding: 0 18px 28px; }
}
