/* ============================================
   Timeline v2 — Styles
   Ref: documentation/development-plan/timeline-v2-development.md
   ============================================ */

/* ============================================
   1. HERO HEADER (full-width, like homepage)
   ============================================ */
.tl2-hero-wrap {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    background: url('../images/timeline-bg.jpg') center / cover no-repeat;
    padding: 48px 0;
}
.tl2-hero {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
}
.tl2-hero-content h1 {
    font-size: 2.75rem;
    font-weight: 700;
    color: var(--pmlens-primary);
    margin: 0 0 10px;
    letter-spacing: -0.03em;
    line-height: 1.1;
}
.tl2-hero-content p {
    font-size: 1.15rem;
    color: var(--pmlens-text-muted);
    margin: 0 0 24px;
    max-width: 560px;
}

/* ============================================
   2. BODY: Left Side + Right Sidebar
   ============================================ */
.tl2-body {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--space-2xl);
    align-items: start;
    margin-top: var(--space-2xl);
}

/* ============================================
   3. LEFT SIDE
   ============================================ */
.tl2-left {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
    min-width: 0;
}

/* 3a. Filters Row */
.tl2-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    padding: 20px;
    background: var(--pmlens-surface);
    border: 1px solid var(--pmlens-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.tl2-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 130px;
    flex: 1;
}
.tl2-filter-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--pmlens-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.tl2-filter-group select,
.tl2-filter-group input[type="search"] {
    height: 36px;
    padding: 8px 12px;
    border: 1px solid var(--pmlens-border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-family: inherit;
    background: var(--pmlens-bg);
    color: var(--pmlens-text);
    outline: none;
    transition: border-color 0.2s;
}
.tl2-filter-group select:focus,
.tl2-filter-group input[type="search"]:focus {
    border-color: var(--pmlens-primary);
}
.tl2-reset-btn {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--pmlens-border);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    color: var(--pmlens-text-muted);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    align-self: flex-end;
    height: 36px;
}
.tl2-reset-btn:hover {
    border-color: var(--pmlens-danger);
    color: var(--pmlens-danger);
}

/* 3b. Main row: Time Nav + Journey Items (sub 2-column) */
.tl2-main {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: var(--space-xl);
}

/* Time Nav (sub left) */
.tl2-time-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-right: 1px solid var(--pmlens-border);
    padding-right: 16px;
}
.tl2-time-tab {
    display: block;
    padding: 10px 14px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--pmlens-text-muted);
    text-decoration: none;
    border-left: 3px solid transparent;
    border-radius: 0 6px 6px 0;
    transition: all 0.15s;
    border-top: none;
    border-right: none;
    border-bottom: none;
    background: none;
    text-align: left;
    cursor: pointer;
    width: 100%;
}
.tl2-time-tab:hover {
    background: var(--pmlens-primary-light);
    color: var(--pmlens-primary);
}
.tl2-time-tab.active {
    background: var(--pmlens-primary-light);
    color: var(--pmlens-primary);
    border-left-color: var(--pmlens-primary);
    font-weight: 700;
}

/* Journey Card overrides for v2 timeline */
.tl2-items-col .journey-card {
    padding: 20px;
    margin-bottom: 16px;
    transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}
.tl2-items-col .journey-card:hover {
    border-color: var(--pmlens-primary-light);
}
.tl2-items-col .journey-card-thumb {
    width: 70px;
    height: 105px;
}
.tl2-items-col .journey-card-header .timeline-title {
    font-size: 1rem;
    font-weight: 600;
}
.tl2-items-col .timeline-type-badge {
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 10px;
}
.tl2-items-col .timeline-date {
    font-size: 0.75rem;
    margin-bottom: 4px;
    color: var(--pmlens-text-muted);
}
.tl2-items-col .timeline-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
    font-size: 0.875rem;
}
.tl2-items-col .journey-card-actions {
    margin-top: 10px;
    gap: 16px;
}
.tl2-items-col .like-btn,
.tl2-items-col .dislike-btn {
    padding: 5px 14px;
    font-size: 13px;
}

