/* bravo-timeline — Elementor Widget
   Scope: .bravo-timeline  /  prefix: .btl-*
   Breakpoints: < 768px mobile | ≥ 768px desktop/tablet
*/

/* ── Elementor panel icon ──────────────────────────────────── */
.bravo-icon-timeline {
    display: inline-block;
    width: 1em;
    height: 1em;
    background: url('../img/bravo-mark-2.svg') no-repeat center / contain;
    vertical-align: middle;
}
.bravo-icon-timeline::before { content: ''; }

/* ── Root ──────────────────────────────────────────────────── */
.bravo-timeline {
    font-family: inherit;
    width: 100%;
}

/* ── Track (vertical line via ::before) ────────────────────── */
.btl-track {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* Vertical line — desktop: centred on the dot column */
.btl-track::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    transform: translateX(-50%);
    background: #201d49;
    pointer-events: none;
}

/* ── Entry ─────────────────────────────────────────────────── */
.btl-entry {
    display: grid;
    /* [main: year+title] [dot col] [alt: desc] */
    grid-template-columns: 1fr 48px 1fr;
    column-gap: 24px;
    align-items: start;
    position: relative;
}

/* Left entry: main(year+title) | dot | alt(desc) */
.btl-entry--left .btl-main     { grid-column: 1; grid-row: 1; text-align: right; }
.btl-entry--left .btl-dot-wrap { grid-column: 2; grid-row: 1; }
.btl-entry--left .btl-alt      { grid-column: 3; grid-row: 1; text-align: left; }

/* Right entry: alt(desc) | dot | main(year+title) */
.btl-entry--right .btl-alt      { grid-column: 1; grid-row: 1; text-align: right; }
.btl-entry--right .btl-dot-wrap { grid-column: 2; grid-row: 1; }
.btl-entry--right .btl-main     { grid-column: 3; grid-row: 1; text-align: left; }

/* ── Main block (year + title) ─────────────────────────────── */
.btl-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* ── Alt block (description) ───────────────────────────────── */
.btl-alt {
    display: flex;
    flex-direction: column;
}

/* ── Dot ───────────────────────────────────────────────────── */
.btl-dot-wrap {
    display: flex;
    justify-content: center;
    padding-top: 3px; /* align visually with first line of text */
    flex-shrink: 0;
    position: relative;
}

/* Horizontal arm — only toward the year+title side (btl-main).
   Dot is 16px centred in 48px column: left edge at x=16, right edge at x=32.
   4px gap between dot edge and arm. Arm length = 20px. */
.btl-dot-wrap::before,
.btl-dot-wrap::after {
    content: '';
    position: absolute;
    top: 10px; /* padding-top(3) + half-dot(8) - half-line(1) */
    height: 2px;
    background: #201d49;
    pointer-events: none;
    width: 20px;
}

/* Left entry: btl-main (year+title) is on left → arm goes LEFT */
.btl-entry--left .btl-dot-wrap::before {
    right: 36px; /* dot left edge (16px) + 4px gap → from right: 48-12=36 */
    left: auto;
}

/* Right entry: btl-main (year+title) is on right → arm goes RIGHT */
.btl-entry--right .btl-dot-wrap::after {
    left: 36px; /* dot right edge (32px) + 4px gap */
    right: auto;
}

/* Hide the unused arm on each side */
.btl-entry--left .btl-dot-wrap::after,
.btl-entry--right .btl-dot-wrap::before {
    display: none;
}

.btl-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #201d49;
    border: 3px solid #ffffff;
    border-style: solid;
    box-sizing: border-box;
    flex-shrink: 0;
    position: relative;
    z-index: 1; /* sit on top of the line */
}

/* ── Typography ────────────────────────────────────────────── */
.btl-year {
    display: block;
    font-size: 13px;
    font-weight: 400;
    color: #6B7280;
    line-height: 1.2;
}

.btl-title {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #201d49;
    line-height: 1.25;
}

.btl-desc {
    margin: 0;
    font-size: 15px;
    font-weight: 400;
    color: #4B5563;
    line-height: 1.55;
}

/* ── Fade animation ────────────────────────────────────────── */
.btl-entry--fade {
    opacity: 0;
    transform: translateY(20px);
    transition:
        opacity  var(--btl-fade-dur, 500ms) ease,
        transform var(--btl-fade-dur, 500ms) ease;
}

.btl-entry--fade.is-visible {
    opacity: 1;
    transform: none;
}

/* In Elementor editor: JS doesn't run the inline init, so entries have no .btl-entry--fade —
   they are visible by default. No override needed here. */

/* ── Mobile (< 768px) ──────────────────────────────────────── */
@media (max-width: 767px) {

    /* Line: aligned to centre of the dot column (24px = 48px / 2) */
    .btl-track::before {
        left: 24px;
        transform: none;
    }

    /* 2-column layout: [48px dot] [1fr card] — dot spans both rows */
    .btl-entry {
        grid-template-columns: 48px 1fr;
        grid-template-rows: auto auto;
        column-gap: 16px;
    }

    /* Dot spans both content rows */
    .btl-entry--left .btl-dot-wrap,
    .btl-entry--right .btl-dot-wrap {
        grid-column: 1;
        grid-row: 1 / span 2;
        align-self: start;
    }

    /* main (year + title): col 2, row 1 */
    .btl-entry--left .btl-main,
    .btl-entry--right .btl-main {
        grid-column: 2;
        grid-row: 1;
        text-align: left;
    }

    /* alt (description): col 2, row 2 */
    .btl-entry--left .btl-alt,
    .btl-entry--right .btl-alt {
        grid-column: 2;
        grid-row: 2;
        text-align: left;
    }

    .btl-desc { margin-top: 4px; }

    /* Mobile: single right arm for all entries (content is always on the right).
       Re-show ::after for left entries (hidden by desktop rule) and add 4px gap. */
    .btl-dot-wrap::before { display: none !important; }
    .btl-entry--left .btl-dot-wrap::after,
    .btl-entry--right .btl-dot-wrap::after {
        display: block;
        left: 36px; /* dot right edge (32px) + 4px gap */
        right: auto;
        width: 12px;
    }

    .btl-title { font-size: 16px; }
    .btl-desc  { font-size: 14px; }
}
