﻿/* Reserve the fixed announcement bar's space only when it is rendered. */
header:has(> .wds-top-bar) {
    --wds-top-bar-height: 44px;
    padding-top: var(--wds-top-bar-height);
}

.wds-top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 101;
    display: flex;
    height: var(--wds-top-bar-height);
    background: #102438;
    color: #fff;
    font-size: 14px;
    line-height: 1.4;
}

.wds-top-bar__viewport {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.wds-top-bar__track {
    display: flex;
    width: max-content;
    height: 100%;
    animation: wds-ticker-right var(--wds-ticker-duration, 35s) linear infinite;
}

.wds-top-bar__group {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-around;
    min-width: 100vw;
}

.wds-top-bar__item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding-inline: 18px;
    white-space: nowrap;
}

.wds-top-bar__item strong { color: #ffda75; font-weight: 700; }
.wds-top-bar__item a { color: inherit; text-decoration: none; }
.wds-top-bar__item a:hover { text-decoration: underline; }
.wds-top-bar__separator { margin-left: 28px; color: #8aa6bd; }

.wds-top-bar :focus-visible { outline: 2px solid #ffda75; outline-offset: -3px; }
.wds-top-bar:hover .wds-top-bar__track,
.wds-top-bar:focus-within .wds-top-bar__track { animation-play-state: paused; }

/* Keyboard users can reach every original link without off-screen focus. */
.wds-top-bar:focus-within .wds-top-bar__track { animation: none; transform: none; }
.wds-top-bar:focus-within .wds-top-bar__viewport { overflow-x: auto; }
.wds-top-bar:focus-within .wds-top-bar__copy { display: none; }

@keyframes wds-ticker-right {
    from { transform: translateX(-50%); }
    to { transform: translateX(0); }
}

/* Keep navigation below the ticker in every theme state and at every width.
   This overrides the theme's absolute/no-background and top:0/sticked rules. */
header:has(> .wds-top-bar) > nav.navbar.validnavs.navbar-fixed {
    position: fixed;
    top: var(--wds-top-bar-height);
    left: 0;
    right: 0;
}

/* On mobile the original navbar occupied normal-flow space. Keep that space
   (including the actual logo/button height) by sticking the whole header instead
   of fixing the navbar out of flow. This preserves the hero's original top gap. */
@media (max-width: 1023px) {
    header:has(> .wds-top-bar) {
        position: sticky;
        top: 0;
        z-index: 100;
    }

    header:has(> .wds-top-bar) > nav.navbar.validnavs.navbar-fixed {
        position: relative;
        top: 0;
    }

    /* The drawer still uses viewport coordinates below the fixed ticker. */
    header:has(> .wds-top-bar) > nav.navbar.validnavs.mobile-sidenav .navbar-collapse.collapse.collapse-mobile {
        top: var(--wds-top-bar-height);
        height: calc(100vh - var(--wds-top-bar-height));
        height: calc(100dvh - var(--wds-top-bar-height));
        min-height: 0;
        /* validnavs adds .no-full, whose 350px cap otherwise truncates the drawer. */
        max-height: none;
    }
}

@media (max-width: 767px) {
    .wds-top-bar { font-size: 13px; }
    .wds-top-bar__item { padding-inline: 12px; }
}

/* No forced movement: announcements remain manually horizontally scrollable. */
@media (prefers-reduced-motion: reduce) {
    .wds-top-bar__track { animation: none; transform: none; }
    .wds-top-bar__viewport { overflow-x: auto; }
    .wds-top-bar__copy { display: none; }
}