/* ============================================================
   Timeline Widget for Elementor  —  v1.0.0
   ============================================================ */

/* ── Reset / Base ── */
.twe-wrapper *,
.twe-wrapper *::before,
.twe-wrapper *::after {
    box-sizing: border-box;
}

.twe-wrapper {
    position: relative;
}

/* ============================================================
   ITEM  —  shared base
   ============================================================ */
.twe-item {
    display: flex;
    align-items: flex-start;
    position: relative;
}

/* ── Icon column ── */
.twe-icon-col {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

/* Vertical connector line */
.twe-line {
    position: absolute;
    top: 44px;          /* sits just below the icon */
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    bottom: -32px;      /* fills the item gap (default 32px) */
    background-color: #e0e0e0;
    z-index: 0;
}

.twe-item:last-child .twe-line {
    display: none;
}

/* ── Icon / dot ── */
.twe-icon {
    width: 44px;
    height: 44px;
    background-color: #6366f1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.twe-icon i,
.twe-icon svg {
    color: #ffffff;
    fill: #ffffff;
    font-size: 16px;
    line-height: 1;
    display: block;
}

/* ── Content body ── */
.twe-body {
    flex: 1;
    min-width: 0;
    margin-left: 20px;
}

/* ── Content box ── */
.twe-content {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px 24px;
    position: relative;
}

/* Arrow — pointing left (default: line on left) */
.twe-has-arrow::before,
.twe-has-arrow::after {
    content: '';
    position: absolute;
    top: 14px;
}

.twe-layout-left .twe-has-arrow::before {
    left: -9px;
    border-top:    8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right:  9px solid #e5e7eb;
}

.twe-layout-left .twe-has-arrow::after {
    left: -7px;
    border-top:    7px solid transparent;
    border-bottom: 7px solid transparent;
    border-right:  8px solid #ffffff;
}

/* Arrow — pointing right (line on right) */
.twe-layout-right .twe-has-arrow::before {
    right: -9px;
    border-top:    8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left:   9px solid #e5e7eb;
}

.twe-layout-right .twe-has-arrow::after {
    right: -7px;
    border-top:    7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left:   8px solid #ffffff;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */

.twe-date {
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #6366f1;
    margin-bottom: 6px;
}

/* Badge style (outside box, above it) */
.twe-date-badge {
    display: inline-block;
    background-color: #6366f1;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 8px;
}

.twe-title {
    font-size: 17px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 10px;
    line-height: 1.35;
}

.twe-desc {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.65;
    margin: 0;
}

/* ============================================================
   LAYOUT: RIGHT  (line on right)
   ============================================================ */
.twe-layout-right .twe-item {
    flex-direction: row-reverse;
}

.twe-layout-right .twe-body {
    margin-left: 0;
    margin-right: 20px;
    text-align: right;
}

/* ============================================================
   LAYOUT: CENTER  (alternating)
   ============================================================ */
.twe-layout-center .twe-item {
    align-items: flex-start;
}

/* Icon stays centered */
.twe-layout-center .twe-icon-col {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.twe-layout-center .twe-line {
    left: 50%;
    /* The absolute line drawn through items */
    bottom: -32px;
}

/* Both sides: occupy half width */
.twe-layout-center .twe-body {
    width: calc(50% - 42px);
    margin-left: 0;
    margin-right: 0;
}

/* Left-side items (odd) → content on the left */
.twe-layout-center .twe-item-left {
    justify-content: flex-start;
}

.twe-layout-center .twe-item-left .twe-body {
    margin-right: 20px;
    text-align: right;
}

/* Right-side items (even) → content on the right */
.twe-layout-center .twe-item-right {
    justify-content: flex-end;
}

.twe-layout-center .twe-item-right .twe-body {
    margin-left: 20px;
    text-align: left;
}

/* Arrows for center layout */
.twe-layout-center .twe-item-left .twe-has-arrow::before {
    right: -9px;
    left: auto;
    border-top:    8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left:   9px solid #e5e7eb;
    border-right:  none;
}

.twe-layout-center .twe-item-left .twe-has-arrow::after {
    right: -7px;
    left: auto;
    border-top:    7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left:   8px solid #ffffff;
    border-right:  none;
}

.twe-layout-center .twe-item-right .twe-has-arrow::before {
    left: -9px;
    border-top:    8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right:  9px solid #e5e7eb;
    border-left:   none;
}

.twe-layout-center .twe-item-right .twe-has-arrow::after {
    left: -7px;
    border-top:    7px solid transparent;
    border-bottom: 7px solid transparent;
    border-right:  8px solid #ffffff;
    border-left:   none;
}

/* ============================================================
   SCROLL ANIMATION
   ============================================================ */
.twe-animate {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}

.twe-animate.twe-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Always visible inside the editor */
.elementor-editor-active .twe-animate {
    opacity: 1 !important;
    transform: none !important;
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .twe-animate {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ============================================================
   RESPONSIVE  —  center layout collapses to left on mobile
   ============================================================ */
@media (max-width: 767px) {
    .twe-layout-center .twe-item {
        flex-direction: row;
        justify-content: flex-start !important;
    }

    .twe-layout-center .twe-icon-col {
        position: relative;
        left: auto;
        transform: none;
    }

    .twe-layout-center .twe-body,
    .twe-layout-center .twe-item-left .twe-body,
    .twe-layout-center .twe-item-right .twe-body {
        width: auto;
        flex: 1;
        margin-left: 20px;
        margin-right: 0;
        text-align: left;
    }

    .twe-layout-center .twe-item-left .twe-has-arrow::before,
    .twe-layout-center .twe-item-right .twe-has-arrow::before {
        right: auto;
        left: -9px;
        border-right:  9px solid #e5e7eb;
        border-left:   none;
    }

    .twe-layout-center .twe-item-left .twe-has-arrow::after,
    .twe-layout-center .twe-item-right .twe-has-arrow::after {
        right: auto;
        left: -7px;
        border-right:  8px solid #ffffff;
        border-left:   none;
    }

    .twe-layout-right .twe-body {
        text-align: left;
    }
}
