/* ============================================================
   What's New — the release list on /features/whats-new.

   The page furniture (header, hero, footer, tokens) comes from the stylesheets
   guides;head loads. This file defines the year jump list, one release, its
   screenshot thumbnail and the full-size viewer. It defines no colour of its
   own: every colour is a token from b2b-ads/main.css.
   ============================================================ */

/* ── Year jump list ───────────────────────────────────────── */

.whats-new-years-label {
    margin: 28px 0 10px;
    font-size: 0.86rem;
    color: var(--text-dim);
}

.whats-new-years {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 24px;
    padding: 0;
    list-style: none;
}

.whats-new-years a {
    display: inline-block;
    padding: 6px 14px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.9rem;
    text-decoration: none;
    transition: border-color 0.2s ease;
}

.whats-new-years a:hover,
.whats-new-years a:focus-visible {
    border-color: var(--accent-violet);
}

/* ── One year ─────────────────────────────────────────────── */

.whats-new-year {
    padding: 8px 0 32px;
    border-top: 0;
    /* The header is fixed, so a jump to a year stops below it. */
    scroll-margin-top: 96px;
}

.guides-lp .whats-new-year-title {
    margin: 0 0 8px;
    font-family: "Inter Tight", Gilroy, sans-serif;
    font-size: 1.6rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.whats-new-list {
    max-width: 980px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.whats-new-list > li + li {
    border-top: 1px solid var(--border-subtle);
}

.whats-new-empty {
    color: var(--text-secondary);
}

/* ── One release ──────────────────────────────────────────── */

/* Text on the left, the screenshot thumbnail on the right. A release without a
   screenshot uses the whole width. */
.whats-new-entry {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px 32px;
    padding: 24px 0;
    scroll-margin-top: 96px;
}

.whats-new-entry.has-shot {
    grid-template-columns: minmax(0, 1fr) 260px;
    align-items: start;
}

.whats-new-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 0 0 8px;
    font-size: 0.86rem;
    color: var(--text-dim);
}

.whats-new-tag {
    display: inline-block;
    padding: 2px 10px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.whats-new-tag--fix {
    border-color: var(--accent-green);
    color: var(--accent-green);
}

.guides-lp .whats-new-entry h3 {
    margin: 0 0 8px;
    font-family: "Inter Tight", Gilroy, sans-serif;
    font-size: 1.24rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.whats-new-summary,
.whats-new-body {
    margin: 0 0 8px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.whats-new-body {
    color: var(--text-dim);
}

.whats-new-link {
    margin: 4px 0 0;
}

.whats-new-link a {
    color: var(--accent-violet);
    font-weight: 600;
    text-decoration: none;
}

.whats-new-link a:hover,
.whats-new-link a:focus-visible {
    text-decoration: underline;
}

.whats-new-link i {
    font-size: 0.8rem;
}

/* ── Screenshot thumbnail ─────────────────────────────────── */

/* A fixed frame anchored to the top left of the screenshot, so every thumbnail is
   the same size and the list does not shift while images load. */
.whats-new-shot {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    cursor: zoom-in;
    transition: border-color 0.2s ease;
}

.whats-new-shot img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Screens put their heading at the top left, so that corner stays. */
    object-position: left top;
}

.whats-new-shot:hover,
.whats-new-shot:focus-visible {
    border-color: var(--accent-violet);
}

.whats-new-shot:focus-visible {
    outline: 2px solid var(--accent-violet);
    outline-offset: 2px;
}

.whats-new-shot-zoom {
    position: absolute;
    right: 8px;
    bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-size: 0.8rem;
}

/* ── Full-size viewer ─────────────────────────────────────── */

.whats-new-viewer {
    /* The site's reset removes a dialog's own centring, so it is set here. */
    position: fixed;
    inset: 0;
    margin: auto;
    height: fit-content;
    width: min(1200px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    padding: 0;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--bg-elevated);
    color: var(--text-primary);
    overflow: hidden;
}

.whats-new-viewer::backdrop {
    background: rgba(11, 10, 21, 0.8);
    backdrop-filter: blur(6px);
}

.whats-new-viewer[open] {
    display: flex;
    flex-direction: column;
}

.whats-new-viewer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 12px 12px 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.whats-new-viewer-title {
    margin: 0;
    font-family: "Inter Tight", Gilroy, sans-serif;
    font-weight: 600;
    color: var(--text-primary);
}

.whats-new-viewer-close {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-primary);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.whats-new-viewer-close:hover,
.whats-new-viewer-close:focus-visible {
    border-color: var(--accent-violet);
}

.whats-new-viewer-image {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 110px);
    margin: 0 auto;
    object-fit: contain;
    overflow: auto;
}

/* ── Narrow screens ───────────────────────────────────────── */

@media (max-width: 720px) {
    /* The thumbnail moves under the text and keeps a readable width. */
    .whats-new-entry.has-shot {
        grid-template-columns: minmax(0, 1fr);
    }

    .whats-new-shot {
        max-width: 360px;
    }
}
