.wp-block-za-timeline-full-widget,
.wp-block-za-timeline-full-widget * {
    box-sizing: border-box;
}

.wp-block-za-timeline-full-widget .t-text-align-left {
    text-align: left;
}

.wp-block-za-timeline-full-widget .t-text-align-center {
    text-align: center;
}

.wp-block-za-timeline-full-widget .t-text-align-right {
    text-align: right;
}


.timeline-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
}

.timeline-line-animation {
    position: absolute;
    top: 0;
    left: 50%;
    width: var(--timeline-line-width, 4px);
    height: 100%;
    transform-origin: top;
    transform: translateX(-50%) scaleY(0);
    background-color: var(--timeline-line-active-color, #F37321);
    will-change: transform;
    z-index: 2;
}


.timeline-media-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.timeline-media-link img,
.timeline-media-link video {
    display: block;
}


.timeline img {
    border: 0;
    margin: 0 auto;
    max-width: 100%;
}

ul.timeline {
    list-style: none;
    position: relative;
    padding: 0;
    margin: 0;
}

.timeline:before {
    position: absolute;
    content: "";
    top: 0;
    bottom: 0;
    width: var(--timeline-line-width, 4px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;

    background-color: var(--timeline-line-color, #F6F6F8);
}

.timeline-panel {
    position: relative;

}



.timeline-item {
    position: relative;
    display: grid;
    grid-template-columns:1fr;
    justify-content: center;
    margin: 0;
}


.timeline-item:not(:first-child) {
    margin-top: 40px;
}

.timeline-side p:not(:last-child) {
    margin-bottom: 10px;
}

.tl-desc-short strong {
    font-weight: bold;
}
.tl-desc-short a {
    text-decoration: underline;
}

.tl-content{
    display: flex;
    flex-direction: column;
    border: 1px solid #F6F6F8;
    border-radius: 5px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.tl-content .tl-desc-short p{
    margin-bottom: 10px;
}


.tl-content-horizontal{
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.tl-content-horizontal .timeline_pic,
.tl-content-horizontal .timeline-media-link {
    flex: 0 1 45%;
    min-width: 0;
    max-width: 45%;
}

.tl-content-horizontal .timeline-media-link .timeline_pic {
    max-width: 100%;
}

.tl-content-horizontal .timeline_pic img,
.tl-content-horizontal .timeline_pic video {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
}

.tl-content-horizontal .tl-desc {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}

.tl-content-horizontal .tl-title,
.tl-content-horizontal .tl-desc-short {
    max-width: 100%;
}


.tl-mark {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    align-self: self-start;
    transition: background 0.2s;
    width: var(--marker-size, 30px);
    height: var(--marker-size, 30px);
    border-radius: 50%;
    box-sizing: border-box;
    backface-visibility: hidden;
    z-index: 3;
    background-color: var(--timeline-marker-color, #F6F6F8);

}



.tl-mark:has(img) {
    background: none !important;
    background-size: cover;
    max-width: var(--marker-size, 30px);
}

.tl-mark img {
    max-width: initial !important;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.timeline.timeline-animation-marker .is-stuck .tl-mark,
.timeline.timeline-animation-marker li.is-stuck .tl-mark {
    transition: background 0.2s;
    background-color: var(--timeline-marker-active-color, #F37321);
}

.timeline-numbers {
    counter-reset: item;
}


.timeline-numbers li .tl-mark::after {
    counter-increment: item;
    content: counter(item);

    position: absolute;
    inset: 0;

    display: grid;
    place-items: center;

    font-size: clamp(12px, calc(var(--marker-size, 30px) * 0.55), 26px);
    line-height: 1;
    font-weight: 700;
    color: #6f6f6f;

    font-variant-numeric: tabular-nums;

    transition: color 0.12s;
    pointer-events: none;
    z-index: 3;
}

.timeline-numbers .is-stuck .tl-mark::after{
    color: #fff;
}

.tl-trigger {
    position: absolute;
    top: 50vh;
    height: 1px;
    width: 100%;
    pointer-events: none;
}

.timeline-side {
    width: 100%;
    line-height: 1.3em;
}

.timeline-side b,
.timeline-side strong{
    font-weight: 700;
}

.timeline-side p {
    margin-top: 0;
}

.timeline-side li:not(:last-child){
    margin-bottom: 8px;
}


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

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

.timeline .timeline_pic {
    position: relative;
    padding: 0;
}

.tl-title {
    display: block;
    margin: 10px 0 0;
    font-size: 22px;
    line-height: 1.5;
    font-weight: 700;
}

.tl-content p {
    margin-top: 0;
    margin-bottom: 5px
}


@media (min-width: 701px) {

    .timeline-item {
        grid-template-columns: 1fr 1fr;
    }

    .timeline-animation-marker .timeline-item {
        grid-template-columns: 1fr var(--marker-size, 30px) 1fr;
        grid-gap: 20px;
        padding-left: 0;
    }

    .timeline-inverted {
        direction: rtl;
    }

    .timeline-inverted > * {
        direction: ltr;
    }

    .tl-desc-short ul,
    .timeline-side ul {
        padding-left: 22px;
    }

    .timeline-animation-other-side-sticky .timeline-side {
        position: sticky;
        top: 0;
        align-self: start;
        z-index: 2;
    }

    .timeline.timeline-animation-marker .timeline-item {
        grid-template-columns: minmax(0, 1fr) var(--marker-size, 30px) minmax(0, 1fr);
        column-gap: 20px;
    }

    .timeline.timeline-animation-marker .tl-mark {
        grid-column: 2;
        justify-self: center;
        align-self: start;

        position: sticky;
        top: 0;

        left: auto;
        transform: none;
    }

    .timeline-left .timeline-side {
        padding-right: 30px;
    }

    .timeline-animation-marker .timeline-panel {
        margin: 0;
    }

    .tl-reverse{
        flex-direction: column-reverse;
    }
    .tl-content-horizontal.tl-reverse{
        flex-direction: row-reverse;
    }

    .timeline.timeline-animation-marker > .timeline-item > .timeline-side {
        grid-column: 1;
        grid-row: 1;
        align-self: start;
    }

    .timeline.timeline-animation-marker > .timeline-item > .tl-mark {
        grid-column: 2;
        grid-row: 1;
    }

    .timeline.timeline-animation-marker > .timeline-item > .timeline-panel {
        grid-column: 3;
        grid-row: 1;
        align-self: start;
    }



}

@media (max-width: 700px) {

    .timeline-item {
        padding-left: calc(var(--marker-size, 30px) + 4px);
        padding-right: 10px;
    }

    .tl-title,
    .timeline-side p {
        text-align: left;
    }

    .tl-mark {
        left: calc(var(--marker-size, 30px) / 2);
    }

    .timeline-line-animation {
        left:  calc(var(--marker-size, 30px) / 2);
    }

    .timeline:before {
        left:  calc(var(--marker-size, 30px) / 2);
        margin-left: 0;
    }

    .timeline-panel {
        order: -1;
        margin-bottom:  calc(var(--marker-size, 30px) / 2);
    }


    .timeline-item > .timeline-panel:before {
        border-left-width: 0;
        border-right-width: 15px;
        left: -15px;
        right: auto;
    }

    .timeline-item > .timeline-panel:after {
        border-left-width: 0;
        border-right-width: 14px;
        left: -14px;
        right: auto;
    }

    .tl-content-horizontal {
        flex-direction: column;
        align-items: stretch;
    }


    .tl-content-horizontal .timeline_pic,
    .tl-content-horizontal .timeline-media-link {
        flex-basis: auto;
        max-width: 100%;
    }
}




/* Portable transfers deliberately use one SVG instead of copying site media.
   Keep a missing-size placeholder inside a normal Timeline card: SVG intrinsic
   dimensions must never determine the height of the entire widget. */
.timeline .timeline_pic img[src*="media-placeholder.svg"],
.timeline .timeline_pic img.timeline-video-placeholder {
    display: block;
    max-width: 100%;
    max-height: 320px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.timeline .tl-content-horizontal .timeline_pic img[src*="media-placeholder.svg"],
.timeline .tl-content-horizontal .timeline_pic img.timeline-video-placeholder {
    width: 100%;
}

/* Marker image placeholders must use the configured marker diameter.
   The generic .tl-mark img rule uses max-width:initial!important, which made
   800x600 SVG placeholders escape the marker and cover the Elementor canvas. */
.timeline .tl-mark img[src*="media-placeholder.svg"] {
    width: var(--marker-size, 30px) !important;
    height: var(--marker-size, 30px) !important;
    max-width: var(--marker-size, 30px) !important;
    max-height: var(--marker-size, 30px) !important;
    object-fit: contain;
}


/* Elementor per-item typography: ensure paragraph theme rules do not override
   the explicit settings imported from nested Gutenberg text blocks. */
.timeline-item.tfw-side-custom-color .timeline-side :is(p, li, h1, h2, h3, h4, h5, h6) {
    color: inherit;
}
.timeline-item.tfw-side-custom-size .timeline-side :is(p, li, h1, h2, h3, h4, h5, h6) {
    font-size: inherit;
}
.timeline-item.tfw-content-custom-color .tl-desc-short :is(p, li) {
    color: inherit;
}
.timeline-item.tfw-content-custom-size .tl-desc-short :is(p, li) {
    font-size: inherit;
}

/* Explicit media width controls the display size, independently of the
   attachment thumbnail resolution; linked media uses the anchor as wrapper. */
.timeline .timeline_pic.tfw-media-sized > :is(img, video),
.timeline .timeline-media-link.tfw-media-sized .timeline_pic > :is(img, video) {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: auto;
    object-fit: contain;
}
.timeline .tl-content-horizontal .timeline_pic.tfw-media-sized,
.timeline .tl-content-horizontal .timeline-media-link.tfw-media-sized {
    flex: 0 1 auto;
    max-width: 100%;
}
/* The marker's diameter, not an uploaded image's intrinsic dimensions,
   determines its size. Applies to real images and transfer placeholders. */
.timeline .tl-mark > img {
    width: var(--marker-size, 30px) !important;
    height: var(--marker-size, 30px) !important;
    max-width: var(--marker-size, 30px) !important;
    max-height: var(--marker-size, 30px) !important;
    object-fit: contain;
}
