/**
 * Timeline Brochure Styles - v1.0.4
 * Brochure layout inspired by Raniero/Lampocar historical timeline.
 */

.tb {
    --tb-accent: #BB1B0E;
    --tb-text: #222222;
    --tb-muted: #666666;
    --tb-white: #ffffff;
    --tb-maxw: 1100px;
    --tb-pillar-width: 86px;
    --tb-pillar-gap: 58px;
    --tb-event-gap: 92px;
    --tb-image-size: 128px;
    --tb-content-gap: 42px;
    --tb-visual-pillar-width: var(--tb-pillar-width);
    --tb-visual-pillar-gap: var(--tb-pillar-gap);
    --tb-visual-event-gap: var(--tb-event-gap);
    --tb-visual-image-size: clamp(112px, var(--tb-image-size), 150px);
    --tb-visual-content-gap: var(--tb-content-gap);
    --tb-font: 'Poppins', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --tb-start-year-desktop: 96px;
    --tb-start-year-mobile: 64px;
    --tb-event-title-size: 16px;
    --tb-event-desc-size: 17px;
    --tb-year-font-size: 21px;
    --tb-stroke-width: 2px;
    --tb-radius: 34px;
    position: relative;
    width: 100%;
    max-width: var(--tb-maxw);
    margin: 0 auto;
    padding: 42px 24px 110px;
    background: var(--tb-white);
    color: var(--tb-text);
    font-family: var(--tb-font);
    overflow: visible;
}

.tb *,
.tb *::before,
.tb *::after {
    box-sizing: border-box;
}

.tb__container {
    position: relative;
    z-index: 2;
}

.tb__path {
    display: none;
}

.tb__start {
    position: relative;
    width: min(320px, 100%);
    margin: 0 0 28px;
    padding-left: 0;
    opacity: 0;
    transition: opacity 0.45s ease;
}

.tb__start.tb-visible {
    opacity: 1;
}

.tb__start::after {
    content: '';
    position: absolute;
    left: calc(var(--tb-visual-pillar-width) / 2);
    top: calc(100% - 2px);
    width: 3px;
    height: 68px;
    background: var(--tb-accent);
    transform: translateX(-50%);
}

.tb__start-label {
    display: block;
    margin: 0 0 2px;
    color: var(--tb-muted);
    font-size: 17px;
    font-weight: 500;
    line-height: 1;
    text-transform: lowercase;
}

.tb__start-year {
    display: block;
    margin: 0;
    color: var(--tb-accent);
    font-size: var(--tb-start-year-desktop);
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 0.9;
}

.tb__start-subtitle {
    margin-top: 10px;
    color: var(--tb-muted);
    font-size: 15px;
    line-height: 1.5;
}

.tb__timeline {
    position: relative;
    display: grid;
    grid-template-columns: var(--tb-visual-pillar-width) minmax(0, 1fr);
    column-gap: var(--tb-visual-pillar-gap);
    margin: 0 0 0;
}

.tb__pillar {
    grid-column: 1;
    grid-row: 1;
    position: relative;
    min-height: 100%;
    padding: 52px 0;
    background: var(--tb-accent);
    border-radius: calc(var(--tb-visual-pillar-width) / 2);
    opacity: 0;
    transition: opacity 0.6s ease;
}

.tb__pillar.tb-visible {
    opacity: 1;
}

