/*
 * FP Billing Stack Section — frontend + editor styles.
 *
 * Rounded card (heading + subtitle + infinite logo marquee + button).
 * Design source: Framer "billing stack" section (.framer-1y56018).
 *
 * Architecture
 * ────────────
 * .fpr-billing-stack               Outer wrapper — receives CSS variables from render.php.
 *   .fpr-billing-stack__card         The rounded, bordered card (background applied here).
 *     .fpr-billing-stack__header       Heading + subtitle (centered).
 *     .fpr-billing-stack__viewport     overflow:hidden clip box; optional edge fade mask.
 *       .fpr-billing-stack__track        flex row that runs the @keyframes marquee.
 *         .fpr-billing-stack__item         each logo slot (list item).
 *           .fpr-billing-stack__logo         the <img>.
 *     .fpr-billing-stack__actions      Button row (centered).
 *
 * The track is rendered twice (PHP side) so translateX(-50%) loops seamlessly.
 *
 * CSS variables (injected by render.php on the wrapper):
 *   --fpr-bs-duration   one full loop in seconds
 *   --fpr-bs-gap        gap between logos
 *   --fpr-bs-height     logo height
 *   --fpr-bs-bg         card background (solid color OR gradient)
 *   --fpr-bs-border     card border shorthand (e.g. "1px solid var(--wp--preset--color--light)" or "none")
 *   --fpr-bs-title      heading color
 *   --fpr-bs-subtitle   subtitle color
 *   --fpr-bs-btn-bg     button background
 *   --fpr-bs-btn-text   button text color
 */

/* ── Keyframes ───────────────────────────────────────────────────────────────── */

@keyframes fpr-bs-scroll-left {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

@keyframes fpr-bs-scroll-right {
    from { transform: translateX(-50%); }
    to   { transform: translateX(0); }
}

/* ── Outer wrapper + card ────────────────────────────────────────────────────── */

.fpr-billing-stack {
    width: 100%;
    /* Variable defaults (overridden by render.php inline style) */
    --fpr-bs-duration: 30s;
    --fpr-bs-gap: 64px;
    --fpr-bs-height: 40px;
    --fpr-bs-bg: linear-gradient(180deg, var(--wp--preset--color--light) 0%, var(--wp--preset--color--light) 100%);
    --fpr-bs-border: 1px solid var(--wp--preset--color--light);
    --fpr-bs-title: var(--wp--preset--color--overlay);
    --fpr-bs-subtitle: var(--wp--preset--color--secondary);
    --fpr-bs-btn-bg: var(--wp--preset--color--primary);
    --fpr-bs-btn-text: var(--wp--preset--color--background);
}

.fpr-billing-stack__card {
    background: var(--fpr-bs-bg);
    border: var(--fpr-bs-border);
    border-radius: 24px;
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

/* ── Header ──────────────────────────────────────────────────────────────────── */

.fpr-billing-stack__header {
    text-align: center;
    max-width: 720px;
    margin: 0 auto;
}

.fpr-billing-stack__title {
    color: var(--fpr-bs-title);
    font-size: 40px;
    font-weight: 600;
    line-height: 1.2;
    margin: 0;
}

.fpr-billing-stack__subtitle {
    color: var(--fpr-bs-subtitle);
    font-size: 18px;
    font-weight: 400;
    line-height: 1.5;
    margin: 12px 0 0;
}

/* ── Viewport (clip + optional edge fade) ────────────────────────────────────── */

.fpr-billing-stack__viewport {
    width: 100%;
    overflow: hidden;
}

.fpr-billing-stack--fade .fpr-billing-stack__viewport {
    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0%,
        black 12%,
        black 88%,
        transparent 100%
    );
    mask-image: linear-gradient(
        to right,
        transparent 0%,
        black 12%,
        black 88%,
        transparent 100%
    );
}

/* ── Track (marquee) ─────────────────────────────────────────────────────────── */

.fpr-billing-stack__track {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: var(--fpr-bs-gap);
    width: max-content;

    list-style: none;
    margin: 0;
    padding: 0;

    animation-name: fpr-bs-scroll-left;
    animation-duration: var(--fpr-bs-duration);
    animation-timing-function: linear;
    animation-iteration-count: infinite;

    will-change: transform;
}

.fpr-billing-stack--reverse .fpr-billing-stack__track {
    animation-name: fpr-bs-scroll-right;
}

/* ── Logo items ──────────────────────────────────────────────────────────────── */

.fpr-billing-stack__item {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.fpr-billing-stack__logo {
    display: block;
    height: var(--fpr-bs-height);
    width: auto;
    max-width: none;
    object-fit: contain;
}

/* ── Button ──────────────────────────────────────────────────────────────────── */

.fpr-billing-stack__actions {
    display: flex;
    justify-content: center;
}

.fpr-billing-stack__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--fpr-bs-btn-bg);
    color: var(--fpr-bs-btn-text);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.25;
    padding: 16px 40px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: filter 0.2s ease;
}

.fpr-billing-stack__button:hover {
    filter: brightness(0.95);
}

/* ── Responsive ──────────────────────────────────────────────────────────────── */

@media (max-width: 782px) {
    .fpr-billing-stack__card {
        padding: 40px 20px;
        gap: 28px;
    }

    .fpr-billing-stack__title {
        font-size: 28px;
    }

    .fpr-billing-stack__subtitle {
        font-size: 16px;
    }
}

/* ── Reduced motion ──────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .fpr-billing-stack__track {
        animation: none;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }

    .fpr-billing-stack--fade .fpr-billing-stack__viewport {
        -webkit-mask-image: none;
        mask-image: none;
        overflow: visible;
    }
}

/* ── Editor-only ─────────────────────────────────────────────────────────────── */

.fpr-billing-stack--editor .fpr-billing-stack__track {
    animation: none;
}

.fpr-billing-stack--editor .fpr-billing-stack__viewport {
    overflow: auto;
}

.fpr-billing-stack__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 24px;
    background: rgba(0, 0, 0, 0.04);
    border: 2px dashed rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    color: rgba(0, 0, 0, 0.5);
    font-size: 13px;
    min-height: 72px;
}

.fpr-billing-stack--editor .fpr-billing-stack__title,
.fpr-billing-stack--editor .fpr-billing-stack__subtitle {
    text-align: center;
}
