/* Editorial update desk. Kept separate from the ship-guide component library. */
.updates-page {
    --updates-positive: #85d99d;
    --updates-negative: #ff9f91;
    --updates-world: #7cc4ff;
    --updates-caution: #f2ca72;
    min-height: 100vh;
    background: var(--bg-primary);
    color: var(--text-primary);
}

:root[data-theme="light"] .updates-page {
    --updates-positive: #137a3d;
    --updates-negative: #b42318;
    --updates-world: #1769aa;
    --updates-caution: #8a5a00;
}

.updates-page h1,
.updates-page h2,
.updates-page h3,
.updates-page h4,
.updates-page p {
    margin-top: 0;
}

.updates-page a {
    text-underline-offset: 0.2em;
}

.updates-masthead {
    padding: clamp(3.5rem, 8vw, 7rem) max(1.25rem, calc((100vw - 1180px) / 2)) 3rem;
    border-bottom: 1px solid var(--border-primary);
    background:
        linear-gradient(90deg, rgba(124, 196, 255, 0.08), transparent 45%),
        var(--bg-secondary);
}

.updates-eyebrow {
    margin-bottom: 0.45rem;
    color: var(--text-accent);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.updates-masthead h1 {
    max-width: 780px;
    margin-bottom: 1rem;
    font-family: var(--font-heading);
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 400;
    line-height: 0.96;
    letter-spacing: 0.015em;
}

.updates-masthead__intro {
    max-width: 720px;
    margin-bottom: 1.7rem;
    color: var(--text-secondary);
    font-size: clamp(1.04rem, 2vw, 1.28rem);
    line-height: 1.65;
}

.updates-sync {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1.5rem;
    color: var(--text-tertiary);
    font-size: 0.87rem;
}

.updates-sync span {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.updates-sync i {
    color: var(--updates-positive);
}

.release-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    max-width: 1180px;
    margin: 0 auto;
    padding: 2rem 1.25rem 0;
    gap: 1px;
}

.release-strip article {
    min-width: 0;
    padding: 1.5rem;
    border: 1px solid var(--border-primary);
    background: var(--bg-secondary);
}

.release-strip article:first-child {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

.release-strip article:last-child {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.release-strip__next {
    border-left: 3px solid var(--updates-caution) !important;
}

.release-strip__archive {
    border-left: 3px solid var(--updates-world) !important;
}

.release-strip__archive ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.9rem;
    margin: 0.65rem 0 0.55rem;
    padding: 0;
    list-style: none;
}

.release-strip__archive li {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem;
}

.release-strip__archive time {
    color: var(--text-tertiary);
    font-size: 0.72rem;
}

.release-strip h2 {
    margin-bottom: 0.2rem;
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 400;
    letter-spacing: 0.03em;
}

.release-strip article > p:not(.updates-eyebrow) {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.release-strip a,
.current-release a,
.source-note a,
.ship-change a,
.world-change-list a,
.watch-list a,
.update-archive-list a {
    color: var(--color-info);
    font-weight: 650;
}

.development-brief,
.current-release,
.update-archive {
    max-width: 1180px;
    margin: 2rem auto 0;
    padding: clamp(1.4rem, 4vw, 2.5rem);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
}

.development-brief__header,
.current-release > header,
.update-archive > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-primary);
}

.development-brief__header h2,
.current-release h2,
.update-archive h2 {
    margin-bottom: 0;
    font-family: var(--font-heading);
    font-size: clamp(2.1rem, 5vw, 3.4rem);
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0.02em;
}

.development-state {
    flex: 0 0 auto;
    padding: 0.45rem 0.7rem;
    border: 1px solid color-mix(in srgb, var(--updates-caution), transparent 55%);
    border-radius: var(--radius-sm);
    color: var(--updates-caution);
    font-size: 0.78rem;
    font-weight: 700;
}

.development-brief__lede {
    max-width: 850px;
    margin: 1.5rem 0;
    color: var(--text-secondary);
    font-size: 1.12rem;
    line-height: 1.7;
}

.change-index {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 1.5rem;
    border-block: 1px solid var(--border-primary);
}

.change-index a {
    display: flex;
    min-width: 0;
    min-height: 74px;
    align-items: center;
    gap: 0.7rem;
    padding: 0.9rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
}

.change-index a + a {
    border-left: 1px solid var(--border-primary);
}

.change-index strong {
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 400;
}

.change-index span {
    line-height: 1.2;
}

.change-group {
    min-width: 0;
    margin-top: 1rem;
    padding: 1.25rem 1.25rem 1.25rem 1.4rem;
    border: 1px solid var(--border-primary);
    border-left: 3px solid var(--text-tertiary);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
}

.change-group--adjusted {
    border-left-color: var(--updates-caution);
}

.change-group__header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-primary);
}

