/*------------------------------------*\
    CTA Block - Contained (.cta)
\*------------------------------------*/

.cta__wrap {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    background: var(--secondary-color);
}

.cta__bg {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    -o-object-fit: cover;
       object-fit: cover;
    opacity: 0.12;
}

.cta__content {
    padding: 35px 18px;
    z-index: 2;
    text-align: center;
}

.cta__content .cta__btn {
    z-index: 1;
}

.cta__content :last-child {
    margin-bottom: 0;
}

.cta__heading {
    padding-bottom: 24px;
}

.cta__heading :last-child {
    margin-bottom: 0;
}

.cta__heading a:not(.btn) {
    color: var(--color-white);
    text-decoration: none;
    background-image:
        linear-gradient(var(--color-white), var(--color-white)),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.15) 100%);
    background-position: 0 100%, 0 104%;
    background-repeat: no-repeat, repeat-x;
    background-size: 100% 2px, 4px 0;
    transition: background-size 0.3s ease;
}

.cta__heading a:not(.btn):hover,
.cta__heading a:not(.btn):focus-visible {
    color: var(--color-white);
    background-size: 100% 0, 4px 20px;
}

@media (min-width: 768px) {
    .cta__content {
        padding: 45px 52px;
    }
}

@media (min-width: 1200px) {
    .cta__content {
        padding: 52px 52px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        text-align: left;
    }

    .cta__heading {
        width: 60%;
        padding-bottom: 0;
    }
}

/* Contained - image variant (.cta--has-img) */

.cta--has-img .cta__wrap {
    overflow: visible;
}

.cta--has-img .cta__bg {
    border-radius: 24px;
}

.cta--has-img .cta__content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    text-align: center;
    z-index: 2;
}

.cta--has-img .cta__heading {
    padding-bottom: 0;
}

.cta--has-img .cta__card {
    order: -1;
    width: 220px;
    max-width: 80%;
    height: auto;
    margin-top: -100px;
    z-index: 1;
}

@media (min-width: 1200px) {
    .cta--has-img .cta__content {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "heading card"
            "heading button";
        align-items: center;
        -webkit-column-gap: 40px;
           -moz-column-gap: 40px;
                column-gap: 40px;
        row-gap: 20px;
        text-align: left;
    }

    .cta--has-img .cta__heading {
        grid-area: heading;
        width: 92%;
    }

    .cta--has-img .cta__card {
        grid-area: card;
        order: 0;
        width: 300px;
        max-width: none;
        margin-top: -120px;
        justify-self: end;
        align-self: end;
    }

    .cta--has-img .cta__btn {
        grid-area: button;
        justify-self: end;
        align-self: start;
    }

    .cta:not(.cta--no-image) .cta__btn a.btn {
        font-size: 32px;
        padding: 23.5px 82px 23.5px 25px;
    }

    .cta:not(.cta--no-image) .cta__btn .btn::after {
        width: 50px;
        height: 50px;
        font-size: 32px;
    }

}

/* Contained - small sized, no background image (.cta--no-image) */

.cta--no-image {
    margin-top: var(--section-pad-y-sm);
    margin-bottom: var(--section-pad-y-sm);
}

.cta--no-image .cta__content {
    padding: var(--inner-general);
}

.cta__description {
    margin: 8px 0 0;
    color: var(--color-white);
}

.cta--no-image .cta__heading :is(h1, .h1, h2, .h2, h3, .h3, h4, .h4) {
    margin-bottom: 0;
}

@media (min-width: 1200px) {
    .cta--no-image .cta__content {
        gap: 32px;
    }

    .cta--no-image .cta__heading {
        width: auto;
        flex: 1 1 auto;
    }

    .cta--no-image .cta__btn {
        flex-shrink: 0;
    }
}

/*------------------------------------*\
    Large CTA with Background Image (.large-cta)
\*------------------------------------*/

.large-cta {
    position: relative;
    overflow: hidden;
}

.large-cta__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    -o-object-fit: cover;
       object-fit: cover;
    z-index: 0;
}

.large-cta::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--color-ink);
    opacity: 0.8;
    z-index: 1;
}

.large-cta .container {
    position: relative;
    z-index: 2;
}

.large-cta__card {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 40px 24px;
    background: var(--color-white);
    border-radius: var(--radius-box);
}

