/* ============================================================
   MT Timeline Widget — Video Background + Full Color Control
   ============================================================ */

/* ── Wrapper ───────────────────────────────────────────────── */
.mt-addon-timeline-wrapper.mt-timeline-has-video {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 0;
    width: 100%;
}

/* ── Video fill layer ──────────────────────────────────────── */
.mt-timeline-video-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.mt-timeline-video-bg video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* ── Dim overlay ───────────────────────────────────────────── */
.mt-timeline-video-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(0, 0, 0, 0.55);
    pointer-events: none;
}

/* ── Inner content sits above video & overlay ──────────────── */
.mt-timeline-inner-content {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 0 clamp(1.5rem, 3vw, 5rem); /* horizontal padding so items don't clip */
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

/* ── Main title ────────────────────────────────────────────── */
.mt-addon-timeline-wrapper .mt-e-timeline-main-title {
    font-family: var(--mt-e-title-font, 'Poppins', sans-serif);
    margin-top: 0;
    text-transform: capitalize;
    text-wrap: balance;
    font-weight: 600;
    color: #ffffff;
    text-align: center;
    margin-bottom: clamp(1.25rem, 0.9615rem + 1.2821vw, 2.5rem);
    height: auto;
    width: 100%;
}

/* ── Main description ──────────────────────────────────────── */
.mt-addon-timeline-wrapper .mt-e-timeline-main-desc {
    font-family: var(--mt-e-title-font, 'Poppins', sans-serif);
    font-size: clamp(1rem, 0.8rem + 0.9vw, 1.5rem);
    line-height: 1.6;
    color: #cccccc;
    font-weight: 400;
    text-align: center;
    max-width: 800px;
    margin: clamp(1.25rem, 0.9615rem + 1.2821vw, 2.5rem) auto 0;
}

/* ── Items row ─────────────────────────────────────────────── */
.mt-addon-timeline-wrapper .mt-addon-timeline-items {
    display: flex;
    flex-wrap: nowrap;
    gap: clamp(1.25rem, 0.9615rem + 1.2821vw, 2.5rem);
    font-family: var(--mt-e-title-font, 'Poppins', sans-serif);
    width: 100%;
    align-items: flex-start;
}

.mt-addon-timeline-wrapper .mt-addon-timeline-item {
    flex: 1 1 0%;       /* equal columns, no overflow */
    min-width: 0;       /* prevent flex blowout */
    padding: 40px 0;
    display: inline-flex;
    align-items: flex-start;
}

.mt-addon-timeline-wrapper .mt-addon-timeline-item .mt-content {
    width: 100%;
}

/* ── Counter + connector ───────────────────────────────────── */
.mt-count-wrapper {
    margin: clamp(1.25rem, 1.1058rem + 0.641vw, 1.875rem) 0;
}

.mt-count-wrapper .mt-e-count-line {
    position: relative;
}

.mt-count-wrapper .mt-e-count-line:before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    width: calc(100% - clamp(2.5rem, 1.9231rem + 2.5641vw, 5rem));
    height: 3px;
    background: #A29C9C;
    transform: translateY(-50%);
    opacity: 0.6;
    z-index: 1;
    transition: var(--mt-e-transition, 375ms cubic-bezier(0.7, 0, 0.3, 1));
    margin: 0 auto;
}

.mt-count-wrapper .mt-e-count-line > .mt-count {
    width: clamp(2.5rem, 2.2115rem + 1.2821vw, 3.75rem);
    height: clamp(2.5rem, 2.2115rem + 1.2821vw, 3.75rem);
    border-radius: 50%;
    background: #A29C9C;
    border: 2px solid #A29C9C;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
    transition: var(--mt-e-transition, 375ms cubic-bezier(0.7, 0, 0.3, 1));
    font-size: clamp(1.125rem, 1.0385rem + 0.3846vw, 1.5rem);
    font-weight: 700;
    color: #fff;
}

/* Last item — no connector line after it */
.mt-addon-timeline-wrapper .mt-addon-timeline-item:last-child .mt-count-wrapper .mt-e-count-line:before {
    display: none;
}

/* ── Sub title ─────────────────────────────────────────────── */
.mt-addon-timeline-wrapper .mt-addon-timeline-item .mt-e-cert-top {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #fff;
    line-height: 1.3;
    transition: var(--mt-e-transition, 375ms cubic-bezier(0.7, 0, 0.3, 1));
}

