/* ═══════════════════════════════════════════════════════════
   SERENITY — VERTICAL SCROLL TIMELINE
   All color / size values are defaults only.
   Elementor controls override everything via inline CSS vars.
═══════════════════════════════════════════════════════════ */

/* ── Wrapper ── */
.sn-timeline-wrap {
    position: relative;
    width: 100%;
    max-width: 900px;       /* overridden by Elementor slider */
    margin: 0 auto;
    padding: 40px 20px 60px;
    box-sizing: border-box;
}

/* ── Central vertical track ── */
.sn-timeline-track {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    width: 2px;             /* overridden by Elementor slider */
    height: 100%;
    background: #e0e0e0;    /* overridden by color picker */
    z-index: 0;
}

/* ── Animated fill bar ── */
.sn-timeline-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0%;             /* driven by JS scroll progress */
    background: #7c4dff;    /* overridden by color picker */
    transition: height 0.1s linear;
    z-index: 1;
}

/* ── Each timeline row ── */
.sn-timeline-item {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 70px;    /* overridden by Elementor slider */
    z-index: 2;
}

/* Left items — card sits to the left of the line */
.sn-timeline-item.left {
    flex-direction: row-reverse;
    padding-right: calc(50% + 30px); /* overridden by Elementor slider */
    padding-left: 0;
}

/* Right items — card sits to the right of the line */
.sn-timeline-item.right {
    flex-direction: row;
    padding-left: calc(50% + 30px);  /* overridden by Elementor slider */
    padding-right: 0;
}

/* ── Card ── */
.sn-timeline-card {
    background: #f5f5f5;    /* overridden by color picker */
    border-radius: 4px;
    padding: 22px 28px;     /* overridden by Elementor dimensions */
    width: 100%;
    box-sizing: border-box;
    /* initial hidden state — JS sets inline opacity/transform */
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease; /* overridden by number controls */
}

.sn-timeline-card h3 {
    margin: 0 0 8px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a1a;
    font-family: inherit;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.sn-timeline-card p {
    margin: 0;
    font-size: 0.95rem;
    color: #555555;
    line-height: 1.6;
}

/* ── Dot ── */
.sn-timeline-dot {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;            /* overridden by Elementor slider */
    height: 16px;
    border-radius: 50%;
    background: #e0e0e0;    /* overridden by color picker */
    z-index: 3;
    flex-shrink: 0;
    transition: background 0.4s ease, transform 0.3s ease;
}

.sn-timeline-dot.active {
    background: #7c4dff;    /* overridden by fill color picker */
    transform: translateX(-50%) scale(1.2); /* scale overridden by number control */
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — Tablet  (max 1024px)
═══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .sn-timeline-item.left {
        padding-right: calc(50% + 20px);
    }
    .sn-timeline-item.right {
        padding-left: calc(50% + 20px);
    }
    .sn-timeline-item {
        margin-bottom: 50px;
    }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — Mobile  (max 767px)
   Stack layout: line moves to the left edge, all cards go right
═══════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
    .sn-timeline-wrap {
        padding: 20px 12px 30px 36px; /* left room for the line */
    }

    /* Move line to left edge */
    .sn-timeline-track {
        left: 12px;
        transform: none;
    }

    /* All items stack to the right of the line */
    .sn-timeline-item.left,
    .sn-timeline-item.right {
        flex-direction: row;
        padding-left: 24px;
        padding-right: 0;
    }

    /* Dot stays pinned to the left line */
    .sn-timeline-dot {
        left: 12px;
        transform: translateX(-50%);
    }

    .sn-timeline-dot.active {
        transform: translateX(-50%) scale(1.2);
    }

    .sn-timeline-item {
        margin-bottom: 32px;
    }

    .sn-timeline-card h3 {
        font-size: 1rem;
    }

    .sn-timeline-card p {
        font-size: 0.875rem;
    }
}

/* ═══════════════════════════════════════════════════════════
   ELEMENTOR EDITOR — force cards visible inside preview iframe
═══════════════════════════════════════════════════════════ */
.elementor-editor-active .sn-timeline-card {
    opacity: 1 !important;
    transform: translateY(0) !important;
}
