/*
 * Public changelog (/novedades): dark hero card, type filter, month timeline and pagination.
 * Loaded after the home base, header and footer sheets; colours and type come from the
 * design system tokens.
 *
 * Breakpoints: the month labels sit in their own column from 900px; below, they head
 * each group.
 */

.changelog-page {
    --changelog-width: 1120px;
    --changelog-month-column: 200px;
    --changelog-dot-size: 9px;
    --changelog-glow: rgb(255 42 60 / 55%);
    --changelog-glow-soft: rgb(255 42 60 / 0%);
}

/* Header: the home header without the search column. */
.changelog-header .home-header__inner {
    grid-template-columns: auto minmax(0, 1fr);
    max-width: var(--changelog-width);
}

.changelog-header .home-header__actions {
    justify-self: end;
}

.changelog {
    max-width: var(--changelog-width);
    margin: 0 auto;
    padding: var(--rg-space-8) var(--home-gutter) var(--rg-space-10);
}

/* Hero */
.changelog-hero {
    position: relative;
    overflow: hidden;
    padding: 72px var(--rg-space-10);
    border: 1px solid var(--rg-color-inverse-line);
    border-radius: var(--rg-radius-xl);
    background: var(--rg-color-inverse);
    color: var(--rg-color-inverse-text);
    isolation: isolate;
}

.changelog-hero::before {
    content: '';
    position: absolute;
    inset: -70% -25% auto 45%;
    z-index: -1;
    height: 180%;
    background: radial-gradient(closest-side, var(--changelog-glow), var(--changelog-glow-soft));
    transform: rotate(-12deg);
}

.changelog-hero__title {
    margin: 0;
    font-size: var(--rg-font-size-6xl);
    font-weight: var(--rg-font-weight-medium);
    letter-spacing: var(--rg-letter-spacing-display);
    line-height: 1.05;
}

.changelog-hero__intro {
    max-width: 560px;
    margin: var(--rg-space-4) 0 0;
    color: var(--rg-color-inverse-muted);
    font-size: var(--rg-font-size-lg);
    line-height: 1.5;
}

/* Type filter */
.changelog-filters {
    display: inline-flex;
    flex-wrap: wrap;
    gap: var(--rg-space-1);
    margin: var(--rg-space-6) 0 var(--rg-space-8);
    padding: var(--rg-space-1);
    border-radius: var(--rg-radius-pill);
    background: var(--rg-color-surface);
    box-shadow: inset 0 0 0 1px var(--home-line);
}

.changelog-page .changelog-filters__option {
    padding: var(--rg-space-2) var(--rg-space-4);
    border-radius: var(--rg-radius-pill);
    color: var(--rg-color-ink-muted);
    font-size: var(--rg-font-size-base);
    transition: background var(--rg-transition), color var(--rg-transition);
}

.changelog-page .changelog-filters__option:hover {
    background: var(--rg-color-surface-sunken);
    color: var(--rg-color-ink);
}

.changelog-page .changelog-filters__option[aria-current='page'] {
    background: var(--rg-color-ink);
    color: var(--rg-color-inverse-text);
}

.changelog-page .changelog-filters__option:focus-visible,
.changelog-page .changelog-pagination__page:focus-visible {
    outline: 2px solid var(--rg-color-brand);
    outline-offset: 2px;
}

/* Timeline */
.changelog-month {
    display: grid;
    grid-template-columns: var(--changelog-month-column) minmax(0, 1fr);
}

.changelog-month__label {
    position: sticky;
    top: calc(var(--home-header-height) + var(--rg-space-4));
    align-self: start;
    margin: 0;
    padding-top: var(--rg-space-1);
    font-size: var(--rg-font-size-base);
    font-weight: var(--rg-font-weight-medium);
}

.changelog-month__entries {
    margin: 0;
    padding: 0 0 var(--rg-space-6) var(--rg-space-10);
    border-left: 1px solid var(--home-line);
    list-style: none;
}

.changelog-entry {
    position: relative;
    padding-bottom: var(--rg-space-8);
}

.changelog-entry::before {
    content: '';
    position: absolute;
    top: 7px;
    left: calc(-1 * var(--rg-space-10) - (var(--changelog-dot-size) / 2) - 0.5px);
    width: var(--changelog-dot-size);
    height: var(--changelog-dot-size);
    border: 2px solid var(--home-page);
    border-radius: 50%;
    background: var(--rg-color-text-faint);
}

.changelog-entry__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--rg-space-2);
    margin: 0;
    color: var(--rg-color-text-muted);
    font-size: var(--rg-font-size-md);
}

