.ers-story {
    --ers-brand: var(--awb-color4, #0071c0);
    --ers-brand-ink: var(--awb-color7, #192026);
    --ers-ink: var(--awb-color8, #000000);
    --ers-ink-2: var(--awb-color6, #323e48);
    --ers-muted: var(--awb-color5, #69727a);
    --ers-hairline: var(--awb-color3, #e0e0e0);
    --ers-success: var(--awb-color4, #0071c0);
    --ers-danger: var(--awb-color4, #0071c0);
    --ers-header-height: 0px;
    --ers-initial-header-height: 80px;
    --ers-stage-height: 100svh;
    position: relative;
    z-index: 0;
    isolation: isolate;
    width: 100%;
    color: var(--ers-ink);
    background: #fff;
}

/* Four transitions: clamp(4*800px, 4*115svh, 4*1400px). */
.ers-scroll-pending .ers-story {
    height: calc(100svh - var(--ers-initial-header-height) + clamp(3200px, 460svh, 5600px));
    min-height: calc(100svh - var(--ers-initial-header-height) + clamp(3200px, 460svh, 5600px));
}

/* Match the enhanced geometry before the module executes so the story never reflows on boot. */
.ers-scroll-pending .ers-story .ers-track {
    height: 100%;
}

.ers-scroll-pending .ers-story .ers-stage {
    position: sticky;
    top: var(--ers-initial-header-height);
    height: calc(100svh - var(--ers-initial-header-height));
    min-height: 36rem;
    overflow: hidden;
    isolation: isolate;
    background: #fff;
    touch-action: pan-y;
}

.ers-scroll-pending .ers-story .ers-scenes,
.ers-scroll-pending .ers-story .ers-scene {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    border: 0;
    pointer-events: none;
}

.ers-scroll-pending .ers-story .ers-scene:not(:first-child) {
    opacity: 0;
}

.ers-scroll-pending .ers-story .ers-scene:first-child .ers-scene-copy {
    pointer-events: auto;
}

.ers-story *,
.ers-story *::before,
.ers-story *::after {
    box-sizing: border-box;
}

.ers-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.ers-skip-link {
    position: absolute;
    top: max(0.75rem, env(safe-area-inset-top));
    left: max(0.75rem, env(safe-area-inset-left));
    z-index: 20;
    display: inline-flex;
    min-height: 2.75rem;
    align-items: center;
    border: 1px solid rgba(29, 78, 216, 0.28);
    border-radius: 4px;
    padding: 0.55rem 0.8rem;
    color: var(--ers-brand-ink);
    background: rgba(255, 255, 255, 0.94);
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    box-shadow: 0 8px 22px -18px rgba(17, 24, 39, 0.55);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.ers-story[data-skip-visible="true"] .ers-skip-link,
.ers-skip-link:focus-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.ers-skip-link:hover {
    color: var(--ers-brand);
    border-color: var(--ers-brand);
}

.ers-skip-link:focus-visible,
.ers-button:focus-visible,
.ers-context-link:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
    box-shadow: 0 0 0 5px var(--ers-brand);
}

.ers-track,
.ers-stage,
.ers-scenes {
    position: relative;
    width: 100%;
}

.ers-transition-media {
    display: none;
}

.ers-scene {
    position: relative;
    display: grid;
    min-height: max(42rem, calc(100svh - var(--ers-header-height)));
    overflow: hidden;
    isolation: isolate;
    border-bottom: 1px solid var(--ers-hairline);
    background: #fff;
}

.ers-scene-media,
.ers-scene-scrim {
    position: absolute;
    inset: 0;
}

.ers-scene-media {
    z-index: 0;
    overflow: hidden;
    background: #f6f9ff;
}

.ers-scene-media picture,
.ers-scene-media img {
    display: block;
    width: 100%;
    height: 100%;
}

.ers-scene-media img {
    object-fit: cover;
    object-position: var(--ers-object-position, 50% 50%);
}

.ers-scene-scrim {
    z-index: 1;
    pointer-events: none;
}

.ers-scene--copy-left .ers-scene-scrim {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.985) 0%,
        rgba(248, 251, 255, 0.94) 33%,
        rgba(248, 251, 255, 0.58) 48%,
        rgba(255, 255, 255, 0.08) 68%,
        rgba(255, 255, 255, 0) 78%
    );
}

.ers-scene--copy-right .ers-scene-scrim {
    background: linear-gradient(
        270deg,
        rgba(255, 255, 255, 0.985) 0%,
        rgba(248, 251, 255, 0.94) 33%,
        rgba(248, 251, 255, 0.58) 48%,
        rgba(255, 255, 255, 0.08) 68%,
        rgba(255, 255, 255, 0) 78%
    );
}

.ers-scene-copy {
    position: relative;
    z-index: 2;
    align-self: center;
    width: min(44rem, 50vw);
    margin-block: 4.75rem 3.75rem;
    padding: 2rem clamp(1.5rem, 4vw, 5.5rem);
}

.ers-scene--copy-left .ers-scene-copy {
    justify-self: start;
}

.ers-scene--copy-right .ers-scene-copy {
    justify-self: end;
}

.ers-scene-kicker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    color: var(--awb-color6, var(--ers-ink-2));
    font-family: var(--awb-typography2-font-family, inherit);
    font-size: 0.8125rem;
    font-weight: var(--awb-typography2, 600);
    line-height: 1.3;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ers-scene-label {
    color: var(--awb-color4, var(--ers-brand));
}

.ers-scene--failure .ers-scene-kicker::before,
.ers-scene--diagnostic .ers-scene-kicker::before,
.ers-scene--success .ers-scene-kicker::before {
    width: 0.55rem;
    height: 0.55rem;
    flex: 0 0 auto;
    border-radius: 2px;
    background: var(--ers-brand);
    content: '';
}

.ers-scene--failure .ers-scene-kicker::before {
    background: var(--ers-danger);
}

.ers-scene--success .ers-scene-kicker::before {
    background: var(--ers-success);
}

.ers-scene-copy .fusion-title {
    display: block;
    width: 100%;
    margin: 0.55rem 0 0;
}

.ers-scene-copy h1,
.ers-scene-copy h1.fusion-title-heading,
.ers-scene-copy h2,
.ers-scene-copy h2.fusion-title-heading {
    max-width: 18ch;
    margin: 0;
    color: var(--awb-color6, var(--ers-ink-2));
    font-family: var(--awb-typography2-font-family, inherit);
    font-weight: var(--awb-typography2, 600);
    letter-spacing: var(--awb-typography2-letter-spacing, normal);
    text-transform: var(--awb-typography2-text-transform, none);
    text-wrap: balance;
}

.ers-story .awb-gradient-text {
    background-size: 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ers-scene-lead {
    max-width: 42rem;
    margin: 1.15rem 0 0;
    color: var(--awb-color6, var(--ers-ink-2));
    font-family: var(--awb-typography4-font-family, inherit);
    font-size: var(--awb-typography4-font-size, 1rem);
    font-weight: var(--awb-typography4, 400);
    line-height: 1.7;
    letter-spacing: var(--awb-typography4-letter-spacing, normal);
}

.ers-scene-lead--hero {
    color: var(--awb-color5, var(--ers-muted));
    font-size: clamp(1.05rem, 1.65vw, 1.5625rem);
    line-height: 1.6;
}

.ers-scene-points {
    display: grid;
    gap: 0.62rem;
    max-width: 42rem;
    margin: 1.15rem 0 0;
    padding: 0;
    list-style: none;
    color: var(--ers-ink-2);
    font-size: clamp(0.86rem, 1vw, 0.96rem);
    line-height: 1.48;
}

.ers-scene-points li {
    position: relative;
    padding-left: 1.35rem;
}

.ers-scene-points li::before {
    position: absolute;
    top: 0.56em;
    left: 0;
    width: 0.46rem;
    height: 0.46rem;
    border: 1px solid var(--ers-brand);
    border-radius: 1px;
    background: #fff;
    content: '';
}

.ers-scene--success .ers-scene-points li::before {
    border-color: var(--ers-success);
    background: color-mix(in srgb, var(--ers-success) 18%, #fff);
}

.ers-context-link {
    display: inline-flex;
    margin-top: 0.9rem;
    color: var(--ers-brand-ink);
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.4;
    text-underline-offset: 0.2em;
}

.ers-context-link:hover {
    color: var(--ers-brand);
}

.ers-scene-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 1.25rem;
}

.ers-scene-copy .fusion-button {
    text-decoration: none;
}

.ers-progress,
.ers-scroll-cue {
    display: none;
}

/* JavaScript upgrades the same six articles into one sticky stage. */
.ers-story.is-enhanced .ers-track {
    height: 100%;
}

.ers-story.is-enhanced .ers-stage {
    position: sticky;
    top: var(--ers-header-height);
    height: var(--ers-stage-height);
    min-height: 36rem;
    overflow: hidden;
    isolation: isolate;
    background: #fff;
    touch-action: pan-y;
}

.ers-story.is-enhanced .ers-transition-media {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: block;
    pointer-events: none;
}

.ers-transition-video {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: var(--ers-video-position, 50% 50%);
    opacity: var(--ers-video-opacity, 0);
    background: transparent;
    pointer-events: none;
    will-change: opacity;
}

/*
 * Narrow stages crop 16:9 media left/right. Keep the poster and the
 * transition clip on the same center crop so the last frame does not jump.
 */
@media (max-width: 1199.98px) {
    .ers-story .ers-scene-media img,
    .ers-story .ers-transition-video {
        object-position: 50% 50%;
    }
}

.ers-story.is-enhanced .ers-scenes,
.ers-story.is-enhanced .ers-scene {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    border: 0;
    background: transparent;
    pointer-events: none;
}

.ers-story.is-enhanced .ers-scene {
    isolation: auto;
}

.ers-story.is-enhanced .ers-scene-media {
    z-index: 1;
    opacity: var(--ers-scene-opacity, 0);
    will-change: opacity;
}

.ers-story.is-enhanced .ers-scene-scrim {
    z-index: 3;
    opacity: var(--ers-scene-opacity, 0);
    will-change: opacity;
}

.ers-story.is-enhanced .ers-scene-copy {
    z-index: 4;
    opacity: var(--ers-copy-opacity, var(--ers-scene-opacity, 0));
    will-change: opacity;
}

/* Never fade a scene's controls out while keyboard focus is still inside it. */
.ers-story.is-enhanced .ers-scene:focus-within .ers-scene-scrim,
.ers-story.is-enhanced .ers-scene:focus-within .ers-scene-copy {
    opacity: 1;
}

.ers-story.is-enhanced .ers-scene.is-interactive .ers-scene-copy {
    pointer-events: auto;
}

.ers-story.is-enhanced .ers-progress {
    position: absolute;
    right: max(1.5rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
    z-index: 8;
    display: flex;
    gap: 0.36rem;
    align-items: center;
    padding: 0.35rem 0.45rem;
    border: 1px solid rgba(17, 24, 39, 0.12);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.88);
}

.ers-progress span {
    display: block;
    width: 1.3rem;
    height: 0.18rem;
    border-radius: 1px;
    background: #cbd5e1;
    transform-origin: left center;
    transition: background-color 120ms ease, transform 120ms ease;
}

.ers-progress span.is-current {
    background: var(--ers-brand);
    transform: scaleY(1.8);
}

.ers-story.is-enhanced .ers-scroll-cue {
    position: absolute;
    bottom: max(1.2rem, env(safe-area-inset-bottom));
    left: max(1.5rem, env(safe-area-inset-left));
    z-index: 8;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin: 0;
    color: var(--ers-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.ers-scroll-cue-line {
    display: block;
    width: 2.5rem;
    height: 1px;
    background: currentColor;
}

.ers-story.is-enhanced[data-story-exited="true"] .ers-scroll-cue {
    display: none;
}

.ers-normal-content {
    position: relative;
    z-index: 1;
    scroll-margin-top: calc(var(--ers-header-height, 4rem) + 1rem);
    background: #fff;
}

@media (max-width: 1023.98px) {
    .ers-scene-copy {
        width: min(41rem, 58vw);
        padding-inline: clamp(1.25rem, 4vw, 2.75rem);
    }

    .ers-scene-copy h1,
    .ers-scene-copy h1.fusion-title-heading,
    .ers-scene-copy h2,
    .ers-scene-copy h2.fusion-title-heading {
        max-width: 100%;
    }
}

@media (max-width: 767.98px) {
    .ers-story {
        --ers-initial-header-height: 84px;
        --ers-header-height: var(--ers-initial-header-height);
        --ers-mobile-media-height: calc((100svh - var(--ers-header-height)) * 0.5);
        --ers-mobile-media-fade: 2.25rem;
    }

    /* The donor mobile call bar belongs to the ordinary content, not the story. */
    .ers-scroll-pending .ers-story + .ers-normal-content > .fixed.inset-x-0.bottom-0,
    .ers-story.is-enhanced + .ers-normal-content > .fixed.inset-x-0.bottom-0 {
        display: none;
    }

    .ers-story.is-enhanced[data-story-exited="true"] + .ers-normal-content > .fixed.inset-x-0.bottom-0 {
        display: block;
    }

    .ers-skip-link {
        top: 0.6rem;
        left: 0.6rem;
        min-height: 2.6rem;
        padding: 0.48rem 0.65rem;
        font-size: 0.75rem;
    }

    .ers-scene {
        min-height: calc(var(--ers-mobile-media-height) + 18rem);
        background: #fff;
    }

    .ers-scene-media,
    .ers-scroll-pending .ers-story .ers-scene-media,
    .ers-story.is-enhanced .ers-scene-media,
    .ers-story.is-enhanced .ers-transition-media {
        inset: auto;
        top: 0;
        right: 0;
        left: 0;
        bottom: auto;
        height: var(--ers-mobile-media-height);
        -webkit-mask-image: linear-gradient(
            to bottom,
            #000 0%,
            #000 calc(100% - var(--ers-mobile-media-fade)),
            transparent 100%
        );
        mask-image: linear-gradient(
            to bottom,
            #000 0%,
            #000 calc(100% - var(--ers-mobile-media-fade)),
            transparent 100%
        );
    }

    .ers-scroll-pending .ers-story .ers-scene-media,
    .ers-story.is-enhanced .ers-scene-media,
    .ers-story.is-enhanced .ers-transition-media {
        height: 50%;
    }

    .ers-scene-scrim,
    .ers-scene--copy-left .ers-scene-scrim,
    .ers-scene--copy-right .ers-scene-scrim {
        display: none;
        background: none;
    }

    .ers-scene-copy {
        align-self: start;
        width: min(100%, 35rem);
        margin: var(--ers-mobile-media-height) 0 0;
        padding: 0.85rem max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
        background: transparent;
    }

    .ers-scroll-pending .ers-story .ers-scene-copy,
    .ers-story.is-enhanced .ers-scene-copy {
        position: absolute;
        top: 50%;
        right: 0;
        bottom: 0;
        left: 0;
        display: flex;
        flex-direction: column;
        align-self: stretch;
        justify-self: stretch;
        width: 100%;
        max-width: none;
        margin: 0;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .ers-scene--copy-left .ers-scene-copy,
    .ers-scene--copy-right .ers-scene-copy {
        justify-self: stretch;
        padding-right: max(1rem, env(safe-area-inset-right));
        padding-left: max(1rem, env(safe-area-inset-left));
        text-align: left;
    }

    .ers-scene-copy .fusion-title {
        margin-top: 0.45rem;
    }

    .ers-scene-copy .fusion-title {
        --awb-font-size: 1.7rem;
    }

    .ers-scene-copy h1,
    .ers-scene-copy h1.fusion-title-heading,
    .ers-scene-copy h2,
    .ers-scene-copy h2.fusion-title-heading {
        max-width: 18ch;
        font-size: 1.7rem !important;
        line-height: 1.2;
    }

    .ers-scene-lead {
        margin-top: 0.7rem;
        font-size: 0.95rem;
        line-height: 1.55;
    }

    .ers-scene-lead--hero {
        font-size: 1.05rem;
        line-height: 1.5;
    }

    .ers-scene-points {
        gap: 0.42rem;
        margin-top: 0.7rem;
        font-size: 0.77rem;
        line-height: 1.37;
    }

    .ers-scene-points li {
        padding-left: 1.05rem;
    }

    .ers-scene-points li::before {
        width: 0.38rem;
        height: 0.38rem;
    }

    .ers-context-link {
        margin-top: 0.55rem;
        font-size: 0.76rem;
    }

    .ers-scene-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        margin-top: 0.85rem;
    }

    .ers-scroll-pending .ers-story .ers-scene-actions,
    .ers-story.is-enhanced .ers-scene-actions {
        margin-top: auto;
        padding-top: 0.85rem;
    }

    .ers-story.is-enhanced .ers-stage,
    .ers-scroll-pending .ers-story .ers-stage {
        top: var(--ers-header-height);
        height: calc(100svh - var(--ers-header-height));
        max-height: calc(100svh - var(--ers-header-height));
        min-height: 0;
    }

    .ers-story.is-enhanced .ers-progress {
        top: max(0.7rem, env(safe-area-inset-top));
        right: max(0.65rem, env(safe-area-inset-right));
        bottom: auto;
    }

    .ers-progress span {
        width: 0.8rem;
    }

    .ers-story.is-enhanced .ers-scroll-cue {
        display: none;
    }
}

@media (max-width: 767.98px) and (max-height: 760px) {
    .ers-story {
        --ers-mobile-media-fade: 1.75rem;
    }

    .ers-scene-copy {
        padding-top: 0.65rem;
        padding-bottom: max(0.65rem, env(safe-area-inset-bottom));
    }

    .ers-scene-kicker {
        font-size: 0.65rem;
    }

    .ers-scene-copy .fusion-title {
        --awb-font-size: 1.45rem;
    }

    .ers-scene-copy h1,
    .ers-scene-copy h1.fusion-title-heading,
    .ers-scene-copy h2,
    .ers-scene-copy h2.fusion-title-heading {
        max-width: 16ch;
        font-size: 1.45rem !important;
    }

    .ers-scene-lead {
        font-size: 0.88rem;
        line-height: 1.4;
    }

    .ers-scene-lead--hero {
        font-size: 0.95rem;
        line-height: 1.42;
    }

    .ers-scene-points {
        font-size: 0.69rem;
        line-height: 1.3;
    }

    .ers-scene-actions {
        margin-top: 0.65rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ers-story,
    .ers-story .ers-track,
    .ers-story .ers-stage,
    .ers-story .ers-scenes,
    .ers-story .ers-scene {
        height: auto !important;
        min-height: 0;
    }

    .ers-story .ers-stage,
    .ers-story .ers-scenes,
    .ers-story .ers-scene {
        position: relative !important;
        inset: auto !important;
        top: auto !important;
    }

    .ers-story .ers-scene {
        min-height: max(39rem, calc(100svh - var(--ers-header-height))) !important;
        border-bottom: 1px solid var(--ers-hairline) !important;
        pointer-events: auto !important;
    }

    .ers-story .ers-transition-media,
    .ers-story .ers-progress,
    .ers-story .ers-scroll-cue {
        display: none !important;
    }

    .ers-story .ers-scene-media,
    .ers-story .ers-scene-scrim,
    .ers-story .ers-scene-copy {
        opacity: 1 !important;
        transition: none !important;
        will-change: auto !important;
    }
}

@media print {
    .ers-story,
    .ers-track,
    .ers-stage,
    .ers-scenes,
    .ers-scene {
        position: relative !important;
        inset: auto !important;
        top: auto !important;
        height: auto !important;
        min-height: 0 !important;
    }

    .ers-transition-media,
    .ers-progress,
    .ers-scroll-cue,
    .ers-skip-link {
        display: none !important;
    }

    .ers-scene {
        break-inside: avoid;
    }

    .ers-scene-media,
    .ers-scene-scrim,
    .ers-scene-copy {
        opacity: 1 !important;
    }
}

/* Demo page: hide the original Avada hero + four service rows. */
body.gs-home-scroll-demo .post-content > .fusion-builder-row-3,
body.gs-home-scroll-demo .post-content > .fusion-builder-row-4,
body.gs-home-scroll-demo .post-content > .fusion-builder-row-5,
body.gs-home-scroll-demo .post-content > .fusion-builder-row-6,
body.gs-home-scroll-demo .post-content > .fusion-builder-row-7,
body.gs-home-scroll-demo .post-content > .fusion-builder-row-8,
body.gs-home-scroll-demo .post-content > .fusion-builder-row-9,
body.gs-home-scroll-demo .gs-home-scroll-hide-original {
    display: none !important;
}

body.gs-home-scroll-demo #main,
body.gs-home-scroll-demo #gs-home-after-story {
    scroll-margin-top: calc(var(--ers-header-height, 6rem) + 1rem);
}

body.gs-home-scroll-demo .ers-story {
    width: 100%;
    margin: 0;
}

/* Avada Go to Top only after the slider has released into the donor page. */
body.gs-home-scroll-demo:not(.gs-home-scroll-exited) .to-top-container,
body.gs-home-scroll-demo:not(.gs-home-scroll-exited) #toTop {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.ers-scene-copy h1 .ers-heading-accent,
.ers-scene-copy h2 .ers-heading-accent {
    color: var(--ers-brand);
}
