/* ============================================
   SECTION: Naturalistic ABA Care — What is NDBI?
   Sticky intro (left) + two stacked cards (right):
   pink (two areas of science, with two tilted mini-
   cards + a "+" connector) and cream (how NDBI supports
   learning). Mirrors the neuroaffirming Definition.
   ============================================ */

.ndbi-def {
    max-width: calc(var(--container-max) + 2 * var(--section-side-padding));
    margin-inline: auto;
    padding: 100px var(--section-side-padding);
    background: var(--color-white);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

/* ----- Intro (sticky, left) ----- */
.ndbi-def__intro {
    flex: 0 1 468px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 100px;
    align-self: flex-start;
}

.ndbi-def__heading {
    font-family: var(--font-display);
    font-size: 42px;
    font-weight: var(--font-weight-normal);
    line-height: 50px;
    letter-spacing: -1.26px;
    color: #484336;
    margin: 0;
    max-width: 532px;
}

.ndbi-def__heading .accent-script {
    color: var(--color-accent-yellow);   /* #e09b2b */
}

.ndbi-def__lede {
    max-width: 468px;
    font-size: 16px;
    line-height: 26px;
    color: var(--color-text-faint);
    margin: 0;
}

/* ----- Cards (stacked, right) ----- */
.ndbi-def__cards {
    flex: 0 1 610px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ndbi-def-card {
    position: relative;
    padding: 32px;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.ndbi-def-card--pink { background-color: var(--color-primary-light); }
.ndbi-def-card--cream { background-color: var(--color-accent-yellow-bg); }

/* Decorative swirls — same assets as the neuroaffirming/home cards */
.ndbi-def-card__swirl {
    position: absolute;
    z-index: 0;
    pointer-events: none;
}
.ndbi-def-card--pink .ndbi-def-card__swirl {
    top: -39px;
    left: -37px;
    width: 760px;
    aspect-ratio: 828 / 285;
    background: url("../../../images/decorative/vector-270.f060f4d8b30d.png") no-repeat center / contain;
}
.ndbi-def-card--cream .ndbi-def-card__swirl {
    top: 0;
    left: 0;
    width: 100%;
    aspect-ratio: 610 / 145;
    background: url("../../../images/decorative/vector-270-tan.af3e16a592bf.png") no-repeat center / contain;
}

.ndbi-def-card__icon {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    background: var(--color-white);
    border-radius: 12px;
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.02);
    flex-shrink: 0;
    margin-bottom: 32px;
}

.ndbi-def-card__title {
    position: relative;
    z-index: 1;
    font-family: var(--font-body);
    font-size: 24px;
    font-weight: var(--font-weight-medium);
    line-height: 32px;
    color: var(--color-text-heading);
    margin: 0;
    max-width: 516px;
}

/* ----- Pink card: the two tilted science cards + "+" ----- */
.ndbi-def__sciences {
    position: relative;
    z-index: 1;
    margin-top: 28px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 16px;
}

.ndbi-def-mini {
    flex: 1 1 0;
    min-width: 0;
    min-height: 207px;
    padding: 24px 20px;
    background: var(--color-white);
    border: 2px solid var(--color-primary-light);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}
.ndbi-def-mini--a { transform: rotate(-3deg); }
.ndbi-def-mini--b { transform: rotate(2deg); }

.ndbi-def-mini__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 33px;
    height: 33px;
    flex-shrink: 0;
}

.ndbi-def-mini__body {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ndbi-def-mini__title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: var(--font-weight-normal);
    line-height: 28px;
    color: #2c2626;
    margin: 0;
}

.ndbi-def-mini__sub {
    font-size: 15px;
    line-height: 22px;
    color: #5b6e78;
    margin: 0;
}

/* "+" connector between the two science cards */
.ndbi-def__plus {
    position: absolute;
    left: 50%;
    top: 34%;
    transform: translate(-50%, -50%);
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--color-text-heading);   /* #0c2733 */
}

