/* Listing badges, homepage only (2026-11-25). Each badge is another company's name on this
   homepage and joins only on the owner's own yes for that name.

   Three states (2026-11-27), set by js/badge-strip.js from the number of DIFFERENT badges:
   - none: the strip is hidden;
   - one or two: a quiet line, the badges centred on white, no band, no border, no pause button (this
     is also the look without JavaScript). White, not the body's pearl: the section above (.gradient-cta)
     and the footer below are both white, so pearl here showed as a stripe, which is a band again;
   - three or more: .is-band, a band that rolls (.is-rolling, with hidden repeats of the list, enough
     to fill the strip twice over, so the loop has no seam). With reduced motion the band stays still
     and the badges wrap onto more rows.
   Each img carries width and height (171 x 54), so nothing moves when it loads. The strip is an
   <aside>, not a <section>: home-journeys.css gives every direct section of the homepage 72px of
   padding with an id-strength selector. */

.badge-strip {
    position: relative;
    background: #ffffff;
    padding: 12px 0;
}

.badge-strip.is-band {
    background: var(--pearl, #faf9f7);
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    padding: 20px 0;
}

/* The padding and matching negative margin give the links' focus ring room inside the clip. */
.badge-strip__viewport {
    overflow: hidden;
    padding: 6px 0;
    margin: -6px 0;
}

.badge-strip__track {
    display: flex;
}

.badge-strip__list {
    flex: 1 1 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 16px 32px;
    list-style: none;
    margin: 0;
    padding: 0 24px;
}

.badge-strip__list li {
    flex: none;
}

.badge-strip__list a {
    display: block;
    border-radius: 12px;
}

.badge-strip__list a:focus-visible {
    outline: 2px solid var(--indigo, #4338ca);
    outline-offset: 3px;
}

.badge-strip__list img {
    display: block;
    width: 171px;
    height: 54px;
    max-width: none;
}

/* Rolling: the list stays on one line at its natural width. */
.badge-strip.is-rolling .badge-strip__list {
    flex: none;
    flex-wrap: nowrap;
    width: max-content;
}

.badge-strip.is-rolling .badge-strip__viewport {
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 48px, #000 calc(100% - 48px), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 48px, #000 calc(100% - 48px), transparent);
}

.badge-strip.is-rolling .badge-strip__track {
    width: max-content;
    animation: badge-strip-roll var(--badge-strip-duration, 30s) linear infinite;
}

/* The gap after the last badge equals the gap between badges, so the copy joins seamlessly. */
.badge-strip.is-rolling .badge-strip__list {
    padding: 0 32px 0 0;
}

/* Hover and focus pause it over the badges only, so the pause button's own hover or focus never
   holds it paused after Play is pressed. */
.badge-strip.is-rolling .badge-strip__viewport:hover .badge-strip__track,
.badge-strip.is-rolling .badge-strip__viewport:focus-within .badge-strip__track,
.badge-strip.is-paused .badge-strip__track {
    animation-play-state: paused;
}

/* A badge reached with the keyboard may have slid out of view, and pausing would hold it there. Stop
   the roll instead, so the real list sits at the start and the browser can bring the badge into view. */
.badge-strip.is-rolling .badge-strip__viewport:has(a:focus-visible) .badge-strip__track {
    animation: none;
}

@keyframes badge-strip-roll {
    to { transform: translateX(-50%); }
}

/* Moving content that lasts more than five seconds needs a way to stop it (WCAG 2.2.2). */
.badge-strip__pause {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 999px;
    background: #fff;
    color: #334155;
    cursor: pointer;
}

.badge-strip__pause:focus-visible {
    outline: 2px solid var(--indigo, #4338ca);
    outline-offset: 2px;
}

.badge-strip__pause[hidden] {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .badge-strip__track {
        animation: none !important;
    }
}