/* Journey Items (sub right) */
.tl2-items-col {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    min-width: 0;
}

/* Empty state */
.tl2-empty {
    text-align: center;
    padding: 60px 24px;
    background: var(--pmlens-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--pmlens-border);
}
.tl2-empty p {
    font-size: 1.125rem;
    color: var(--pmlens-text-muted);
    margin: 0;
}

/* ============================================
   4. RIGHT SIDEBAR — Widgets
   ============================================ */
.tl2-right {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}
.tl2-widget {
    background: var(--pmlens-surface);
    border: 1px solid var(--pmlens-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}
.tl2-widget h3 {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--pmlens-primary);
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--pmlens-primary-light);
}

/* Stats widget */
.tl2-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.tl2-stat {
    text-align: center;
    padding: 4px;
    background: none;
}
.tl2-stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--pmlens-primary);
    line-height: 1.2;
}
.tl2-stat-label {
    display: block;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--pmlens-text-muted);
    margin-top: 2px;
}

/* Focus widget */
.tl2-focus-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--pmlens-border);
}
.tl2-focus-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.tl2-focus-title {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--pmlens-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tl2-focus-bar-wrap {
    flex-shrink: 0;
    width: 80px;
    height: 8px;
    background: var(--pmlens-border);
    border-radius: 4px;
    overflow: hidden;
}
.tl2-focus-bar {
    height: 100%;
    background: var(--pmlens-accent);
    border-radius: 4px;
    transition: width 0.3s;
}
.tl2-focus-pct {
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--pmlens-text-muted);
    min-width: 36px;
    text-align: right;
}

/* Top Tags widget */
.tl2-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.tl2-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--pmlens-primary);
    background: var(--pmlens-primary-light);
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.15s;
}
.tl2-tag:hover {
    background: var(--pmlens-primary);
    color: #fff;
}
.tl2-tag-count {
    font-size: 0.6875rem;
    opacity: 0.7;
}

/* Highlights widget */
.tl2-highlight-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 0;
    border-bottom: 1px solid var(--pmlens-border);
}
.tl2-highlight-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.tl2-highlight-badge {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #fff;
    padding: 3px 10px;
    border-radius: 10px;
    width: fit-content;
    margin-bottom: 2px;
}
.tl2-highlight-title {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--pmlens-text);
    text-decoration: none;
    transition: color 0.15s;
}
.tl2-highlight-title:hover {
    color: var(--pmlens-primary);
}
.tl2-highlight-date {
    font-size: 0.75rem;
    color: var(--pmlens-text-muted);
}

/* ============================================
   5. MOBILE FILTER TOGGLE (hidden on desktop)
   ============================================ */
.tl2-filter-toggle {
    display: none;
}

/* ============================================
   6. RESPONSIVE
   ============================================ */
@media (max-width: 1023px) {
    .tl2-body {
        grid-template-columns: 1fr;
    }
    .tl2-hero-content h1 {
        font-size: 1.875rem;
    }
}

/* ============================================
   5. FILTER BOTTOM SHEET (mobile)
   ============================================ */
