/* =========================================================
   Ranosys Our Capabilities Widget — Pipeline Stepper
   Matched to Figma: ReveuGuard node 179:764
   ========================================================= */

.rsc-cap-section {
    padding: 100px 0;
    background: #1a1a1a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    font-family: inherit;
    overflow: visible;
}

.rsc-cap-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    overflow: visible;
}

/* ── Header ── */
.rsc-cap-header {
    margin-bottom: 60px;
    text-align: center;
}

.rsc-cap-title {
    font-size: 36px;
    font-family: Poppins, sans-serif;
    font-weight: 500;
    color: #ffffff;
    margin: 0 0 12px;
    line-height: 1.11;
    letter-spacing: -0.93px;
}

.rsc-cap-subtitle {
    font-size: 18px;
    font-family: "source-sans-pro", sans-serif;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.75);
    margin: 0 auto;
    line-height: 1.5 !important;
    max-width: 800px;
}

/* ── Grid ── */
.rsc-cap-grid {
    display: grid;
    grid-template-columns: 2fr 5fr;
    gap: 48px;
    align-items: start;
    position: relative;
    overflow: visible;
}

/* ── Stepper Column ── */
.rsc-cap-stepper-wrapper {
    position: relative;
    padding: 0;
    overflow: visible;
}

.rsc-cap-stepper {
    display: flex;
    flex-direction: column;
    gap: 16px;          /* Figma: 16px between 94px-tall cards */
    position: relative;
}

/* Vertical connector — hidden */
.rsc-cap-connector { display: none; }

/* ── Step Items ── */
.rsc-cap-step {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-height: 94px;
    padding: 0 20px 0 38px;
    border-radius: 12px;
    cursor: pointer;
    overflow: hidden;            /* clips ::before left bar to rounded corners */
    background: #292929;
    border: 1px solid transparent;

    /* Figma orange-tinted glow shadow */
    box-shadow: 0px 20px 12.5px rgba(255, 107, 0, 0.05),
                0px 8px 5px rgba(255, 107, 0, 0.05);

    transition: background 0.25s ease, border-color 0.25s ease,
                box-shadow 0.25s ease;
}

/* Step dot — hidden */
.rsc-cap-dot { display: none; }

.rsc-cap-step:hover {
    background: #333333;
}

/* Active step — orange border + solid left bar */
.rsc-cap-step.active {
    background: #292929;
    border: 2px solid rgba(255, 107, 0, 0.2);
    box-shadow: 0px 20px 12.5px rgba(255, 107, 0, 0.05),
                0px 8px 5px rgba(255, 107, 0, 0.05);
}

/* Orange left accent bar (Figma: 7px solid #ff6b00, clipped by overflow:hidden) */
.rsc-cap-step.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 5px;        /* visually 5px (border accounts for the rest) */
    height: 100%;
    background: #ff6b00;
    border-radius: 0;  /* parent overflow:hidden + border-radius handles corners */
}

/* ── Step Text ── */
.rsc-cap-step-text h5 {
    font-size: 20px;
    font-weight: 600;
    font-family: Poppins, sans-serif;
    margin: 0;
    color: #ffffff;
    line-height: 24px;
    transition: none;
}

.rsc-cap-step-text p {
    font-size: 16px;
    font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
    font-weight: 400;
    color: #c4c4c4;
    margin: 0;
    line-height: 20px;
    transition: none;
}

