.feature-columns {
    position: relative;
    background-size: 480px !important;
    background-position: top right !important;
    background-repeat: no-repeat !important;
    scroll-margin-block-start: 14rem;
    z-index: 1;

    .mini-container {
        &.overlap-hero {
            margin-top: -56px;
            position: relative;
            border-radius: 8px;
            background: white;
            padding: 56px 56px 0 56px;
            margin-left: 50px;
            margin-right: 50px;

            @media only screen and (max-width: 767px) {
                margin-left: 0;
                margin-right: 0;
            }
        }
    }

    @media only screen and (max-width: 767px) {
        padding-bottom: 56px !important;
    }

    > svg {
        position: absolute;
        right: 0;
    }

    .eagleview-container > .title {
        font-size: 32px;
        font-weight: 500;
        line-height: 41.6px !important;
        margin-bottom: 16px;
    }

    .center-title,
    .center-subtitle {
        text-align: center;
    }

    .eagleview-container > .subtitle {
        font-size: 20px !important;
        margin-bottom: 16px;
        margin-top: 24px;
        font-weight: 300 !important;
        line-height: 24px !important;
    }

    .eagleview-container.show-dots {
        @media only screen and (max-width: 767px) {
            margin-top: 120px;
            padding-top: 80px;
        }
    }

    .columns {
        display: grid;
        gap: 25px;
        margin-bottom: 32px;

        &.add-margin {
            margin-top: 56px;
        }

        &.columns-0 {
            margin-top: 0 !important;
        }

        .icon {
            width: 34px;
            height: 34px;
            display: block;
        }

        .image-media {
            position: relative;
            display: block;
            width: 100%;

            .image {
                display: block;
                width: 100%;
                border-radius: 8px;
                margin-bottom: 0;
            }

            .image-label {
                position: absolute;
                top: 24px;
                left: 24px;
                background: #f7f8fa;
                border-radius: 16px;
                padding: 4px 12px;
                color: #231f20;
                font-size: 14px;
                font-weight: 400;
                line-height: normal;
                white-space: nowrap;
            }
        }

        .column-title {
            font-size: 20px !important;
            line-height: 32px !important;
            margin-bottom: 16px;
            color: var(--eagleview--color--blue);
            font-weight: 500 !important;

            &.fix-height {
                line-clamp: 2;
                -webkit-line-clamp: 2;
                overflow: hidden;
                text-overflow: ellipsis;
                height: 64px;
            }

            @media only screen and (max-width: 767px) {
                height: fit-content !important;
            }
        }

        p {
            line-height: normal;
            font-weight: 300;
        }

        .column {
            border-radius: 8px;

            &.bg-white {
                background: white;
            }
            &.bg-light-grey {
                background: #f4f6f8;
            }
            &.padding {
                padding: 24px;
            }

            p:last-of-type {
                margin-bottom: 0;
            }

            &.center {
                img.icon {
                    margin: 0 auto 16px;
                }

                .image-media {
                    margin: 0 auto 16px;
                }

                .column-title,
                p,
                ul,
                li,
                div {
                    text-align: center;
                }
            }

            a {
                text-decoration: underline;
                color: var(--eagleview--color--green-hover);
            }

            ul {
                padding-left: 30px;
                font-size: 20px;
                font-weight: 300;

                li {
                    font-weight: 300;
                }
            }

            &:not(.center) {
                img.icon,
                .image-media {
                    margin-bottom: 24px;
                }
            }

            .cta {
                color: white;
                background-color: var(--eagleview--color--green-hover);
                padding: 8px 24px;
                border-radius: 4px;
                font-size: 18px;
                font-weight: 700;
                line-height: 25px;
                text-align: center;
                display: block;
                width: fit-content;
                margin-top: 24px;
                text-decoration: none;
                height: 40px;
                margin-bottom: 32px;

                &:hover {
                    background-color: var(--eagleview--color--green);
                    color: var(--eagleview--color--white) !important;
                }

                &.alt-cta {
                    background: none;
                    padding: 0;
                    color: var(--eagleview--color--black);
                    font-size: 14px;
                    font-weight: 300;
                    margin-bottom: 0;
                    display: flex;
                    align-items: center;
                    height: fit-content;

                    &:hover {
                        color: var(--eagleview--color--green) !important;
                    }
                }
            }
        }

        &.columns-1 {
            grid-template-columns: 1fr;
        }
        &.columns-2 {
            grid-template-columns: 1fr 1fr;
        }
        &.columns-3 {
            grid-template-columns: 1fr 1fr 1fr;
        }
        &.columns-4 {
            grid-template-columns: 1fr 1fr 1fr 1fr;
        }
        &.columns-5 {
            grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
        }
        &.columns-6 {
            grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
        }

        @media only screen and (max-width: 1300px) {
            &.columns-4 {
                grid-template-columns: 1fr 1fr 1fr;
            }
            &.columns-5 {
                grid-template-columns: 1fr 1fr 1fr;
            }
            &.columns-6 {
                grid-template-columns: 1fr 1fr 1fr;
            }
        }

        @media only screen and (max-width: 1000px) {
            &.columns-3 {
                grid-template-columns: 1fr 1fr;
            }
            &.columns-4 {
                grid-template-columns: 1fr 1fr;
            }
            &.columns-5 {
                grid-template-columns: 1fr 1fr;
            }
            &.columns-6 {
                grid-template-columns: 1fr 1fr;
            }
        }

        @media only screen and (max-width: 600px) {
            &.columns-1 {
                grid-template-columns: 1fr;
            }
            &.columns-2 {
                grid-template-columns: 1fr;
            }
            &.columns-3 {
                grid-template-columns: 1fr;
            }
            &.columns-4 {
                grid-template-columns: 1fr;
            }
            &.columns-5 {
                grid-template-columns: 1fr;
            }
            &.columns-6 {
                grid-template-columns: 1fr;
            }
        }
    }

    &.bg-white {
        .eagleview-container > .title {
            color: var(--eagleview--color--blue);
        }

        .eagleview-container > .subtitle {
            color: var(--eagleview--color--black);
        }
    }

    &.bg-light-grey {
        background: #f4f6f8;

        .eagleview-container > h2 {
            color: var(--eagleview--color--blue);
        }

        .eagleview-container > h3 {
            color: var(--eagleview--color--black);
        }
    }

    &.bg-blue {
        background: #1e334e;
        color: white;

        & .overlap-hero {
            background: #1e334e !important;
        }

        & .eagleview-container:has(.overlap-hero) > * {
            translate: 0 -56px;
        }

        & .eagleview-container:has(.overlap-hero) > *:last-child {
            /* negate the translate */
            margin-block-end: -56px;
        }

        .eagleview-container > .title {
            color: white;
        }

        .eagleview-container .subtitle,
        .columns .column-title {
            color: white;
        }
    }

    .f-13 p {
        font-size: 13px;
    }

    .f-14 p {
        font-size: 14px;
    }

    .f-15 p {
        font-size: 15px;
    }

    .f-16 p, .f-16 p a {
        font-size: 16px;
    }

    .f-17 p {
        font-size: 17px;
    }

    .f-18 p {
        font-size: 18px;
    }

    .f-19 p {
        font-size: 19px;
    }

    .f-20 p {
        font-size: 20px;
    }

    &.is-partner-cards {
        .columns {
            gap: 24px !important;

            .column {
                border-radius: 10px;
                display: flex;
                flex-direction: column;
                align-items: center;
                gap: 24px;
                padding: 0 0 20px;
                overflow: hidden;

                &.padding {
                    padding: 0 0 20px;
                }

                .image-media {
                    width: 100%;
                    margin-bottom: 0;

                    .image {
                        height: 136px;
                        object-fit: cover;
                        border-radius: 8px 8px 0 0;
                        border: 1px solid #c4c4c4;
                        box-sizing: border-box;
                    }
                }

                h3 {
                    font-size: 20px;
                    font-weight: 500;
                    line-height: 32px;
                    color: #3c659b;
                    margin: 0;

                    &.fix-height {
                        height: auto;
                        line-clamp: unset;
                        -webkit-line-clamp: unset;
                        overflow: visible;
                        text-overflow: unset;
                    }
                }

                hr {
                    display: none;
                }

                [class^="f-"] {
                    font-size: 16px !important;
                    font-weight: 300;
                    line-height: 24px;
                    margin: 0;

                    p {
                        font-size: 16px;
                        font-weight: 300;
                        line-height: 24px;
                        margin: 0;
                    }
                }

                .column-body {
                    display: flex;
                    flex-direction: column;
                    justify-content: space-between;
                    flex: 1 0 auto;
                    width: 100%;
                    box-sizing: border-box;
                    padding: 0 31.5px;
                    gap: 24px;
                    min-height: 160px;
                }

                .column-body-content {
                    display: flex;
                    flex-direction: column;
                    gap: 24px;
                }

                .cta {
                    margin-top: auto;
                    margin-bottom: 0;
                }
            }
        }
    }

    .section-button {
        text-align: center;
        margin-top: 24px;

        .cta {
            color: white;
            background-color: var(--eagleview--color--green-hover);
            padding: 8px 24px;
            border-radius: 4px;
            font-size: 18px;
            font-weight: 700;
            line-height: 25px;
            text-align: center;
            display: inline-block;
            width: fit-content;
            text-decoration: none;
            height: 40px;

            &:hover {
                background-color: var(--eagleview--color--green);
                color: var(--eagleview--color--white) !important;
            }
        }
    }
}
@media only screen and (max-width: 767px) {
    svg.pattern {
        max-width: 100%;
    }
}

