.timeline-fortaleza {
    --timeline-bg: #fff;
    --timeline-line: #d8e2ed;
    --timeline-dot: #f97316;
    --timeline-card-bg: #ffffff;
    --timeline-border: #e5edf5;
    --timeline-text: #1e293b;
    --timeline-muted: #64748b;
    --timeline-soft: #f1f5f9;
    /*! --timeline-glow: radial-gradient(circle at 0 0, rgba(15, 23, 42, 0.06), transparent 62%); */
    --timeline-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);

    margin-top: 2.1rem;
    color: var(--timeline-text);
    /*! background: var(--timeline-bg); */
    /*! border: 1px solid var(--timeline-border); */
    border-radius: 0;
    padding: 1.5rem 1.25rem;
    position: relative;
    overflow: hidden;
}

.timeline-fortaleza::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--timeline-glow);
    pointer-events: none;
}

.timeline-header h3 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    position: relative;
    z-index: 1;
    text-align: center;
}

.timeline-header p {
    margin: 0.35rem 0 1.6rem;
    position: relative;
    z-index: 1;
    text-align: center;
    font-size: 1rem;
}

.timeline-track {
    position: relative;
    z-index: 1;
    padding: 0.2rem 0.2rem 0.4rem;
}

.timeline-track::before {
    content: "";
    position: absolute;
    left: 62px;
    transform: translateX(-50%);
    top: 1rem;
    bottom: 0.4rem;
    width: 1px;
    background: linear-gradient(180deg, #e6edf5, var(--timeline-line), #ecf2f8);
    z-index: 1;
}

.timeline-period {
    display: grid;
    grid-template-columns: minmax(0, 0fr) 140px minmax(0, 1fr);
    align-items: start;
    margin-bottom: 2.2rem;
    position: relative;
    z-index: 2;
    position: relative;
}

.timeline-period:last-child {
    margin-bottom: 0.4rem;
}

.timeline-dot {
    width: 0.82rem;
    height: 0.82rem;
    border-radius: 50%;
    border: 5px solid #f0f2f2;
    background-color: #000;
    box-shadow: 0 0 0 1px #000;
}


.timeline-axis {
    grid-column: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    flex-direction: column;
    padding-top: 1rem;
    text-align: center;
    position: absolute;
    /* transform: translate(-50%, -50%);
    top: 50%;
    left: 66px; */
}

.timeline-years {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f2f2;
    color: #000;
    border: 2px solid #1E293B;
    border-radius: 999px;
    min-height: 32px;
    padding: 0.3rem 0.75rem;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.timeline-event-card {
    background: var(--timeline-card-bg);
    padding: 1rem;
    max-width: 520px;
    width: 100%;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        border-color 0.18s ease;
}

.timeline-event-card:hover {
    transform: translateY(-2px);
}

.timeline-period.is-left .timeline-event-card {
    grid-column: 1;
    justify-self: end;
}

.timeline-period.is-right .timeline-event-card {
    grid-column: 3;
    justify-self: start;
}

.timeline-title {
    margin: 0;
    padding: 0 0 0.85rem;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--timeline-text);
}

.timeline-item {
    margin: 0;
    /*! border: 1px solid #e4ebf3; */
    /*! border-radius: 14px; */
    overflow: hidden;
    /*! background: var(--timeline-soft); */
}

.timeline-item-primary {
    /*! border-radius: 15px; */
    /*! background: #f7fafd; */
    margin-bottom: 0.75rem;
}

.timeline-item-primary img,
.timeline-item-primary .timeline-image-fallback {
    /*! min-height: 220px; */
    /*! max-height: 330px; */
}

.timeline-item img:hover {
    cursor: pointer;
    filter: saturate(180%) brightness(0.8);
    border: 2px solid #212529;
}

.timeline-item figcaption {
    line-height: 1.4;
    max-height: calc(1.4rem * 2);
    overflow: hidden;

    transition: 
        max-height 0.7s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.2s ease;

    opacity: 0.85;
}


.timeline-item.expanded figcaption {
    max-height: 500px;
    overflow: visible;
    opacity: 1;
}

.timeline-item-primary figcaption {
    font-size: 0.87rem;
    min-height: 68px;
}

.see-more {
    text-align: center;
    display: block;
    font-weight: 500;
}

.timeline-gallery {
    max-height: 0px;
    overflow: hidden;
    transition: all 1s;
}

.timeline-event-card:hover .timeline-gallery {
    max-height: 1000px;
}

/* .timeline-event-card .timeline-gallery.expanded {
    max-height: 1000px;
} */

.timeline-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
}

.timeline-gallery .timeline-item figcaption {
    min-height: 0;
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.timeline-lightbox-trigger,
.timeline-item img,
.timeline-image-fallback {
    display: block;
    width: 100%;
}

.timeline-lightbox-trigger {
    border: 0;
    padding: 0;
    background: transparent;
    cursor: zoom-in;
    text-align: left;
}

.timeline-item img,
.timeline-image-fallback {
    height: 80px;
    object-fit: cover;
}

.timeline-item-primary img {
    height: 150px;
    width: 100%;
    background: #333;
}

.timeline-image-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.84rem;
    color: #64748b;
    background: repeating-linear-gradient(
        -45deg,
        #eef3f8,
        #eef3f8 10px,
        #e1e9f2 10px,
        #e1e9f2 20px
    );
}