.large-cta__content {
    text-align: center;
}

.large-cta__content :last-child {
    margin-bottom: 0;
}

.large-cta__content p {
    max-width: 854px;
    margin-left: auto;
    margin-right: auto;
}

.large-cta__content .btn-group,
.large-cta__content > p:has(> .btn) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 24px;
    max-width: none;
}

@media (min-width: 1200px) {
    .large-cta__card {
        padding: 52px;
    }
}

/*------------------------------------*\
    Small CTA - Half Image (.small-cta)
\*------------------------------------*/

.small-cta {
    position: relative;
    overflow: hidden;
    padding-top: var(--section-pad-y-sm);
    padding-bottom: var(--section-pad-y-sm);
}

.small-cta .container {
    position: relative;
}

.small-cta__content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    color: var(--color-white);
}

.small-cta__content :last-child {
    margin-bottom: 0;
}

.small-cta__content h2,
.small-cta__heading {
    margin: 0;
    color: var(--color-white);
}

.small-cta__content p,
.small-cta__subheading {
    font-family: var(--font-gotham);
    font-weight: 700;
    font-size: 22px;
    line-height: 1.2em;
    color: var(--color-white);
}

.small-cta__image {
    display: none;
}

/* No side image: content uses the full container width and stays centered. */
.small-cta:not(.small-cta--has-img) .small-cta__content {
    text-align: center;
    align-items: center;
}

@media (min-width: 1200px) {
    .small-cta--has-img .small-cta__image {
        display: block;
        position: absolute;
        left: -185px;
        top: 50%;
        -webkit-transform: translateY(-50%);
                transform: translateY(-50%);
        width: 415px;
        height: auto;
        pointer-events: none;
    }

    .small-cta--has-img .small-cta__content {
        padding-left: 260px;
        text-align: left;
        align-items: flex-start;
    }
}

/*------------------------------------*\
    Solid Color CTA (.solid-cta)
\*------------------------------------*/

.solid-cta {
    /*
     * Fixed image box + small red overlap. Any upload is contain-fitted and
     * bottom-aligned so the overlap stays the same regardless of asset size.
     */
    --solid-cta-img-height: 160px;
    --solid-cta-img-overlap: 24px;
    --solid-cta-img-space: calc(var(--solid-cta-img-height) - var(--solid-cta-img-overlap));
    overflow: visible;
    padding-top: var(--section-pad-y-sm);
    padding-bottom: var(--section-pad-y-sm);
}

.solid-cta--has-img {
    /* Image space lives on the previous section so its bg fills the overhang. */
    margin-top: 0;
    padding-top: 0;
}

.solid-cta--has-truck {
    /* Full-width truck strip sits inside the section (no previous-section overhang). */
    padding-top: 0;
}

.solid-cta__image-wrap {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    width: 100%;
    max-width: 520px;
    height: var(--solid-cta-img-height);
    margin: calc(-1 * var(--solid-cta-img-space)) auto 20px;
    pointer-events: none;
}

.solid-cta__image {
    display: block;
    width: 100%;
    height: 100%;
    -o-object-fit: contain;
       object-fit: contain;
    -o-object-position: center bottom;
       object-position: center bottom;
}

/*
 * Previous section (direct sibling or ACF block wrapper) grows so its
 * background color paints behind the overhanging image.
 */
:is(.bg-white, .bg-gray, .bg-dark, .bg-red, .bg-has-dark):has(+ .solid-cta--has-img)::after,
[class*="wp-block-acf-"]:has(+ .wp-block-acf-cta-block .solid-cta--has-img) > :is(
    section,
    .bg-white,
    .bg-gray,
    .bg-dark,
    .bg-red,
    .bg-has-dark
)::after {
    content: "";
    display: block;
    height: var(--solid-cta-img-space, 136px);
    pointer-events: none;
}

/* Keep the spacer height in sync with the image pull-up at each breakpoint. */
:is(.bg-white, .bg-gray, .bg-dark, .bg-red, .bg-has-dark):has(+ .solid-cta--has-img),
[class*="wp-block-acf-"]:has(+ .wp-block-acf-cta-block .solid-cta--has-img) > :is(
    section,
    .bg-white,
    .bg-gray,
    .bg-dark,
    .bg-red,
    .bg-has-dark
) {
    --solid-cta-img-height: 160px;
    --solid-cta-img-overlap: 24px;
    --solid-cta-img-space: calc(var(--solid-cta-img-height) - var(--solid-cta-img-overlap));
}

