/* =========================================================
   Trajectory Timeline
   ========================================================= */

.tl-page-header {
    padding: 4rem 0 2rem;
}

.tl-page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.tl-page-header p {
    opacity: 0.6;
    font-size: 1.1rem;
}

/* ── Filter bar ── */
.tl-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 3rem;
}

.tl-filter-btn {
    padding: 6px 18px;
    border-radius: 20px;
    border: 1.5px solid currentColor;
    background: transparent;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    opacity: 0.5;
}

.tl-filter-btn.active,
.tl-filter-btn:hover {
    opacity: 1;
}

.tl-filter-btn[data-cat="all"]       { color: #ef5d39; }
.tl-filter-btn[data-cat="life"]      { color: #2e7d32; }
.tl-filter-btn[data-cat="work"]      { color: #1565c0; }
.tl-filter-btn[data-cat="project"]   { color: #e65100; }
.tl-filter-btn[data-cat="education"] { color: #6a1b9a; }
.tl-filter-btn[data-cat="award"]     { color: #b8860b; }

.tl-filter-btn[data-cat="all"].active       { background: #ef5d39; color: #fff; }
.tl-filter-btn[data-cat="life"].active      { background: #2e7d32; color: #fff; }
.tl-filter-btn[data-cat="work"].active      { background: #1565c0; color: #fff; }
.tl-filter-btn[data-cat="project"].active   { background: #e65100; color: #fff; }
.tl-filter-btn[data-cat="education"].active { background: #6a1b9a; color: #fff; }
.tl-filter-btn[data-cat="award"].active     { background: #b8860b; color: #fff; }

/* ── Timeline wrap ── */
.tl-wrap {
    position: relative;
    padding: 1rem 0 4rem;
}

.tl-wrap::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    bottom: 0;
    width: 2px;
    background: currentColor;
    opacity: 0.12;
}

/* ── Items ── */
.tl-item {
    position: relative;
    width: 46%;
    margin-bottom: 2.5rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.tl-item.tl-visible {
    opacity: 1;
    transform: translateY(0);
}

.tl-item.tl-hidden {
    display: none;
}

.tl-item.tl-left {
    margin-right: auto;
    padding-right: 2.5rem;
    text-align: right;
}

.tl-item.tl-right {
    margin-left: auto;
    padding-left: 2.5rem;
    text-align: left;
}

/* ── Dot ── */
.tl-dot {
    position: absolute;
    top: 1.25rem;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ef5d39;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px #ef5d39;
    z-index: 1;
}

.tl-item.tl-left .tl-dot  { right: -7px; }
.tl-item.tl-right .tl-dot { left: -7px; }

/* ── Card ── */
.tl-card {
    background: rgba(0,0,0,0.03);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    border: 1px solid rgba(0,0,0,0.07);
    transition: box-shadow 0.2s;
}

.tl-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.tl-date {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.45;
    margin-bottom: 0.4rem;
}

.tl-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.6rem;
}

.tl-badge-life      { background: #e8f5e9; color: #2e7d32; }
.tl-badge-work      { background: #e3f2fd; color: #1565c0; }
.tl-badge-project   { background: #fff3e0; color: #e65100; }
.tl-badge-education { background: #f3e5f5; color: #6a1b9a; }
.tl-badge-award     { background: #fef9e7; color: #b8860b; }

.tl-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.tl-card p {
    font-size: 0.9rem;
    opacity: 0.75;
    margin-bottom: 0;
    line-height: 1.6;
}

/* ── Media ── */
.tl-media {
    margin-top: 1rem;
    border-radius: 8px;
    overflow: hidden;
}

.tl-media img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    border-radius: 8px;
    transition: transform 0.3s;
}

.tl-media img:hover {
    transform: scale(1.02);
}

.tl-media .tl-video-wrap {
    position: relative;
    padding-top: 56.25%;
}

.tl-media .tl-video-wrap iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
}

/* ── Link ── */
.tl-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 0.75rem;
    color: #ef5d39;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s;
}

.tl-link:hover {
    opacity: 0.75;
    color: #ef5d39;
    text-decoration: none;
}

/* ── Empty state ── */
.tl-empty {
    text-align: center;
    padding: 4rem 1rem;
    opacity: 0.45;
}

/* ── Responsive ── */
@media (max-width: 767px) {
    .tl-wrap::before {
        left: 20px;
    }

    .tl-item,
    .tl-item.tl-left,
    .tl-item.tl-right {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        padding-left: 3.5rem;
        padding-right: 0;
        text-align: left;
    }

    .tl-item .tl-dot,
    .tl-item.tl-left .tl-dot,
    .tl-item.tl-right .tl-dot {
        left: 13px;
        right: auto;
    }

    .tl-item.tl-left .tl-badge,
    .tl-item.tl-left .tl-link {
        float: none;
    }
}
