/*
 * Timeline: approved center-circle designs.
 *
 * Paired: one shared circle per pair.
 * Ribbon: individual circles with a vertical offset.
 *
 * Load AFTER assets/timeline.css.
 */

/* =====================================================
   1. Shared variables and container
   ===================================================== */

.btl.btl-style-paired,
.btl.btl-style-ribbon {
    --tl-bar-width: 76px;
    --tl-circle-size: 56px;
    --tl-half-circle: 28px;
    --tl-year-width: 90px;
    --tl-content-gap: 146px;
    --tl-row-gap: 28px;
    --tl-ribbon-offset: 64px;

    width: 100%;
    max-width: 100%;
    padding: 44px 12px 24px;
    box-sizing: border-box;

    color: var(--btl-text, #293448);
    font-family: var(--btl-font, inherit);
    font-size: var(--btl-size, 16px);
    line-height: 1.5;

    container-type: inline-size;
}

.btl.btl-style-paired *,
.btl.btl-style-ribbon * {
    box-sizing: border-box;
}

/* =====================================================
   2. Two-column event grid
   ===================================================== */

.btl.btl-style-paired .btl-list,
.btl.btl-style-ribbon .btl-list {
    display: grid !important;
    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1fr);

    align-items: start;
    gap: var(--tl-row-gap) 0;

    position: relative;
    isolation: isolate;

    width: 100%;
    margin: 0 !important;
    padding: 14px 0 !important;

    list-style: none !important;
    overflow: visible;
}

/* =====================================================
   3. Wide middle bar
   ===================================================== */

.btl.btl-style-paired .btl-list::before,
.btl.btl-style-ribbon .btl-list::before {
    content: "";

    position: absolute;
    z-index: -1;

    top: -8px;
    bottom: 0;
    left: 50%;
    right: auto;

    width: var(--tl-bar-width);
    height: auto;

    transform: translateX(-50%);

    border: 1px solid #e9edf2;
    border-radius: 28px 28px 10px 10px;

    background: linear-gradient(
        90deg,
        #e2e7ef 0%,
        #f6f8fb 22%,
        #ffffff 48%,
        #f6f8fb 78%,
        #e2e7ef 100%
    );

    box-shadow:
        inset 4px 0 8px #ffffff99,
        4px 0 12px #0000000b;
}

/* =====================================================
   4. Event positions and palette
   ===================================================== */

.btl .tl-entry {
    --tl-event-color: #743c8f;

    position: relative;

    width: 100%;
    min-width: 0;
    min-height: 110px;

    margin: 0 !important;
    padding: 10px var(--tl-content-gap) 17px 0;

    list-style: none !important;
    text-align: right;
}

.btl .tl-entry:nth-child(6n + 2) {
    --tl-event-color: #b52c39;
}

.btl .tl-entry:nth-child(6n + 3) {
    --tl-event-color: #df6c37;
}

.btl .tl-entry:nth-child(6n + 4) {
    --tl-event-color: #a48808;
}

.btl .tl-entry:nth-child(6n + 5) {
    --tl-event-color: #08794c;
}

.btl .tl-entry:nth-child(6n + 6) {
    --tl-event-color: #086e76;
}

.btl .tl-entry:nth-child(even) {
    padding: 10px 0 17px var(--tl-content-gap);
    text-align: left;
}

/* =====================================================
   5. Chevron year backgrounds
   ===================================================== */

.btl .tl-year {
    position: absolute;
    z-index: 3;

    top: 12px;
    right: var(--tl-half-circle);
    left: auto;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: var(--tl-year-width);
    min-height: 32px;
    padding: 5px 20px;

    background: var(--tl-event-color);
    color: #ffffff;

    font-family: Arial, sans-serif;
    font-size: 13px;
    font-weight: 650;
    line-height: 22px;

    white-space: nowrap;
    border: 0;
    border-radius: 0;

    /*
     * Right-pointing > shape:
     * pointed end and notched tail.
     */
    clip-path: polygon(
        0 0,
        calc(100% - 12px) 0,
        100% 50%,
        calc(100% - 12px) 100%,
        0 100%,
        12px 50%
    );
}

.btl .tl-entry:nth-child(even) .tl-year {
    left: var(--tl-half-circle);
    right: auto;
}

/* =====================================================
   6. Center circles and icons
   ===================================================== */