.change-group__symbol {
    display: grid;
    width: 2.1rem;
    height: 2.1rem;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-size: 1.25rem;
    font-weight: 800;
}

.change-group--adjusted .change-group__symbol {
    color: var(--updates-caution);
}

.change-group h3 {
    margin-bottom: 0.1rem;
    font-size: 1.1rem;
}

.change-group__header p,
.change-group__empty {
    margin-bottom: 0;
    color: var(--text-tertiary);
    font-size: 0.82rem;
}

.change-group__context {
    max-width: 760px;
    margin: 1rem 0 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.55;
}

.change-group__preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0.9rem 0;
    padding: 0;
    list-style: none;
}

.change-group__preview li {
    padding: 0.35rem 0.65rem;
    border: 1px solid var(--border-primary);
    border-radius: 999px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.change-group__preview .change-group__more {
    border-style: dashed;
    color: var(--text-tertiary);
}

.change-group__details {
    border-top: 1px solid var(--border-primary);
}

.change-group__details > summary {
    display: flex;
    min-height: 48px;
    cursor: pointer;
    align-items: center;
    color: var(--color-info);
    font-size: 0.88rem;
    font-weight: 700;
}

.change-group__details > summary::before {
    content: "+";
    display: grid;
    width: 1.35rem;
    height: 1.35rem;
    margin-right: 0.55rem;
    place-items: center;
    border: 1px solid currentColor;
    border-radius: 50%;
    line-height: 1;
}

.change-group__details[open] > summary::before {
    content: "−";
}

.change-group__details > summary::-webkit-details-marker,
.ship-change__summary::-webkit-details-marker {
    display: none;
}

.ship-change {
    padding: 0;
}

.ship-change + .ship-change {
    border-top: 1px solid var(--border-primary);
}

.ship-change__summary {
    display: grid;
    min-height: 58px;
    cursor: pointer;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.7rem 0;
}

.ship-change__summary > span:first-child {
    display: grid;
    gap: 0.1rem;
}

.ship-change__summary strong {
    color: var(--text-primary);
    font-size: 0.95rem;
}

.ship-change__summary small,
.ship-change__count {
    color: var(--text-tertiary);
    font-size: 0.76rem;
    font-weight: 500;
}

.ship-change__summary::after {
    content: "+";
    color: var(--text-tertiary);
    font-size: 1.2rem;
}

.ship-change[open] > .ship-change__summary::after {
    content: "−";
}

.metric-list {
    margin: 0;
    padding: 0 0 1rem 1rem;
    border-left: 1px solid var(--border-primary);
    list-style: none;
}

.metric-list li + li {
    margin-top: 0.9rem;
    padding-top: 0.9rem;
    border-top: 1px dashed var(--border-primary);
}

.metric-list__topline {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
}

.metric-list p {
    margin: 0.35rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.55;
}

.metric-list a,
.world-change-list a {
    display: inline-block;
    min-height: 44px;
    padding-block: 0.55rem;
    font-size: 0.8rem;
}

.metric-delta {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.35rem;
    color: var(--text-tertiary);
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
}

.world-changes {
    margin-top: 1.5rem;
    padding: 1.4rem;
    border: 1px solid var(--border-primary);
    border-left: 3px solid var(--updates-world);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
}

.world-changes__header h3 {
    margin-bottom: 1rem;
    font-size: 1.35rem;
}

.world-change-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-sm);
    background: var(--border-primary);
}

.world-change-list article {
    min-width: 0;
    padding: 1.15rem;
    background: var(--bg-secondary);
}

