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

/* Common layout */
.timeline-section {
    margin-bottom: 4rem;
}

.timeline-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 50px;
}

.timeline-items {
    position: relative;
    margin-top: 40px;
    padding-left: 20px;
    padding-right: 0;
}

.timeline-items::before {
    content: '';
    position: absolute;
    top: 0;
    left: 120px;
    width: 4px;
    height: 100%;
    background: #405566;
    border-radius: 2px;
    z-index: 0;
}

.timeline-item {
    position: relative;
    margin-left: 135px;
    text-align: left;
    margin-bottom: 4rem;
}

.timeline-header {
    position: relative;
    font-weight: 600;
    border-radius: 0.25rem 0.25rem 0 0;
    padding: 0.5rem 1rem;
    font-size: 1.25rem;
    border: 1px solid transparent;
    z-index: 2;
    --triangle-bg: inherit;
    background-color: var(--triangle-bg);
}

.timeline-header::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    clip-path: polygon(0 50%, 100% 0, 100% 100%);
    left: -18px;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--triangle-bg);
    z-index: 2;
}

.timeline-header::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    left: -42px;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--triangle-bg);
    z-index: 3;
}

.timeline-item > .timeline-dot {
    display: none !important;
}

.timeline-dot-start,
.timeline-dot-end {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: #405566;
    z-index: 5;
}

.timeline-dot-start { top: 0; left: 122px; transform: translate(-50%, -50%); }
.timeline-dot-end   { bottom: 0; left: 122px; transform: translate(-50%, 50%); }

/*.card-body {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}*/

.timeline-item.show {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.5s ease;
}

/* ---------- Style Variants ---------- */

/* Default timeline (NHS Blue & NHS Pink) */
.default-timeline .timeline-item:nth-child(odd) .timeline-header {
    --triangle-bg: #005eb8;
    background-color: #005eb8;
    color: #ffffff;
    border-color: #005eb8;
}

.default-timeline .card.timeline-item:nth-child(odd){
    border-color: #005eb8;
}


.default-timeline .timeline-item:nth-child(odd) .timeline-header::after {
    background-color: #005eb8;
}
.default-timeline .timeline-item:nth-child(even) .timeline-header {
    --triangle-bg: #AE2573;
    background-color: #AE2573;
    color: #ffffff;
    border-color: #AE2573;
}

.default-timeline .card.timeline-item:nth-child(even){
    border-color: #AE2573;
}

.default-timeline .timeline-item:nth-child(even) .timeline-header::after {
    background-color: #AE2573;
}

/* Our Timeline (#00b7b2 / #96ca4c) */
.our-timeline .timeline-item:nth-child(odd) .timeline-header {
    --triangle-bg: #00b7b2;
    background-color: #00b7b2;
    color: #ffffff;
    border-color: #00b7b2;
}

.our-timeline .card.timeline-item:nth-child(odd) {
    border-color: #00b7b2;
}

.our-timeline .timeline-item:nth-child(odd) .timeline-header::after {
    background-color: #00b7b2;
}
.our-timeline .timeline-item:nth-child(even) .timeline-header {
    --triangle-bg: #96ca4c;
    background-color: #96ca4c;
    color: #000000;
    border-color: #96ca4c;
}

.our-timeline .card.timeline-item:nth-child(even) {
    border-color: #96ca4c;
}

.our-timeline .timeline-item:nth-child(even) .timeline-header::after {
    background-color: #96ca4c;
}

/* Alt Timeline (#8c4799 / #fdb813) */
.alt-timeline .timeline-item:nth-child(odd) .timeline-header {
    --triangle-bg: #8c4799;
    background-color: #8c4799;
    color: #ffffff;
    border-color: #8c4799;
}

.alt-timeline .card.timeline-item:nth-child(odd)  {
    border-color: #8c4799;
}

.alt-timeline .timeline-item:nth-child(odd) .timeline-header::after {
    background-color: #8c4799;
}
.alt-timeline .timeline-item:nth-child(even) .timeline-header {
    --triangle-bg: #fdb813;
    background-color: #fdb813;
    color: #000000;
    border-color: #fdb813;
}

.alt-timeline .card.timeline-item:nth-child(even)  {
    border-color: #fdb813;
}

.alt-timeline .timeline-item:nth-child(even) .timeline-header::after {
    background-color: #fdb813;
}

/* Load More Button Wrapper */
.timeline-items + div {
    min-height: 60px; /* Reserve space for the button */
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}

/* Ensure button doesn't suddenly jump */
.timeline-items + div button {
    transition: opacity 0.3s ease, visibility 0.3s ease;
    opacity: 0;
    visibility: hidden;
}

.timeline-items + div button.show {
    opacity: 1;
    visibility: visible;
}


/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .timeline-item {
        margin-left: 19px;
    }

    .timeline-items::before {
        left: 10px;
    }

    .timeline-header::before {
        left: -18px;
    }

    .timeline-header::after {
        left: -36px;
    }

    .timeline-dot-start,
    .timeline-dot-end {
        left: 12px;
    }
}
