html.lenis,
html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

/* SVG tuyệt đối đi theo khoảng cách top - bottom */
#scroll-svg {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: -1;
    pointer-events: none;
    width: 100%;
    max-width: 800px;
    /* Giữ kích thước gốc trên màn hình lớn */
    /* Chiều cao và top sẽ được JS cập nhật tự động */
}

@media (max-width: 1230px) {
    #scroll-svg {
        max-width: 500px;
        /* Thu nhỏ bề ngang khi màn hình dưới 1230px */
    }
}

@media (max-width: 767px) {
    #scroll-svg {
        display: none !important;
        /* Ẩn SVG trên mobile */
    }
}

.process-section,
.wt-timeline-wrap,
.wt-item-hanh-trinh {
    overflow-x: hidden !important;
}

/* Hide scrollbar for process-section and wt-timeline-wrap */
.process-section,
.wt-timeline-wrap {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.process-section::-webkit-scrollbar,
.wt-timeline-wrap::-webkit-scrollbar {
    display: none; /* Chrome, Safari, and Opera */
}

.svg-line {
    clip-path: inset(0 0 100% 0);
    will-change: clip-path;
}

.svg-line.active {
    animation: drawVertical 4s linear forwards;
}

.svg-arrow {
    opacity: 0;
}

.svg-arrow.active {
    animation: showArrow 4s linear forwards;
}

@keyframes drawVertical {
    0% {
        clip-path: inset(0 0 100% 0);
    }

    100% {
        clip-path: inset(0 0 0 0);
    }
}

@keyframes showArrow {

    0%,
    97% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

/* animation title */
/* Reveal Heading Letter-by-Letter Animation */
/* .wt-animate-heading-reveal,
.wt-animate-heading-reveal h1,
.wt-animate-heading-reveal h2,
.wt-animate-heading-reveal h3,
.wt-animate-heading-reveal h4,
.wt-animate-heading-reveal h5,
.wt-animate-heading-reveal h6 {
    overflow: hidden;
} */

.wt-animate-heading-reveal .reveal-word {
    display: inline-block;
    white-space: nowrap;
}

.wt-animate-heading-reveal .reveal-char {
    display: inline-block !important;
    opacity: 0;
    margin-right: -0.015em;
    /* Bù trừ khoảng trống nhẹ của inline-block để giữ nguyên độ dài chữ */
   	will-change: opacity;
    transition: opacity 0.4s ease;
    transition-delay: calc(var(--char-index) * 0.05s);
}

.wt-animate-heading-reveal.is-in-viewport .reveal-char {
    opacity: 1;
}

/* ================================================================
   Image Hover Zoom Animation
   ================================================================ */
.wt-hover-img {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
}

.wt-hover-img .wp-block-uagb-image__figure {
    position: relative;
    overflow: hidden;
    margin: 0;
}

.wt-hover-img .wp-block-uagb-image__figure img {
    display: block;
    width: 100%;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    will-change: transform;
}

.wt-hover-img:hover .wp-block-uagb-image__figure img {
    transform: scale(1.05);
}

/* ================================================================
   Why Cavalry List Animation
   ================================================================ */
.why-cavalry-list .why-cavalry-card {
    opacity: 0;
    transform: translateX(-60px);
    transition: opacity .8s ease, transform .8s ease;
}

.why-cavalry-list .why-cavalry-card.is-inview {
    opacity: 1;
    transform: translateX(0);
}

/* animation zoom and box-shadow */
.wt-hover-boxshadown {
    overflow: hidden !important;
    transition: box-shadow .35s ease, transform .35s cubic-bezier(0.17, 0.84, 0.44, 1) !important;
}

.wt-hover-boxshadown:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 10px 25px rgba(92, 64, 51, 0.15) !important;
}

/* ================================================================
   Fade & Rise Entrance Animation for Images
   ================================================================ */
.wt-animation-img {
    opacity: 0 !important;
    transform: translateY(40px) !important;
    transition: opacity 2.2s ease,
        transform 2.2s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

.wt-animation-img.is-inview {
    opacity: 1 !important;
    transform: translateY(0) !important;
}


/* ================================================================
   Timeline Rows: Image Slide Left-to-Right & Content Slide Right-to-Left
   ================================================================ */
/* Initial states (Hidden & Offset) */
.wt-animation-left-img {
    opacity: 0 !important;
    transform: translateX(-80px) translateZ(0) !important;
    will-change: transform, opacity;
    transition: opacity 2.2s cubic-bezier(0.25, 1, 0.5, 1),
        transform 2.2s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

.wt-animation-left-content {
    opacity: 0 !important;
    transform: translateX(80px) translateZ(0) !important;
    will-change: transform, opacity;
    /* transition-delay: 0.6s to execute after the image starts */
    transition: opacity 2.2s cubic-bezier(0.25, 1, 0.5, 1),
        transform 2.2s cubic-bezier(0.25, 1, 0.5, 1) !important;
    transition-delay: 0.6s !important;
}

/* Optimize translation distance on mobile and tablet to prevent breaking layout / heavy clipping */
@media (max-width: 991px) {
    .wt-animation-left-img {
        transform: translateX(-40px) translateZ(0) !important;
    }

    .wt-animation-left-content {
        transform: translateX(40px) translateZ(0) !important;
    }
}

@media (max-width: 767px) {
    .wt-animation-left-img {
        transform: translateX(-20px) translateZ(0) !important;
    }

    .wt-animation-left-content {
        transform: translateX(20px) translateZ(0) !important;
    }
}

/* Triggered states when parent row is in viewport */
.wt-item-hanh-trinh.is-inview .wt-animation-left-img {
    opacity: 1 !important;
    transform: translateX(0) translateZ(0) !important;
}

.wt-item-hanh-trinh.is-inview .wt-animation-left-content {
    opacity: 1 !important;
    transform: translateX(0) translateZ(0) !important;
}

/* ================================================================
   Fade & Rise Entrance Animation for Paragraphs (Liquid Steam Reveal)
   ================================================================ */
.wt-animation-p p {
    opacity: 0 !important;
    transform: scale(0.96) translateZ(0) !important;
    /* Đẩy lùi nhẹ về phía sau */
    will-change: transform, opacity;
    transition: opacity 3.2s cubic-bezier(0.25, 1, 0.5, 1),
        transform 3.2s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

.wt-animation-p.is-inview p {
    opacity: 1 !important;
    transform: scale(1) translateZ(0) !important;
    /* Tiến nhẹ về phía trước màn hình */
}

/* ================================================================
   Left-to-Right & Right-to-Left Entrance Animations for Images
   ================================================================ */
.wt-animation-img-left {
    opacity: 0 !important;
    transform: translateX(-100px) translateZ(0) !important;
    filter: blur(5px);
    will-change: transform, opacity, filter;
    transition: opacity 2.2s cubic-bezier(0.25, 1, 0.5, 1),
        transform 2.2s cubic-bezier(0.25, 1, 0.5, 1),
        filter 2.2s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

.wt-animation-img-left.is-inview {
    opacity: 1 !important;
    transform: translateX(0) translateZ(0) !important;
    filter: blur(0) !important;
}

.wt-animation-img-right {
    opacity: 0 !important;
    transform: translateX(100px) translateZ(0) !important;
    filter: blur(5px);
    will-change: transform, opacity, filter;
    transition: opacity 2.2s cubic-bezier(0.25, 1, 0.5, 1),
        transform 2.2s cubic-bezier(0.25, 1, 0.5, 1),
        filter 2.2s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

.wt-animation-img-right.is-inview {
    opacity: 1 !important;
    transform: translateX(0) translateZ(0) !important;
    filter: blur(0) !important;
}

/* Optimize translation distance on mobile and tablet to prevent breaking layout / heavy clipping */
@media (max-width: 991px) {
    .wt-animation-img-left {
        transform: translateX(-40px) translateZ(0) !important;
    }
    .wt-animation-img-right {
        transform: translateX(40px) translateZ(0) !important;
    }
}

@media (max-width: 767px) {
    .wt-animation-img-left {
        transform: translateX(-20px) translateZ(0) !important;
    }
    .wt-animation-img-right {
        transform: translateX(20px) translateZ(0) !important;
    }
}