.tl2-filter-sheet-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 400;
    align-items: flex-end;
    justify-content: center;
}
.tl2-filter-sheet-overlay.open {
    display: flex;
}
.tl2-filter-sheet {
    background: var(--pmlens-surface);
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 16px 16px 0 0;
    padding: 20px 24px 32px;
    animation: tl2SheetUp 0.25s ease-out;
}
.tl2-filter-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1rem;
    font-weight: 600;
    color: var(--pmlens-primary);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--pmlens-border);
}
.tl2-filter-sheet-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--pmlens-text-muted);
    padding: 0 4px;
    line-height: 1;
}
.tl2-filter-sheet-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.tl2-filter-sheet-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.tl2-filter-sheet-group label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--pmlens-text-muted);
}
.tl2-filter-sheet-group select,
.tl2-filter-sheet-group input[type="search"] {
    padding: 10px 14px;
    border: 1px solid var(--pmlens-border);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-family: inherit;
    background: var(--pmlens-bg);
    color: var(--pmlens-text);
    outline: none;
}
.tl2-filter-sheet-group select:focus,
.tl2-filter-sheet-group input[type="search"]:focus {
    border-color: var(--pmlens-primary);
}
.tl2-filter-sheet-actions {
    display: flex;
    gap: 8px;
    padding-top: 8px;
}
.tl2-filter-sheet-apply {
    flex: 1;
    padding: 12px 20px;
    background: var(--pmlens-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: opacity 0.15s;
}
.tl2-filter-sheet-apply:hover {
    opacity: 0.9;
}
.tl2-filter-sheet-reset {
    padding: 12px 20px;
    background: transparent;
    border: 1px solid var(--pmlens-border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--pmlens-text-muted);
    text-decoration: none;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.tl2-filter-sheet-reset:hover {
    border-color: var(--pmlens-danger);
    color: var(--pmlens-danger);
}

/* ============================================
   6. MOBILE BOTTOM NAV
   ============================================ */
.tl2-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 56px;
    background: var(--pmlens-surface);
    border-top: 1px solid var(--pmlens-border);
    z-index: 300;
    justify-content: space-around;
    align-items: center;
    padding: 0 8px;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
}
.tl2-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: none;
    border: none;
    padding: 6px 12px;
    cursor: pointer;
    color: var(--pmlens-text-muted);
    font-size: 0.6875rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s;
    font-family: inherit;
}
.tl2-bottom-nav-item:hover,
.tl2-bottom-nav-item:active {
    color: var(--pmlens-primary);
}
.tl2-bottom-nav-item svg {
    display: block;
}

/* Time bottom sheet */
.tl2-time-sheet-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 400;
    align-items: flex-end;
    justify-content: center;
}
.tl2-time-sheet-overlay.open {
    display: flex;
}
.tl2-time-sheet {
    background: var(--pmlens-surface);
    width: 100%;
    max-width: 500px;
    border-radius: 16px 16px 0 0;
    padding: 20px 24px 32px;
    animation: tl2SheetUp 0.25s ease-out;
}
@keyframes tl2SheetUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
.tl2-time-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1rem;
    font-weight: 600;
    color: var(--pmlens-primary);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--pmlens-border);
}
.tl2-time-sheet-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--pmlens-text-muted);
    padding: 0 4px;
    line-height: 1;
}
.tl2-time-sheet-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.tl2-time-sheet-option {
    display: block;
    padding: 12px 16px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--pmlens-text);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}
.tl2-time-sheet-option:hover {
    background: var(--pmlens-primary-light);
    color: var(--pmlens-primary);
}
.tl2-time-sheet-option.active {
    background: var(--pmlens-primary);
    color: #fff;
}

/* ============================================
   6. MOBILE (< 768px)
   ============================================ */
@media (max-width: 767px) {
    .tl2-hero-wrap {
        padding: 32px 0;
    }
    .tl2-hero-content h1 {
        font-size: 1.75rem;
    }
    .tl2-hero-content p {
        font-size: 0.9375rem;
        margin-bottom: 0;
    }

    /* Show bottom nav on mobile */
    .tl2-bottom-nav {
        display: flex;
    }

    /* Add padding to body to account for fixed bottom nav */
    .tl2-body {
        margin-bottom: 64px;
    }

    /* Filter toggle hidden — filters toggled via bottom nav */
    .tl2-filter-toggle {
        display: none !important;
    }

    /* Filters panel hidden by default, toggled via .open (from bottom nav) */
    .tl2-filters {
        display: none;
    }
    .tl2-filters.open {
        display: flex;
        flex-direction: column;
    }
    .tl2-filter-group {
        min-width: 0;
        width: 100%;
    }

    .tl2-main {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    /* Hide time nav on mobile — replaced by bottom sheet */
    .tl2-time-nav {
        display: none;
    }

    .tl2-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .tl2-widget {
        padding: 16px;
    }
}