.timeline-lightbox-trigger:focus-visible {
    outline: 2px solid #f97316;
    outline-offset: -2px;
}

.timeline-empty {
    margin: 0.6rem 0 0;
    color: var(--timeline-muted);
}

.timeline-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: none;
    z-index: 9999999;
}

.timeline-lightbox.is-open {
    display: block;
}

.timeline-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);

    z-index: 99999;
}

.timeline-lightbox-dialog {
    position: relative;
    margin: 3vh auto;
    width: min(980px, calc(100% - 2rem));
    height: 94vh;
    border-radius: 16px;
    padding: 1rem;
    display: grid;
    grid-template-rows: minmax(280px, 1fr) auto 116px;
    gap: 0.75rem;
    overflow: hidden;
    z-index: 99999;
}

.timeline-lightbox-close {
    position: absolute;
    right: 0.8rem;
    top: 0.6rem;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    font-size: 1.15rem;
    line-height: 1;
}

.timeline-lightbox-main {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(3, 8, 14, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-lightbox-main img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.timeline-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    border-radius: 999px;
    font-size: 1.3rem;
    color: #fff;
    background: rgba(0, 0, 0, 0.45);
}

.timeline-lightbox-nav.prev {
    left: 0.7rem;
}

.timeline-lightbox-nav.next {
    right: 0.7rem;
}

.timeline-lightbox-caption {
    margin: 0;
    color: #d7e4f3;
    font-size: 0.92rem;
    line-height: 1.5;
    max-height: 92px;
    overflow-y: auto;
    padding-right: 0.35rem;
}

.timeline-lightbox-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 100px));
    gap: 0.55rem;
    align-content: start;
    overflow-y: auto;
    padding-right: 0.3rem;
}

.timeline-lightbox-thumb {
    /* border: 1px solid rgba(255, 255, 255, 0.25); */
    /* border-radius: 8px; */
    overflow: hidden;
    padding: 0;
    height: 72px;
    background: transparent;
}
.timeline-lightbox-thumb:hover {
    filter: saturate(180%) brightness(0.8);
    border: 2px solid #cfcfcf;
}

.timeline-lightbox-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    
}

.timeline-lightbox-thumb.is-active {
    border-color: #9dd0ff;
    box-shadow: 0 0 0 2px rgba(157, 208, 255, 0.28);
}

@media (max-width: 991.98px) {
    .timeline-period {
        grid-template-columns: minmax(0, 0fr) 108px minmax(0, 1fr);
        margin-bottom: 1.7rem;
    }

    .timeline-event-card {
        max-width: 430px;
    }

    .timeline-years {
        font-size: 0.72rem;
        padding: 0.28rem 0.62rem;
    }

    .timeline-item-primary img {
        height: clamp(200px, 32vw, 280px);
    }
}

@media (max-width: 575.98px) {
    .timeline-header h3 {
        font-size: 1.16rem;
    }

    .timeline-header p {
        margin-bottom: 1.1rem;
    }

    .timeline-track {
        padding: 0.05rem 0;
    }

    .timeline-track::before {
        left: 12px;
        transform: none;
    }

    .timeline-period {
        grid-template-columns: 24px minmax(0, 0fr);
        column-gap: 0.7rem;
        margin-bottom: 1.15rem;
    }

    .timeline-axis {
        grid-column: 1;
        padding-top: 0.8rem;
        gap: 0.35rem;
        position: initial;
        transform: translate(0);
    }

    .timeline-years {
        writing-mode: vertical-rl;
        transform: rotate(180deg);
        border-radius: 12px;
        min-height: 80px;
        padding: 0.5rem 0.3rem;
        font-size: 0.68rem;
    }

    .timeline-period.is-left .timeline-event-card,
    .timeline-period.is-right .timeline-event-card {
        grid-column: 2;
        justify-self: stretch;
        max-width: none;
    }

    .timeline-event-card {
        padding: 0.82rem;
        border-radius: 14px;
    }

    .timeline-gallery {
        grid-template-columns: 1fr;
        gap: 0.58rem;
        max-height: 2000px;
    }

    .timeline-item-primary img,
    .timeline-item-primary .timeline-image-fallback {
        min-height: 190px;
        max-height: 250px;
    }

    .timeline-lightbox-dialog {
        width: calc(100% - 0.8rem);
        margin: 0.4rem auto;
        height: calc(100vh - 0.8rem);
        border-radius: 12px;
        padding: 0.75rem;
        grid-template-rows: minmax(210px, 1fr) auto 96px;
    }

    .timeline-lightbox-caption {
        font-size: 0.84rem;
    }

    .timeline-lightbox-thumb {
        height: 58px;
    }
}
