/* ============================================
   SECTION: Autism Testing — Explore Our Centers
   Header (title + intro) + horizontal-scroll location
   cards (image left, city/address right) + a contact CTA
   row + a pink insurance banner. Mirrors home/centers.
   ============================================ */

.at-centers {
    padding: 100px 0;
    background: var(--color-white);
}

/* The section itself has no side padding so the card track can bleed to the
   edges, which means the inner blocks have to carry the gutter themselves —
   without it the header and contact rows sit flush to the screen edges below
   the container width. */
.at-centers__inner {
    max-width: calc(var(--container-max) + 2 * var(--section-side-padding));
    margin-inline: auto;
    padding-inline: var(--section-side-padding);
}

/* ----- Header ----- */
.at-centers__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 48px;
    margin-bottom: 40px;
}

.at-centers__heading-group {
    flex: 0 1 690px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.at-centers__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;
}

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

.at-centers__lede {
    flex: 0 1 400px;
    align-self: center;
    font-size: 16px;
    line-height: 26px;
    color: #776d79;
    margin: 0;
}

/* ----- Carousel ----- */
.at-centers__carousel {
    position: relative;
    margin-bottom: 56px;
}

.at-centers__list {
    list-style: none;
    margin: 0;
    padding: 0 var(--section-side-padding);
    display: flex;
    gap: 20px;
    margin-top: 200px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    scroll-padding-left: var(--section-side-padding);
}
.at-centers__list::-webkit-scrollbar { display: none; }

.at-center-card {
    flex: 0 0 400px;
    max-width: 400px;
    scroll-snap-align: start;
}

.at-center-card__link {
    display: flex;
    align-items: stretch;
    width: 100%;
    height: 154px;
    overflow: hidden;
    background: var(--color-primary-light);   /* #ffebf0 */
    border: 2px solid var(--color-surface-line-soft);   /* #f6f6f6 */
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow var(--transition-fast);
}
.at-center-card__link:hover {
    box-shadow: var(--shadow-card);
}

.at-center-card__photo {
    flex: 0 0 176px;
    width: 176px;
    height: 100%;
    object-fit: cover;
    display: block;
}
/* No photo yet (e.g. a just-added center) — keep the slot, show the
   card's pink background instead of a broken image. */
.at-center-card__photo--empty {
    background: var(--color-primary-light);
}

.at-center-card__body {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 24px;
}

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

.at-center-card__address {
    display: flex;
    align-items: center;
    gap: 6px;
    font-style: normal;
    font-size: 15px;
    font-weight: var(--font-weight-medium);
    line-height: 20px;
    color: #3e2e2d;
}

.at-center-card__icon {
    flex-shrink: 0;
    display: inline-flex;
    width: 24px;
    height: 24px;
}

/* Scroll-position bars — phones only (arrows take over above) */
.at-centers__bars {
    display: none;
    gap: 7px;
    margin-top: 24px;
    padding-inline: var(--section-side-padding);
}

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

.at-centers__bar.is-active {
    background: var(--color-primary);
}

/* Carousel arrows */
.at-centers__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius-full);
    background: var(--color-white);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    color: var(--color-text-heading);
    cursor: pointer;
}
.at-centers__arrow--prev { left: calc(var(--section-side-padding) - 22px); }
.at-centers__arrow--next { right: calc(var(--section-side-padding) - 22px); }
.at-centers__arrow[hidden] { display: none; }

/* ----- Contact CTA row ----- */
.at-centers__contact {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 43px 0;
    border-top: 1px solid var(--color-surface-line-soft);
}

.at-centers__contact-icon {
    flex-shrink: 0;
    align-self: flex-start;
    display: inline-flex;
    width: 32px;
    height: 32px;
}

.at-centers__contact-text {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.at-centers__contact-title {
    font-size: 16px;
    font-weight: var(--font-weight-semibold);
    line-height: 26px;
    color: var(--color-text-heading);
    margin: 0;
}

.at-centers__contact-body {
    font-size: 16px;
    line-height: 26px;
    color: #776d79;
    margin: 0;
}

.at-centers__contact-cta {
    flex-shrink: 0;
}

/* ----- Insurance banner ----- */
.at-centers__insurance {
    position: relative;
    overflow: hidden;
    margin-top: 8px;
    padding: 60px 0;
    border-radius: 12px;
    background: var(--color-primary-light);   /* #ffebf0 */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

/* Decorative swirls behind the banner content */
.at-centers__insurance-wave {
    position: absolute;
    z-index: 0;
    pointer-events: none;
    background-repeat: no-repeat;
}

.at-centers__insurance-wave--top {
    top: 0;
    left: 0;
    width: 884px;
    aspect-ratio: 884 / 127;
    background-image: url("../../../images/decorative/swirl-top-left.34835c489e93.png");
    background-position: top left;
    background-size: contain;
}

.at-centers__insurance-wave--bottom {
    bottom: 0;
    right: 0;
    width: 1143px;
    aspect-ratio: 1143 / 61;
    background-image: url("../../../images/decorative/swirl-bottom-right.61354c0db5f0.png");
    background-position: bottom right;
    background-size: contain;
}

.at-centers__insurance-text {
    position: relative;
    z-index: 1;
    max-width: 560px;
    text-align: center;
    font-size: 16px;
    line-height: 26px;
    color: var(--color-text-faint);
    margin: 0;
}

.at-centers__insurance-logos {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: var(--container-max);
}

.at-centers__insurance-logos-img {
    width: 100%;
    height: auto;
    display: block;
}

/* ----- Responsive ----- */
@media (max-width: 1024px) {
    .at-centers__header {
        flex-direction: column;
        gap: 24px;
    }
    .at-centers__heading-group,
    .at-centers__lede {
        flex: initial;
        max-width: none;
        align-self: auto;
    }
    /* The 200px gap is deliberate breathing room beside the desktop two-column
       header; once that stacks it is just dead space. */
    .at-centers__list {
        margin-top: 40px;
    }
}

@media (max-width: 768px) {
    .at-centers {
        padding: 60px 0;
    }
    .at-centers__heading {
        font-size: 32px;
        line-height: 38px;
    }
    .at-centers__contact {
        flex-direction: column;
        align-items: flex-start;
    }
    .at-centers__insurance {
        padding: 40px 20px;
    }
    /* On touch devices, hide the arrows and let users swipe the row */
    .at-centers__arrow {
        display: none;
    }
}

/* ----- Phones -----
   Cards turn vertical (photo above the details) so they fit the screen, and
   position bars replace the arrows — matching the home page centers row. */
@media (max-width: 600px) {
    .at-centers__list {
        margin-top: 32px;
    }

    .at-center-card {
        flex: 0 0 308px;
        max-width: none;
    }
    .at-center-card__link {
        flex-direction: column;
        height: auto;
    }

    .at-center-card__photo {
        flex: 0 0 auto;
        width: 100%;
        height: 150px;
    }

    .at-center-card__body {
        gap: 12px;
        padding: 20px;
    }

    .at-centers__bars {
        display: flex;
    }

    .at-centers__contact-cta {
        width: 100%;
        text-align: center;
    }
}