/* ----- Cream card: how NDBI supports learning ----- */
.ndbi-def-card__desc {
    position: relative;
    z-index: 1;
    margin: 16px 0 0;
    max-width: 525px;
    font-size: 16px;
    line-height: 26px;
    color: var(--color-text-faint);
}

.ndbi-def-card__eyebrow {
    position: relative;
    z-index: 1;
    margin: 40px 0 0;
    color: var(--color-accent-yellow-label);   /* gold */
}

.ndbi-def-card__statement {
    position: relative;
    z-index: 1;
    margin: 24px 0 0;
    max-width: 546px;
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: var(--font-weight-normal);
    line-height: 44px;
    color: var(--color-accent-yellow);       /* #e09b2b */
}

/* Scroll-position bars — phones only, and only for the scrolling variant */
.ndbi-def__bars {
    display: none;
    gap: 7px;
    width: 100%;
    margin-top: 24px;
}

.ndbi-def__bar {
    flex: 1 1 0;
    height: 4px;
    border-radius: 100px;
    background: var(--color-primary-light);
    transition: background-color var(--transition-fast);
}

.ndbi-def__bar.is-active {
    background: var(--color-primary);
}

/* ----- Responsive ----- */
@media (max-width: 1024px) {
    .ndbi-def {
        flex-direction: column;
        gap: 48px;
    }
    .ndbi-def__intro,
    .ndbi-def__cards {
        flex: initial;
        max-width: none;
        width: 100%;
        position: static;
    }
    .ndbi-def__heading {
        font-size: 36px;
        line-height: 42px;
    }
}

@media (max-width: 768px) {
    .ndbi-def {
        padding: 60px var(--section-side-padding);
    }
    .ndbi-def-card {
        padding: 24px;
    }
    .ndbi-def__sciences {
        flex-direction: column;
        gap: 28px;
    }
    /* Stacked, the desktop `flex: 1 1 0` would set each card's *height* to
       zero instead of splitting the row's width — collapsing the box and
       spilling its text. Size them to their content instead. */
    .ndbi-def-mini {
        width: 100%;
        min-height: 0;
        flex: 0 0 auto;
    }

    /* Stacked, the two cards overlap and tilt against each other: the first
       card carries extra bottom padding for the second to ride up into. */
    .ndbi-def-mini--a {
        transform: rotate(-2deg);
        padding-bottom: 44px;
    }

    .ndbi-def-mini--b {
        transform: rotate(2deg);
        margin-top: -47px;
        margin-left: 0;
        max-width: 100%;
    }
    .ndbi-def__plus {
        top: 50%;
    }
    .ndbi-def-card__statement {
        font-size: 22px;
        line-height: 29px;
    }
}

/* ----- Phones: the two cards become a horizontal, snapping scroller -----
   Scoped to the --scroll modifier — .ndbi-def__cards is reused by five
   other pages whose cards stay stacked. Geometry from the 360px frame:
   308px cards, 12px apart, the next one peeking past the right edge. */
@media (max-width: 600px) {
    .ndbi-def__cards--scroll {
        flex-direction: row;
        gap: 12px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        /* Bleed to the section edges so a card can peek in from the right,
           while the first card still lines up with the intro text. */
        margin-inline: calc(-1 * var(--section-side-padding));
        padding-inline: var(--section-side-padding);
        /* keeps the snap point from cancelling the padding above */
        scroll-padding-inline: var(--section-side-padding);
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .ndbi-def__cards--scroll::-webkit-scrollbar {
        display: none;
    }

    .ndbi-def__cards--scroll .ndbi-def-card {
        flex: 0 0 min(308px, calc(100vw - 2 * var(--section-side-padding)));
        max-width: calc(100vw - 2 * var(--section-side-padding));
        scroll-snap-align: start;
    }

    .ndbi-def__bars {
        display: flex;
    }
}
