/*
 * Change Log. Scoped to .changelog-page so the stylesheet can load globally and
 * every colour comes from the shared --tb-* theme tokens.
 */

.changelog-page {
    max-width: 1080px;
    margin: 0 auto;
    padding: 1.25rem;
    color: var(--tb-text);
}

/* Release hero */
.cl-hero {
    position: relative;
    overflow: hidden;
    margin: 0 0 1.25rem;
    padding: clamp(1.25rem, 3vw, 2.5rem);
    border: 1px solid var(--tb-border);
    border-radius: var(--tb-radius-lg);
    background: linear-gradient(135deg, var(--tb-primary), var(--tb-primary-hover));
    box-shadow: var(--tb-shadow);
    color: var(--tb-primary-fg);
    text-align: center;
}

.cl-hero::after {
    content: "";
    position: absolute;
    inset: -40% -10% auto auto;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: var(--tb-accent);
    opacity: .18;
    filter: blur(60px);
    pointer-events: none;
}

.cl-hero > * {
    position: relative;
    z-index: 1;
}

.cl-eyebrow {
    display: inline-block;
    padding: .3rem .8rem;
    border: 1px solid var(--tb-primary-fg);
    border-radius: 999px;
    font-size: .8rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    opacity: .9;
}

.cl-hero-title {
    margin: .9rem 0 .6rem;
    color: var(--tb-primary-fg);
    font-size: clamp(1.6rem, 4vw, 2.6rem);
    line-height: 1.15;
}

.cl-hero-lead {
    max-width: 60ch;
    margin: 0 auto 1.2rem;
    opacity: .95;
}

.cl-hero-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .5rem;
    margin: 0 0 1.4rem;
    padding: 0;
    list-style: none;
}

.cl-hero-chips li {
    padding: .35rem .75rem;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
    font-size: .9rem;
}

.changelog-page .cl-hero-cta {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    min-height: 44px;
    padding: .55rem 1.2rem;
    border-radius: var(--tb-radius-sm);
    background: var(--tb-primary-fg);
    color: var(--tb-primary);
    font-weight: 600;
    text-decoration: none;
}

.changelog-page .cl-hero-cta:hover,
.changelog-page .cl-hero-cta:focus {
    color: var(--tb-primary-hover);
    text-decoration: none;
    opacity: .92;
}

/* Jump row */
.cl-jump {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .5rem;
    margin: 0 0 1.5rem;
    padding: 0;
    list-style: none;
}

.cl-jump a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: .3rem .85rem;
    border: 1px solid var(--tb-border);
    border-radius: 999px;
    background: var(--tb-surface);
    color: var(--tb-text);
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color var(--tb-transition), border-color var(--tb-transition), color var(--tb-transition);
}

.cl-jump a:hover,
.cl-jump a:focus {
    border-color: var(--tb-border-strong);
    background: var(--tb-surface-alt);
}

.cl-jump a.is-latest {
    border-color: var(--tb-primary);
    background: var(--tb-primary);
    color: var(--tb-primary-fg);
}

/* Release timeline */
.cl-release {
    position: relative;
    margin: 0 0 1.1rem;
    padding-left: 1.6rem;
    scroll-margin-top: 5rem;
}

.cl-release::before {
    content: "";
    position: absolute;
    top: .6rem;
    bottom: -.6rem;
    left: .34rem;
    width: 2px;
    background: var(--tb-border);
}

.cl-release:last-child::before {
    bottom: auto;
    height: calc(100% - .6rem);
}

.cl-release::after {
    content: "";
    position: absolute;
    top: .55rem;
    left: 0;
    width: .7rem;
    height: .7rem;
    border-radius: 50%;
    background: var(--tb-primary);
    box-shadow: 0 0 0 3px var(--tb-bg);
}

.cl-release--latest::after {
    background: var(--tb-success);
}

.cl-release-card {
    overflow: hidden;
    border: 1px solid var(--tb-border);
    border-radius: var(--tb-radius);
    background: var(--tb-surface);
    box-shadow: var(--tb-shadow-sm);
    transition: box-shadow var(--tb-transition);
}

.cl-release-card:hover {
    box-shadow: var(--tb-shadow);
}

.cl-release-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--tb-border);
}

.cl-release-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
    margin: .15rem 0 0;
    color: var(--tb-heading);
    font-size: 1.15rem;
    font-weight: 700;
}

.cl-release-meta {
    margin: 0;
    color: var(--tb-text-muted);
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .02em;
}

.cl-version,
.cl-latest-badge {
    display: inline-flex;
    align-items: center;
    padding: .15rem .55rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .02em;
}

.cl-version {
    border: 1px solid var(--tb-border);
    background: var(--tb-surface-alt);
    color: var(--tb-text-muted);
}

.cl-latest-badge {
    border: 1px solid var(--tb-success);
    background: var(--tb-success-bg);
    color: var(--tb-text);
}

/* Change index */
.cl-changes {
    margin: 0;
    padding: 0 1.25rem 1rem;
    list-style: none;
}

.cl-change {
    padding: .85rem 0;
    border-top: 1px solid var(--tb-border);
}

.cl-change:first-child {
    border-top: 0;
}

.cl-change h3 {
    margin: 0 0 .3rem;
    color: var(--tb-heading);
    font-size: 1rem;
    font-weight: 700;
}

.cl-change p {
    margin: 0;
}

.cl-change ul {
    margin: .4rem 0 0;
    padding-left: 1.15rem;
}

.cl-change li {
    margin: .2rem 0;
}

.cl-pill {
    display: inline-block;
    margin-bottom: .35rem;
    padding: .12rem .55rem;
    border: 1px solid var(--tb-border);
    border-radius: 999px;
    background: var(--tb-surface-alt);
    color: var(--tb-text-muted);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.cl-pill--new {
    border-color: var(--tb-success);
    background: var(--tb-success-bg);
    color: var(--tb-text);
}

.cl-pill--improved {
    border-color: var(--tb-info);
    background: var(--tb-info-bg);
    color: var(--tb-text);
}

/* Collapsed older releases */
details.cl-release > summary {
    display: block;
    cursor: pointer;
    list-style: none;
}

details.cl-release > summary::-webkit-details-marker {
    display: none;
}

details.cl-release > summary:focus-visible {
    outline: 2px solid var(--tb-focus);
    outline-offset: 3px;
}

.cl-summary-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    padding: 1rem 1.25rem;
}

.cl-summary-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
    color: var(--tb-heading);
    font-size: 1.05rem;
    font-weight: 700;
}

.cl-summary-chevron {
    color: var(--tb-text-muted);
    transition: transform var(--tb-transition);
}

details.cl-release[open] .cl-summary-chevron {
    transform: rotate(180deg);
}

details.cl-release[open] > summary .cl-release-card {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    box-shadow: none;
}

.cl-release-body {
    border-top: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    box-shadow: none;
}

/* Mobile */
@media (max-width: 576px) {
    .changelog-page {
        padding: .75rem;
    }

    .cl-release {
        padding-left: 1.1rem;
    }

    .cl-release-head,
    .cl-changes,
    .cl-summary-head {
        padding-left: .9rem;
        padding-right: .9rem;
    }

    .cl-hero-chips {
        gap: .35rem;
    }
}
