/**
 * Homepage-specific styles.
 */

/* ==========================================================================
   Finance platform logos
   Desktop: six-column logo row
   Mobile: continuously scrolling ticker
   ========================================================================== */

.tfb-platforms-viewport {
    width: 100%;
    margin-top: 2.5rem;
    overflow: visible;
}

.tfb-platforms-track {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: center;
    justify-items: center;
    gap: clamp(0.5rem, 1vw, 1rem);
    width: 100%;
    max-width: 840px;
    margin-inline: auto;
}

/* Individual logo slots */
.tfb-platforms-track > * {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    height: 68px;
    background: transparent;
    box-shadow: none;
    line-height: 0;
}

/* Hide the duplicated logo set on desktop and tablet */
.tfb-platforms-track > :nth-child(n + 7) {
    display: none;
}

.tfb-platforms-track img {
    display: block;
    width: auto;
    height: auto;
    max-width: 125px;
    max-height: 68px;
    object-fit: contain;
    filter: none;
    box-shadow: none;
}

.tfb-platforms-track img {
    display: block;
    width: auto;
    height: auto;
    max-width: 125px;
    max-height: 68px;
    object-fit: contain;
    background-color: #fff;
    border-radius: 8px;
    filter: none;
    box-shadow: none;
}

/* ==========================================================================
   Mobile scrolling ticker
   ========================================================================== */

@media (max-width: 768px) {
    .tfb-platforms-viewport {
        margin-top: 1.75rem;
        overflow: hidden;
    }

    .tfb-platforms-track {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: flex-start;
        gap: 0;
        width: max-content;
        max-width: none;
        margin-inline: 0;
        animation: tfb-platform-scroll 24s linear infinite;
        will-change: transform;
    }

    /* Show the duplicated logo set for seamless scrolling */
    .tfb-platforms-track > :nth-child(n + 7) {
        display: flex;
    }

    .tfb-platforms-track > * {
        flex: 0 0 130px;
        width: 130px;
        height: 60px;
        padding-inline: 0.75rem;
        box-sizing: border-box;
    }

    .tfb-platforms-track img {
        width: auto;
        height: auto;
        max-width: 105px;
        max-height: 56px;
    }
}

/* Respect reduced-motion accessibility settings */
@media (prefers-reduced-motion: reduce) {
    .tfb-platforms-track {
        animation: none;
        transform: none;
    }
}

@keyframes tfb-platform-scroll {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}