.solid-cta__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    text-align: center;
}

.solid-cta__content :last-child {
    margin-bottom: 0;
}

.solid-cta__content h2,
.solid-cta__content .h2,
.solid-cta__content h3,
.solid-cta__content .h3,
.solid-cta__content h4,
.solid-cta__content .h4,
.solid-cta__content p,
.solid-cta__heading {
    margin: 0;
}

.solid-cta__content h2,
.solid-cta__heading {
    font-size: var(--fs-h2-callout);
    color: inherit;
}

.solid-cta__content h3,
.solid-cta__subheading {
    margin: 0;
    font-family: var(--font-gotham);
    font-weight: 700;
    font-size: var(--fs-h3-callout);
    line-height: 1.2em;
}

.solid-cta__content p,
.solid-cta__text {
    margin: 0;
    font-weight: 700;
}

.solid-cta__content hr {
    width: 100%;
    max-width: 280px;
    margin: 0;
    border: 0;
    border-top: 1px solid currentColor;
    opacity: 1;
}

@media (min-width: 768px) {
    .solid-cta {
        --solid-cta-img-height: 200px;
        --solid-cta-img-overlap: 28px;
    }

    :is(.bg-white, .bg-gray, .bg-dark, .bg-red, .bg-has-dark):has(+ .solid-cta--has-img),
    [class*="wp-block-acf-"]:has(+ .wp-block-acf-cta-block .solid-cta--has-img) > :is(
        section,
        .bg-white,
        .bg-gray,
        .bg-dark,
        .bg-red,
        .bg-has-dark
    ) {
        --solid-cta-img-height: 200px;
        --solid-cta-img-overlap: 28px;
    }

    .solid-cta__image-wrap {
        max-width: 640px;
        margin-bottom: 28px;
    }

    .solid-cta__content hr {
        max-width: 420px;
    }
}

@media (min-width: 1200px) {
    .solid-cta {
        --solid-cta-img-height: 220px;
        --solid-cta-img-overlap: 32px;
    }

    :is(.bg-white, .bg-gray, .bg-dark, .bg-red, .bg-has-dark):has(+ .solid-cta--has-img),
    [class*="wp-block-acf-"]:has(+ .wp-block-acf-cta-block .solid-cta--has-img) > :is(
        section,
        .bg-white,
        .bg-gray,
        .bg-dark,
        .bg-red,
        .bg-has-dark
    ) {
        --solid-cta-img-height: 220px;
        --solid-cta-img-overlap: 32px;
    }

    .solid-cta__image-wrap {
        max-width: 720px;
        margin-bottom: 32px;
    }

    .solid-cta__content hr {
        max-width: 560px;
    }
}

/*------------------------------------*\
    Truck animation (.truck-anim)
    Full-width strip at the top of Small / Solid CTA sections.
\*------------------------------------*/

.truck-anim {
    /*
     * Fixed strip height across breakpoints. Landscape tiles keep a constant
     * height and grow wider via aspect-ratio; multiple clones cover big screens.
     * background.svg viewBox is 1920 x 464.25 (road bottom, no empty red footer).
     */
    --truck-anim-height: 220px;
    --truck-anim-landscape-h: 130px;
    --truck-anim-truck-w: 240px;
    --truck-anim-strip-count: 12;
    --truck-anim-tile-overlap: 2px;
    position: relative;
    overflow: hidden;
    width: 100%;
    height: var(--truck-anim-height);
    margin: 0;
    pointer-events: none;
    background-color: #e2f0fe;
}

.small-cta--has-truck {
    padding-top: 0;
}

.small-cta--has-truck .container {
    padding-top: var(--section-pad-y-sm);
}

.solid-cta--has-truck .container {
    padding-top: var(--section-pad-y-sm);
}

.truck-anim__sky,
.truck-anim__road {
    position: absolute;
    left: 0;
    width: 100%;
    overflow: hidden;
}

/*
 * Sky fills the strip; clouds sit near the horizon above the landscape.
 */