.tb__year {
    position: absolute;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 8px;
    color: var(--tb-white);
    font-size: var(--tb-year-font-size);
    font-weight: 800;
    line-height: 1.1;
    text-align: center;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.tb__year.tb-visible {
    opacity: 1;
}

.tb__events {
    grid-column: 2;
    display: grid;
    grid-template-columns: 1fr;
    row-gap: var(--tb-visual-event-gap);
    padding: 42px 0 34px;
}

.tb__event {
    position: relative;
    min-height: var(--tb-visual-image-size);
    opacity: 0;
    transition: opacity 0.45s ease;
}

.tb__event.tb-visible {
    opacity: 1;
}

.tb__event:nth-child(1).tb-visible { transition-delay: 0.04s; }
.tb__event:nth-child(2).tb-visible { transition-delay: 0.08s; }
.tb__event:nth-child(3).tb-visible { transition-delay: 0.12s; }
.tb__event:nth-child(4).tb-visible { transition-delay: 0.16s; }
.tb__event:nth-child(5).tb-visible { transition-delay: 0.20s; }
.tb__event:nth-child(6).tb-visible { transition-delay: 0.24s; }
.tb__event:nth-child(7).tb-visible { transition-delay: 0.28s; }
.tb__event:nth-child(8).tb-visible { transition-delay: 0.32s; }
.tb__event:nth-child(9).tb-visible { transition-delay: 0.36s; }
.tb__event:nth-child(10).tb-visible { transition-delay: 0.40s; }
.tb__event:nth-child(n+11).tb-visible { transition-delay: 0.44s; }

.tb__event-content {
    display: grid;
    grid-template-columns: var(--tb-visual-image-size) minmax(0, 1fr);
    column-gap: var(--tb-visual-content-gap);
    align-items: center;
}

.tb__event-image {
    width: var(--tb-visual-image-size);
    min-height: var(--tb-visual-image-size);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateX(var(--tb-event-image-offset-x, 0px));
}

.tb__event-image img {
    display: block;
    width: 100%;
    height: auto;
    max-height: calc(var(--tb-visual-image-size) * 1.15);
    object-fit: contain;
    object-position: center;
}

.tb__event--framed-image .tb__event-image {
    min-height: auto;
    padding: 8px;
    border: 3px solid var(--tb-accent);
    border-radius: 12px;
    background: var(--tb-white);
}

.tb__event--framed-image .tb__event-image img {
    width: 100%;
    max-height: none;
}

.tb__event-text {
    min-width: 0;
}

.tb__event-title {
    display: none;
}

.tb__event-description {
    margin: 0;
    color: var(--tb-muted);
    font-size: var(--tb-event-desc-size);
    font-weight: 500;
    line-height: 1.58;
}

.tb__event-description p {
    margin: 0 0 0.55em;
}

.tb__event-description p:last-child {
    margin-bottom: 0;
}

.tb__badge {
    position: absolute;
    top: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 112px;
    color: var(--badge-color, var(--tb-accent));
    opacity: 0;
    transform: translateY(-50%) scale(0.88);
    transition: opacity 0.45s ease, transform 0.45s ease;
    z-index: 4;
}

.tb__badge.tb-visible {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

.tb__badge--right {
    left: 0;
}

.tb__badge--left {
    right: calc(100% + 18px);
}

.tb__badge-number {
    font-size: 54px;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 0.9;
}

.tb__badge-label {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.52em;
    line-height: 1;
    text-transform: lowercase;
}

.tb__end {
    position: relative;
    display: grid;
    grid-template-columns:
        var(--tb-visual-pillar-width)
        var(--tb-visual-pillar-gap)
        var(--tb-visual-image-size)
        var(--tb-visual-content-gap)
        minmax(0, 1fr);
    column-gap: 0;
    align-items: end;
    margin-top: 0;
    padding-top: 94px;
    opacity: 0;
    transition: opacity 0.45s ease;
}

.tb__end.tb-visible {
    opacity: 1;
}

.tb__end-line {
    position: absolute;
    left: calc(var(--tb-visual-pillar-width) / 2);
    top: 0;
    width: 3px;
    height: 104px;
    background: var(--tb-accent);
    transform: translateX(-50%);
}

.tb__end-heading {
    grid-column: 1;
    grid-row: 1;
    align-self: end;
    min-width: 190px;
    transform: translateX(-42px);
}

.tb__end-label {
    margin-bottom: 5px;
    color: var(--tb-accent);
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
}

.tb__end-year {
    color: var(--tb-accent);
    font-size: 61px;
    font-weight: 800;
    letter-spacing: -0.055em;
    line-height: 0.9;
}

.tb__end-image {
    grid-column: 3;
    grid-row: 1;
    width: var(--tb-visual-image-size);
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.tb__end-image img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.tb__end-description {
    grid-column: 5;
    grid-row: 1;
    align-self: center;
    max-width: 470px;
    color: var(--tb-text);
    font-size: calc(var(--tb-event-desc-size) * 0.86);
    font-weight: 500;
    line-height: 1.55;
}

.tb__end-description p {
    margin: 0 0 0.5em;
}

.tb__end-description p:last-child {
    margin-bottom: 0;
}

.tb__page-number {
    position: absolute;
    right: 0;
    bottom: -54px;
    color: var(--tb-muted);
    font-size: 18px;
}

@media (max-width: 992px) {
    .tb {
        --tb-visual-pillar-width: min(var(--tb-pillar-width), 74px);
        --tb-visual-pillar-gap: 38px;
        --tb-visual-event-gap: 70px;
        --tb-visual-image-size: 110px;
        --tb-visual-content-gap: 30px;
        padding-left: 22px;
        padding-right: 22px;
    }

    .tb__start-year {
        font-size: calc(var(--tb-start-year-desktop) * 0.82);
    }

    .tb__year {
        font-size: calc(var(--tb-year-font-size) * 0.86);
    }

    .tb__end-heading {
        transform: translateX(-26px);
    }

    .tb__end-year {
        font-size: 50px;
    }
}

@media (max-width: 768px) {
    .tb {
        --tb-visual-pillar-width: 56px;
        --tb-visual-pillar-gap: 20px;
        --tb-visual-event-gap: 42px;
        --tb-visual-image-size: 92px;
        --tb-visual-content-gap: 20px;
        padding: 34px 18px 70px;
    }

    .tb__start {
        width: 100%;
        margin-bottom: 24px;
        padding-left: calc(var(--tb-visual-pillar-width) + 18px);
    }

    .tb__start::after {
        left: calc(var(--tb-visual-pillar-width) / 2);
        height: 54px;
    }

    .tb__start-label {
        font-size: 15px;
    }

    .tb__start-year {
        font-size: var(--tb-start-year-mobile);
    }

    .tb__timeline {
        grid-template-columns: var(--tb-visual-pillar-width) minmax(0, 1fr);
        column-gap: 18px;
    }

    .tb__pillar {
        padding: 34px 0;
        border-radius: 999px;
    }

    .tb__year {
        font-size: 13px;
        min-height: 26px;
    }

    .tb__events {
        row-gap: var(--tb-visual-event-gap);
        padding-top: 34px;
        padding-bottom: 28px;
    }

    .tb__event-content {
        grid-template-columns: var(--tb-visual-image-size) minmax(0, 1fr);
        column-gap: var(--tb-visual-content-gap);
    }

    .tb__event-description {
        font-size: 14px;
        line-height: 1.5;
    }

    .tb__badge {
        position: static;
        transform: none;
        align-items: flex-start;
        margin: 20px 0 0;
    }

    .tb__badge.tb-visible {
        transform: none;
    }

    .tb__badge-number {
        font-size: 42px;
    }

    .tb__badge-label {
        font-size: 11px;
    }

    .tb__end {
        grid-template-columns: var(--tb-visual-pillar-width) 18px minmax(0, 1fr);
        column-gap: 0;
        row-gap: 20px;
        padding-top: 72px;
    }

    .tb__end-line {
        width: 3px;
        height: 82px;
    }

    .tb__end-heading {
        grid-column: 1 / -1;
        padding-left: calc(var(--tb-visual-pillar-width) + 18px);
        transform: none;
    }

    .tb__end-image {
        grid-column: 3;
        grid-row: 2;
        width: var(--tb-visual-image-size);
        justify-content: flex-start;
    }

    .tb__end-description {
        grid-column: 3;
        grid-row: 3;
        max-width: 100%;
        font-size: 14px;
    }

    .tb__end-year {
        font-size: 48px;
    }
}

@media (max-width: 520px) {
    .tb {
        --tb-visual-image-size: 76px;
        --tb-visual-content-gap: 14px;
        padding-left: 14px;
        padding-right: 14px;
    }

    .tb__event-content {
        align-items: start;
    }

    .tb__event-image {
        align-items: flex-start;
    }

    .tb__event-description {
        font-size: 13px;
    }

    .tb__end-year {
        font-size: 42px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tb *,
    .tb *::before,
    .tb *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .tb__start,
    .tb__pillar,
    .tb__event,
    .tb__badge,
    .tb__end,
    .tb__year {
        opacity: 1 !important;
        transform: none !important;
    }
}

@media print {
    .tb {
        max-width: 100%;
        padding: 20px;
    }

    .tb__pillar,
    .tb__end-line,
    .tb__start::after {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .tb__start,
    .tb__pillar,
    .tb__event,
    .tb__badge,
    .tb__end,
    .tb__year {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}