/* Active state — text is same colour (no extra dimming needed) */
.rsc-cap-step.active .rsc-cap-step-text h5 { color: #ffffff; }
.rsc-cap-step.active .rsc-cap-step-text p  { color: #c4c4c4; }

/* ── Detail Card Column — sticky handled by JS translateY ── */
.rsc-cap-card-column {
    will-change: transform;
    overflow: visible;
}

/* ── Detail Card ── */
.rsc-cap-card {
    background: #ffffff;
    border: 1px solid rgba(229, 231, 235, 0.5);
    border-radius: 24px;
    padding: 48px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35),
                0 0 0 1px rgba(255, 255, 255, 0.05);
    min-height: 380px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.rsc-cap-card-content {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.rsc-cap-card-content.exiting  { opacity: 0; transform: translateY(-12px); }
.rsc-cap-card-content.entering { opacity: 0; transform: translateY(12px); }

/* Card header row */
.rsc-cap-card-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.rsc-cap-icon-wrap {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: rgba(255, 107, 0, 0.08);
    color: #ff6b00;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    flex-shrink: 0;
    border: 1px solid rgba(255, 107, 0, 0.1);
}

.rsc-cap-card-title {
    font-size: 1.625rem;
    font-family: Poppins, sans-serif;
    font-weight: 700;
    color: #111111;
    margin: 0;
    line-height: 1.2;
}

.rsc-cap-card-desc {
    font-size: 1rem;
    font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
    color: #4B5563;
    line-height: 1.65;
    margin: 0 0 28px;
}

/* Bullet list */
.rsc-cap-bullets {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.rsc-cap-bullets li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
    font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
    color: #374151;
    font-weight: 600;
}

.rsc-cap-bullets li i {
    color: #10B981;
    font-size: 1.15rem;
    flex-shrink: 0;
}

/* ── Scroll fade animation ── */
.rsc-cap-fade {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.rsc-cap-fade.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── Responsive ── */
@media (max-width: 991px) {
    .rsc-cap-section { padding: 60px 0 80px; }

    .rsc-cap-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    /* Disable JS sticky on single-column layout */
    .rsc-cap-card-column {
        transform: none !important;
        will-change: auto;
    }

    .rsc-cap-stepper {
        flex-direction: column;
        gap: 12px;
    }

    /* Card injected inline after active step on mobile */
    .rsc-cap-stepper .rsc-cap-card-column {
        width: 100%;
        margin: 4px 0;
    }

    .rsc-cap-step {
        min-height: 80px;
        padding: 0 16px 0 28px;
    }

    .rsc-cap-step.active { border: 2px solid rgba(255, 107, 0, 0.2); }

    .rsc-cap-step-text h5 { font-size: 16px; line-height: 20px; }
    .rsc-cap-step-text p  { font-size: 14px; line-height: 18px; }

    .rsc-cap-card {
        min-height: auto;
        padding: 28px 22px;
    }
}

@media (max-width: 575px) {
    .rsc-cap-title { font-size: 28px; letter-spacing: -0.5px; }

    .rsc-cap-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}


/* =========================================================
   PATCH for our-capabilities.css
   Replace the existing .rsc-cap-card-column rule with this.
   Also add the ancestor-overflow override at the bottom.
   ========================================================= */

/* ── Detail Card Column — NATIVE CSS STICKY ── */
.rsc-cap-card-column {
    position: sticky;
    /* Top offset = (viewport - card height) / 2 approx. Tweak if header overlaps.
       Use a fixed value so sticky works without measuring card height. */
    top: 120px;
    align-self: start;   /* CRITICAL inside a grid/flex parent — without this,
                            the item stretches and sticky has nothing to stick to. */
    will-change: transform;
}

/* Mobile — release sticky */
@media ( max-width: 991px ) {
    .rsc-cap-card-column {
        position: static;
        top: auto;
        align-self: auto;
        will-change: auto;
    }
}

/* ── Ancestor overflow override ──
   `position: sticky` is silently killed by any ancestor with
   `overflow: hidden | auto | scroll`. Elementor sections often set
   `overflow: hidden` on the outer wrapper. This forces it back to visible
   for the ancestors of our sticky element. Adjust the selector if your
   widget sits inside a differently-named Elementor section. */
.elementor-section:has( .rsc-cap-section ),
.elementor-container:has( .rsc-cap-section ),
.elementor-column:has( .rsc-cap-section ),
.elementor-widget-wrap:has( .rsc-cap-section ),
.elementor-widget:has( .rsc-cap-section ) {
    overflow: visible !important;
}

/* Fallback for browsers without :has() — apply to the section's own ancestors
   by class. Safe even if the rule above already worked. */
.rsc-cap-section,
.rsc-cap-section .elementor-widget-wrap,
.rsc-cap-section .elementor-container {
    overflow: visible;
}



/* =========================================================
   PATCH for our-capabilities.css
   Replaces the mobile media query block and the
   .rsc-cap-card-column rule. Adds accordion styles.
   ========================================================= */

/* ── Desktop: native CSS sticky card column ── */
.rsc-cap-card-column {
    position: sticky;
    top: 120px;
    align-self: start;
    will-change: transform;
}

.rsc-cap-section,
.rsc-cap-section .elementor-widget-wrap,
.rsc-cap-section .elementor-container {
    overflow: visible;
}

/* ── FOUC GUARD ──
   Hide the card column at mobile widths BEFORE JS runs, so we never get
   a one-frame flash of the duplicate card. JS later detaches it from DOM,
   but this CSS keeps the initial paint correct. */
@media ( max-width: 991px ) {
    .rsc-cap-card-column {
        display: none !important;
    }
}

/* =========================================================
   MOBILE ACCORDION (< 992px)
   ========================================================= */
@media ( max-width: 991px ) {

    .rsc-cap-section { padding: 60px 0 80px; }

    .rsc-cap-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .rsc-cap-stepper {
        flex-direction: column;
        gap: 12px;
    }

    .rsc-cap-step {
        position: relative;            /* contains the orange ::before bar */
        min-height: 80px;
        padding: 0 20px 0 28px;        /* no extra right padding for chevron */
        transition: background 0.25s ease, border-color 0.25s ease,
                    box-shadow 0.25s ease;
    }

    /* NO CHEVRON / ARROW — explicitly remove anything that might add one */
    .rsc-cap-step::after,
    .rsc-cap-step .rsc-cap-arrow,
    .rsc-cap-step .rsc-cap-chevron {
        display: none !important;
        content: none !important;
    }

    .rsc-cap-step-text h5 { font-size: 16px; line-height: 20px; }
    .rsc-cap-step-text p  { font-size: 14px; line-height: 18px; }

    /* ── ACTIVE STATE (open accordion) ──
       Orange left accent bar + orange border, matching the desktop design.
       Specificity bumped + !important to win against Elementor/RUCSS rewrites. */
    .rsc-cap-section .rsc-cap-step.active {
        background: #292929 !important;
        border: 2px solid rgba( 255, 107, 0, 0.45 ) !important;
        box-shadow:
            0px 20px 18px rgba( 255, 107, 0, 0.10 ),
            0px 8px 8px rgba( 255, 107, 0, 0.08 ) !important;
    }

    .rsc-cap-section .rsc-cap-step.active::before {
        content: '' !important;
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 5px !important;
        height: 100% !important;
        background: #ff6b00 !important;
        display: block !important;
        border-radius: 0 !important;
        z-index: 1 !important;
    }

    /* ── Accordion container ──
       grid-template-rows 0fr ↔ 1fr animates from 0 to natural height
       with no JS measurement. Supported in all current mobile browsers. */
    .rsc-cap-accordion {
        display: grid;
        grid-template-rows: 0fr;
        opacity: 0;
        transition:
            grid-template-rows 600ms cubic-bezier( 0.16, 1, 0.3, 1 ),
            opacity 400ms ease 80ms,
            margin 600ms cubic-bezier( 0.16, 1, 0.3, 1 );
        margin: 0;
    }

    .rsc-cap-accordion.is-open {
        grid-template-rows: 1fr;
        opacity: 1;
        margin: 8px 0 10px;
    }

    .rsc-cap-accordion-inner {
        overflow: hidden;
        min-height: 0;
    }

    .rsc-cap-accordion .rsc-cap-card {
        background: #ffffff;
        border: 1px solid rgba( 229, 231, 235, 0.5 );
        border-radius: 20px;
        padding: 24px 22px;
        box-shadow: 0 18px 32px -12px rgba( 0, 0, 0, 0.35 ),
                    0 0 0 1px rgba( 255, 255, 255, 0.05 );
        min-height: auto;

        /* Inner card slides + fades in, slightly delayed for layered feel */
        transform: translateY( -10px ) scale( 0.97 );
        opacity: 0;
        transition:
            transform 550ms cubic-bezier( 0.16, 1, 0.3, 1 ) 120ms,
            opacity 450ms ease 140ms;
    }

    .rsc-cap-accordion.is-open .rsc-cap-card {
        transform: translateY( 0 ) scale( 1 );
        opacity: 1;
    }

    .rsc-cap-accordion .rsc-cap-card-header {
        display: flex;
        align-items: center;
        gap: 14px;
        margin-bottom: 16px;
    }

    .rsc-cap-accordion .rsc-cap-icon-wrap {
        width: 48px;
        height: 48px;
        border-radius: 12px;
        background: rgba( 255, 107, 0, 0.08 );
        color: #ff6b00;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.35rem;
        flex-shrink: 0;
        border: 1px solid rgba( 255, 107, 0, 0.1 );
    }

    .rsc-cap-accordion .rsc-cap-card-title {
        font-size: 1.2rem;
        font-family: Poppins, sans-serif;
        font-weight: 700;
        color: #111111;
        margin: 0;
        line-height: 1.25;
    }

    .rsc-cap-accordion .rsc-cap-card-desc {
        font-size: 0.95rem;
        font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
        color: #4B5563;
        line-height: 1.6;
        margin: 0 0 18px;
    }

    .rsc-cap-accordion .rsc-cap-bullets {
        list-style: none;
        padding: 0;
        margin: 0;
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .rsc-cap-accordion .rsc-cap-bullets li {
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 0.95rem;
        font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
        color: #374151;
        font-weight: 600;
    }

    .rsc-cap-accordion .rsc-cap-bullets li i {
        color: #10B981;
        font-size: 1rem;
        flex-shrink: 0;
    }
}

@media ( max-width: 575px ) {
    .rsc-cap-title { font-size: 28px; letter-spacing: -0.5px; }
}