/*
 * Call to Action
 * The "do this now" block for a sales page: headline, a line of text, a price,
 * a button, a line of small print. Also gives a standalone button (.cta-btn).
 * No script.
 *
 * NEUTRAL BY DESIGN. Do not edit this file per project. To match a project's
 * look, override the --cta-* variables in the project's own CSS (see CLAUDE.md).
 */

/* The variables are set on the block, and on a button that stands alone.
   A button INSIDE a block takes the block's values (so a dark block gets the
   dark button). */
.cta,
.cta-btn:not(.cta .cta-btn) {
    /* ---- theme: light (default) ---- */
    --cta-bg: #f4f4f5;
    --cta-border: #d4d4d8;
    --cta-title: #18181b;
    --cta-text: #3f3f46;
    --cta-muted: #52525b;           /* small print, struck-through price */
    --cta-btn-bg: #18181b;          /* THE button — usually the brand colour */
    --cta-btn-text: #ffffff;
    --cta-btn-hover-bg: #3f3f46;
    --cta-focus: #18181b;

    /* ---- shape and size ---- */
    --cta-radius: 20px;
    --cta-btn-radius: 999px;
    --cta-font: inherit;
    --cta-title-font: inherit;
}

.cta {
    box-sizing: border-box;
    margin: 2.5rem 0;
    padding: clamp(1.5rem, 1rem + 4vw, 3.5rem) clamp(1.25rem, 0.5rem + 4vw, 3rem);
    background: var(--cta-bg);
    border: 1px solid var(--cta-border);
    border-radius: var(--cta-radius);
    color: var(--cta-text);
    font-family: var(--cta-font);
    line-height: 1.55;
    text-align: center;
}

.cta *,
.cta *::before,
.cta *::after {
    box-sizing: border-box;
}

/* ---- theme: dark (add class "cta--dark") ---- */
.cta--dark,
.cta-btn.cta--dark:not(.cta .cta-btn) {
    --cta-bg: #1c1f26;
    --cta-border: #3a404c;
    --cta-title: #f1f3f5;
    --cta-text: #d3d8df;
    --cta-muted: #aab1bd;
    --cta-btn-bg: #f1f3f5;
    --cta-btn-text: #12151a;
    --cta-btn-hover-bg: #d3d8df;
    --cta-focus: #f1f3f5;
}

.cta-title {
    max-width: 22em;
    margin: 0 auto 0.5rem;
    color: var(--cta-title);
    font-family: var(--cta-title-font);
    font-size: clamp(1.5rem, 1.1rem + 2vw, 2.25rem);
    font-weight: 800;
    line-height: 1.15;
    text-wrap: balance;
}

/* Headline straight into the price or button: give it room. */
.cta-title + .cta-price,
.cta-title + .cta-btn {
    margin-top: 1rem;
}

.cta-text {
    max-width: 36em;
    margin: 0 auto 1.25rem;
    font-size: 1.0625rem;
    text-wrap: pretty;
}

.cta-price {
    margin: 0 0 1.25rem;
    color: var(--cta-title);
    font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.cta-price s {
    margin-right: 0.35em;
    color: var(--cta-muted);
    font-size: 0.6em;
    font-weight: 500;
}

.cta-price small {
    color: var(--cta-muted);
    font-size: 0.4em;
    font-weight: 500;
}

.cta-small {
    max-width: 34em;
    margin: 1rem auto 0;
    color: var(--cta-muted);
    font-size: 0.875rem;
}

/* ---- the button (also works on its own, anywhere) ---- */
.cta-btn {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    max-width: 100%;
    padding: 0.75rem 2rem;
    background: var(--cta-btn-bg);
    border: 0;
    border-radius: var(--cta-btn-radius);
    color: var(--cta-btn-text);
    font-family: var(--cta-font);
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 150ms ease;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .cta-btn:hover {
        background: var(--cta-btn-hover-bg);
    }
}

.cta-btn:focus-visible {
    outline: 2px solid var(--cta-focus);
    outline-offset: 3px;
}

/* ---- quiet: a second button, to sit beside the main one ---- */
.cta-btn--quiet {
    background: transparent;
    box-shadow: inset 0 0 0 1.5px currentColor;
    color: var(--cta-title);
}

@media (hover: hover) {
    .cta-btn--quiet:hover {
        background: color-mix(in srgb, currentColor 10%, transparent);
    }
}

/* ---- small: for a card or a table, where the full size is too much ---- */
.cta-btn--small {
    min-height: 44px;
    padding: 0.5rem 1.25rem;
    font-size: 0.9375rem;
}

/* Full-width button on a phone, so it is an easy thumb target. */
@media (max-width: 480px) {
    .cta .cta-btn {
        display: flex;
        width: 100%;
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* ---- split: text on the left, button on the right (wide screens) ---- */
@media (min-width: 720px) {
    .cta--split {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        column-gap: 2.5rem;
        text-align: left;
    }
    .cta--split > * {
        grid-column: 1;
        margin-left: 0;
        margin-right: 0;
    }
    .cta--split > .cta-text:last-of-type {
        margin-bottom: 0;
    }
    .cta--split > .cta-btn {
        grid-column: 2;
        grid-row: 1 / span 9;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cta-btn {
        transition: none;
    }
}
