﻿.hp-bg-canvas-funds {
    position: relative;
    background-size: cover;
    background-position: top;
    background-repeat: no-repeat;
}

.if-services {
    max-width: var(--site-max-width);
    margin: 0 auto;
    padding: 64px var(--site-padding, 40px);
}

.if-services__head {
    text-align: center;
    max-width: 80%;
    margin-inline: auto;
    margin-bottom: 3rem;
}

.if-services__title {
    margin: 0 0 16px;
}

.if-services__note {
    text-align: center;
    max-width: 800px;
    margin: auto;
    margin-top: 3rem;
}

.if-cards-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
}

.if-card {
    display: flex;
    flex-direction: column;
    border: 1.5px solid var(--color-brand);
    border-radius: 30px;
    padding: 24px 20px 20px;
    background: transparent;
    text-decoration: none;
    transition: box-shadow 0.22s ease, background 0.22s ease;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

    .if-card:hover {
        box-shadow: 0 10px 36px rgba(109, 54, 30, 0.14);
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
    }

.if-card-flipper {
    grid-column: span 3;
    perspective: 1500px;
    -webkit-perspective: 1500px;
}

.if-offer-card {
    position: relative;
    grid-column: span 4;
    display: grid;
    grid-template-rows: 1fr 2fr;
    min-height: 420px;
    border: 1.5px solid var(--color-brand);
    border-radius: 30px;
    overflow: hidden;
    background: var(--color-cream);
    transition: box-shadow 0.22s ease;
}

    .if-offer-card:hover,
    .if-offer-card:focus-within {
        box-shadow: 0 10px 36px rgba(109, 54, 30, 0.14);
    }

.if-offer-card__media {
    position: relative;
    overflow: hidden;
    background: #fff;
}

.if-offer-card__image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.if-offer-card__body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 20px;
    min-height: 0;
}

.if-offer-card__title {
    margin: 0;
    font-size: 20px;
    line-height: 1.3;
}

.if-offer-card__text {
    color: var(--color-brand-mid);
    font-size: 14px;
    line-height: 1.65;
}

    .if-offer-card__text p {
        margin: 0 0 8px;
        color: var(--color-brand-mid);
    }

        .if-offer-card__text p:last-child {
            margin-bottom: 0;
        }

/* Covers the card so a click anywhere follows the link; the label stays for assistive tech. */
.if-offer-card__link {
    position: absolute;
    inset: 0;
}

    .if-offer-card__link span {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        border: 0;
        overflow: hidden;
        white-space: nowrap;
        clip-path: inset(50%);
    }

.if-card-flipper__inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
    will-change: transform;
    transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.if-card--sizer {
    visibility: hidden;
    pointer-events: none;
    border-color: transparent !important;
    box-shadow: none !important;
}

.if-card-flipper.is-flipped .if-card-flipper__inner {
    transform: rotateY(180deg);
}

.if-card--front,
.if-card--back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    background: transparent;
}

.if-card--front {
    transform: rotateY(0deg) translateZ(0);
    -webkit-transform: rotateY(0deg) translateZ(0);
}

.if-card--back {
    transform: rotateY(180deg) translateZ(0);
    -webkit-transform: rotateY(180deg) translateZ(0);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
}

    .if-card--back .if-card__footer {
        margin-top: auto;
        padding: 12px 0;
    }

.if-card__flip-text {
    flex: 1;
    overflow-y: auto;
    color: var(--color-brand-mid);
    line-height: 1.65;
    font-size: 14px;
}

    .if-card__flip-text p {
        margin: 0 0 8px;
        color: var(--color-brand-mid);
    }

.if-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
}

.if-card__funds {
    padding-bottom: 2rem;
}

.if-card__title {
    text-transform: uppercase;
    max-width: 72%;
}

.if-card__logo {
    width: auto;
    height: 40px;
    max-width: 60px;
    object-fit: contain;
    flex-shrink: 0;
}

.if-card .hp-btn {
    margin-top: auto;
    width: fit-content;
    align-self: flex-start;
}

.if-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
}

.hp-hero__scroll-icon {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 3px;
}

    .hp-hero__scroll-icon span {
        display: block;
        width: 14px;
        height: 15px;
        border-left: 2px solid var(--color-brand);
        border-bottom: 2px solid var(--color-brand);
        transform: rotate(-135deg);
    }

        .hp-hero__scroll-icon span:nth-child(1) {
            animation: hp-scroll-fade-h 1.8s ease-in-out infinite 0s;
        }

        .hp-hero__scroll-icon span:nth-child(2) {
            animation: hp-scroll-fade-h 1.8s ease-in-out infinite 0.3s;
        }

        .hp-hero__scroll-icon span:nth-child(3) {
            animation: hp-scroll-fade-h 1.8s ease-in-out infinite 0.6s;
        }

.hp-hero__scroll-icon--reverse span {
    border-left: none;
    border-bottom: none;
    border-right: 2px solid var(--color-brand);
    border-top: 2px solid var(--color-brand);
    animation: hp-scroll-fade-h-reverse 1.8s ease-in-out infinite;
}

    .hp-hero__scroll-icon--reverse span:nth-child(1) {
        animation-delay: 0.6s;
    }

    .hp-hero__scroll-icon--reverse span:nth-child(2) {
        animation-delay: 0.3s;
    }

    .hp-hero__scroll-icon--reverse span:nth-child(3) {
        animation-delay: 0s;
    }

@keyframes hp-scroll-fade-h {
    0% {
        opacity: 0;
        transform: translateX(-6px) rotate(-135deg);
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translateX(6px) rotate(-135deg);
    }
}

@keyframes hp-scroll-fade-h-reverse {
    0% {
        opacity: 0;
        transform: translateX(6px) rotate(-135deg);
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        transform: translateX(-6px) rotate(-135deg);
    }
}

@media (min-width: 1101px) {
    .if-cards-grid--rem4-2 .if-card-flipper:nth-last-child(-n+2) {
        grid-column: span 6;
    }

    .if-cards-grid--rem4-3 .if-card-flipper:nth-last-child(-n+3) {
        grid-column: span 4;
    }
}

@media (min-width: 901px) and (max-width: 1300px) {
    .if-cards-grid--few .if-card-flipper {
        grid-column: span 6;
    }
}

@media (min-width: 901px) and (max-width: 1100px) {
    .if-card-flipper {
        grid-column: span 4;
    }

    .if-offer-card {
        grid-column: span 6;
    }

    .if-cards-grid--rem3-2 .if-card-flipper:nth-last-child(-n+2) {
        grid-column: span 6;
    }

    .if-cards-grid--rem3-1 .if-card-flipper {
        grid-column: span 6;
    }
}

@media (min-width: 601px) and (max-width: 900px) {
    .if-card-flipper,
    .if-offer-card {
        grid-column: span 6;
    }

    .if-cards-grid--rem2-1 .if-card-flipper:last-child {
        grid-column: span 12;
    }
}

@media (max-width: 600px) {
    .if-card-flipper,
    .if-offer-card {
        grid-column: span 12;
    }
}