.custom-timeline-1862-container {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 0;
}

.timeline-1862-item {
    display: flex;
    justify-content: center;
    position: relative;
    margin-bottom: 60px; /* Default value, overridden by control */
    width: 100%;
}

.timeline-1862-item:last-child {
    margin-bottom: 0 !important;
}

/* Connect dots with per-item lines downwards */
.timeline-1862-item::before {
    content: '';
    position: absolute;
    top: 21px; /* Starts below the dot (5px top + 16px height) */
    bottom: -60px; /* Extends to the next item's top. Overridden by control to match margin-bottom */
    left: 50%;
    width: 2px;
    background-color: #e0e0e0;
    transform: translateX(-50%);
    z-index: 1;
}

/* Ensure line from the LAST item is completely hidden */
.timeline-1862-item:last-of-type::before,
.timeline-1862-item:last-child::before {
    display: none !important;
}

/* Base Animation Styles for children */
.timeline-1862-year-wrap,
.timeline-1862-content {
    opacity: 0;
    transition: opacity 600ms ease-out, transform 600ms ease-out;
}

/* .timeline-1862-item-left: Content is on RIGHT, Year is on LEFT */
.timeline-1862-item-left .timeline-1862-year-wrap {
    transform: translateX(-50px); /* Year slides from left to right */
}
.timeline-1862-item-left .timeline-1862-content {
    transform: translateX(50px); /* Content slides from right to left */
}

/* .timeline-1862-item-right: Content is on LEFT, Year is on RIGHT */
.timeline-1862-item-right .timeline-1862-year-wrap {
    transform: translateX(50px); /* Year slides from right to left */
}
.timeline-1862-item-right .timeline-1862-content {
    transform: translateX(-50px); /* Content slides from left to right */
}

/* When visible, reset transform and opacity */
.timeline-1862-item.is-visible .timeline-1862-year-wrap,
.timeline-1862-item.is-visible .timeline-1862-content {
    opacity: 1;
    transform: translateX(0);
}


.timeline-1862-dot-wrap {
    position: absolute;
    left: 50%;
    top: 5px;
    transform: translateX(-50%);
    z-index: 2;
}

.timeline-1862-dot {
    width: 16px;
    height: 16px;
    background-color: #73253c; /* Default Burgundy */
    border-radius: 50%;
}

.timeline-1862-year-wrap,
.timeline-1862-content {
    width: 50%;
    /* Padding is now controlled via Elementor settings */
    box-sizing: border-box;
}

.timeline-1862-item-left {
    flex-direction: row-reverse;
}

/* Base text alignments (will be overridden by user controls if set) */
.timeline-1862-item-left .timeline-1862-year-wrap {
    text-align: left;
}

.timeline-1862-item-left .timeline-1862-content {
    text-align: right;
}

.timeline-1862-item-right .timeline-1862-year-wrap {
    text-align: right;
}

.timeline-1862-item-right .timeline-1862-content {
    text-align: left;
}


.timeline-1862-year {
    font-size: 32px;
    font-weight: 700;
    color: #73253c; /* Default Burgundy */
    line-height: 1;
}

.timeline-1862-title {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: #212121;
}

.timeline-1862-description {
    font-size: 16px;
    line-height: 1.6;
    color: #555;
    margin: 0 0 20px 0;
}

.timeline-1862-image {
    margin-top: 20px; /* Default value, overridden by control */
    width: 100%; /* Take maximum available width */
    max-width: 100%; /* Ensure it does not overflow */
}

.timeline-1862-image img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    display: inline-block; /* allows text-align to control horizontal placement */
}

/* For default image alignment based on side (can be overridden by user controls) */
.timeline-1862-item-left .timeline-1862-image {
    text-align: right;
}
.timeline-1862-item-right .timeline-1862-image {
    text-align: left;
}


/* Mobile Responsive */
@media (max-width: 767px) {
    .timeline-1862-item::before {
        left: 28px !important; /* Adjust line position for mobile (20px left + 8px dot center) */
    }
    
    .timeline-1862-item {
        flex-direction: column;
        align-items: flex-start;
        padding-left: 60px;
    }

    /* On mobile, everything slides from the right */
    .timeline-1862-item-left .timeline-1862-year-wrap,
    .timeline-1862-item-left .timeline-1862-content,
    .timeline-1862-item-right .timeline-1862-year-wrap,
    .timeline-1862-item-right .timeline-1862-content {
        transform: translateX(50px);
    }

    .timeline-1862-item.is-visible .timeline-1862-year-wrap,
    .timeline-1862-item.is-visible .timeline-1862-content {
        transform: translateX(0);
    }
    
    .timeline-1862-dot-wrap {
        left: 20px;
        transform: none;
    }
    
    .timeline-1862-year-wrap,
    .timeline-1862-content {
        width: 100%;
        /* Reset padding handled by Elementor controls when responsive */
    }
    
    /* Ensure padding control doesn't override mobile reset unless specified */
    .elementor-widget-custom_timeline_1862 .timeline-1862-year-wrap,
    .elementor-widget-custom_timeline_1862 .timeline-1862-content {
        /* User controls padding directly now via DIMENSIONS */
    }
    
    /* Base mobile alignment (will be overridden by user controls if set) */
    .timeline-1862-item-left .timeline-1862-year-wrap,
    .timeline-1862-item-left .timeline-1862-content,
    .timeline-1862-item-right .timeline-1862-year-wrap,
    .timeline-1862-item-right .timeline-1862-content {
        text-align: left;
    }
    
    .timeline-1862-item-left .timeline-1862-image,
    .timeline-1862-item-right .timeline-1862-image {
        text-align: left;
    }
    
    .timeline-1862-year-wrap {
        margin-bottom: 10px;
    }
}
