/* Global on purpose: Razor CSS isolation would rename the @keyframes, which breaks
   the mobile re-enable override in cms.css. */
.logo-treadmill {
    --logo-height: 28px;
    --logo-gap: 64px;
    --duration: 40s;
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
    align-self: stretch;
    filter: brightness(0) invert(1);
}

.logo-treadmill-viewport {
    flex: 1 1 auto;
    min-width: 0;
    /* clip, not hidden: hidden makes this a scroll container and a focused link would shift the loop */
    overflow: hidden;
    overflow: clip;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}

.logo-treadmill-track {
    display: flex;
    width: max-content;
    animation: logo-treadmill-scroll var(--duration) linear infinite;
    will-change: transform;
}

/* hover: hover only, iOS keeps :hover stuck after a tap.
   !important: cms.css re-enables the animation on mobile with an !important shorthand */
@media (hover: hover) {
    .logo-treadmill:hover .logo-treadmill-track {
        animation-play-state: paused !important;
    }
}

.logo-treadmill-set {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
    list-style: none;
}

.logo-treadmill-set li {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    height: var(--logo-height);
    padding-right: var(--logo-gap);
}

.logo-treadmill-set a {
    display: flex;
    align-items: center;
    height: 100%;
}

.logo-treadmill-set img {
    display: block;
    height: var(--logo-height);
    width: auto;
    max-width: none;
    -webkit-user-drag: none;
    user-select: none;
    -webkit-user-select: none;
}

/* --set-width is set by logo-treadmill.js */
@keyframes logo-treadmill-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(calc(-1 * var(--set-width, 50%))); }
}

@media (prefers-reduced-motion: reduce) {
    .logo-treadmill-track {
        animation: none;
    }
}
