/* Weinrich ticker widget. */

.wtk {
    --wtk-bg: #009fe3;
    --wtk-fg: #04172a;
    --wtk-tag-bg: #134094;
    --wtk-tag-fg: #fff;
    --wtk-gap: 48px;
    --wtk-duration: 40s;
    --wtk-distance: 0px;
    --wtk-font: "Montserrat", "Helvetica Neue", Arial, sans-serif;

    display: flex;
    align-items: center;
    gap: 20px;
    padding: 14px 20px;
    background: var(--wtk-bg);
    color: var(--wtk-fg);
    font-family: var(--wtk-font);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

.wtk *,
.wtk *::before,
.wtk *::after {
    box-sizing: border-box;
}

.wtk .wtk__tag {
    flex: none;
    padding: 9px 12px;
    background: var(--wtk-tag-bg);
    color: var(--wtk-tag-fg);
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.wtk .wtk__mask {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}

.wtk .wtk__track {
    display: flex;
    width: max-content;
}

.wtk.is-running .wtk__track {
    animation: wtk-run var(--wtk-duration) linear infinite;
}

.wtk.is-reverse .wtk__track {
    animation-direction: reverse;
}

.wtk.is-hover-pause:hover .wtk__track,
.wtk.is-hover-pause:focus-within .wtk__track,
.wtk.is-paused .wtk__track {
    animation-play-state: paused;
}

.wtk .wtk__list {
    display: flex;
    align-items: center;
    flex: none;
    gap: var(--wtk-gap);
    margin: 0;
    padding: 0 var(--wtk-gap) 0 0;
    list-style: none;
}

.wtk .wtk__item {
    display: flex;
    align-items: center;
    gap: var(--wtk-gap);
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
}

.wtk .wtk__item a {
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.wtk .wtk__item a:hover,
.wtk .wtk__item a:focus {
    color: inherit;
    text-decoration-color: transparent;
}

.wtk .wtk__sep {
    opacity: .5;
}

.wtk .wtk__toggle {
    flex: none;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 2px solid currentColor;
    border-radius: 50%;
    color: var(--wtk-fg);
    cursor: pointer;
}

.wtk .wtk__toggle:hover,
.wtk .wtk__toggle:focus {
    background: rgba(255, 255, 255, .2);
    color: var(--wtk-fg);
}

.wtk .wtk__toggle:focus-visible {
    outline: 3px solid var(--wtk-tag-bg);
    outline-offset: 2px;
}

.wtk .wtk__toggle svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.wtk .wtk__icon-play,
.wtk.is-paused .wtk__icon-pause {
    display: none;
}

.wtk.is-paused .wtk__icon-play {
    display: block;
}

@keyframes wtk-run {
    to {
        transform: translateX(calc(-1 * var(--wtk-distance)));
    }
}

@media (max-width: 767px) {
    .wtk {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "tag toggle"
            "mask mask";
        gap: 10px 12px;
        padding: 12px 14px 14px;
    }

    .wtk .wtk__tag {
        grid-area: tag;
        justify-self: start;
        padding: 7px 9px;
        font-size: 12px;
    }

    .wtk .wtk__toggle {
        grid-area: toggle;
        width: 32px;
        height: 32px;
    }

    .wtk .wtk__mask {
        grid-area: mask;
    }

    .wtk .wtk__item {
        font-size: 17px;
    }
}

/* Static list without motion. */
@media (prefers-reduced-motion: reduce) {
    .wtk.is-running .wtk__track {
        animation: none;
    }

    .wtk .wtk__mask {
        mask-image: none;
    }

    .wtk .wtk__track {
        display: block;
        width: auto;
    }

    .wtk .wtk__list {
        flex-wrap: wrap;
        padding: 0;
        gap: 6px 24px;
    }

    .wtk .wtk__item {
        white-space: normal;
    }

    .wtk .wtk__sep,
    .wtk .wtk__list[aria-hidden="true"],
    .wtk .wtk__toggle {
        display: none;
    }
}