.truck-anim__sky {
    inset: 0;
    z-index: 2;
}

/*
 * Fixed-height landscape band. Each SVG clone is as tall as this band and
 * as wide as the SVG aspect ratio requires (longer, not taller).
 */
.truck-anim__road {
    right: 0;
    bottom: 0;
    top: auto;
    height: var(--truck-anim-landscape-h);
    z-index: 1;
}

.truck-anim__clouds,
.truck-anim__bg {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: stretch;
    -ms-flex-align: stretch;
    align-items: stretch;
    width: -webkit-max-content;
    width: -moz-max-content;
    width: max-content;
    min-width: 100%;
    -ms-flex-negative: 0;
        flex-shrink: 0;
    will-change: transform;
    -webkit-backface-visibility: hidden;
            backface-visibility: hidden;
}

.truck-anim__clouds {
    position: absolute;
    left: 0;
    right: auto;
    bottom: calc(var(--truck-anim-landscape-h) + 4px);
    height: 48px;
    -webkit-animation: truck-anim-scroll-left 11s linear infinite;
            animation: truck-anim-scroll-left 11s linear infinite;
}

.truck-anim__bg {
    height: 100%;
    -webkit-animation: truck-anim-scroll-left 6s linear infinite;
            animation: truck-anim-scroll-left 6s linear infinite;
}

.truck-anim__clouds-strip,
.truck-anim__bg-strip {
    display: block;
    -webkit-box-flex: 0;
    -ms-flex: 0 0 auto;
        flex: 0 0 auto;
    height: 100%;
    width: auto;
    max-width: none;
    /* Pull tiles together so subpixel gaps do not show as lines on large screens. */
    margin-right: calc(var(--truck-anim-tile-overlap) * -1);
}

/*
 * Width comes from height x native SVG ratio so tiles get longer, not taller.
 */
.truck-anim__bg-strip {
    aspect-ratio: 1920 / 464.25;
    overflow: hidden;
}

.truck-anim__clouds-strip {
    aspect-ratio: 1358 / 189;
    overflow: visible;
    opacity: 0.9;
    margin-right: 0;
}

.truck-anim__vehicle {
    position: absolute;
    left: 50%;
    bottom: 3%;
    z-index: 3;
    width: var(--truck-anim-truck-w);
    max-width: 42%;
    aspect-ratio: 655 / 226;
    -webkit-transform: translateX(-50%);
            transform: translateX(-50%);
}

.truck-anim__body,
.truck-anim__lights,
.truck-anim__lights_2,
.truck-anim__wheel {
    position: absolute;
    display: block;
    max-width: none;
    overflow: visible;
}

.truck-anim__body {
    left: 0;
    bottom: 8%;
    width: 100%;
    height: auto;
    z-index: 2;
}

/* Headlight beams ahead of the cab (truck faces right). */
.truck-anim__lights {
    left: auto;
    right: -41.5%;
    bottom: -2%;
    width: 58%;
    height: auto;
    z-index: 3;
    opacity: 0.9;
}

.truck-anim__lights_2 {
    left: auto;
    right: -28.5%;
    bottom: -2%;
    width: 58%;
    height: auto;
    z-index: 3;
    opacity: 0.9;
}
.truck-anim__wheel {
    bottom: 1%;
    width: 7.5%;
    height: auto;
    -webkit-animation: truck-anim-bounce 0.4s ease-in-out infinite alternate;
            animation: truck-anim-bounce 0.4s ease-in-out infinite alternate;
}

.truck-anim__wheel:nth-child(odd) {
    -webkit-animation-delay: 0.12s;
            animation-delay: 0.12s;
}

@-webkit-keyframes truck-anim-bounce {
    from {
        -webkit-transform: translateY(0);
                transform: translateY(0);
    }
    to {
        -webkit-transform: translateY(-4px);
                transform: translateY(-4px);
    }
}

@keyframes truck-anim-bounce {
    from {
        -webkit-transform: translateY(0);
                transform: translateY(0);
    }
    to {
        -webkit-transform: translateY(-4px);
                transform: translateY(-4px);
    }
}

/*
 * Scroll exactly one equal tile. With N identical clones that is -100%/N.
 */
