/*
 * File: /assets/css/platform-marquee.css
 * Module: The platform logo marquee (template-parts/platform-marquee.php)
 *
 * Self-contained so any page can load it: site tokens only (style.css :root
 * and dark-mode.css), prefix ch-pmq. Motion is transform only, so the rows
 * never shift layout; the boxes have fixed heights before any logo paints.
 */

.ch-pmq {
    --pmq-card: #FFFFFF;
    --pmq-line: #E2E8F0;
    --pmq-ink: #0F172A;
    --pmq-body: #475569;
    --pmq-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 10px 24px -16px rgba(15, 23, 42, 0.3);
    --pmq-gap: 0.75rem;
    position: relative;
    margin: 3rem 0 0;
    padding: 1.6rem 0 0.4rem;
}

html[data-theme="dark"] .ch-pmq {
    --pmq-card: #111B2E;
    --pmq-line: #26344F;
    --pmq-ink: #F1F5F9;
    --pmq-body: #CBD5E1;
    --pmq-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 24px -16px rgba(0, 0, 0, 0.8);
}

.ch-pmq-k {
    margin: 0 0 1.1rem;
    color: var(--pmq-body);
    font-family: 'JetBrains Mono', 'Roboto Mono', monospace;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-align: center;
    text-transform: uppercase;
}

.ch-pmq-rows {
    display: grid;
    gap: var(--pmq-gap);
    overflow: hidden;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 9%, #000 91%, transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 9%, #000 91%, transparent 100%);
}

.ch-pmq-row { overflow: hidden; }

.ch-pmq-move {
    display: flex;
    width: max-content;
    animation: chPmqSlide 46s linear infinite;
    will-change: transform;
}

.ch-pmq-row.is-reverse .ch-pmq-move {
    animation-duration: 52s;
    animation-direction: reverse;
}

/* Each list ends with the same gap it has inside, so the two copies are equal
   and -50% lands exactly on the start of the second one. */
.ch-pmq-list {
    display: flex;
    flex: none;
    gap: var(--pmq-gap);
    margin: 0;
    padding: 0.25rem var(--pmq-gap) 0.55rem 0;
    list-style: none;
}

.ch-pmq-item {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 0.65rem;
    height: 58px;
    margin: 0;
    padding: 0 1.25rem 0 1rem;
    border: 1px solid var(--pmq-line);
    border-radius: 16px;
    background-color: var(--pmq-card);
    box-shadow: var(--pmq-shadow);
    color: var(--pmq-ink);
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    white-space: nowrap;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.25s ease;
}

.ch-pmq-item:hover {
    border-color: color-mix(in srgb, var(--brand, #10B981) 45%, var(--pmq-line));
    transform: translateY(-2px);
}

.ch-pmq .ch-plat-logo {
    display: block;
    flex: none;
    color: var(--brand, var(--pmq-ink));
}

/* "Any website" is a globe from the UI set, boxed to the same height. */
.ch-pmq span.ch-plat-logo.is-any {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    color: #059669;
}

html[data-theme="dark"] .ch-pmq span.ch-plat-logo.is-any { color: #34D399; }

/* Brands whose mark is black would vanish on a dark card. */
html[data-theme="dark"] .ch-plat-logo.is-bigcommerce,
html[data-theme="dark"] .ch-plat-logo.is-squarespace {
    color: #F1F5F9;
}

/* WooCommerce purple sinks into the dark card; its lighter tint reads. */
html[data-theme="dark"] .ch-plat-logo.is-woocommerce {
    color: #C99BC2;
}

/* Pause while the visitor reads a name, and while the rows are off screen. */
.ch-pmq:hover .ch-pmq-move,
.ch-pmq:focus-within .ch-pmq-move,
.ch-pmq.is-off .ch-pmq-move {
    animation-play-state: paused;
}

/* Page fits: under the home hero and the Premium hero, which already end in
   their own padding, the rows sit closer. */
.ch-home .ch-pmq,
.ch-prem .ch-pmq {
    margin-top: 0.5rem;
    padding-top: 0.6rem;
}

/* The home hero keeps an empty band under its chips; the rows move into it. */
.ch-home .ch-pmq {
    margin-top: -2.5rem;
}

@media (max-width: 600px) {
    .ch-home .ch-pmq { margin-top: 0; }
}

.ch-prem .ch-pmq + .ch-prem-section {
    margin-top: 4rem;
}

@keyframes chPmqSlide {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

@media (max-width: 600px) {
    .ch-pmq { margin-top: 2.25rem; }
    .ch-pmq-item { height: 50px; padding: 0 1rem 0 0.85rem; font-size: 0.9rem; }
    .ch-pmq svg.ch-plat-logo { transform: scale(0.86); transform-origin: left center; margin-right: -3px; }
    .ch-pmq span.ch-plat-logo.is-any { width: 22px; height: 22px; }
}

/* Reduced motion: still, centered, wrapped rows; the duplicate copy goes. */
@media (prefers-reduced-motion: reduce) {
    .ch-pmq-rows { -webkit-mask-image: none; mask-image: none; }
    .ch-pmq-move { flex-wrap: wrap; justify-content: center; width: auto; animation: none; }
    .ch-pmq-list { flex-wrap: wrap; justify-content: center; padding-right: 0; }
    .ch-pmq-list[aria-hidden="true"] { display: none; }
    .ch-pmq-item:hover { transform: none; }
}
