/* ============================================
   SECTION: Autism Screening — Conditions
   Full-bleed cream panel with a decorative swirl behind, a
   centered header, and a staggered set of tilted cards
   (icon circle + title). Mirrors parent_coaching/how_it_works.
   ============================================ */

.as-conditions {
    position: relative;
    overflow: clip;
    padding: 100px var(--section-side-padding) 112px;
    background-color: var(--color-accent-yellow-bg-soft);   /* #fffbf1 */
}

/* Decorative swirl backdrop, behind the content */
.as-conditions::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background: url("../../../images/ndbi-therapy/bg-omparision.77b4eba313d9.png") no-repeat center center / cover;
    opacity: 0.5;
    pointer-events: none;
}

/* ----- Header ----- */
.as-conditions__header {
    position: relative;
    z-index: 1;
    max-width: 688px;
    margin: 0 auto 56px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.as-conditions__header .eyebrow {
    margin-bottom: 18px;
    color: #846c30;
}

.as-conditions__heading {
    font-family: var(--font-display);
    font-size: 42px;
    font-weight: var(--font-weight-normal);
    line-height: 50px;
    letter-spacing: -1.26px;
    color: var(--color-text-heading);
    margin: 0;
}

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

.as-conditions__lede {
    font-size: 16px;
    line-height: 26px;
    color: var(--color-text-faint);
    margin: 0;
}

/* ----- Condition cards (staggered) ----- */
.as-conditions__cards {
    position: relative;
    z-index: 1;
    list-style: none;
    margin: 0;
    padding: 0;
    max-width: 1312px;               /* fits 4 cards (310) + 3 gaps → 7 wrap to 4 + 3 */
    margin-inline: auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
}

.as-condition {
    width: 310px;
    min-height: 284px;
    padding: 24px;
    background: var(--color-white);
    border: 2px solid var(--color-surface-line-soft);   /* #f6f6f6 */
    border-radius: 12px;
    box-shadow: 0 15px 32px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 24px;
}

/* Alternating tilt for the playful stagger */
.as-condition:nth-child(odd)  { transform: rotate(-3deg); }
.as-condition:nth-child(even) { transform: rotate(3deg); }

.as-condition__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 67px;
    height: 67px;
    flex-shrink: 0;
    background: var(--color-primary-light);   /* #ffebf0 */
    border-radius: 60px;
}

.as-condition__title {
    font-family: var(--font-body);
    font-size: 20px;
    font-weight: var(--font-weight-medium);
    line-height: 32px;
    color: var(--color-text-heading);
    margin: 0;
}

/* Scroll-position bars — phones only. Sits above the section swirl. */
.as-conditions__bars {
    position: relative;
    z-index: 1;
    display: none;
    gap: 7px;
    margin-top: 24px;
}

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

.as-conditions__bar.is-active {
    background: var(--color-primary);
}

/* ----- Responsive ----- */
@media (max-width: 768px) {
    .as-conditions {
        padding: 56px var(--section-side-padding);
    }
    .as-conditions__heading {
        font-size: 32px;
        line-height: 38px;
    }
    .as-condition {
        transform: none !important;   /* drop the tilt when stacked */
        width: 100%;
        max-width: 340px;
        min-height: 0;
    }
}

/* ----- Phones: the cards become a horizontal, snapping scroller -----
   The track bleeds to the section edges so the next card peeks in from the
   right, with position bars underneath. */
@media (max-width: 600px) {
    .as-conditions__cards {
        flex-wrap: nowrap;
        justify-content: flex-start;
        align-items: stretch;         /* equal heights; ragged looks broken */
        gap: 16px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        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;
    }

    .as-conditions__cards::-webkit-scrollbar {
        display: none;
    }

    .as-condition {
        flex: 0 0 288px;
        width: auto;
        max-width: none;
        scroll-snap-align: start;
    }

    .as-conditions__bars {
        display: flex;
    }
}