@-webkit-keyframes truck-anim-scroll-left {
    from {
        -webkit-transform: translateX(0);
                transform: translateX(0);
    }
    to {
        -webkit-transform: translateX(calc(-100% / var(--truck-anim-strip-count)));
                transform: translateX(calc(-100% / var(--truck-anim-strip-count)));
    }
}

@keyframes truck-anim-scroll-left {
    from {
        -webkit-transform: translateX(0);
                transform: translateX(0);
    }
    to {
        -webkit-transform: translateX(calc(-100% / var(--truck-anim-strip-count)));
                transform: translateX(calc(-100% / var(--truck-anim-strip-count)));
    }
}

@media (prefers-reduced-motion: reduce) {
    .truck-anim__clouds,
    .truck-anim__bg,
    .truck-anim__wheel {
        -webkit-animation: none;
                animation: none;
    }

    .truck-anim__clouds,
    .truck-anim__bg {
        -webkit-transform: translateX(0);
                transform: translateX(0);
    }

    .truck-anim__lights {
        -webkit-transform: scaleX(-1);
                transform: scaleX(-1);
    }
}

/*------------------------------------*\
    Dynamic CTA (.dynamic-cta)
\*------------------------------------*/

.dynamic-cta {
    position: relative;
    z-index: 1;
    padding-top: var(--section-margins);
    padding-bottom: 80px;
    background: var(--color-secondary);
}

.dynamic-cta__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    -o-object-fit: cover;
       object-fit: cover;
    opacity: 0.12;
    z-index: 0;
}

.dynamic-cta .container {
    position: relative;
    z-index: 2;
}

.dynamic-cta__trucks {
    position: absolute;
    top: 100%;
    left: 50%;
    margin-top: 24px;
    -webkit-transform: translateX(-50%);
            transform: translateX(-50%);
    width: 100%;
    max-width: 700px;
    height: auto;
    z-index: 1;
    pointer-events: none;
}

.dynamic-cta__card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--color-white);
    border-radius: var(--radius-box);
}

.dynamic-cta__panel {
    display: flex;
    align-items: center;
    padding: 32px;
    background: var(--color-primary);
    border-radius: var(--radius-box) var(--radius-box) 0 0;
}

.dynamic-cta__heading {
    margin: 0;
    color: var(--color-white);
}

.dynamic-cta__body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 24px;
    padding: 32px;
}

.dynamic-cta__body > :last-child {
    margin-bottom: 0;
}

.dynamic-cta__body p,
.dynamic-cta__text {
    margin: 0;
    color: var(--color-ink);
}

.dynamic-cta__body h3,
.dynamic-cta__body h4,
.dynamic-cta__subheading {
    margin: 0;
    font-family: var(--font-gotham);
    font-weight: 700;
    font-size: 24px;
    line-height: 1.5em;
    color: var(--color-primary);
}

.dynamic-cta__red-content {
    font-family: var(--font-gotham);
    font-weight: 700;
    font-size: 24px;
    line-height: 1.5;
    color: var(--color-primary);
}

.dynamic-cta__buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 24px;
}

.dynamic-cta__person {
    display: none;
}

@media (min-width: 768px) {
    .dynamic-cta__trucks {
        max-width: 760px;
    }

    .dynamic-cta__person {
        display: block;
        position: absolute;
        left: -16px;
        bottom: -16px;
        width: 240px;
        height: auto;
        z-index: 2;
        pointer-events: none;
    }

    .dynamic-cta__body {
        padding-left: 260px;
    }
}

@media (min-width: 1200px) {
    .dynamic-cta {
        padding-bottom: 140px;
    }

    .dynamic-cta__trucks {
        max-width: 900px;
        left: auto;
        right: 40px;
        -webkit-transform: none;
                transform: none;
    }

    .dynamic-cta__card {
        flex-direction: row;
        max-width: 977px;
        margin-left: auto;
    }

    .dynamic-cta__panel {
        flex-shrink: 0;
        width: 400px;
        border-radius: var(--radius-box) 0 0 var(--radius-box);
    }

    .dynamic-cta__panel h2 {
        font-size: 44px;
    }

    .dynamic-cta__body {
        flex: 1 1 0;
        min-width: 0;
        padding-left: 32px;
    }

    .dynamic-cta__person {
        left: -285px;
        right: 100%;
        bottom: -142px;
        width: 350px;
    }
}
