/* GSAP for Elementor - Premium Frontend Styles */

/* CRITICAL: Hide elements before animation to prevent FOUC/blink */
/* Using opacity instead of visibility for smoother transition */
[data-gsap] {
    visibility: hidden;
}

/* Show when GSAP has set initial state */
[data-gsap].gsap-ready {
    visibility: visible;
}

/* Performance optimization */
[data-gsap].gsap-ready {
    will-change: transform, opacity, clip-path, filter;
}

/* ========================================
   TEXT SPLIT ELEMENTS
   ======================================== */

/* Character split */
.gsap-split-char {
    display: inline-block !important;
    will-change: transform, opacity, filter;
}

/* Word split */
.gsap-split-word {
    display: inline-block !important;
    will-change: transform, opacity, filter;
}

/* Line split - wrapper with overflow hidden for mask effect */
.gsap-split-line {
    display: block !important;
    overflow: hidden;
    /* Preserve paragraph spacing */
    margin-bottom: 0;
}

/* Line split - inner element that gets animated */
.gsap-split-line-inner {
    display: block !important;
    will-change: transform, opacity, filter;
}

/* Line split - no mask version */
.gsap-split-line-nomask {
    display: block !important;
    will-change: transform, opacity, filter;
}

/* Preserve paragraph structure in text editor */
.elementor-text-editor p {
    margin-bottom: 1em;
}

.elementor-text-editor p:last-child {
    margin-bottom: 0;
}

/* When paragraphs contain split lines, remove extra margin */
.elementor-text-editor p .gsap-split-line:last-child {
    margin-bottom: 0;
}

/* ========================================
   MASK WRAPPER (for word/char mask reveal)
   ======================================== */
.gsap-mask-wrap {
    display: inline-block;
    overflow: hidden;
    vertical-align: bottom;
}

/* ========================================
   SPECIAL EFFECTS
   ======================================== */

/* Clip path elements */
[data-gsap*="reveal-"] {
    overflow: hidden;
}

/* 3D transforms */
[data-gsap*="flip-"] {
    perspective: 1000px;
    transform-style: preserve-3d;
}

/* ========================================
   RENDERING OPTIMIZATION
   ======================================== */
[data-gsap].gsap-ready,
[data-gsap].gsap-ready * {
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Ensure split elements don't break layout */
.gsap-split-char,
.gsap-split-word,
.gsap-split-line-inner,
.gsap-split-line-nomask {
    backface-visibility: hidden;
}
