/* =====================================================
   IV1 Timeline Widget – Styles
   ===================================================== */

/* ── Wrapper ──────────────────────────────────────── */
.iv1-timeline {
    position: relative;
    padding: 40px 0;
    overflow: hidden;
}

/* ── Center line ──────────────────────────────────── */
.iv1-timeline__line-wrap {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 100%;
    display: flex;
    justify-content: center;
}

.iv1-timeline__line {
    width: 100%;
    height: 100%;
    background-color: #1a1a5e;
}

/* ── Each item row ────────────────────────────────── */
.iv1-timeline__item {
    display: grid;
    grid-template-columns: 1fr 60px 1fr;
    align-items: center;
    margin-bottom: 48px;
    position: relative;
}

.iv1-timeline__item:last-child {
    margin-bottom: 0;
}

/* ── Card wrap ────────────────────────────────────── */
.iv1-timeline__card-wrap {
    display: flex;
    align-items: center;
    position: relative;
}

/* Left side: card is in column 1, dot in column 2, spacer in column 3 */
.iv1-timeline__item--left .iv1-timeline__card-wrap {
    grid-column: 1;
    grid-row: 1;
    justify-content: flex-end;
}

.iv1-timeline__item--left .iv1-timeline__dot-wrap {
    grid-column: 2;
    grid-row: 1;
}

.iv1-timeline__item--left .iv1-timeline__spacer,
.iv1-timeline__item--left .iv1-timeline__date-outside {
    grid-column: 3;
    grid-row: 1;
}

/* Right side: spacer in column 1, dot in column 2, card in column 3 */
.iv1-timeline__item--right .iv1-timeline__spacer,
.iv1-timeline__item--right .iv1-timeline__date-outside {
    grid-column: 1;
    grid-row: 1;
}

.iv1-timeline__item--right .iv1-timeline__dot-wrap {
    grid-column: 2;
    grid-row: 1;
}

.iv1-timeline__item--right .iv1-timeline__card-wrap {
    grid-column: 3;
    grid-row: 1;
    justify-content: flex-start;
}

/* ── Card ─────────────────────────────────────────── */
.iv1-timeline__card {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 24px 28px;
    border-left: 4px solid #8b0045;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.10);
    position: relative;
    width: 100%;
    max-width: calc(100% - 20px);
    box-sizing: border-box;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.iv1-timeline__card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

/* ── Connector arrow ──────────────────────────────── */
.iv1-timeline__connector {
    width: 20px;
    height: 2px;
    background-color: #1a1a5e;
    flex-shrink: 0;
}

/* Arrow tip for left-side cards (arrow points right toward dot) */
.iv1-timeline__item--left .iv1-timeline__connector {
    order: 1;
    position: relative;
}

.iv1-timeline__item--left .iv1-timeline__connector::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: #1a1a5e;
}

/* Arrow for right-side cards (points left toward dot) */
.iv1-timeline__item--right .iv1-timeline__card-wrap {
    flex-direction: row-reverse;
}

.iv1-timeline__item--right .iv1-timeline__connector {
    position: relative;
}

.iv1-timeline__item--right .iv1-timeline__connector::after {
    content: '';
    position: absolute;
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: #1a1a5e;
}

/* ── Dot ──────────────────────────────────────────── */
.iv1-timeline__dot-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
}

.iv1-timeline__dot {
    width: 16px;
    height: 16px;
    background-color: #1a1a5e;
    border: 3px solid #1a1a5e;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.iv1-timeline__item:hover .iv1-timeline__dot {
    transform: scale(1.3);
}

/* Date at dot */
.iv1-timeline__dot-date {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 12px;
    font-weight: 600;
    color: #8b0045;
    background: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

/* ── Date ─────────────────────────────────────────── */
.iv1-timeline__date {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8b0045;
    margin-bottom: 8px;
}

/* Outside date */
.iv1-timeline__date-outside {
    display: flex;
    align-items: center;
    padding: 0 16px;
}

.iv1-timeline__item--left .iv1-timeline__date-outside {
    justify-content: flex-start;
    padding-left: 20px;
}

.iv1-timeline__item--right .iv1-timeline__date-outside {
    justify-content: flex-end;
    padding-right: 20px;
}

.iv1-timeline__date-outside .iv1-timeline__date {
    font-size: 14px;
    margin-bottom: 0;
}

/* ── Title ────────────────────────────────────────── */
.iv1-timeline__title {
    margin: 0 0 10px 0;
    padding: 0;
    font-size: 18px;
    font-weight: 700;
    color: #1a1a5e;
    line-height: 1.3;
}

/* ── Text ─────────────────────────────────────────── */
.iv1-timeline__text {
    margin: 0;
    padding: 0;
    font-size: 15px;
    line-height: 1.65;
    color: #555555;
}

/* ── Spacer ───────────────────────────────────────── */
.iv1-timeline__spacer {
    /* Keeps grid balanced on the opposite side */
}

/* ── Scroll Animation ─────────────────────────────── */
.iv1-timeline--animate .iv1-timeline__item {
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.iv1-timeline--animate .iv1-timeline__item--left {
    transform: translateX(-40px);
}

.iv1-timeline--animate .iv1-timeline__item--right {
    transform: translateX(40px);
}

.iv1-timeline--animate .iv1-timeline__item.iv1-visible {
    opacity: 1;
    transform: translateX(0);
}

/* ── Responsive ───────────────────────────────────── */
@media ( max-width: 767px ) {
    .iv1-timeline__item {
        grid-template-columns: 36px 1fr;
        margin-bottom: 36px;
    }

    /* Line shifts to the left on mobile */
    .iv1-timeline__line-wrap {
        left: 18px;
        transform: none;
    }

    /* All cards go to column 2 on mobile */
    .iv1-timeline__item--left .iv1-timeline__card-wrap,
    .iv1-timeline__item--right .iv1-timeline__card-wrap {
        grid-column: 2;
        grid-row: 1;
        justify-content: flex-start;
        flex-direction: row-reverse;
    }

    .iv1-timeline__item--left .iv1-timeline__dot-wrap,
    .iv1-timeline__item--right .iv1-timeline__dot-wrap {
        grid-column: 1;
        grid-row: 1;
    }

    /* Hide spacer/outside date on mobile */
    .iv1-timeline__item--left .iv1-timeline__spacer,
    .iv1-timeline__item--right .iv1-timeline__spacer,
    .iv1-timeline__item--left .iv1-timeline__date-outside,
    .iv1-timeline__item--right .iv1-timeline__date-outside {
        display: none;
    }

    /* Connector arrow on mobile (always points left) */
    .iv1-timeline__item--left .iv1-timeline__connector::after,
    .iv1-timeline__item--right .iv1-timeline__connector::after {
        left: -6px;
        right: auto;
        border: 6px solid transparent;
        border-right-color: #1a1a5e;
        border-left-color: transparent;
    }

    .iv1-timeline__card {
        max-width: 100%;
    }

    /* Reset mobile animations */
    .iv1-timeline--animate .iv1-timeline__item--left,
    .iv1-timeline--animate .iv1-timeline__item--right {
        transform: translateY(20px);
    }

    .iv1-timeline--animate .iv1-timeline__item.iv1-visible {
        transform: translateY(0);
    }
}
