/*
 * Newsroom Front Package
 * Progressive enhancement only. The accepted Homepage Newsroom remains the
 * server-rendered fallback and owns the publication layout underneath this.
 */

/* Fix the reproduced desktop defect: the rail should size to its own content,
   not stretch to the full height of the much taller lead story. */
.kwhp-newsroom-lede.has-rail {
    align-items: start;
}

.kwhp-newsroom-top-stories {
    align-self: start;
    height: auto;
    min-height: 0;
}

.kwe-newsroom-front-active .kwhp-newsroom-lede-story-wrap {
    position: relative;
    min-width: 0;
}

.kwe-newsroom-storybar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 27px;
    margin: 0 0 9px;
}

.kwe-newsroom-storybar > .kwhp-newsroom-overline {
    margin: 0;
}

.kwe-newsroom-controls {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    flex: 0 0 auto;
    padding: 2px 5px;
    border: 1px solid var(--kw-adapt-border, rgba(142, 145, 160, .38));
    border-radius: 999px;
    background: var(--kw-adapt-surface, rgba(255, 255, 255, .88));
    background: color-mix(in srgb, var(--kw-adapt-surface, #fff) 88%, transparent);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .08);
    opacity: .82;
    transition: opacity 140ms ease, border-color 140ms ease, background-color 140ms ease;
}

.kwe-newsroom-controls[hidden] {
    display: none !important;
}

.kwe-newsroom-storybar:hover .kwe-newsroom-controls,
.kwe-newsroom-controls:focus-within {
    opacity: 1;
}

.kwe-newsroom-control {
    appearance: none;
    display: inline-grid;
    place-items: center;
    width: 25px;
    height: 23px;
    min-width: 25px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--kw-adapt-text, inherit);
    font: inherit;
    font-size: 18px;
    font-weight: 750;
    line-height: 1;
    cursor: pointer;
}

.kwe-newsroom-control:hover,
.kwe-newsroom-control:focus-visible {
    background: var(--kw-adapt-raised, rgba(127, 111, 190, .12));
    outline: none;
}

.kwe-newsroom-control:focus-visible {
    box-shadow: inset 0 0 0 1px var(--kw-adapt-focus, #7b69c7);
}

.kwe-newsroom-pause-glyph {
    font-size: 8px;
    font-weight: 950;
    letter-spacing: -1px;
}

.kwe-newsroom-pause.is-paused .kwe-newsroom-pause-glyph {
    font-size: 10px;
    letter-spacing: 0;
}

.kwe-newsroom-control:disabled {
    opacity: .45;
    cursor: default;
}

.kwe-newsroom-counter {
    display: inline-block;
    min-width: 51px;
    margin-left: 3px;
    padding-left: 7px;
    border-left: 1px solid var(--kw-adapt-border, rgba(142, 145, 160, .34));
    color: var(--kw-adapt-muted, currentColor);
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .12em;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
}

.kwe-newsroom-hero-stage {
    position: relative;
    width: 100%;
    min-width: 0;
}

.kwe-newsroom-front-active .kwe-newsroom-hero-stage > .kwhp-newsroom-story-lead {
    transition: opacity 170ms ease, transform 170ms ease;
}

.kwe-newsroom-front-active.is-kwe-fading .kwe-newsroom-hero-stage > .kwhp-newsroom-story-lead {
    opacity: 0;
    transform: translateY(3px);
}

/* Off-screen-in-place measurement keeps the lead package at one stable height
   as headlines rotate. It never participates in layout or receives input. */
.kwe-newsroom-hero-measure {
    position: absolute !important;
    z-index: -1 !important;
    top: 36px;
    left: 0;
    width: 100%;
    visibility: hidden !important;
    pointer-events: none !important;
}

.kwe-newsroom-hero-measure .kwhp-newsroom-story-lead {
    width: 100%;
}

@media (max-width: 620px) {
    .kwe-newsroom-storybar {
        gap: 8px;
        margin-bottom: 8px;
    }

    .kwe-newsroom-controls {
        padding-inline: 3px;
    }

    .kwe-newsroom-control {
        width: 24px;
        min-width: 24px;
    }

    .kwe-newsroom-counter {
        min-width: 43px;
        padding-left: 5px;
        font-size: 7px;
    }
}

@media (max-width: 420px) {
    .kwe-newsroom-counter {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .kwe-newsroom-controls,
    .kwe-newsroom-front-active .kwe-newsroom-hero-stage > .kwhp-newsroom-story-lead {
        transition: none !important;
    }

    .kwe-newsroom-pause {
        display: none;
    }

    .kwe-newsroom-front-active.is-kwe-fading .kwe-newsroom-hero-stage > .kwhp-newsroom-story-lead {
        transform: none;
    }
}