.changelog-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: var(--rg-radius-pill);
    font-size: var(--rg-font-size-sm);
    font-weight: var(--rg-font-weight-medium);
}

.changelog-badge__icon {
    width: 13px;
    height: 13px;
}

.changelog-badge--new {
    background: var(--rg-color-brand-tint);
    color: var(--rg-color-brand-strong);
}

.changelog-badge--improvement {
    background: var(--rg-color-info-tint);
    color: var(--rg-color-info);
}

.changelog-badge--fix {
    background: var(--rg-color-warning-tint);
    color: var(--rg-color-warning);
}

.changelog-entry__title {
    margin: var(--rg-space-3) 0 0;
    font-size: var(--rg-font-size-xl);
    font-weight: var(--rg-font-weight-medium);
    line-height: 1.35;
}

/* Card: the title link stretches over the item (its padding below excluded), so a click
   anywhere opens the detail while the item keeps its look. */
.changelog-page .changelog-entry__link {
    color: inherit;
}

.changelog-entry__link::after {
    content: '';
    position: absolute;
    inset: calc(-1 * var(--rg-space-3)) calc(-1 * var(--rg-space-4)) calc(var(--rg-space-8) - var(--rg-space-3));
    border-radius: var(--rg-radius-lg);
}

.changelog-entry__link:focus-visible {
    outline: none;
}

.changelog-entry__link:focus-visible::after {
    outline: 2px solid var(--rg-color-brand);
}

.changelog-entry__summary {
    max-width: 680px;
    margin: var(--rg-space-2) 0 0;
    color: var(--rg-color-ink-muted);
    font-size: var(--rg-font-size-lg);
    line-height: 1.6;
}

.changelog__empty {
    padding: var(--rg-space-10) 0;
    color: var(--rg-color-text-muted);
    font-size: var(--rg-font-size-lg);
    text-align: center;
}

/* Pagination */
.changelog-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--rg-space-4);
    padding-top: var(--rg-space-6);
    border-top: 1px solid var(--home-line);
}

.changelog-pagination__summary {
    margin: 0;
    color: var(--rg-color-text-muted);
    font-size: var(--rg-font-size-base);
}

.changelog-pagination__pages {
    display: flex;
    align-items: center;
    gap: var(--rg-space-1);
    margin: 0;
    padding: 0;
    list-style: none;
}

.changelog-page .changelog-pagination__page {
    display: inline-grid;
    place-items: center;
    min-width: 38px;
    height: 38px;
    padding: 0 var(--rg-space-2);
    border-radius: var(--rg-radius-pill);
    font-size: var(--rg-font-size-base);
    transition: background var(--rg-transition);
}

.changelog-page .changelog-pagination__page:hover {
    background: var(--home-hover);
}

.changelog-page .changelog-pagination__page[aria-current='page'] {
    background: var(--rg-color-ink);
    color: var(--rg-color-inverse-text);
}

.changelog-pagination__gap {
    padding: 0 var(--rg-space-1);
    color: var(--rg-color-text-faint);
}

@media (max-width: 899px) {
    .changelog-month {
        grid-template-columns: minmax(0, 1fr);
    }

    .changelog-month__label {
        position: static;
        padding: 0 0 var(--rg-space-5);
        color: var(--rg-color-text-muted);
    }

    .changelog-month__entries {
        padding-left: var(--rg-space-6);
    }

    .changelog-entry::before {
        left: calc(-1 * var(--rg-space-6) - (var(--changelog-dot-size) / 2) - 0.5px);
    }
}

@media (max-width: 699px) {
    /* No search row: the phone header keeps a single line. */
    .changelog-page {
        --home-header-height: 60px;
    }

    .changelog-header .home-header__inner {
        grid-template-columns: 1fr auto;
        grid-template-rows: auto;
    }

    .changelog {
        padding: var(--rg-space-4) var(--rg-space-4) var(--rg-space-8);
    }

    .changelog-hero {
        padding: var(--rg-space-9) var(--rg-space-6);
    }

    .changelog-hero__title {
        font-size: var(--rg-font-size-5xl);
    }

    .changelog-filters {
        margin: var(--rg-space-5) 0 var(--rg-space-6);
    }

    .changelog-page .changelog-filters__option {
        padding: var(--rg-space-2) var(--rg-space-3);
    }

    .changelog-entry__title {
        font-size: var(--rg-font-size-lg);
    }

    .changelog-entry__summary {
        font-size: var(--rg-font-size-base);
    }
}

@media (prefers-reduced-motion: reduce) {
    .changelog-page .changelog-filters__option,
    .changelog-page .changelog-pagination__page {
        transition: none;
    }
}
