/* Section: compare band. A star over a two-line heading, a line of copy and a
   button, centred on the brand fill; an optional picture stands on the bottom
   edge. Phones set it flush left with the star beside the heading. */

.compare-band {
    /* One Figma pixel of the 1352 content box, shrinking with the viewport. */
    --u: min(1px, (100vw - 2 * var(--container-pad)) / 1352);
    /* Where the site's content column starts and ends; the section is its own
       inline-size container so this ignores the page scrollbar. */
    --edge: max(var(--container-pad), (100cqi - var(--container-max)) / 2);

    position: relative;
    overflow: clip;
    isolation: isolate;
    container-type: inline-size;
    background: var(--color-primary);
    color: var(--color-white);
}

/* A screen tall at 1512 with the copy centred on it. */
.compare-band__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(982 * var(--u));
    padding: calc(101 * var(--u)) var(--edge);
    text-align: center;
}

/* With a picture the copy starts where the design has it and the picture
   takes the space left under it, standing on the section's bottom edge. */
.compare-band--has-image .compare-band__inner {
    justify-content: flex-start;
    padding-bottom: 0;
}

/* Headings/H2 and H2-Italic: Philosopher Bold 56/64. The star is a grid item
   so it can move beside the first line on phones. */
.compare-band__title {
    display: grid;
    grid-template-areas:
        "star"
        "em"
        "span";
    justify-items: center;
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--text-h2);
    font-weight: var(--fw-bold);
    line-height: var(--lh-h2);
    letter-spacing: 0;
    text-wrap: balance;
}

.compare-band__title em {
    grid-area: em;
    font-style: italic;
}

.compare-band__title span {
    grid-area: span;
}

/* The star's frame is 128px with the shape inset 6.42% inside it. */
.compare-band__star {
    grid-area: star;
    box-sizing: border-box;
    display: block;
    width: calc(128 * var(--u));
    height: calc(128 * var(--u));
    max-width: none;
    margin-bottom: calc(64 * var(--u));
    padding: calc(8.2176 * var(--u));
    pointer-events: none;
    user-select: none;
}

/* Sub-heading: Raleway Regular 24/32. */
.compare-band__body {
    max-width: 48rem;
    margin: calc(40 * var(--u)) 0 0;
    font-family: var(--font-body);
    font-size: var(--text-title5);
    font-weight: var(--fw-regular);
    line-height: var(--lh-title5);
    letter-spacing: -0.75px;
    text-wrap: balance;
}

.compare-band__actions {
    margin-top: calc(40 * var(--u));
}

.compare-band--has-image .compare-band__actions {
    margin-bottom: calc(138 * var(--u));
}

/* Paint and a base size. The shared button size (global.css) only arrives with
   .btn-fx-ready, which main.js adds, so this is what shows before it runs. */
.compare-band__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.25rem;
    border: 1px solid var(--color-accent-01);
    border-radius: 999px;
    background: var(--color-accent-01);
    color: var(--color-dark-purple);
    font-family: var(--font-body);
    font-size: var(--text-title6);
    font-weight: var(--fw-semibold);
    line-height: var(--lh-title6);
    text-decoration: none;
    white-space: nowrap;
}

.compare-band__image {
    display: block;
    width: calc(328 * var(--u));
    max-width: 100%;
    height: auto;
    margin-top: auto;
}

@media (max-width: 1024px) {
    .compare-band__inner {
        min-height: 0;
        padding-block: 4.5rem;
    }

    .compare-band--has-image .compare-band__inner {
        padding-bottom: 0;
    }

    .compare-band__star {
        width: 5rem;
        height: 5rem;
        margin-bottom: 2rem;
        padding: 0.3211rem;
    }

    .compare-band__body,
    .compare-band__actions {
        margin-top: 1.75rem;
    }

    .compare-band--has-image .compare-band__actions {
        margin-bottom: 3.5rem;
    }

    .compare-band__image {
        width: 15rem;
    }
}

/* Phones: flush left, the star turned beside the first line, and the button
   the full width. The picture has no room here. */
@media (max-width: 768px) {
    .compare-band__inner,
    .compare-band--has-image .compare-band__inner {
        align-items: stretch;
        gap: 1rem;
        padding: 3.75rem var(--edge);
        text-align: left;
    }

    .compare-band__title {
        grid-template-columns: minmax(0, 243px) auto;
        grid-template-areas:
            "em star"
            "span span";
        column-gap: 4px;
        align-items: end;
        justify-content: start;
        justify-items: start;
        text-wrap: wrap;
    }

    .compare-band__title em {
        font-size: 2.5rem;
        line-height: 1.4;
        letter-spacing: -1.5px;
    }

    .compare-band__title span {
        font-size: 1.5rem;
        line-height: 1.3333;
        letter-spacing: -0.75px;
    }

    /* 59.43px rotated bounds from the design: the shape's 50.17px frame plus
       the margin its turn takes up. */
    .compare-band__star {
        width: 50.166px;
        height: 50.166px;
        margin: 4.63px;
        padding: 3.22px;
        transform: rotate(-11.9deg);
    }

    .compare-band__body {
        max-width: none;
        margin: 0;
        font-size: 1rem;
        line-height: 1.5;
        letter-spacing: 0;
        text-wrap: wrap;
    }

    .compare-band__actions,
    .compare-band--has-image .compare-band__actions {
        margin: 0;
    }

    .compare-band__button {
        width: 100%;
    }

    .compare-band__image {
        display: none;
    }
}
