/* ldev-timeline */
.ldev-timeline {
    position: relative;
    padding: 0;
    list-style: none;
}

/* Suppress ::before on the outer ldev-question wrapper (added by ldev_question.twig via ldev-{{ type }}) */
.ldev-question.ldev-timeline::before {
    display: none;
}

/* vertical line */
.ldev-timeline::before {
    content: '';
    position: absolute;
    top: 4px;
    bottom: 0;
    left: 18px;
    width: 2px;
    background: #ddd;
}

/* item */
.ldev-tl-item {
    position: relative;
    padding-left: 52px;
    margin-bottom: 28px;
}
.ldev-tl-item:last-child {
    margin-bottom: 0;
}

/* dot — size via --ldev-dot-size; color via --ldev-dot-color */
.ldev-tl-dot {
    position: absolute;
    /* center on the line: line center = 18px + 1px = 19px; dot left = 19 - size/2 */
    left: calc(19px - var(--ldev-dot-size, 18px) / 2);
    top: 4px;
    width: var(--ldev-dot-size, 18px);
    height: var(--ldev-dot-size, 18px);
    border-radius: 50%;
    background: var(--ldev-dot-color, #337ab7);
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--ldev-dot-color, #337ab7);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ─── Shape modifiers ─── */
.ldev-tl-dot--square {
    border-radius: 3px;
}
.ldev-tl-dot--diamond {
    border-radius: 3px;
    transform: rotate(45deg);
}
.ldev-tl-dot--ring {
    background: transparent;
    border: 3px solid var(--ldev-dot-color, #337ab7);
    box-shadow: none;
}
.ldev-tl-dot--hexagon {
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    border: none;
    box-shadow: none;
    border-radius: 0;
}
.ldev-tl-dot--star {
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    border: none;
    box-shadow: none;
    border-radius: 0;
}
.ldev-tl-dot--pin {
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
}
.ldev-tl-dot--cross {
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
}
.ldev-tl-dot--cross::before,
.ldev-tl-dot--cross::after {
    content: '';
    position: absolute;
    background: var(--ldev-dot-color, #337ab7);
    border-radius: 1px;
}
.ldev-tl-dot--cross::before {
    width: 100%;
    height: 30%;
    top: 35%;
    left: 0;
}
.ldev-tl-dot--cross::after {
    width: 30%;
    height: 100%;
    top: 0;
    left: 35%;
}

/* ─── Numbered content inside dot ─── */
.ldev-tl-dot--num {
    font-size: calc(var(--ldev-dot-size, 18px) * 0.55);
    color: #fff;
    font-weight: bold;
    line-height: 1;
}
.ldev-tl-dot--ring.ldev-tl-dot--num{
    color:var(--ldev-dot-color, #337ab7);
    background: #fff;
}
.ldev-tl-dot--num span {
    display: block;
    line-height: 1;
}
/* counter-rotate number for rotated shapes */
.ldev-tl-dot--diamond.ldev-tl-dot--num span {
    transform: rotate(-45deg);
}
.ldev-tl-dot--pin.ldev-tl-dot--num span {
    transform: rotate(45deg);
}

/* label (date/marker) */
.ldev-tl-label {
    font-size: 12px;
    color: #888;
    margin-bottom: 3px;
}

/* title */
.ldev-tl-title {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 6px;
    color: #333;
}

/* ─── Alternate layout ─── */
.ldev-timeline--alternate::before {
    left: 50%;
    margin-left: -1px;
}

/* Full-width items; padding pushes content to the correct half */
.ldev-timeline--alternate .ldev-tl-item {
    width: 100%;
    margin-left: 0;
    padding-left: calc(50% + 20px);
    padding-right: 0;
    text-align: left;
}

.ldev-timeline--alternate .ldev-tl-item:nth-child(even) {
    padding-left: 0;
    padding-right: calc(50% + 20px);
    text-align: right;
}

/* Dot exactly on the center line for all alternate items */
.ldev-timeline--alternate .ldev-tl-dot,
.ldev-timeline--alternate .ldev-tl-item:nth-child(even) .ldev-tl-dot {
    left: calc(50% - var(--ldev-dot-size, 18px) / 2);
    right: auto;
}

/* collapse alternate → left on mobile */
@media (max-width: 767px) {
    .ldev-timeline--alternate::before {
        left: 18px;
        margin-left: 0;
    }
    .ldev-timeline--alternate .ldev-tl-item,
    .ldev-timeline--alternate .ldev-tl-item:nth-child(even) {
        padding-left: 52px;
        padding-right: 0;
        text-align: left;
    }
    .ldev-timeline--alternate .ldev-tl-dot,
    .ldev-timeline--alternate .ldev-tl-item:nth-child(even) .ldev-tl-dot {
        left: calc(19px - var(--ldev-dot-size, 18px) / 2);
        right: auto;
    }
}

/* ─── Fade animation ─── */
.ldev-tl-animated .ldev-tl-item {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.ldev-tl-animated .ldev-tl-item.ldev-tl-visible {
    opacity: 1;
    transform: none;
}

/* vertical line fades in when first item becomes visible */
.ldev-tl-animated::before {
    opacity: 0;
    transition: opacity 0.8s ease;
}
.ldev-tl-animated.ldev-tl-started::before {
    opacity: 1;
}
