.cta-blocks-container {
    margin: 0;
    padding: 0;
}

.cta-blocks-wrapper {
    margin: 0;
}

.cta-blocks-grid {
    display: grid;
    gap: 30px;
    padding-bottom: 30px;
}

.cta-blocks-wrapper:last-child .cta-blocks-grid {
    padding-bottom: 0;
}

/* CTA Block Base */
.cta-block {
    position: relative;
    min-height: 400px;
    display: flex;
    align-items: center;
    width: 100%;
    overflow: hidden;
}

/* Background */
.cta-block-background {
    position: absolute;
    inset: 0;
    z-index: 0;
    min-width: 370px;
    min-height: 400px;
}

.cta-block-background picture {
    display: block;
    width: 100%;
    height: 100%;
}

.cta-block-background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 90% 10%;
}

/* Gradient Overlay */
.cta-block[data-gradient="true"] .cta-block-background::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        196deg,
        rgb(0 21 61 / 0%) 25.75%,
        rgb(0 21 61 / 80%) 58.9%,
        rgb(0 21 61 / 90%) 80.3%
    );
    pointer-events: none;
}

.cta-block[data-gradient="true"][data-theme="dark"]
    .cta-block-background::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgb(240 240 240 / 0%) 4.04%,
        rgb(240 240 240 / 85%) 48.99%,
        rgb(240 240 240 / 95%) 95.48%
    );
    pointer-events: none;
}

/* Content */
.cta-block-content {
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 1;
    padding: 30px 20px 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* Stack children from the bottom */
    align-items: flex-start;
}

.cta-block-headings{
    display: flex;
    flex-direction: column;
}

/* Typography */
.cta-block-eyebrow {
    font-size: var(--heading-font-size-s);
    text-transform: inherit;
    line-height: 25px;
    font-weight: 600;
}

.cta-block h2 {
    font-size: var(--heading-font-size-xl);
    line-height: 29px;
    margin: 0;
    font-weight: 400;
}

.cta-block-description {
    font-size: var(--body-font-size-s);
    font-weight: 400;
    line-height: 21px;
    width: 100%;
    margin: 0 0 25px;
}

/* Theme Colors */
.cta-block[data-theme="dark"] {
    color: var(--text-grey);
}

.cta-block:not([data-theme="dark"]) {
    color: var(--rsm-white);
}

.cta-block[data-theme="dark"] .cta-block-description p a:any-link{
    color: var(--text-grey);
}

.cta-block:not([data-theme="dark"]) .cta-block-description p a:any-link{
    color: var(--rsm-white);
}


@media (max-width: 900px) {
    main > .section > div.cta-blocks-wrapper {
        padding: 0 10px;
    }
}

/* Responsive Layout */
@media (min-width: 768px) {
    /* Handle width variations */
    .cta-blocks-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }

    .cta-block {
        position: relative;
    }

    .cta-block[data-full-width="true"] {
        grid-column: span 2;
    }

    .cta-block[data-full-width="false"] {
        grid-column: span 1;
    }

    .cta-block-content {
        position: absolute;
        display: flex; 
        transform: unset;
        justify-content: flex-end;
        padding: 0 20px;
        min-height: 346px;
    }

    .cta-block[data-full-width="true"] .cta-block-content {
        min-width: 666px;
        width: 58%;
    }

    .cta-block:not([data-full-width="true"]) .cta-block-content {
        width: 100%;
    }

    /* Typography */
    .cta-block-eyebrow {
        font-size: var(--heading-font-size-m);
        margin-bottom: 0;
    }

    .cta-block h2 {
        font-size: var(--heading-font-size-xl);
    }

    .cta-block-description p:not(:has(a)){
        font-size: var(--heading-font-size-m);
    }

    .cta-block:not([data-full-width="true"]) .cta-block-description p:not(:has(a)){
        width: 100%;
    }
}

/* Print Styles */
@media print {
    .cta-block {
        break-inside: avoid;
        border: 1px solid #eee;
    }

    .cta-block[data-gradient="true"] .cta-block-background::after {
        display: none;
    }
}

@media (min-width: 900px) {
    .cta-block {
        min-height: 459px;
    }

    .cta-block-background:hover img {
        max-height: 459px;
    }

    .cta-block-content{
        padding: 0 40px;
    }

    .cta-block h2 {
        line-height: 43px;
        display: block;
    }
  
    .cta-block-description {
        line-height: 25px;
    }
}
