.services-clinical-section {
    display: flex;
    flex-direction: column;
    padding: 0 120px;
    box-sizing: border-box;
}

.services-clinical-section .section-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

.services-clinical-intro {
    display: flex;
    align-items: flex-end;
    gap: 24px;
    justify-content: space-between;
    flex-wrap: nowrap;
}

.services-clinical-intro-text {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.services-clinical-title {
    font-family: 'IvyOra Display', serif;
    color: #005b68;
    font-size: 32px;
    font-weight: 700;
    margin: 0;
}

.services-clinical-intro-text p,
.services-clinical-lead {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 16px !important;
    font-style: normal;
    font-weight: 400;
    color: #403936;
    margin: 0;
    -webkit-text-size-adjust: none;
}

/* Mobile CTA wrapper - hide on desktop */
.services-clinical-cta-mobile-wrap {
    display: none;
}

.services-clinical-blocks {
    display: flex;
    flex-direction: column;
    gap: 40px;
    /* gap between cards when collapsed */
    margin-top: 40px;
}

.services-clinical-card {
    background: #ffffff;
    border: 2px solid #ed6a59;
    border-radius: 20px;
    padding: 28px;
    overflow: visible;
    box-sizing: border-box;
}

.services-clinical-card-inner {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.services-clinical-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Header link wraps entire header content when URL is available */
.sc-card-header-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.sc-card-header-link:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(237, 106, 89, 0.12);
    border-radius: 12px;
}

/* Reset native button chrome and make it behave like a block/div */
.services-clinical-card button.services-clinical-card-head {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    background: transparent;
    border: none;
    padding: 0;
    /* adjust if you want spacing inside header */
    margin: 0;
    width: 100%;
    display: flex;
    /* keep your flex layout */
    align-items: center;
    justify-content: space-between;
    font: inherit;
    color: inherit;
    cursor: pointer;
    box-sizing: border-box;
}

/* Remove Firefox inner border for interactive header buttons */
button.services-clinical-card-head::-moz-focus-inner {
    border: 0;
    padding: 0;
}

/* Provide an accessible focus ring for interactive header buttons (do not remove focus) */
button.services-clinical-card-head:focus {
    outline: none;
    /* replace default outline with visible ring */
    box-shadow: 0 0 0 3px rgba(237, 106, 89, 0.12);
    /* subtle visible focus */
    border-radius: 12px;
    /* match your card shape if needed */
}

/* If some higher-specificity rule still adds a border or background for button headers */
.services-clinical-section .services-clinical-card button.services-clinical-card-head {
    border: none !important;
    background: transparent !important;
    padding-right: 24px;
}

/* Non-interactive header (h4) should not appear clickable */
.services-clinical-card-head {
    cursor: default;
}

.sc-card-tag {
    color: #ed6a59;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.sc-card-arrow {
    cursor: pointer;
    display: flex;
    padding: 10px 16px;
    flex-direction: column;
    align-items: center;
    border-radius: 27px;
    background: #ed6a59;
    border: 1px solid #fff;
    transition: filter 0.2s;
    /* Default arrow color (SVG should be black or dark for filter to work) */
}

.sc-card-arrow-icon-orange {
    display: none;
}

.sc-card-arrow:hover .sc-card-arrow-icon,
.sc-card-arrow:focus-visible .sc-card-arrow-icon {
    display: none;
}

.sc-card-arrow:hover .sc-card-arrow-icon-orange,
.sc-card-arrow:focus-visible .sc-card-arrow-icon-orange {
    display: flex;
}

.sc-card-arrow:hover,
.sc-card-arrow:focus-visible {
    background: #ffffff;
    border: 1px solid #ed6a59;
    /* This filter makes a black SVG #ed6a59 (orange) */
}

.sc-card-intro {
    color: #403936;
}

.sc-card-intro p {
    color: #403936;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: normal;
    color: #403936;
    margin: 0 0 16px;
}

/* Separator between intro and lists */
.sc-card-sep {
    height: 1px;
    width: 100%;
    /* per spec */
    background: #bdbdbd;
    margin: 16px 0;
    /* gap 16px above and below */
    /* display: none; */
    /* only show when card is open */
}

.services-clinical-card.is-open .sc-card-sep {
    display: block;
}

.sc-card-lists {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 8px;
}

.sc-list {
    list-style: disc;
    margin: 0;
    padding-left: 20px;
}

.sc-list li {
    margin-bottom: 6px;
    color: #403936;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
}

/* Shared CTA button - now uses centralized component (teal-primary), keep only layout */
.clinical-cta-button {
    width: auto;
    align-self: flex-end !important;
}

@media (max-width: 1200px) {
    .services-clinical-section {
        padding: 0 60px;
    }

    .clinical-cta-button {
        align-self: center !important;
    }
}

@media (max-width: 1024px) {
    .sc-card-lists {
        /* grid-template-columns: repeat(2, 1fr); */
    }

    .services-clinical-intro {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 600px) {
    .services-clinical-intro {
        gap: 16px;
        align-items: flex-start;
        text-align: left;
    }

    .services-clinical-section {
        padding: 0 24px;
    }

    .sc-card-lists {
        grid-template-columns: 1fr;
    }

    .sc-card-arrow {
        /* width: 28px;
        height: 28px;
        padding: 6px; */
    }

    .sc-list li {
        font-family: 'IBM Plex Sans', sans-serif;
        font-size: 16px;
        font-weight: 400;
        font-style: normal;
        margin-bottom: 6px;
        color: #403936;
        line-height: normal;
    }

    .sc-card-sep {
        /* gap 16px above and below */
        display: none;
        /* only show when card is open */
    }

    .services-clinical-card.is-open .sc-card-sep {
        display: block;
    }

    .sc-card-tag {
        font-size: 16px;
        text-align: left;
    }

    .services-clinical-card-head {
        margin-bottom: 0;
    }

    .services-clinical-blocks {
        display: flex;
        flex-direction: column;
        gap: 16px;
        margin-top: 40px;
    }

    /* Collapsed default style: show only title (no card border) */
    .services-clinical-card {
        overflow: hidden;
        transition:
            max-height 0.3s ease,
            box-shadow 0.3s ease,
            padding 0.3s ease;
        max-height: 72px;
        position: relative;
        border: none;
        /* remove border when collapsed */
        background: transparent;
        padding: 16px;
        /* show 16px padding when closed */
    }

    /* Open card shows full bordered card */
    .services-clinical-card.is-open {
        /* allow tall content while keeping a sensible transition limit */
        max-height: 2000px;
        border: 2px solid #ed6a59;
        background: #ffffff;
        padding: 16px;
        border-radius: 20px;
    }

    /* Button header should not show border in collapsed state and act as the visible title */
    .services-clinical-card .services-clinical-card-head {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: transparent;
        border: none;
        padding-right: 16px;
        /* give header padding so tag isn't clipped in collapsed state */
    }

    /* Hide the intro text when collapsed (we animate via max-height for smoother transition) */
    .services-clinical-card:not(.is-open) .sc-card-intro {
        /* allow intro to be hidden via clamp class but remain measurable */
    }

    .services-clinical-card .sc-card-intro p {
        font-family: 'IBM Plex Sans', sans-serif;
        font-size: 16px;
        font-weight: 400;
        line-height: normal;
    }

    /* Mobile intro clamp (show up to 4 lines). Use line-height + max-height so
       we can animate the intro expanding/collapsing. */
    .services-clinical-card .sc-card-intro {
        font-family: 'IBM Plex Sans', sans-serif;
        font-size: 16px;
        font-weight: 400;
        line-height: normal;
        color: #ed6a59;
        padding: 0;
        overflow: hidden;
        transition:
            max-height 360ms ease,
            opacity 260ms ease;
        opacity: 1;
        /* start unbounded; JS will set measured max-heights when appropriate */
        max-height: none;
        -webkit-box-orient: vertical;
    }

    /* Collapsed intro: clamp to 4 lines via max-height calculation for animation */
    .services-clinical-card .sc-card-intro.collapsed-intro {
        display: -webkit-box;
        -webkit-line-clamp: 4;
        -webkit-box-orient: vertical;
        /* use line-height to compute a reasonable max-height we can animate */
        max-height: calc(1.4em * 4);
        opacity: 1;
    }

    .services-clinical-card .sc-card-intro.collapsed-intro p {
        font-family: 'IBM Plex Sans', sans-serif;
        font-size: 16px;
        font-weight: 400;
        line-height: normal;
        color: #403936;
        margin: 0 0 16px;
    }

    .sc-intro-toggle {
        display: inline-block;
        /* inline spacing from paragraph text */
        color: #ed6a59;
        font-family: 'IBM Plex Sans', sans-serif;
        font-size: 14px;
        font-weight: 400;
        background: transparent;
        border: none;
        padding: 0;
        cursor: pointer;
    }

    .services-clinical-intro-text {
        gap: 16px;
    }

    /* content wrapper for intro + separator so we can add padding-right without affecting lists */

    /* make separator full width on mobile when card is open */
    .services-clinical-card.is-open .sc-card-sep {
        width: 100%;
    }

    /* Lists are horizontally scrollable inside open card; hidden when collapsed */
    .services-clinical-card.is-open .sc-card-lists {
        display: flex;
        gap: 12px;
        overflow-x: auto;
        padding-bottom: 28px;
        -webkit-overflow-scrolling: touch;
    }

    .services-clinical-card:not(.is-open) .sc-card-lists {
        display: none;
    }

    .sc-card-lists::-webkit-scrollbar {
        height: 6px;
    }

    .sc-card-lists::-webkit-scrollbar-track {
        background: transparent;
    }

    .sc-card-lists::-webkit-scrollbar-thumb {
        background: #ed6a59;
        border-radius: 40px;
    }

    /* Static visual scrollbar (only on open card) */
    .services-clinical-card.is-open .sc-scrollbar {
        display: block;
    }

    .services-clinical-card:not(.is-open) .sc-scrollbar {
        display: none;
    }

    .sc-list {
        min-width: 220px;
    }

    .sc-card-content {
        padding-right: 16px;
        /* prevent text from being obscured by scrollbar */
    }

    /* Hide inline CTA on small screens and show mobile CTA */
    .clinical-cta-button:not(.clinical-cta-button--mobile) {
        display: none;
    }

    .clinical-cta-button--mobile {
        display: block;
        margin: 16px auto 0;
        text-align: center;
        width: auto;
        padding: 12px 20px;
    }

    .services-clinical-cta-mobile-wrap {
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .services-clinical-title {
        font-size: 24px;
    }
}

/* Fallback styling hook when media queries are not picked up by the UA or devtools.
   The JS file toggles `.sc-mobile` on the `.services-clinical-section` element.
   These rules mirror the critical mobile behaviors so the section remains usable. */
.services-clinical-section.sc-mobile .services-clinical-card {
    overflow: hidden;
    transition:
        max-height 360ms ease,
        box-shadow 360ms ease,
        padding 360ms ease;
    max-height: 72px;
    position: relative;
    border: none;
    background: transparent;
    padding: 16px;
    box-sizing: border-box;
}

.services-clinical-section.sc-mobile .services-clinical-card.is-open {
    max-height: 2000px;
    border: 2px solid #ed6a59;
    background: #ffffff;
    padding: 16px 0 16px 16px;
    border-radius: 20px;
}

.services-clinical-section.sc-mobile .services-clinical-card:not(.is-open) .sc-card-intro {
    display: none;
}

.services-clinical-section.sc-mobile .services-clinical-card.is-open .sc-card-lists {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 28px;
    -webkit-overflow-scrolling: touch;
}

/* Ensure the section inner and cards never exceed the viewport in the sc-mobile fallback mode. */
.services-clinical-section.sc-mobile {
    padding-left: 0;
    padding-right: 0;
    gap: 16px;
}

.services-clinical-section.sc-mobile .section-inner {
    max-width: none;
    width: 100%;
    padding-left: 16px;
    padding-right: 16px;
    box-sizing: border-box;
}

.services-clinical-section.sc-mobile .services-clinical-blocks {
    width: 100%;
    box-sizing: border-box;
}

.services-clinical-section.sc-mobile .services-clinical-card {
    width: 100%;
}

/* Strong full-bleed enforcement for stubborn devtools/layout viewports. */
.services-clinical-section.sc-mobile {
    /* force section to match the visual viewport width */
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    left: 0;
    right: 0;
    box-sizing: border-box;
    overflow-x: hidden;
}

.services-clinical-section.sc-mobile .section-inner {
    /* ensure inner content fits within the forced full-bleed */
    max-width: none !important;
    width: calc(100% - 32px) !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
}