/* ═══════════════════════════════════════════════════════════
   SERENITY — VERTICAL SCROLL TIMELINE
═══════════════════════════════════════════════════════════ */

/* ── Wrapper ── */
.sn-timeline-wrap {
    position: relative;
    width: 100%;
    max-width: 900px;
    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;
    height: 100%;
    background: #e0e0e0;
    z-index: 0;
}

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

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

/* Left items */
.sn-timeline-item.left {
    flex-direction: row-reverse;
    padding-right: calc(50% + 30px);
    padding-left: 0;
}

/* Right items */
.sn-timeline-item.right {
    flex-direction: row;
    padding-left: calc(50% + 30px);
    padding-right: 0;
}

/* ── Card ── */
.sn-timeline-card {
    background: #f5f5f5;
    border-radius: 4px;
    padding: 22px 28px;
    width: 100%;
    box-sizing: border-box;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.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 — absolute to item, centered on the vertical line ── */
.sn-timeline-dot {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #e0e0e0;
    z-index: 3;
    flex-shrink: 0;
    transition: background 0.4s ease, transform 0.3s ease;
}

.sn-timeline-dot.active {
    background: #7c4dff;
    transform: translate(-50%, -50%) scale(1.2);
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — Tablet
═══════════════════════════════════════════════════════════ */
@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
   
   Strategy: line at left edge, dot IN the flex row (not absolute),
   card fills remaining space. Zero absolute positioning tricks.
═══════════════════════════════════════════════════════════ */
@media (max-width: 767px) {

    .sn-timeline-wrap {
        padding: 20px 16px 30px 16px;
        overflow: visible;
    }

    /* Line: left edge of wrapper content area */
    .sn-timeline-track {
        left:      24px !important;
        transform: none !important;
    }

    /* All items: row, no padding — line offset handled differently */
    .sn-timeline-item.left,
    .sn-timeline-item.right,
    .sn-timeline-wrap .sn-timeline-item.left,
    .sn-timeline-wrap .sn-timeline-item.right {
        flex-direction:  row !important;
        padding-left:    20px !important;  /* pushes card clear of dot */
        padding-right:   0 !important;
        align-items:     center !important;
        margin-left:     16px !important;
    }

    /* Dot: take it out of absolute, put it as a flex item sibling.
       We use a pseudo trick — dot stays absolute but anchored to item.
       item has position:relative, line is at 24px from wrapper = 8px from item's left
       (wrapper padding 16px + margin-left 16px = item starts at 32px;
        line at 24px = 24-32 = -8px from item left edge)
       So: left = -8px + half-line(1px) = -7px, then translate(-50%) centers dot */
    /* Math: wrapper padding-left=16, item margin-left=16 → item starts at 32px.
       Line at 24px → line is at -8px relative to item left edge.
       Dot: left=0, translateX(-50%) shifts center by -8px → center at -8px from item = 24px from wrapper = ON THE LINE ✓ */
    .sn-timeline-dot {
        position:  absolute !important;
        left:      0px !important;
        top:       50% !important;
        transform: translate(-50%, -50%) !important;
        margin:    0 !important;
    }

    .sn-timeline-dot.active,
    .sn-timeline-wrap .sn-timeline-dot.active {
        transform: translate(-50%, -50%) scale(1.2) !important;
    }

    .sn-timeline-card {
        width:       100% !important;
        margin-left: 0 !important;
    }

    .sn-timeline-item       { margin-bottom: 32px; }
    .sn-timeline-card h3    { font-size: 1rem; }
    .sn-timeline-card p     { font-size: 0.875rem; }
}

/* ═══════════════════════════════════════════════════════════
   ELEMENTOR EDITOR
═══════════════════════════════════════════════════════════ */
.elementor-editor-active .sn-timeline-card {
    opacity: 1 !important;
    transform: translateY(0) !important;
}