/* Horizon uses Sofia Sans for Feature Columns subtitles without changing existing Feature Columns pages. */
body.post-horizon .feature-columns .eagleview-container > .subtitle {
    font-family: "Sofia Sans", sans-serif;
}


/*
 * Horizon Dark (opt-in via the "Horizon Dark" variation). Photographic full-section background with a dark
 * overlay, white headings and light copy. Nothing here applies unless the section has .is-horizon-dark.
 */
.feature-columns.is-horizon-dark {
    --fc-ink: #231f20;
    --fc-mist: #ebeff5;

    padding-top: 56px;
    padding-bottom: 56px;
    background-color: var(--fc-ink);
    background-size: cover !important;
    background-position: center 75% !important;
    background-repeat: no-repeat !important;
    color: #fff;

    @media only screen and (min-width: 768px) {
        padding-top: 96px;
        padding-bottom: 96px;
        background-position: center 70% !important;
    }

    /* Decorative overlay (pure CSS: nothing for screen readers, no pointer input) */
    &::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: 0;
        background: linear-gradient(
            180deg,
            rgba(35, 31, 32, 0.9) 0%,
            rgba(35, 31, 32, 0.85) 45%,
            rgba(35, 31, 32, 0.93) 100%
        );
        pointer-events: none;
    }

    .eagleview-container {
        position: relative;
        z-index: 1;
    }

    /* Header: centred, 856px wide */
    .title {
        max-width: 856px;
        margin: 0 auto 16px;
        color: #fff;
        font-size: 32px !important;
        font-weight: 500 !important;
        line-height: 32px !important;
        text-wrap: balance;
    }

    .eagleview-container > .subtitle {
        max-width: 856px;
        margin: 0 auto;
        color: var(--fc-mist);
        font-size: 20px !important;
        font-weight: 300 !important;
        line-height: 32px !important;
        text-wrap: pretty;
    }

    /* Columns */
    .columns {
        margin-bottom: 0;

        &.add-margin {
            margin-top: 32px;

            @media only screen and (min-width: 768px) {
                margin-top: 48px;
            }
        }

        &.columns-3 {
            grid-template-columns: repeat(3, minmax(0, 1fr));
        }

        @media only screen and (max-width: 767px) {
            row-gap: 56px !important;

            &.columns-3 {
                grid-template-columns: minmax(0, 1fr);
            }
        }

        .column-title {
            color: #fff;
            overflow-wrap: anywhere;
        }

        .column p,
        .column li {
            margin: 0;
            color: var(--fc-mist);
            font-size: 16px;
            font-weight: 300;
            line-height: 24px;
            overflow-wrap: anywhere;
        }
    }
}

/*
 * Topographic texture (opt-in via "Background Image Style"). Matches the Horizon reference: a 1707x501 box in the
 * top-right, rotated, at 25% opacity behind the content; bottom-right and unrotated on mobile.
 */
.feature-columns.has-texture {
    overflow: hidden;

    /* Mobile: the texture sits at the bottom of the section, so reserve its height (180px in the Horizon reference)
       below the content instead of letting the lines run behind the last item's text. */
    @media only screen and (max-width: 767px) {
        padding-bottom: 180px !important; /* stylelint-disable-line */
    }

    .feature-columns__texture {
        position: absolute;
        top: -250.6045px;
        right: 0;
        z-index: 0;
        width: 1707.344px;
        height: 501.209px;
        background: no-repeat right top / auto;
        opacity: 0.25;
        transform: rotate(180deg);
        pointer-events: none;

        @media only screen and (max-width: 767px) {
            top: auto;
            bottom: 0;
            background-position: right bottom;
            transform: none;
        }
    }

    .eagleview-container {
        position: relative;
        z-index: 1;
    }
}
