/*
 * Changelog/Release Notes Layout
 *
 * Timeline-based design for changelogs and release notes.
 * Inspired by the resume work history timeline.
 */

/* ============================================
   CONTAINER & HEADER
   ============================================ */

.changelog-container {
    max-width: var(--max-width-prose);
    margin: 0 auto;
    padding: var(--space-8) var(--space-6);
}

.changelog-header {
    margin-bottom: var(--space-10);
    text-align: center;
}

.changelog-header h1 {
    font-size: var(--text-4xl);
    font-weight: var(--font-bold);
    margin: 0 0 var(--space-4) 0;
    color: var(--color-text-primary);
}

.changelog-description {
    font-size: var(--text-lg);
    color: var(--color-text-secondary);
    margin: 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: var(--leading-relaxed);
}

/* ============================================
   TIMELINE STRUCTURE
   ============================================ */

.changelog-timeline {
    margin-top: var(--space-8);
}

.timeline {
    position: relative;
}

.timeline-item {
    margin-bottom: var(--space-10);
    padding-left: var(--space-6);
    border-left: 2px solid var(--color-border-light);
    position: relative;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

/* Timeline dot marker */
.timeline-item::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    border: 2px solid var(--color-bg-primary);
    box-shadow: 0 0 0 2px var(--color-primary);
}

/* ============================================
   RELEASE HEADER
   ============================================ */

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
    flex-wrap: wrap;
}

.timeline-title-group {
    flex: 1;
    min-width: 200px;
}

.timeline-title {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    margin: 0 0 var(--space-1) 0;
    color: var(--color-text-primary);
}

.timeline-title a {
    color: var(--color-text-primary);
    text-decoration: none;
    transition: color var(--transition-fast) var(--ease-out);
}

.timeline-title a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.timeline-subtitle {
    font-size: var(--text-base);
    color: var(--color-text-tertiary);
    margin: 0;
    font-weight: var(--font-medium);
}

.timeline-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--space-2);
    font-size: var(--text-sm);
    flex-shrink: 0;
}

.timeline-date {
    font-weight: var(--font-medium);
    color: var(--color-text-secondary);
}

.release-status {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.release-status.status-stable,
.release-status.status-released {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.release-status.status-beta,
.release-status.status-preview {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.release-status.status-alpha,
.release-status.status-experimental {
    background: var(--color-info-bg);
    color: var(--color-info);
}

.release-status.status-deprecated {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

.timeline-description {
    margin: 0 0 var(--space-4) 0;
    color: var(--color-text-secondary);
    line-height: var(--leading-relaxed);
    font-size: var(--text-base);
}

/* ============================================
   CHANGELOG CATEGORIES
   ============================================ */

.changelog-category {
    margin: var(--space-4) 0;
    padding: var(--space-4);
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--color-border-light);
}

.changelog-category.changelog-breaking {
    background: var(--color-danger-bg);
    border-left-color: var(--color-danger);
}

.category-title {
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    margin: 0 0 var(--space-3) 0;
    color: var(--color-text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.changelog-breaking .category-title {
    color: var(--color-danger);
}

.changelog-list {
    margin: 0;
    padding-left: var(--space-6);
    list-style: disc;
}

.changelog-list li {
    margin-bottom: var(--space-2);
    color: var(--color-text-secondary);
    line-height: var(--leading-relaxed);
}

.changelog-list li:last-child {
    margin-bottom: 0;
}

.changelog-list li::marker {
    color: var(--color-primary);
}

.changelog-breaking .changelog-list li::marker {
    color: var(--color-danger);
}

/* ============================================
   READ MORE LINK
   ============================================ */

.changelog-read-more {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--space-4);
    padding: var(--space-2) var(--space-4);
    color: var(--color-primary);
    text-decoration: none;
    font-weight: var(--font-medium);
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast) var(--ease-out);
}

.changelog-read-more:hover {
    background: var(--color-primary);
    color: var(--color-bg-primary);
    transform: translateX(2px);
}

/* ============================================
   SINGLE RELEASE PAGE
   ============================================ */

.changelog-single {
    max-width: var(--max-width-prose);
    margin: 0 auto;
    padding: var(--space-8) var(--space-6);
}

.release-header {
    margin-bottom: var(--space-8);
    padding-bottom: var(--space-6);
    border-bottom: 2px solid var(--color-border-light);
}

.release-header h1 {
    font-size: var(--text-4xl);
    font-weight: var(--font-bold);
    margin: 0 0 var(--space-3) 0;
    color: var(--color-text-primary);
}

.release-name {
    font-size: var(--text-xl);
    color: var(--color-text-secondary);
    margin: 0 0 var(--space-4) 0;
    font-weight: var(--font-medium);
}

.release-meta {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.release-date {
    font-size: var(--text-base);
    color: var(--color-text-secondary);
    font-weight: var(--font-medium);
}

.release-summary {
    margin-top: var(--space-4);
    font-size: var(--text-lg);
    color: var(--color-text-secondary);
    line-height: var(--leading-relaxed);
}

.release-content {
    margin-top: var(--space-6);
}

.release-content .changelog-category {
    margin-bottom: var(--space-6);
}

.release-content .category-title {
    font-size: var(--text-xl);
    margin-bottom: var(--space-4);
}

.release-details {
    margin-top: var(--space-8);
    padding-top: var(--space-8);
    border-top: 1px solid var(--color-border-light);
}

.release-footer {
    margin-top: var(--space-8);
    padding-top: var(--space-6);
    border-top: 1px solid var(--color-border-light);
}

.release-links {
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.release-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-5);
    background: var(--color-bg-secondary);
    color: var(--color-text-primary);
    text-decoration: none;
    font-weight: var(--font-medium);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast) var(--ease-out);
}

.release-link:hover {
    background: var(--color-primary);
    color: var(--color-bg-primary);
    border-color: var(--color-primary);
    transform: translateY(-1px);
}

.release-download {
    background: var(--color-primary);
    color: var(--color-bg-primary);
    border-color: var(--color-primary);
}

.release-download:hover {
    background: var(--color-primary-dark);
    border-color: var(--color-primary-dark);
}

/* ============================================
   EMPTY STATE
   ============================================ */

.changelog-empty {
    text-align: center;
    padding: var(--space-16) var(--space-4);
    color: var(--color-text-tertiary);
}

.changelog-content {
    margin-top: var(--space-10);
    padding-top: var(--space-8);
    border-top: 1px solid var(--color-border-light);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {

    .changelog-container,
    .changelog-single {
        padding: var(--space-6) var(--space-4);
    }

    .changelog-header h1,
    .release-header h1 {
        font-size: var(--text-3xl);
    }

    .timeline-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .timeline-meta {
        align-items: flex-start;
        flex-direction: row;
        gap: var(--space-3);
    }

    .timeline-title {
        font-size: var(--text-xl);
    }

    .timeline-item {
        padding-left: var(--space-4);
    }

    .changelog-category {
        padding: var(--space-3);
    }

    .release-links {
        flex-direction: column;
    }

    .release-link {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .timeline-item::before {
        border-color: var(--color-bg-primary);
        box-shadow: 0 0 0 2px var(--color-primary);
    }

    :root:not([data-theme="light"]) .changelog-category {
        background: var(--color-bg-tertiary);
    }

    :root:not([data-theme="light"]) .changelog-category.changelog-breaking {
        background: rgba(220, 38, 38, 0.1);
    }
}