.world-change-list__area {
    color: var(--updates-world);
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.world-change-list h4 {
    margin: 0.4rem 0;
    font-size: 1rem;
}

.world-change-list p,
.world-changes__empty {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.55;
}

.world-change-list__impact {
    padding-top: 0.6rem;
    border-top: 1px solid var(--border-primary);
}

.watch-list {
    margin-top: 1.25rem;
    padding: 1.2rem;
    border: 1px solid var(--border-primary);
    border-left: 3px solid var(--updates-caution);
    border-radius: var(--radius-md);
}

.watch-list h3 {
    font-size: 1rem;
}

.watch-list ul {
    margin-bottom: 0;
    padding-left: 1.2rem;
    color: var(--text-secondary);
}

.source-note {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-primary);
    color: var(--text-tertiary);
    font-size: 0.84rem;
}

.source-note > p {
    margin-bottom: 0.65rem;
}

.source-note summary,
.release-sources summary {
    min-height: 44px;
    width: fit-content;
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 700;
}

.source-note ul,
.release-sources ul {
    margin-bottom: 0;
    padding-left: 1.15rem;
}

.source-note li,
.release-sources li {
    margin-top: 0.45rem;
}

.source-note time,
.release-sources time {
    margin-left: 0.35rem;
    color: var(--text-tertiary);
}

.current-release > p {
    max-width: 850px;
    margin: 1.4rem 0;
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.current-release__meta {
    display: grid;
    justify-items: end;
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

.release-highlights {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem 1.5rem;
    padding-left: 1.2rem;
    color: var(--text-secondary);
}

.current-release__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.25rem;
}

.updates-button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    padding: 0.65rem 1rem;
    border-radius: var(--radius-sm);
    background: var(--gradient-accent);
    color: var(--text-inverse) !important;
    text-decoration: none;
}

.release-sources {
    margin-top: 1.3rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-primary);
}

.update-archive {
    margin-bottom: 4rem;
}

.update-archive > header > span {
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

.update-archive-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.update-archive-list li {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: start;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border-primary);
}

.update-archive-list__version {
    color: var(--text-accent);
    font-family: var(--font-heading);
    font-size: 1.65rem;
    line-height: 1;
}

.update-archive-list h3 {
    margin-bottom: 0.3rem;
    font-size: 1rem;
}

.update-archive-list p {
    margin-bottom: 0;
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.update-archive-list__meta {
    display: grid;
    justify-items: end;
    color: var(--text-tertiary);
    font-size: 0.8rem;
}

.updates-page :focus-visible {
    outline: 3px solid var(--text-accent);
    outline-offset: 3px;
}

@media (max-width: 800px) {
    .updates-masthead {
        padding-top: 3.5rem;
    }

    .release-strip,
    .world-change-list,
    .release-highlights {
        grid-template-columns: 1fr;
    }

    .release-strip article,
    .release-strip article:first-child,
    .release-strip article:last-child {
        border-radius: var(--radius-md);
    }

    .release-strip article + article {
        margin-top: 0.75rem;
    }

    .development-brief,
    .current-release,
    .update-archive {
        margin-inline: 1rem;
    }

    .development-brief__header,
    .current-release > header,
    .update-archive > header {
        display: block;
    }

    .development-state {
        display: inline-block;
        margin-top: 0.8rem;
    }

    .change-index {
        grid-template-columns: 1fr;
    }

    .change-index a + a {
        border-top: 1px solid var(--border-primary);
        border-left: 0;
    }

    .metric-list__topline {
        display: block;
    }

    .ship-change__summary {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .ship-change__count {
        display: none;
    }

    .metric-delta {
        justify-content: flex-start;
        margin-top: 0.25rem;
    }

    .current-release__meta {
        justify-items: start;
        margin-top: 0.7rem;
    }

    .update-archive-list li {
        grid-template-columns: 58px minmax(0, 1fr);
    }

    .update-archive-list__meta {
        grid-column: 2;
        justify-items: start;
    }
}

@media (max-width: 430px) {
    .updates-masthead h1 {
        font-size: 3.25rem;
    }

    .development-brief,
    .current-release,
    .update-archive {
        padding: 1.1rem;
    }

    .change-group,
    .world-changes {
        padding: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .updates-page *,
    .updates-page *::before,
    .updates-page *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