/* ── Item title ────────────────────────────────────────────── */
.mt-addon-timeline-wrapper .mt-addon-timeline-item .mt-e-timeline-title {
    min-height: clamp(2.5rem, 2.2115rem + 1.2821vw, 3.75rem);
    height: auto;
    font-weight: 600;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 10px;
    transition: var(--mt-e-transition, 375ms cubic-bezier(0.7, 0, 0.3, 1));
}

/* ── Item description ──────────────────────────────────────── */
.mt-addon-timeline-wrapper .mt-addon-timeline-item .mt-e-timeline-desc {
    font-size: clamp(0.5625rem, 0.5192rem + 0.1923vw, 0.75rem);
    line-height: 1.6;
    color: #ccc;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: var(--mt-e-transition, 375ms cubic-bezier(0.7, 0, 0.3, 1));
}

/* ── Button / link ─────────────────────────────────────────── */
.mt-addon-timeline-wrapper .mt-button {
    display: inline-block;
    margin-top: 8px;
    color: #ff6b35;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: opacity 0.2s ease;
}

.mt-addon-timeline-wrapper .mt-button:hover {
    opacity: 0.75;
}

/* ── Active state ──────────────────────────────────────────── */

/*
  ALL active colors are intentionally left WITHOUT hardcoded values here.
  They are 100% controlled via Elementor color pickers in index.php
  using {{WRAPPER}} selectors. This prevents any hardcoded color
  overriding the user's chosen values.
*/

.mt-addon-timeline-wrapper .mt-addon-timeline-item.is-active .mt-e-cert-top,
.mt-addon-timeline-wrapper .mt-addon-timeline-item.is-active .mt-e-timeline-title,
.mt-addon-timeline-wrapper .mt-addon-timeline-item.is-active .mt-e-timeline-desc {
    /* colors come from Elementor controls — no hardcoded override */
    transition: var(--mt-e-transition, 375ms cubic-bezier(0.7, 0, 0.3, 1));
}

/* Counter scale on active */
.mt-addon-timeline-wrapper .mt-addon-timeline-item.is-active .mt-e-count-line > span {
    transform: scale(1.15);
}

/* Active connector line — opacity full */
.mt-addon-timeline-wrapper .mt-addon-timeline-item.is-active .mt-e-count-line:before {
    opacity: 1;
}

/* ── Responsive ────────────────────────────────────────────── */
@media only screen and (max-width: 768px) {

    /* Wrapper padding */
    .mt-addon-timeline-wrapper.mt-timeline-has-video {
        padding: 40px 0;
    }

    /* Inner content horizontal padding */
    .mt-timeline-inner-content {
        padding: 0 1.25rem;
    }

    /* Items wrap into 2-per-row */
    .mt-addon-timeline-wrapper .mt-addon-timeline-items {
        flex-wrap: wrap;
    }

    /* Each item: ~half width, auto height */
    .mt-addon-timeline-wrapper .mt-addon-timeline-item {
        height: auto;
        padding: 10px 20px;
        flex: 1 1 49%;
    }

    /* Content: flex-wrap so sub-title spans full width above circle+text */
    .mt-addon-timeline-wrapper .mt-addon-timeline-item .mt-content {
        display: flex;
        flex-wrap: wrap;
        gap: 12px 20px;
    }

    /* Sub-title: full width, indented to align with text (past the circle) */
    .mt-addon-timeline-wrapper .mt-addon-timeline-item .mt-e-cert-top {
        flex: 0 0 100%;
        padding-left: calc(clamp(2.5rem, 2.2115rem + 1.2821vw, 3.75rem) + 20px);
    }

    /* Count wrapper: no top/bottom margin on mobile */
    .mt-addon-timeline-wrapper .mt-addon-timeline-item .mt-count-wrapper {
        margin: 0;
    }

    /* Line element stretches to fill full item height */
    .mt-count-wrapper .mt-e-count-line {
        height: 100%;
    }

    /* Vertical connector line: runs from top of count-line downward, bridges to next row */
    .mt-count-wrapper .mt-e-count-line:before {
        top: 0;
        left: 0;
        right: 0;
        width: 2px;
        height: calc(100% + 43px);
        transform: none;
    }

    /* Text content fills remaining space beside the circle */
    .mt-addon-timeline-wrapper .mt-addon-timeline-item .mt-timeline-content {
        flex: 1 1 60%;
    }

    /* Circle shifted upward so it sits at the top of the item */
    .mt-count-wrapper .mt-e-count-line > .mt-count {
        transform: translateY(-80%);
        transform-origin: bottom center;
    }
}
