.image-text-cards {
    position: relative;
}

.image-text-cards__inner {
    min-height: 1px;
}

.image-text-cards__heading-row {
    display: grid;
    grid-template-columns: minmax(2rem, 1fr) auto minmax(2rem, 1fr);
    gap: clamp(0.875rem, 2vw, 1.5rem);
    align-items: center;
    margin-bottom: clamp(1.25rem, 3vw, 2rem);
}

.image-text-cards__heading-row::before,
.image-text-cards__heading-row::after {
    height: 1px;
    background: var(--color-black, #000);
    content: "";
}

.image-text-cards__section-heading {
    margin: 0;
    text-align: center;
}

.image-text-cards__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
}

.image-text-cards__card {
    display: flex;
    width: 100%;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid currentColor;
    border-color: color-mix(in srgb, currentColor 12%, transparent);
    border-radius: 0.75rem;
    background: var(--color-grey, #f0f0f0);
    box-shadow: 0 0.625rem 1.75rem color-mix(in srgb, currentColor 6%, transparent);
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.image-text-cards__card:hover,
.image-text-cards__card:focus-within {
    border-color: color-mix(in srgb, currentColor 28%, transparent);
    box-shadow: 0 0.875rem 2rem color-mix(in srgb, currentColor 10%, transparent);
    transform: translateY(-0.2rem);
}

.image-text-cards__card:focus-within {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

.image-text-cards__media {
    overflow: hidden;
}

.image-text-cards__image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: var(--img-ratio-widecard, 7 / 4);
    object-fit: cover;
    transition: transform 220ms ease;
}

.image-text-cards__card:hover .image-text-cards__image,
.image-text-cards__card:focus-within .image-text-cards__image {
    transform: scale(1.02);
}

.image-text-cards__content {
    --block-card-stack-gap: var(--space-s, 1rem);

    display: flex;
    flex: 1;
    flex-direction: column;
    padding: clamp(1.25rem, 2.5vw, 1.75rem);
}

.image-text-cards__heading {
    max-width: 22ch;
}

.image-text-cards__text > :first-child {
    margin-block-start: 0;
}

.image-text-cards__text > :last-child {
    margin-block-end: 0;
}

.image-text-cards__content > .image-text-cards__buttons {
    margin-block-start: auto;
}

.image-text-cards__card--no-image .image-text-cards__content {
    padding-block: clamp(1.5rem, 3vw, 2.25rem);
}

@media (max-width: 900px) {
    .image-text-cards__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .image-text-cards__grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 479px) {
    .image-text-cards__card {
        border-radius: 0.625rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .image-text-cards__card,
    .image-text-cards__image {
        transition: none;
    }

    .image-text-cards__card:hover,
    .image-text-cards__card:focus-within,
    .image-text-cards__card:hover .image-text-cards__image,
    .image-text-cards__card:focus-within .image-text-cards__image {
        transform: none;
    }
}
