﻿.timeline-box {
    position: relative;
}

.img-timeline {
    position: absolute;
}

.timeline-heading {
    border-bottom: 1px solid var(--bs-border-color);
    margin-bottom: 10px;
}

.timeline {
    list-style: none;
    padding: 20px 0 20px;
    position: relative;

    &::before {
        background-color: var(--bs-border-color);
        bottom: 0;
        content: " ";
        left: 50%;
        margin-left: -1.5px;
        position: absolute;
        top: 0;
        width: 3px;
    }

    > li {
        margin-bottom: 20px;
        position: relative;

        &::before,
        &::after {
            content: " ";
            display: table;
        }

        &::after {
            clear: both;
        }

        > .timeline-panel {
            border: 1px solid var(--bs-border-color);
            border-radius: var(--bs-border-radius-lg);
            float: left;
            padding: 20px;
            position: relative;
            width: 46%;

            &::before {
                border-bottom: 15px solid transparent;
                border-left: 15px solid var(--bs-border-color);
                border-right: 0 solid var(--bs-border-color);
                border-top: 15px solid transparent;
                content: " ";
                display: inline-block;
                position: absolute;
                right: -15px;
                top: 26px;
            }

            &::after {
                border-bottom: 14px solid transparent;
                border-left: 14px solid var(--bs-white);
                border-right: 0 solid var(--bs-white);
                border-top: 14px solid transparent;
                content: " ";
                display: inline-block;
                position: absolute;
                right: -14px;
                top: 27px;
            }
        }

        > .timeline-badge {
            border: 3px solid var(--accent-color1);
            border-radius: 50%;
            background-color: var(--bs-white);
            color: var(--accent-color1);
            font-size: 1.4em;
            height: 35px;
            left: 50%;
            margin-left: -17px;
            position: absolute;
            text-align: center;
            top: 24px;
            width: 35px;
            z-index: 100;
        }

        &.timeline-inverted {
            > .timeline-panel {
                float: right;

                &::before {
                    border-left-width: 0;
                    border-right-width: 15px;
                    left: -15px;
                    right: auto;
                }

                &::after {
                    border-left-width: 0;
                    border-right-width: 14px;
                    left: -14px;
                    right: auto;
                }
            }
        }
    }
}

.timeline-body {
    > p,
    > ul {
        margin-bottom: 0;
    }

    > p + p {
        margin-top: 5px;
    }
}

@media (max-width: 767px) {
    .img-timeline {
        display: none;
    }

    ul.timeline {
        &::before {
            left: 22px;
        }

        > li {
            > .timeline-panel {
                float: right;
                width: calc(100% - 65px);

                &::before {
                    border-left-width: 0;
                    border-right-width: 15px;
                    left: -15px;
                    right: auto;
                }

                &::after {
                    border-left-width: 0;
                    border-right-width: 14px;
                    left: -14px;
                    right: auto;
                }
            }

            > .timeline-badge {
                height: 45px;
                left: 0;
                line-height: 45px;
                margin-left: 0;
                top: 16px;
                width: 45px;
            }
        }
    }
}

[data-bs-theme=dark] {
    .timeline-heading {
        border-bottom: 1px solid var(--bs-border-color);
    }

    .timeline {
        &::before {
            background-color: var(--bs-border-color);
        }

        > li {
            > .timeline-panel {
                border: 1px solid var(--bs-border-color);
                background-color: transparent !important;

                &::before {
                    border-left: 15px solid var(--bs-border-color);
                    border-right: 0 solid var(--bs-border-color);
                }

                &::after {
                    border-left: 14px solid var(--bs-border-color);
                    border-right: 0 solid var(--bs-border-color);
                }
            }

            > .timeline-badge {
                background-color: var(--bs-secondary-bg-subtle);
                border: 3px solid var(--bs-border-color);
            }
        }
    }

    .timeline-body a {
        color: var(--bs-secondary-color);
    }

    .timeline-title a {
        color: var(--bs-white);
    }
}