﻿.timeline-main-title {
    font-family: var(--kh-bold);
    font-size: 2.2rem;
    margin-top: 60px;
    margin-bottom: 40px;
    text-align: center;
    margin-inline: auto;
}

.timeline-outer {
    width: min(var(--default-spacing), var(--default-max-spacing));
    margin-inline: auto;
}

.timeline-outer .card-view {
    width: 100%;
}

.timeline-item {
    display: grid;
    grid-template-columns: 1fr 50px 1fr;
    align-items: center;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
    width: 100%;
}

.timeline-content {
    display: flex;
    flex-direction: column;
    background: #f9f9f9;
    border-radius: 15px;
    padding: 20px;
    max-width: 400px;
    row-gap: 20px;
    
     transition: 0.3s;
     overflow: hidden;
     position: relative;

}


    .timeline-content::before {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: 15px;
        padding: 2px;
        background: linear-gradient(120deg, #5BE11E, #00c3ff);
        -webkit-mask: 
            linear-gradient(#fff 0 0) content-box, 
            linear-gradient(#fff 0 0);
        -webkit-mask-composite: xor;
        mask-composite: exclude;
        opacity: 0;
        transition: 0.3s;
    }

    .timeline-content:hover::before {
        opacity: 1;
    }

    .timeline-content:hover {
        transform: translateY(-3px);
        box-shadow: 0 15px 30px rgba(0,0,0,0.15);
    }

/*.timeline-content:hover {
     transform: translateY(-5px);
    border: 1px solid #5BE11E;
}*/

.timeline-outer .card-view:nth-child(odd) .timeline-content {
    grid-column: 1;
    justify-self: end;
    text-align: right;
    direction: rtl;
}

.timeline-outer .card-view:nth-child(odd) .timeline-empty {
    grid-column: 3;
}

.timeline-outer .card-view:nth-child(even) .timeline-content .timeline-content-box .timeline-description {
    direction: rtl;
}

.timeline-outer .card-view:nth-child(even) .timeline-content {
    grid-column: 3;
    justify-self: start;
    text-align: left;
}

.timeline-outer .card-view:nth-child(even) .timeline-empty {
    grid-column: 1;
}

.timeline-outer .card-view:nth-child(even) .timeline-marker {
    grid-column: 2;
    grid-row: 1;
}

.timeline-content-box {
    display: flex;
    flex-direction: column;
}

.timeline-title {
    font-family: var(--kh-bold);
    font-size: 1.1rem;
    color: #0B3B3A;
    position: relative;
}



.timeline-description {
    font-size: 1rem;
    font-family: var(--kh-reg);
    line-height: 27px;
    color: #758584;
    position: relative;
}

.timeline-marker {
    display: flex;
    justify-content: center;
    position: relative;
}

.timeline-item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    height: calc(50% - 10px);
    border-left: 2px dashed rgba(0,0,0, 0.13);
    transform: translateX(-50%);
}

.timeline-item::after {
    content: "";
    position: absolute;
    bottom: -35px;
    left: 50%;
    height: calc(50% - -25px);
    border-left: 2px dashed rgba(0,0,0, 0.13);
    transform: translateX(-50%);
}

.timeline-outer .card-view:last-child .timeline-item::after{
   bottom: 0;
   height: calc(50% - 10px);
}

.pulse-circle {
    transform-origin: center;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.12);
        opacity: 0.5;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}



.timeline-icon-box {
    background-color: #edf8e8;
    width: 65px;
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.timeline-icon-box img {
    object-fit: cover;
    z-index: 2;
    width: 36px;
    height: 36px;
}



/*#region Media Queary*/

/*#region 1255px*/


/*#endregion*/

/*#region 678px*/

@media(max-width: 678px) {


    .timeline-item {
        display: flex;
        flex-direction: column;
        margin-bottom: unset;
    }

    .timeline-outer .card-view:nth-child(odd) .timeline-content
     {
        direction: unset;
    }

    .timeline-outer .card-view:nth-child(even) .timeline-content .timeline-content-box .timeline-description {
        direction: unset;
    }

        .timeline-content {
            margin-block: 20px;
            align-items: flex-end;
        }

        .timeline-item::before,
        .timeline-item:after {
            display: none;
        }

            .timeline-marker {
        position: relative;
        z-index: 2;
    }

      .timeline-marker::after {
        content: "";
        position: absolute;
        top: 100%;                 /* يبدأ أسفل النقطة */
        left: 50%;
        transform: translateX(-50%);
        height: 36px;              /* المسافة بين العناصر */
        border-left: 2px dashed rgba(0,0,0, 0.13);
        z-index: -1;
    }

      .timeline-marker::before {
        content: "";
        position: absolute;
        bottom: 100%;                 /* يبدأ أسفل النقطة */
        left: 50%;
        transform: translateX(-50%);
        height: 19px;              /* المسافة بين العناصر */
        border-left: 2px dashed rgba(0,0,0, 0.13);
        z-index: -1;
    }

    .timeline-outer .card-view:last-child .timeline .timeline-item .timeline-marker::after,
    .timeline-outer .card-view:last-child .timeline .timeline-item .timeline-marker::before {
        display: none;
    }

    .timeline-outer .card-view:last-child .timeline .timeline-item .timeline-marker {
        display: none;
    }

    .timeline-content-box {
        text-align: right;
        direction: rtl;
    }

}

/*#endregion*/

/*#region 495px*/

@media(max-width: 495px) {


    .timeline-main-title {
        width: 390px;
        max-width: 90%;
        font-size: 2rem;
    }

}

/*#endregion*/

/*#region 430px*/

@media(max-width: 430px) {


    .timeline-main-title {
        width: 350px;
        max-width: 90%;
        font-size: 1.7rem;
        margin-bottom: 20px;
    }
}

/*#endregion*/

/*#region 370px*/

@media(max-width: 370px) {


    .timeline-main-title {
        width: 320px;
        font-size: 1.5rem;

    }
}

/*#endregion*/

/*#endregion*/

/*#region توازن التايملاين: رقم كبير بالجهة الفاضية مقابل كل كرت (إضافة، ما تغيّر شي من فوق)*/

/* الترقيم بيصير لحالو بالـ CSS حسب ترتيب الكروت بالداتا، فإذا انضافت خدمة بياخد رقمها */
.timeline-outer {
    counter-reset: kh-service;
}

.timeline-outer .card-view {
    counter-increment: kh-service;
}

/* الجهة الفاضية صارت مكان الرقم */
.timeline-empty {
    display: flex;
    align-items: center;
    padding-inline: 34px;
}

.timeline-empty::before {
    content: counter(kh-service, decimal-leading-zero);
    font-family: var(--kh-bold);
    font-size: 4.6rem;
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 1.5px rgba(0, 34, 33, 0.2);
    transition: color 0.35s ease, -webkit-text-stroke-color 0.35s ease, transform 0.35s ease;
}

/* الكرت على اليسار: الرقم يمين الخط. الكرت على اليمين: الرقم يسار الخط. هيك الرقم دايماً لازق بالخط ومقابل كرتو */
.timeline-outer .card-view:nth-child(odd) .timeline-empty {
    justify-content: flex-start;
}

.timeline-outer .card-view:nth-child(even) .timeline-empty {
    justify-content: flex-end;
    /* بالكروت الزوجية الجهة الفاضية كانت تنزل لسطر تاني بالـ grid (ما كان يبيّن لأنها فاضية). هلّق فيها الرقم، فلازم تضل بنفس سطر الكرت */
    grid-row: 1;
}

/* لما الماوس يكون على الكرت، رقمو بيتعبّى بأخضر الهوية: بيربط الكرت برقمو */
.timeline-item:hover .timeline-empty::before {
    color: var(--pr-color);
    -webkit-text-stroke-color: var(--pr-color);
    transform: scale(1.06);
}

/* ظهور ناعم وقت السكرول: كل كرت بيدخل من جهتو، والرقم من الجهة التانية (CSS بس).
   بيحرّك translate مش transform، مشان ما يلغي حركة الـ hover تبع الكرت */
@keyframes kh-tl-from-left {
    from {
        opacity: 0;
        translate: -40px 0;
    }

    to {
        opacity: 1;
        translate: none;
    }
}

@keyframes kh-tl-from-right {
    from {
        opacity: 0;
        translate: 40px 0;
    }

    to {
        opacity: 1;
        translate: none;
    }
}

@media (min-width: 679px) and (prefers-reduced-motion: no-preference) {
    @supports (animation-timeline: view()) {
        .timeline-outer .card-view:nth-child(odd) .timeline-content,
        .timeline-outer .card-view:nth-child(even) .timeline-empty {
            animation: kh-tl-from-left linear both;
            animation-timeline: view();
            animation-range: entry 0% entry 70%;
        }

        .timeline-outer .card-view:nth-child(even) .timeline-content,
        .timeline-outer .card-view:nth-child(odd) .timeline-empty {
            animation: kh-tl-from-right linear both;
            animation-timeline: view();
            animation-range: entry 0% entry 70%;
        }
    }
}

/* الموبايل: الكروت تحت بعض وما في جهة فاضية، فالرقم بيصير شارة صغيرة بزاوية الكرت مقابل الأيقونة */
@media (max-width: 678px) {
    .timeline-empty {
        display: none;
    }

    .timeline-content::after {
        content: counter(kh-service, decimal-leading-zero);
        position: absolute;
        top: 20px;
        left: 20px;
        padding: 4px 12px;
        border-radius: 999px;
        background-color: #edf8e8;
        color: #3BA811;
        font-family: var(--kh-bold);
        font-size: 0.95rem;
        line-height: 1.4;
    }
}

@media (prefers-reduced-motion: reduce) {
    .timeline-empty::before {
        transition: none;
    }

    .timeline-item:hover .timeline-empty::before {
        transform: none;
    }
}

/*#endregion*/


/*#region منع الـ scroll الأفقي وقت دخول الكروت من الجنب (إضافة 23-10-2026)*/

/* على الشاشات المتوسطة الكرت وهو داخل من الجنب كان يطلع كم بكسل برّا الشاشة ويعمل scroll أفقي. clip (مش hidden) مشان ما يخرّب أي sticky */
.sh-page:has(.timeline-outer) {
    overflow-x: clip;
}

/*#endregion*/