.btl .tl-circle {
    position: absolute;
    z-index: 5;

    top: 0;
    right: calc(-1 * var(--tl-half-circle));
    left: auto;

    display: flex;
    align-items: center;
    justify-content: center;

    width: var(--tl-circle-size);
    height: var(--tl-circle-size);

    border: 5px solid #ffffff;
    border-radius: 50%;

    background: var(--tl-event-color);
    color: var(--btl-icon-color, #ffffff);

    box-shadow: 0 2px 9px #1b294530;
}

.btl .tl-circle i {
    display: inline-block;
    font-size: 20px;
    line-height: 1;
}

/* Ribbon: right event gets its own circle. */

.btl-style-ribbon .tl-entry:nth-child(even) .tl-circle {
    left: calc(-1 * var(--tl-half-circle));
    right: auto;
}

/* Paired: shared marker uses the timeline accent. */

.btl-style-paired .tl-shared-circle {
    background: var(--btl-accent, #156c80);
}

/* =====================================================
   7. Event text
   ===================================================== */

.btl .tl-card {
    position: relative;

    min-width: 0;
    margin: 0;
    padding: 0;

    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;

    overflow-wrap: anywhere;
}

.btl .tl-card .btl-title {
    margin: 0 0 5px;

    color: var(--tl-event-color);

    font-family: inherit;
    font-size: 1.125em;
    font-weight: 700;
    line-height: 1.3;
}

.btl .tl-card .btl-description {
    color: var(--btl-text, #586478);

    font-size: 0.875em;
    line-height: 1.5;
}

.btl .tl-card .btl-description > :first-child {
    margin-top: 0;
}

.btl .tl-card .btl-description > :last-child {
    margin-bottom: 0;
}

.btl .tl-card img,
.btl .tl-card video {
    max-width: 100%;
    height: auto;
}

.btl .tl-card iframe {
    max-width: 100%;
}

/* =====================================================
   8. Tapered shadows
   ===================================================== */

.btl .tl-entry::after {
    content: "";

    position: absolute;

    right: 96px;
    left: auto;
    bottom: 0;

    width: calc(100% - 100px);
    height: 6px;

    background: linear-gradient(
        90deg,
        transparent,
        #00000015
    );

    clip-path: polygon(
        0 100%,
        100% 0,
        100% 100%
    );
}

.btl .tl-entry:nth-child(even)::after {
    right: auto;
    left: 96px;

    background: linear-gradient(
        90deg,
        #00000015,
        transparent
    );

    clip-path: polygon(
        0 0,
        100% 100%,
        0 100%
    );
}

/* =====================================================
   9. Template differences
   ===================================================== */

/* Paired: both events start at the same height. */

.btl-style-paired .tl-entry {
    margin-top: 0 !important;
}

/* Ribbon: offset the right event to separate the circles. */

.btl-style-ribbon .tl-entry:nth-child(even) {
    margin-top: var(--tl-ribbon-offset) !important;
}

/* =====================================================
   10. Pagination
   ===================================================== */

.btl .btl-navigation {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;

    margin-top: 22px;
}

.btl .btl-navigation a {
    display: inline-block;

    padding: 8px 16px;
    border: 1px solid var(--btl-accent, #147d92);
    border-radius: 5px;

    background: var(--btl-bg, #ffffff);
    color: var(--btl-text, #293448);

    text-decoration: none;
}

.btl .btl-status {
    min-height: 1.4em;
    margin: 8px 0;
    text-align: center;
}

.btl [aria-disabled="true"] {
    opacity: 0.5;
    pointer-events: none;
}

.btl a:focus-visible,
.btl .btl-list:focus-visible {
    outline: 3px solid var(--btl-accent, #147d92);
    outline-offset: 4px;
}

/* =====================================================
   11. Responsive container layout
   ===================================================== */

@container (max-width: 700px) {

    .btl.btl-style-paired .btl-list,
    .btl.btl-style-ribbon .btl-list {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .btl.btl-style-paired .btl-list::before,
    .btl.btl-style-ribbon .btl-list::before {
        left: 28px;
        width: 60px;
    }

    .btl .tl-entry,
    .btl .tl-entry:nth-child(even) {
        min-height: 136px;
        padding: 52px 0 24px 70px;
        margin-top: 0 !important;
        text-align: left;
    }

    .btl .tl-year,
    .btl .tl-entry:nth-child(even) .tl-year {
        top: 12px;
        left: 56px;
        right: auto;
    }

    .btl .tl-circle,
    .btl-style-ribbon .tl-entry:nth-child(even) .tl-circle {
        top: 0;
        left: 0;
        right: auto;
    }

    /* Second event connects to the shared spine without
       creating a second circle. */

    .btl-style-paired .tl-entry:nth-child(even)::before {
        content: "";

        position: absolute;
        top: 28px;
        left: 28px;

        width: 28px;
        border-top: 2px solid var(--tl-event-color);
    }

    .btl .tl-entry::after,
    .btl .tl-entry:nth-child(even)::after {
        right: 0;
        left: 70px;
        bottom: 15px;

        width: calc(100% - 70px);

        background: linear-gradient(
            90deg,
            #00000015,
            transparent
        );

        clip-path: polygon(
            0 0,
            100% 100%,
            0 100%
        );
    }
}

/* Viewport fallback for browsers without container queries. */

@media (max-width: 700px) {

    .btl.btl-style-paired .btl-list,
    .btl.btl-style-ribbon .btl-list {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .btl.btl-style-paired .btl-list::before,
    .btl.btl-style-ribbon .btl-list::before {
        left: 28px;
        width: 60px;
    }

    .btl .tl-entry,
    .btl .tl-entry:nth-child(even) {
        min-height: 136px;
        padding: 52px 0 24px 70px;
        margin-top: 0 !important;
        text-align: left;
    }

    .btl .tl-year,
    .btl .tl-entry:nth-child(even) .tl-year {
        top: 12px;
        left: 56px;
        right: auto;
    }

    .btl .tl-circle,
    .btl-style-ribbon .tl-entry:nth-child(even) .tl-circle {
        top: 0;
        left: 0;
        right: auto;
    }

    .btl-style-paired .tl-entry:nth-child(even)::before {
        content: "";

        position: absolute;
        top: 28px;
        left: 28px;

        width: 28px;
        border-top: 2px solid var(--tl-event-color);
    }

    .btl .tl-entry::after,
    .btl .tl-entry:nth-child(even)::after {
        right: 0;
        left: 70px;
        bottom: 15px;

        width: calc(100% - 70px);

        background: linear-gradient(
            90deg,
            #00000015,
            transparent
        );

        clip-path: polygon(
            0 0,
            100% 100%,
            0 100%
        );
    }
}

/*
 * Left event: point left.
 */
.btl .tl-entry:nth-child(odd) .tl-year {
    clip-path: polygon(
        12px 0,
        100% 0,
        calc(100% - 12px) 50%,
        100% 100%,
        12px 100%,
        0 50%
    );
}

/*
 * Right event: point right.
 */
.btl .tl-entry:nth-child(even) .tl-year {
    clip-path: polygon(
        0 0,
        calc(100% - 12px) 0,
        100% 50%,
        calc(100% - 12px) 100%,
        0 100%,
        12px 50%
    );
}
/* Paired: Soft Accent. Append AFTER the current paired.css rules.
 * All selectors are scoped to Paired; Ribbon is unchanged.
 */
.btl.btl-style-paired {
    --tl-bar-width: 76px;
    --tl-circle-size: 56px;
    --tl-half-circle: 28px;
    --tl-content-gap: 146px;
    --tl-row-gap: 28px;
}
.btl.btl-style-paired .btl-list {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: var(--tl-row-gap) 0;
}
.btl.btl-style-paired .tl-entry {
    --tl-event-color: #7046ad;
    --tl-soft-tint: #f5efff;
    min-height: 135px;
    margin: 0 !important;
    padding: 0 var(--tl-content-gap) 0 0;
}
.btl.btl-style-paired .tl-entry:nth-child(6n + 2) {
    --tl-event-color: #b33b59;
    --tl-soft-tint: #fff0f3;
}
.btl.btl-style-paired .tl-entry:nth-child(6n + 3) {
    --tl-event-color: #b56527;
    --tl-soft-tint: #fff5e9;
}
.btl.btl-style-paired .tl-entry:nth-child(6n + 4) {
    --tl-event-color: #8d7414;
    --tl-soft-tint: #fff9df;
}
.btl.btl-style-paired .tl-entry:nth-child(6n + 5) {
    --tl-event-color: #26764c;
    --tl-soft-tint: #edf9f0;
}
.btl.btl-style-paired .tl-entry:nth-child(6n + 6) {
    --tl-event-color: #166b83;
    --tl-soft-tint: #eaf8fc;
}
.btl.btl-style-paired .tl-entry:nth-child(even) {
    padding: 0 0 0 var(--tl-content-gap);
}
.btl.btl-style-paired .tl-card {
    position: relative;
    min-height: 135px;
    padding: 20px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: linear-gradient(
        145deg,
        var(--tl-soft-tint),
        var(--btl-bg, #fff) 78%
    );
    box-shadow: 0 8px 25px #32456f0c;
}
/* Remove the previous tapered underline from Paired only. */
.btl.btl-style-paired .tl-entry::after,
.btl.btl-style-paired .tl-card::after {
    content: none;
    display: none;
}
/* Accent edge nearest the center spine. */
.btl.btl-style-paired .tl-card::before {
    content: '';
    position: absolute;
    top: 20px;
    bottom: 20px;
    right: -1px;
    left: auto;
    width: 3px;
    border-radius: 6px;
    background: var(--tl-event-color);
}
.btl.btl-style-paired .tl-entry:nth-child(even) .tl-card::before {
    left: -1px;
    right: auto;
}
.btl.btl-style-paired .tl-card .btl-title {
    margin: 0 0 7px;
    color: var(--tl-event-color);
    font-size: 1.06em;
    font-weight: 700;
    line-height: 1.3;
}
.btl.btl-style-paired .tl-card .btl-description {
    font-size: .875em;
    line-height: 1.55;
    color: var(--btl-text, #627188);
}
.btl.btl-style-paired .tl-year {
    top: 12px;
    background: var(--tl-event-color);
    border-radius: 0;
}
/* Left event points left, right event points right. */
.btl.btl-style-paired .tl-entry:nth-child(odd) .tl-year {
    clip-path: polygon(
        12px 0, 100% 0, calc(100% - 12px) 50%,
        100% 100%, 12px 100%, 0 50%
    );
}
.btl.btl-style-paired .tl-entry:nth-child(even) .tl-year {
    clip-path: polygon(
        0 0, calc(100% - 12px) 0, 100% 50%,
        calc(100% - 12px) 100%, 0 100%, 12px 50%
    );
}
.btl.btl-style-paired .tl-shared-circle {
    top: 0;
    background: var(--btl-accent, #286d86);
    box-shadow: 0 3px 12px #172d4525;
}

@container (max-width: 700px) {
.btl.btl-style-paired .btl-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
}
.btl.btl-style-paired .tl-entry,
.btl.btl-style-paired .tl-entry:nth-child(even) {
    padding: 52px 0 18px 70px;
    min-height: 0;
    text-align: left;
}
.btl.btl-style-paired .tl-card {
    min-height: 0;
    padding: 18px;
}
.btl.btl-style-paired .tl-card::before,
.btl.btl-style-paired .tl-entry:nth-child(even) .tl-card::before {
    left: -1px;
    right: auto;
}
.btl.btl-style-paired .tl-entry:nth-child(odd) .tl-year,
.btl.btl-style-paired .tl-entry:nth-child(even) .tl-year {
    clip-path: polygon(
        0 0, calc(100% - 12px) 0, 100% 50%,
        calc(100% - 12px) 100%, 0 100%, 12px 50%
    );
}
}
@media (max-width: 700px) {
.btl.btl-style-paired .btl-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
}
.btl.btl-style-paired .tl-entry,
.btl.btl-style-paired .tl-entry:nth-child(even) {
    padding: 52px 0 18px 70px;
    min-height: 0;
    text-align: left;
}
.btl.btl-style-paired .tl-card {
    min-height: 0;
    padding: 18px;
}
.btl.btl-style-paired .tl-card::before,
.btl.btl-style-paired .tl-entry:nth-child(even) .tl-card::before {
    left: -1px;
    right: auto;
}
.btl.btl-style-paired .tl-entry:nth-child(odd) .tl-year,
.btl.btl-style-paired .tl-entry:nth-child(even) .tl-year {
    clip-path: polygon(
        0 0, calc(100% - 12px) 0, 100% 50%,
        calc(100% - 12px) 100%, 0 100%, 12px 50%
    );
}
}
.tl-milestone-title{
    margin:0 0 10px;
    font-size:20px;
    font-weight:700;
    color:#4f46e5;
}

.tl-milestone{
    display:inline-block;
    padding:6px 12px;
    border-radius:20px;
    background:#eef2ff;
    color:#4f46e5;
    font-weight:600;
    margin-bottom:12px;
}