/* ==================================================
   Unified Slide Motion System (Editorial Minimalism)
   ================================================== */

/* Motion tokens */
:root {
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-inout: cubic-bezier(0.65, 0, 0.35, 1);
    --dur-fast: 0.22s;
    --dur-med: 0.56s;
    --dur-slow: 1.05s;
    --dist-sm: 10px;
    --dist-md: 18px;
    --dist-lg: 26px;

    --motion-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --motion-ease-inout: cubic-bezier(0.65, 0, 0.35, 1);
    --motion-dur-fast: 220ms;
    --motion-dur-med: 560ms;
    --motion-dur-slow: 1050ms;
    --motion-distance-sm: 10px;
    --motion-distance-md: 18px;
    --motion-distance-lg: 26px;
}

/* Keep hero hidden behind preloader until hero timeline is ready */
html[data-rido-motion="editorial"].motion-hero-pending [data-hero] {
    visibility: hidden;
}

/* Disable legacy WOW/animate.css motion so one system controls all motion */
html[data-rido-motion="editorial"] .wow,
html[data-rido-motion="editorial"] .animated,
html[data-rido-motion="editorial"] .fadeIn,
html[data-rido-motion="editorial"] .fadeInUp,
html[data-rido-motion="editorial"] .fadeInDown,
html[data-rido-motion="editorial"] .fadeInLeft,
html[data-rido-motion="editorial"] .fadeInRight {
    animation: none !important;
    transition-property: opacity, transform;
}

html[data-rido-motion="editorial"] .wow {
    visibility: visible !important;
}

/* Neutralize older section-transition CSS so GSAP slide reveals stay clean */
html[data-rido-motion="editorial"] .rido-topic-divider .rido-topic-divider__header,
html[data-rido-motion="editorial"] .rido-topic-divider .rido-topic-divider__cell,
html[data-rido-motion="editorial"] .rido-case-card,
html[data-rido-motion="editorial"] .rido-case-top,
html[data-rido-motion="editorial"] .rido-case-title,
html[data-rido-motion="editorial"] .rido-case-desc,
html[data-rido-motion="editorial"] .rido-case-media {
    opacity: 1;
    transform: none;
    transition: none !important;
}

html[data-rido-motion="editorial"] .rido-topic-divider .rido-topic-divider__img {
    transform: none;
}

/* Utility wrappers for heading line slides */
html[data-rido-motion="editorial"] .motion-line-mask {
    display: block;
    overflow: hidden;
}

html[data-rido-motion="editorial"] .motion-line {
    display: block;
    transform: translateZ(0);
    will-change: transform;
}

/* Prepared state (no layout shift; transform/opacity only) */
html[data-rido-motion="editorial"].motion-prepared [data-reveal],
html[data-rido-motion="editorial"].motion-prepared [data-reveal-item] {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Keep section helper lines removed for clean editorial surface */
html[data-rido-motion="editorial"] .motion-underline,
html[data-rido-motion="editorial"] .motion-divider-line,
html[data-rido-motion="editorial"] .scroll-ink-line {
    display: none !important;
}

/* Responsive fix: keep scroll-to-top rail from overlapping content */
html[data-rido-motion="editorial"] body:not(.rido-scroll-rails-ready) .float-text.show-on-scroll,
html[data-rido-motion="editorial"] body:not(.rido-scroll-rails-ready) .scrollbar-v.show-on-scroll {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

@media (max-width: 1320px) {
    html[data-rido-motion="editorial"] .scrollbar-v,
    html[data-rido-motion="editorial"] .float-text {
        display: none !important;
    }
}

@media (min-width: 1321px) and (max-width: 1366px) {
    html[data-rido-motion="editorial"] .scrollbar-v {
        display: none !important;
    }

    html[data-rido-motion="editorial"] .float-text {
        top: auto;
        left: 16px;
        right: auto;
        bottom: clamp(12px, 2vw, 20px);
        width: auto;
        margin-left: 0;
        transform: none;
        z-index: 1200;
        text-align: left;
    }

    html[data-rido-motion="editorial"] .float-text span {
        margin: 0;
        writing-mode: horizontal-tb;
        transform: none;
        letter-spacing: 0.08em;
        line-height: 1;
        white-space: nowrap;
        display: inline-block;
        padding: 8px 10px 7px;
        background: rgba(255, 255, 255, 0.96);
        border: 1px solid rgba(0, 0, 0, 0.18);
    }

    html[data-rido-motion="editorial"] .float-text a {
        display: inline-block;
        color: inherit;
    }

    html[data-rido-motion="editorial"] .float-text.dark span {
        background: rgba(12, 12, 12, 0.88);
        border-color: rgba(255, 255, 255, 0.24);
    }
}

@media (max-width: 767px) {
    html[data-rido-motion="editorial"] .float-text {
        display: none !important;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    html[data-rido-motion="editorial"] .motion-line,
    html[data-rido-motion="editorial"] [data-reveal],
    html[data-rido-motion="editorial"] [data-reveal-item] {
        transition: none !important;
        animation: none !important;
        transform: none !important;
        opacity: 1 !important;
        will-change: auto !important;
    }
}
