/* -------------------------------------------
    Timeline
        - Timeline
        - Timeline item
        - Timeline media
        - Timeline content
        - Timeline title
        - Timeline meta
        - Timeline description
        - Timeline point
        - Timeline progress
        - Timeline line
        - Timeline alignment
        - Vertical timeline
---------------------------------------------- */

@import '../../../assets/sass/config';
@import '../../../assets/sass/direction';
@import '../../../assets/sass/mixins';

/* -------------------------------------------
    Timeline
---------------------------------------------- */


.timeline {
    position: relative;
}
.timeline-with-shadow .timeline-content {
    padding: 3rem;
    box-shadow: 0 5px 40px rgba(0, 0, 0, .07);
}
.timeline-item {
    display: flex;
    position: relative;
}
.timeline-media img {
    object-fit: cover;
}
.timeline-vertical .timeline-content {
    flex: 1;
    max-width: 100%;
}
.timeline-content > * {
    margin-top: .5rem;
    margin-bottom: 0;

    &:first-child {
        margin: 0;
    }
}
.timeline-title {
    font-size: 2.8rem;
}
.timeline-media + .timeline-title {
    margin-top: 1rem;
}
.timeline-meta {
    font-size: 1.6rem;
    letter-spacing: .1em;
    color: var(--alpha-primary-color, $primary-color);
    margin-top: .2rem;
}
.timeline-desc {
    margin-top: 1.3rem;
}
.timeline-point {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    margin-left: 2rem;
    margin-right: 2rem;
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--alpha-dark-color, $dark-color);
    background-color: var(--alpha-change-color-light-2);
    border-radius: 50%;
    transition: .3s;
}
div.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background-color: var(--alpha-change-color-light-2);
}
.timeline-item + .timeline-item {
    margin-top: 50px;
}


.timeline-v-align-top {
    .timeline-item {
        align-items: flex-start;
    }
}
.timeline-v-align-middle {
    .timeline-item {
        align-items: center;
    }
}
.timeline-v-align-bottom {
    .timeline-item {
        align-items: flex-end;
    }
}
.timeline-h-align-left {
    .timeline-line {
        #{$left}: 0;
        margin-left: 35px;
    }
    .timeline-point {
        order: -1;
    }
    .timeline-item .timeline-content,
    .timeline-item .timeline-meta-wrap {
        text-align: left;
    }
    &.timeline .timeline-point {
        margin-left: 0;
    }
}
.timeline-h-align-center {
    .timeline-item:nth-child(odd) {
        flex-direction: row-reverse;

        .timeline-meta-wrap {
            text-align: $right;
        }
    }
    .timeline-item:nth-child(even) {
        .timeline-content {
            text-align: $right;
        }
    }
    &.timeline-vertical .timeline-content,
    &.timeline-vertical .timeline-meta-wrap {
        flex: 1 1 50%;
        max-width: 50%;
    }
}
.timeline-h-align-right {
    .timeline-line {
        left: auto;
        right: 0;
        transform: translateX(50%);
        margin-right: 35px;
    }
    .timeline-point {
        order: 13;
    }
    .timeline-item .timeline-content,
    .timeline-item .timeline-meta-wrap {
        text-align: right;
    }
    &.timeline .timeline-point {
        margin-right: 0;
    }
}
.timeline-vertical.timeline-h-align-center {
    @include mq(lg) {
        .timeline-line {
            margin: 0 !important;
        }
    }
    @include mq(lg, max) {
        .timeline-meta-wrap {
            display: none;
        }

        .timeline-line {
            #{$left}: 0;
            margin-#{$left}: 35px;
        }

        .timeline-list .timeline-content {
            flex: 1;
            max-width: none;
            text-align: $left;
        }

        .timeline-list .timeline-item {
            flex-direction: row;
            justify-content: flex-start;
        }

        .timeline-point {
            order: -1;
            margin-#{$left}: 0;
        }
    }
}

.timeline-horizontal {
    padding-bottom: 3rem;
    -webkit-overflow-scrolling: touch;
    overflow: auto;
    &::-webkit-scrollbar {
        height: 4px;
        width: 4px;
        background-color: rgba(#000, .1);
        border-radius: 5px;
    }
    &::-webkit-scrollbar-thumb {
        background: rgba(#000, .3);
        border-radius: 5px;
        cursor: pointer;
    }

    .timeline-line {
        top: 50%;
        left: 0;
        right: 0;
        width: 100%;
        max-width: calc(100% - var(--alpha-gap) * 2);
        flex: 0 0 100%;
        height: 2px;
        transform: none;
        margin: 0 auto;
        padding: 0;
    }
    .timeline-point-wrap {
        position: relative;

        > img {
            position: absolute;
            left: 100%;
            top: 50%;
            transform: translate(-50%);
        }
    }
    .timeline-point {
        position: relative;
        margin-left: auto;
        margin-right: auto;
    }
    .timeline-item {
        flex-wrap: nowrap;
    }
    .timeline-item-top {
        align-items: flex-end;
    }
    .timeline-item-bottom {
        align-items: flex-start;
    }
    &.timeline-h-align-center .timeline-item .timeline-meta-wrap,
    .timeline-content {
        text-align: center;
    }
    &.timeline .timeline-item {
        flex-direction: row;
    }

    &.timeline .row {
        width: 100%;
        margin: 0;
        
        > * {
            padding: 0 var(--alpha-gap);
        }
    }
}

@include mq(lg) {
    .timeline-lg-none {
        display: none;
    }
}
