/* ── Blok "Timeline" (page-builder) ──
   Struktur per peristiwa (dibuat renderBlock() → case 'timeline'):
     .bk-tl-item > .bk-tl-seg (garis ke item berikutnya)
                 + .bk-tl-node (bulatan + icon)
                 + .bk-tl-side (tanggal besar, khusus zig-zag desktop)
                 + .bk-tl-card > .bk-tl-meta (tanggal + badge) + h4 + p
   Warna aksen/garis/latar ditulis INLINE (lolos HtmlSanitizer); bentuk,
   posisi & hover di sini (border-radius, position, :hover dibuang kalau inline).

   Model:
     .bk-tl-alternate  Model 1: zig-zag, garis di tengah (≥ 768px).
                       Di < 768px berubah jadi satu sisi dengan garis kiri.
     .bk-tl-line       Model 2: garis di kiri.
     .bk-tl-horizontal Model 3: geser ke samping (overflow-x + scroll-snap).

   Selektor dibuat ≥ 3 class supaya menang dari aturan umum konten halaman
   (.pg-body h4 { margin: 2em 0 .75em }, .pg-body p { margin-bottom: 1.25em }). */

.bk-timeline {
    --bk-tl-node: 44px;
    position: relative;
    margin: 1.5rem 0;
}

.bk-timeline .bk-tl-item {
    position: relative;
}

/* ── Bagian bersama ── */
.bk-timeline .bk-tl-item .bk-tl-node {
    position: relative;
    z-index: 2;
    width: var(--bk-tl-node);
    height: var(--bk-tl-node);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    box-shadow: 0 0 0 5px #fff, 0 4px 12px rgba(0, 0, 0, .15);
    transition: transform .2s ease;
}

.bk-timeline .bk-tl-item .bk-tl-seg {
    position: absolute;
    z-index: 1;
    display: block;
    border-radius: 2px;
}

.bk-timeline .bk-tl-item:last-child .bk-tl-seg {
    display: none;
}

.bk-timeline .bk-tl-item .bk-tl-side {
    display: none;
}

.bk-timeline .bk-tl-item .bk-tl-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .08);
    padding: 18px 22px;
    transition: transform .2s ease, box-shadow .2s ease;
}

.bk-timeline .bk-tl-item:hover .bk-tl-card {
    transform: translateY(-3px);
    box-shadow: 0 12px 26px rgba(0, 0, 0, .13);
}

.bk-timeline .bk-tl-item:hover .bk-tl-node {
    transform: scale(1.08);
}

.bk-timeline .bk-tl-card .bk-tl-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    margin-bottom: 6px;
}

.bk-timeline .bk-tl-meta .bk-tl-date {
    font-weight: 700;
    font-size: .85rem;
    letter-spacing: .03em;
}

.bk-timeline .bk-tl-meta .bk-tl-badge {
    border: 1px solid;
    border-radius: 999px;
    padding: 1px 10px;
    font-size: .75rem;
    font-weight: 600;
    background: #fff;
}

.bk-timeline .bk-tl-card .bk-tl-title {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 6px;
}

.bk-timeline .bk-tl-card .bk-tl-desc {
    margin: 0;
    color: #6c757d;
    font-size: .95rem;
    line-height: 1.55;
    white-space: pre-line;
}

.bk-timeline .bk-tl-card > :last-child {
    margin-bottom: 0;
}

/* ── Model 2: garis kiri (juga Model 1 di HP) ── */
.bk-tl-line .bk-tl-item {
    padding: 0 0 24px 64px;
}

.bk-tl-line .bk-tl-item .bk-tl-node {
    position: absolute;
    top: 0;
    left: 0;
}

.bk-tl-line .bk-tl-item .bk-tl-seg {
    left: calc(var(--bk-tl-node) / 2 - 1.5px);
    top: calc(var(--bk-tl-node) / 2);
    width: 3px;
    height: 100%;
}

@media (max-width: 767.98px) {
    .bk-tl-alternate .bk-tl-item {
        padding: 0 0 24px 60px;
    }

    .bk-tl-alternate .bk-tl-item .bk-tl-node {
        position: absolute;
        top: 0;
        left: 0;
    }

    .bk-tl-alternate .bk-tl-item .bk-tl-seg {
        left: calc(var(--bk-tl-node) / 2 - 1.5px);
        top: calc(var(--bk-tl-node) / 2);
        width: 3px;
        height: 100%;
    }
}

/* ── Model 1: zig-zag, garis di tengah (desktop) ── */
@media (min-width: 768px) {
    .bk-tl-alternate .bk-tl-item {
        display: grid;
        grid-template-columns: 1fr 88px 1fr;
        align-items: start;
        padding-bottom: 32px;
    }

    .bk-tl-alternate .bk-tl-item .bk-tl-node {
        grid-row: 1;
        grid-column: 2;
        justify-self: center;
    }

    .bk-tl-alternate .bk-tl-item .bk-tl-seg {
        left: calc(50% - 1.5px);
        top: calc(var(--bk-tl-node) / 2);
        width: 3px;
        height: 100%;
    }

    .bk-tl-alternate .bk-tl-item .bk-tl-side {
        display: block;
        grid-row: 1;
        padding-top: 4px;
        font-size: 1.6rem;
        font-weight: 800;
        line-height: 1.2;
    }

    .bk-tl-alternate .bk-tl-item .bk-tl-card {
        grid-row: 1;
    }

    /* Ganjil: tanggal kiri, kartu kanan. Genap: kartu kiri, tanggal kanan. */
    .bk-tl-alternate .bk-tl-item:nth-child(odd) .bk-tl-side  { grid-column: 1; text-align: right; }
    .bk-tl-alternate .bk-tl-item:nth-child(odd) .bk-tl-card  { grid-column: 3; }
    .bk-tl-alternate .bk-tl-item:nth-child(even) .bk-tl-side { grid-column: 3; text-align: left; }
    .bk-tl-alternate .bk-tl-item:nth-child(even) .bk-tl-card { grid-column: 1; }

    /* Tanggal sudah tampil besar di samping */
    .bk-tl-alternate .bk-tl-meta .bk-tl-date {
        display: none;
    }
}

/* ── Model 3: horizontal, geser ke samping ── */
.bk-tl-horizontal {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 8px 4px 16px;
    -webkit-overflow-scrolling: touch;
}

.bk-tl-horizontal .bk-tl-item {
    flex: 0 0 290px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    padding-right: 20px;
    scroll-snap-align: start;
}

.bk-tl-horizontal .bk-tl-item .bk-tl-node {
    margin: 0 0 18px 4px;
    flex-shrink: 0;
}

.bk-tl-horizontal .bk-tl-item .bk-tl-seg {
    top: calc(var(--bk-tl-node) / 2 - 1.5px);
    left: calc(var(--bk-tl-node) / 2 + 4px);
    width: 100%;
    height: 3px;
}

.bk-tl-horizontal .bk-tl-item .bk-tl-card {
    flex: 1;
}

@media (max-width: 575.98px) {
    .bk-tl-horizontal .bk-tl-item {
        flex-basis: 250px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bk-timeline .bk-tl-item .bk-tl-node,
    .bk-timeline .bk-tl-item .bk-tl-card {
        transition: none;
    }

    .bk-timeline .bk-tl-item:hover .bk-tl-card,
    .bk-timeline .bk-tl-item:hover .bk-tl-node {
        transform: none;
    }

    .bk-tl-horizontal {
        scroll-behavior: auto;
    }
}
