/* =========================================
   Journey Section Styles
   Extracted from style.css (restored from style copy.css)
   ========================================= */

/* Root Journey Styles */
.journey {
    background: #fff;
    height: 1080px;
    padding-top: 1px;
}

    .journey [role="heading"][aria-level="2"] {
        margin-top: 116px;
        margin-bottom: 120px;
    }

.journey__flow {
    display: flex;
    justify-content: center;
    margin-top: 66px;
}

    .journey__flow svg {
        max-width: 100%;
        height: auto;
    }

/* Journey image/video fixed size + responsive fallback */
.journey__flow img,
.journey__flow video {
    width: auto;
    height: 700px !important;
    object-fit: contain;
    display: block;
    position: relative;
    z-index: 0; /* keep image behind overlay items */
}

/* Responsive video: 1280px+ shows large, below 1280px shows small */
.journey__video-sm {
    display: none !important;
}
@media (max-width: 1279px) {
    .journey__video-lg {
        display: none !important;
    }
    .journey__video-sm {
        display: block !important;
    }
}

/* Journey Overlay Items - Base Styles */
.journey__flow {
    position: relative;
}

.journey__overlay {
    position: absolute;
    inset: 0;
    width: 1300px; /* Match image width */
    height: 800px; /* Match image height */
    margin: 0 auto; /* Center it */
    pointer-events: none;
    overflow: visible; /* allow expanded items to overflow without shifting image */
}

.journey__item {
    position: absolute;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    padding: 6px;
    border-radius: 20px;
}

/* Preparation class: force item visible before triggering animation
   (fixes display:none transition issue on mobile/tablet) */
.journey__item.journey__item--preparing {
    display: flex !important;
}

/* Background pseudo-element: expands from top-left like turning a page */
/* Acts as the SOLID layer (second to open, first to close — CodePen :after) */
.journey__item::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    background: #FFF;
    border: 1px solid #E0E0E0;
    border-bottom-right-radius: 200%;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    border-bottom-left-radius: 20px;
    box-shadow: none;
    z-index: -1;
    visibility: hidden;
    -webkit-transition: width 0.6s cubic-bezier(0.55, 0.055, 0.675, 0.19),
                height 0.6s cubic-bezier(0.55, 0.055, 0.675, 0.19),
                border-bottom-right-radius 0.8s linear,
                /* box-shadow 0.5s ease, */
                visibility 0s 0.6s;
    transition: width 0.6s cubic-bezier(0.55, 0.055, 0.675, 0.19),
                height 0.6s cubic-bezier(0.55, 0.055, 0.675, 0.19),
                border-bottom-right-radius 0.8s linear,
                /* box-shadow 0.5s ease, */
                visibility 0s 0.6s;
}

.journey__item.is-active::before {
    width: 100%;
    height: 100%;
    border-bottom-right-radius: 20px;
    box-shadow: none;
    visibility: visible;
    -webkit-transition: width 0.6s cubic-bezier(0.77, 0, 0.175, 1) 0.1s,
                height 0.6s cubic-bezier(0.77, 0, 0.175, 1) 0.1s,
                border-bottom-right-radius 0.8s linear 0.1s,
                /* box-shadow 0.5s ease 0.1s, */
                visibility 0s 0s;
    transition: width 0.6s cubic-bezier(0.77, 0, 0.175, 1) 0.1s,
                height 0.6s cubic-bezier(0.77, 0, 0.175, 1) 0.1s,
                border-bottom-right-radius 0.8s linear 0.1s,
                /* box-shadow 0.5s ease 0.1s, */
                visibility 0s 0s;
}

.journey__btn {
    background: #F6F6F6;
    border: 1px solid #E0E0E0;
    border-radius: 20px;
    padding: 5px 16px;
    font-weight: 600;
    color: #27201f;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s;
    white-space: nowrap;
    margin-left: 0px !important;
    font-family: inherit;
    padding-right: 12px;
}

    .journey__btn::after {
        content: "";
        display: inline-block;
        width: 16px;
        height: 16px;
        background-color: #DA291C;
        background-image: url("/Style%20Library/OLL/img/icon-right.svg");
        background-repeat: no-repeat;
        background-position: 60%;
        background-size: 17px;
        border-radius: 50%;
        border: #E0E0E0 3px solid;
    }

@media (hover: hover) {
    .journey__btn:hover {
        transform: translateY(-2px);
        border-color: #DA291C;
    }
}

/* Planning List - collapsed + absolute so it doesn't widen the item */
.journey__list {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    list-style: none;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    padding: 0 10px 0 20px;
    margin: 0;
    transition: max-height 0.35s cubic-bezier(0.77,0,0.175,1),
                opacity 0s,
                padding 0.25s ease;
}

.journey__item.is-active {
    z-index: 1;
}

    .journey__item.is-active .journey__list {
        position: relative;
        top: auto;
        left: auto;
        max-height: 300px;
        opacity: 1;
        padding: 5px 10px 5px 16px;
        transition: max-height 0.5s cubic-bezier(0.77,0,0.175,1) 0.05s,
                    opacity 0.4s ease 0.55s,
                    padding 0.35s ease 0.05s;
    }

    .journey__item.is-active .journey__btn {
        color: #DA291C;
        width: 100%;
        justify-content: space-between;
    }

    /* Ensure the dashed line sits centered with the pill even when item is active */
    .journey__item.is-active::after {
        left: -29px;
        top: 0;
        bottom: 0;
    }

.journey__list li {
    font-size: 14px;
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0s, transform 0s;
    white-space: nowrap;
    width: fit-content;
}

.journey__item.is-active .journey__list li {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.journey__item.is-active .journey__list li:nth-child(1) { transition-delay: 0.6s; }
.journey__item.is-active .journey__list li:nth-child(2) { transition-delay: 0.7s; }
.journey__item.is-active .journey__list li:nth-child(3) { transition-delay: 0.8s; }
.journey__item.is-active .journey__list li:nth-child(4) { transition-delay: 0.9s; }
.journey__item.is-active .journey__list li:nth-child(5) { transition-delay: 1.0s; }

    .journey__list li::before {
        color: #333;
        font-weight: bold;
    }

.journey__list a {
    color: #444;
    text-decoration: none;
    transition: color 0.2s;
}

    .journey__list a:hover {
        color: #DA291C;
        text-decoration: underline;
    }

/* Positioning */
/* Row 1 */
.journey__item:nth-child(1) { top: -70px; left: 70px; }
.journey__item:nth-child(2) { top: -70px; left: 280px; }
.journey__item:nth-child(3) { top: -70px; left: 600px; }
.journey__item:nth-child(4) { top: -70px; left: 1000px; }

/* Row 2 */
.journey__item:nth-child(5) { top: 210px; left: 80px; }

/* Row 3 */
.journey__item:nth-child(6) { top: 435px; left: 130px; }
.journey__item:nth-child(7) { top: 435px; left: 400px; }
.journey__item:nth-child(8) { top: 435px; left: 660px; }
.journey__item:nth-child(9) { top: 435px; left: 1020px; }


/* Responsive Adjustments (< 1400px) */
@media (max-width: 1400px) {
    .journey__overlay {
        width: 100%;
        height: 100%;
        position: absolute;
        top: -10px;
        left: 0;
    }
    /* Scale down items on smaller screens or hide them if too complex */
    .journey__btn {
        padding: 6px 12px;
        font-size: 18px;
    }

    .journey__flow img,
    .journey__flow video {
        width: 85%;
        height: auto;
        margin: -80px auto;
        max-width: 1307px;
    }

    .journey__btn::after {
        width: 16px;
        height: 16px;
        font-size: 18px;
    }
    /* Adjust positions to percentages for responsiveness */
    .journey__item:nth-child(1) { top: -15%; left: 10%; }
    .journey__item:nth-child(2) { top: -15%; left: 26%; }
    .journey__item:nth-child(3) { top: -15%; left: 50%; }
    .journey__item:nth-child(4) { top: -15%; left: 78%; }

    .journey__item:nth-child(5) { top: 28%; left: 16%; }

    .journey__item:nth-child(6) { top: 62%; left: 15%; }
    .journey__item:nth-child(7) { top: 62%; left: 35%; }
    .journey__item:nth-child(8) { top: 62%; left: 58%; }
    .journey__item:nth-child(9) { top: 62%; left: 80%; }
}

/* Tablet Range (768px - 1023px) - Combined Rules */
/* Part 1: Initial "Timeline/Carousel" definitions */
@media (max-width: 1023px) and (min-width: 768px) {
    /* Journey Section - Carousel Layout Base */
    .journey__flow {
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-top: 40px;
        width: 100%;
        overflow: hidden;
    }

    .journey__overlay {
        height: 60px !important;
        position: static !important;
        width: 100% !important;
        display: flex;
        flex-direction: column; /* Vertical stack */
        overflow-y: auto; /* Vertical scroll */
        overflow-x: hidden;
        scroll-snap-type: y mandatory; /* Snap vertically */
        gap: 40px; /* Space to connect timeline lines */
        padding: 10px 0;
        order: 1; /* Items above image */
        pointer-events: auto !important;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
    }

    .journey__overlay::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }

    /* Expand container when an item is active */
    .journey__overlay.is-expanded {
        height: auto !important;
    }

        /* Hide other items when one is expanded */
        .journey__overlay.is-expanded .journey__item:not(.is-active) {
            display: none;
        }

    /* When the overlay is NOT expanded (collapsed) on tablet, show only one item
        to prevent visual stacking. Prefer an item with `is-active` if present,
        otherwise fall back to the first item. Keep items positioned relative so
        they don't overlap. */
    .journey__overlay:not(.is-expanded) .journey__item {
        display: none;
    }

        .journey__overlay:not(.is-expanded) .journey__item.is-active,
        .journey__overlay:not(.is-expanded) .journey__item:first-child {
            display: flex;
        }

    .journey__item {
        margin-left: 10%;
        position: relative !important;
        flex: 0 0 auto;
        width: 30%;
        scroll-snap-align: center;
        background: #fff;
        border: 1px solid #E0E0E0;
        border-radius: 16px;
        display: flex;
        flex-direction: column;
        gap: 12px;
        top: auto !important;
        left: auto !important;
    }

        /* Timeline dot decoration */
        /* Move timeline dot to the pill so it centers vertically with the button */
        .journey__item::before {
            display: none;
        }

    .journey__btn {
        position: relative;
    }

        .journey__btn::before {
            content: '';
            position: absolute;
            left: -38px; /* sits to the left of the pill */
            top: 50%; /* center vertically relative to the pill */
            transform: translateY(-50%);
            width: 12px;
            height: 12px;
            background: radial-gradient(circle at center, #DA291C 0 50%, #ffffff 51% 70%, rgba(239, 239, 239, 1) 71% 100%);
            border: 3px solid rgba(239, 239, 239, 1); /* white ring to match background */
            border-radius: 50%;
        }


    /* Vertical dashed line segment to suggest timeline */
    /* Vertical dashed line for timeline (span full item area) */
    .journey__item::after {
        /* Use a narrow element with a repeating-linear-gradient to control dash length and gap.
            Position it to the right of the active marker so it doesn't run over the red dot. */
        content: '';
        position: absolute;
        left: -12px; /* moved right so the dashed line sits to the right of the marker */
        top: 0;
        bottom: 0;
        width: 2px;
        background: repeating-linear-gradient( to bottom, #ccc 0px, #ccc 4px, transparent 4px, transparent 14px );
        z-index: -1;
    }
    /* Hide line for first item top? */
    .journey__item:first-child::after {
        top: 32px;
    }

    /* Button styling */
    .journey__btn {
        background: #f6f6f6; /* match other breakpoints */
        border: 1px solid #E0E0E0;
        border-radius: 999px;
        padding: 10px 18px;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        color: #221f27;
        font-weight: 700;
        font-size: 18px;
        box-shadow: none;
    }

        .journey__btn:hover {
            transform: none;
            background: #fff;
        }

        .journey__btn::after {
            content: "";
            display: inline-block;
            width: 22px;
            height: 22px;
            background-color: #DA291C; /* red circle */
            background-image: url("/Style%20Library/OLL/img/icon-right.svg");
            background-repeat: no-repeat;
            background-position: 60%;
            background-size: 17px 17px;
            border-radius: 50%;
            border: 3px solid #fff; /* white ring like screenshot */
            box-sizing: border-box;
            flex-shrink: 0;
        }

    /* List styling */
    .journey__list {
        display: none; /* hidden by default on this breakpoint */
        padding-left: 0;
        margin: 0;
    }
    /* When an item is activated, show its details */
    .journey__item.is-active .journey__list {
        display: block;
        padding-left: 0;
        margin: 0;
    }

    .journey__list li {
        font-size: 14px;
        color: #333;
        display: flex;
        align-items: center;
        gap: 8px;
        white-space: nowrap;
        width: fit-content;
    }

        .journey__list li::before {
            color: #333;
        }

    /* Image styling */
    .journey__flow picture,
    .journey__flow img,
    .journey__flow video {
        order: 2;
        max-width: 800px;
        display: block;
        margin-top: 5rem;
    }
}

/* Part 2: "Map Squish Fix" overrides */
/* At exactly 768px ensure Journey heading has smaller bottom margin */
@media (min-width: 768px) and (max-width: 1023px) {
    .journey [role="heading"][aria-level="2"] {
        margin-top: 116px;
        margin-bottom: 10px !important;
    }

    .journey__item.is-active.journey__btn::before {
        left: -95px;
    }
}
/* Ensure journey flow can expand to show full image on tablet */
@media (min-width: 768px) and (max-width: 1023px) {
    .journey__flow {
        height: auto !important;
        overflow: visible !important;
        position: relative !important;
    }

        .journey__flow img,
        .journey__flow video {
            height: 700px !important;
            max-width: 100% !important;
            position: relative !important;
            z-index: 1 !important;
            left: 5%;
            margin-top: 20%;
        }
    /* Center journey__video-sm in 768px-1023px range */
    .journey__flow .journey__video-sm {
        left: auto !important;
        margin-left: auto !important;
        margin-right: auto !important;
        display: block !important;
    }
    /* Keep overlay positioned over the image, prevent expansions from reflowing layout */
    .journey__overlay {
        position: absolute !important;
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
        pointer-events: none !important;
        overflow: visible !important;
        z-index: 2 !important;
    }

    .journey__item {
        position: absolute !important;
        pointer-events: auto !important;
        transition: transform 0.18s ease, opacity 0.18s ease !important;
        width: auto !important;
    }

        .journey__item .journey__btn {
            display: inline-flex !important;
            width: auto !important;
            min-width: 244px !important;
            white-space: nowrap !important;
        }

        .journey__item.is-active {
            transform: translateY(0) !important;
            pointer-events: auto !important;
            display: flex !important;
        }

    /* Hide vertical dashed line when collapsed */
    .journey__item::after {
        display: none !important;
    }

    .journey__item.is-active::after {
        display: block !important;
        top: 13%;
        left: -23px;
    }

    /* Override Part 1 card styling: animated bg comes from .journey__bg */
    .journey__item {
        background: transparent !important;
        border-color: transparent !important;
    }

    /* Convert list from display:none to max-height for diagonal expansion */
    .journey__list {
        display: block !important;
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        max-height: 0 !important;
        overflow: hidden !important;
        opacity: 0 !important;
        padding: 0 10px 0 20px !important;
        margin: 0 !important;
        -webkit-transition: max-height 0.35s cubic-bezier(0.77,0,0.175,1),
                    opacity 0s,
                    padding 0.25s ease;
        transition: max-height 0.35s cubic-bezier(0.77,0,0.175,1),
                    opacity 0s,
                    padding 0.25s ease;
    }

    .journey__item.is-active .journey__list {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        max-height: 300px !important;
        overflow: visible !important;
        opacity: 1 !important;
        padding: 5px 10px 5px 20px !important;
        -webkit-transition: max-height 0.5s cubic-bezier(0.77,0,0.175,1) 0.05s,
                    opacity 0.4s ease 0.55s,
                    padding 0.35s ease 0.05s;
        transition: max-height 0.5s cubic-bezier(0.77,0,0.175,1) 0.05s,
                    opacity 0.4s ease 0.55s,
                    padding 0.35s ease 0.05s;
    }

    /* Enable list item stagger animation */
    .journey__list li {
        opacity: 0 !important;
        -webkit-transform: translateX(30px) !important;
        transform: translateX(30px) !important;
        -webkit-transition: opacity 0s, -webkit-transform 0s;
        transition: opacity 0s, transform 0s;
    }

    .journey__item.is-active .journey__list li {
        opacity: 1 !important;
        -webkit-transform: translateX(0) !important;
        transform: translateX(0) !important;
        -webkit-transition: opacity 0.3s ease, -webkit-transform 0.3s ease;
        transition: opacity 0.3s ease, transform 0.3s ease;
    }
}


/* Timeline-style layout for journey on 1024px - 1279px: items on left, image on right */
@media (min-width:1024px) and (max-width:1279px) {
    .journey {
        padding: 0 60px 60px 60px;
        height: auto;
    }

    .journey__flow {
        display: flex;
        align-items: flex-start;
        justify-content: center;
        gap: 32px;
    }

    /* Ensure journey heading is left-aligned at this breakpoint */
    #journey [role="heading"][aria-level="2"],
    #journey .journey__title {
        font-weight: 700;
        font-style: Bold;
        font-size: 28px;
        line-height: 100%;
        letter-spacing: 0%;
        text-align: left;
        line-height: 3rem;
        margin-top: 3rem;
        margin-bottom: 40px;
        max-width: 400px;
    }

    /* Make the overlay act as the left column (timeline) and image the right column */
    .journey__overlay {
        position: relative;
        pointer-events: auto;
        order: 1;
        flex-shrink: 0;
        width: 400px;
        height: 600px;
        overflow-y: auto;
        overflow-x: hidden;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .journey__overlay::-webkit-scrollbar {
        display: none;
    }

    .journey__flow picture, .journey__flow img, .journey__flow video {
        order: 2;
        flex: 1;
        min-width: 0;
        height: 600px !important;
        display: block;
    }

    /* When overlay is expanded, switch to stretch alignment so video-sm matches overlay height */
    .journey__flow:has(.journey__overlay.is-expanded) {
        align-items: stretch;
    }

    .journey__flow:has(.journey__overlay.is-expanded) .journey__video-sm {
        min-height: 650px;
        align-self: stretch;
    }

    /* Layout items vertically in the overlay as a timeline */
    .journey__item {
        position: relative;
        display: block;
        width: 100%;
        margin: 0 0 4px 0;
        padding-left: 75px;
    }

        .journey__item .journey__btn {
            border: none;
            background: none;
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: space-between;
            white-space: normal;
            text-align: left;
        }

        /* Active list: static flow inside the card, padded like Figma */
        .journey__item.is-active .journey__list {
            position: static !important;
            top: auto !important;
            left: auto !important;
            max-height: none !important;
            overflow: visible !important;
            opacity: 1 !important;
            padding: 0 16px 8px !important;
            margin: 0 !important;
            display: block !important;
        }

        .journey__item .journey__list {
            margin-top: 0;
            padding-left: 16px;
            list-style: none;
        }

            .journey__item .journey__list li {
                font-weight: 400;
                font-style: normal;
                font-size: 14px;
                line-height: 22px;
                letter-spacing: 0;
                vertical-align: middle;
                color: rgba(0,0,0,0.85);
                opacity: 1 !important;
        white-space: nowrap;
        width: fit-content;                color: inherit;
            }

    /* Vertical dashed line in the timeline */
    .journey__overlay::before {
        content: '';
        position: absolute;
        left: 40px;
        top: 24px;
        bottom: 32px;
        width: 0;
        border-left: 2px dashed #ccc;
    }

    /* Node markers – inactive items get a small grey hollow dot, centered on dashed line */
    .journey__item::before {
        content: '';
        position: absolute;
        left: 36px;
        top: 14px;
        width: 10px;
        height: 10px;
        border-radius: 50%;
        background: #fff;
        border: 2px solid #bbb;
        box-sizing: border-box;
        visibility: visible;
        transition: none;
        z-index: 2;
    }

    /* Button: flex row — arrow is a flex item (not absolute) so it always stays inside */
    .journey__btn {
        position: static;
        padding: 6px 12px 6px 16px;
        font-size: 15px;
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        border: none;
        background: none;
        white-space: normal;
        gap: 0;
        height: 34px;
    }
    /* Arrow as flex item — always contained inside the button */
    .journey__btn::after {
        content: "";
        position: static;
        display: inline-block;
        flex-shrink: 0;
        order: 2;
        width: 16px;
        height: 16px;
        background-color: #DA291C;
        background-image: url("data:image/svg+xml,%3Csvg width='6' height='10' viewBox='0 0 6 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 9L5 5L1 1' stroke='white' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: center;
        background-size: 8px;
        border-radius: 50%;
        border: 3px solid #E0E0E0;
        box-shadow: none;
        transform: none;
        top: auto;
        right: auto;
    }
    /* Dashed line spacer between label and arrow for non-active buttons */
    .journey__btn::before {
        content: '';
        flex: 1;
        border-bottom: 2px dashed #ccc;
        margin: 0 12px;
        height: 1px;
        display: block;
        order: 1;
    }
    /* Active item: outer white card matching Figma design */
    /* Background/border/shadow come from .journey__bg (animated page-turn) — not set here */
    .journey__item.is-active {
        position: relative;
        width: auto;
        min-width: calc(100% - 75px);
        margin-left: 75px;
        padding: 8px;
        background: transparent;
        border: none;
        border-radius: 20px;
        box-shadow: none;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    /* Active button: inner gray pill */
    .journey__item.is-active .journey__btn {
        background: #F6F6F6;
        border: 1px solid #E0E0E0;
        border-radius: 20px;
        width: 100%;
        padding: 6px 12px 6px 16px;
        height: 34px;
    }
    /* Hide dashed spacer inside active button */
    .journey__item.is-active .journey__btn::before {
        display: none;
    }
    /* Reduce absolute-positioned item rules which may interfere */
    .journey__item:nth-child(1), .journey__item:nth-child(2), .journey__item:nth-child(3), .journey__item:nth-child(4),
    .journey__item:nth-child(5), .journey__item:nth-child(6), .journey__item:nth-child(7), .journey__item:nth-child(8), .journey__item:nth-child(9) {
        top: auto;
        left: auto;
        right: auto;
    }

    /* Keep the node marker visually on the timeline edge (outside the card) */
    .journey__item.is-active::before {
        /* inner red dot, white gap, outer red ring */
        width: 22px;
        height: 22px;
        border-radius: 50%;
        background: radial-gradient(circle at center, #DA291C 0 30%, #ffffff 41% 60%, rgba(239, 239, 239, 1) 61% 100%);
        box-sizing: border-box;
        border: 3px solid rgba(239, 239, 239, 1); /* outer ring matches red */
        left: -45px;
        top: 19px;
        position: absolute;
        -webkit-transition: none;
        transition: none;
    }
    
    /* Allow text to wrap so arrow stays aligned at right edge */
    .journey__item, .journey__item .journey__btn {
        white-space: normal;
    }

    .journey__item .journey__btn {
        overflow: visible;
        max-width: 100%;
    }

    /* Instant close for .journey__bg at timeline breakpoint to avoid
       lingering card background behind non-active items */
    .journey__item:not(.is-active) .journey__bg {
        -webkit-transition: none;
        transition: none;
    }

    /* Also instant-reset the timeline dot marker on deactivation */
    .journey__item:not(.is-active)::before {
        -webkit-transition: none;
        transition: none;
    }

    /* White gradient mask at the bottom of the journey section
       to handle height variation between left column and image */
    .journey__flow::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: linear-gradient(to bottom, transparent, #f8f8f8);
        pointer-events: none;
        z-index: 2;
    }
}

/* Mobile styles for Journey section (360px - 767px) */
@media (min-width: 360px) and (max-width: 767px) {
    /* Journey adjustments */
    .journey {
        height: auto;
        padding: 40px 20px;
        background: #fff; /* Or match the design background */
    }

    .journey__flow {
        flex-direction: column;
        margin-top: 20px;
    }

    .journey [role="heading"][aria-level="2"] {
        margin-top: 0;
        margin-bottom: 40px;
    }

    /* Hide the desktop/tablet picture element and large video */
    .journey__flow picture,
    .journey__video-lg {
        display: none;
    }

    /* Show the small video on mobile */
    .journey__flow .journey__video-sm {
        display: block !important;
        width: 100%;
        height: auto !important;
        margin-top: 50px;
        opacity: 1 !important;
        transform: none !important;
        order: 2;
    }

    /* Hide the SVG background pseudo-element */
    .journey__flow::after {
        display: none;
    }

    .journey__overlay {
        position: relative;
        width: 100%;
        height: 45px; /* Fixed height for pill only; expanded list overflows visually */
        pointer-events: auto;
        display: flex;
        flex-direction: column;
        gap: 0;
        overflow: visible;
        padding-left: 30px; /* Space for timeline line */
        order: 1;
        margin-bottom: 20px; /* Fixed gap between item and video */
        z-index: 2;
    }

    /* Timeline line */
    .journey__overlay::before {
        content: '';
        position: absolute;
        left: 15px;
        top: 12%;
        bottom: 0;
        width: 0;
        border-left: 1px dashed #ccc;
    }

    .journey__item {
        position: relative;
        width: 100%;
        min-height: 50px;
        flex-shrink: 0;
        display: none; /* Hide all items by default */
        flex-direction: column;
        justify-content: center;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        margin: 0;
        padding: 0;
        background: transparent;
        border: none;
        box-shadow: none;
        transition: min-height 0.3s ease;
    }

    /* Show only the active item (or first item as fallback) */
    .journey__item.is-active,
    .journey__overlay:not(:has(.is-active)) .journey__item:first-child {
        display: flex;
    }

    .journey__item.is-active {
        height: auto;
        justify-content: flex-start;
        padding-bottom: 10px;
        /* Card background animated via .journey__bg */
        background: transparent;
        border: none;
        border-radius: 16px;
        overflow: visible; /* Allow dot to show outside */
    }

    /* Hide original item dot */
    .journey__item::before {
        display: none;
    }

    .journey__btn {
        width: 100%;
        text-align: left;
        padding: 3px 12px;
        background: #f9f9f9; /* Light grey background */
        border: 1px solid #eee;
        border-radius: 30px; /* Pill shape */
        font-weight: 600;
        color: #000000; /* Red text */
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: relative;
        transition: all 0.3s ease;
    }
}

/* =========================================
   Journey Overlay Scroll-fade Masks
   Applied via JS based on scroll position
   ========================================= */
@media (min-width: 768px) and (max-width: 1279px) {
    .journey__overlay.journey__overlay--mask-bottom {
        -webkit-mask-image: linear-gradient(to bottom, black 0%, black calc(100% - 60px), transparent 100%);
        mask-image: linear-gradient(to bottom, black 0%, black calc(100% - 60px), transparent 100%);
    }
    .journey__overlay.journey__overlay--mask-top {
        -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 60px, black 100%);
        mask-image: linear-gradient(to bottom, transparent 0%, black 60px, black 100%);
    }
    .journey__overlay.journey__overlay--mask-both {
        -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 60px, black calc(100% - 60px), transparent 100%);
        mask-image: linear-gradient(to bottom, transparent 0%, black 60px, black calc(100% - 60px), transparent 100%);
    }
}

/* =========================================
   Journey Section – Scroll-triggered Entrance Animation
   ========================================= */

/* --- Initial hidden state (before section scrolls into view) --- */
.journey [role="heading"][aria-level="2"] {
    opacity: 0;
    transform: translateY(-40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.journey .journey__flow picture,
.journey .journey__flow > img,
.journey .journey__flow > video {
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.8s ease 0.2s, transform 0.8s ease 0.2s;
}

.journey .journey__overlay {
    transition: opacity 0.8s ease 0.4s, transform 0.8s ease 0.4s;
}

/* Only apply the initial hidden state when the section has NOT been revealed yet.
   We use .journey:not(.journey--visible) to keep the hidden state. */
.journey:not(.journey--visible) [role="heading"][aria-level="2"] {
    opacity: 0;
    transform: translateY(-40px);
}

.journey:not(.journey--visible) .journey__flow picture,
.journey:not(.journey--visible) .journey__flow > img,
.journey:not(.journey--visible) .journey__flow > video {
    opacity: 0;
    transform: scale(0.85);
}

.journey:not(.journey--visible) .journey__overlay {
    opacity: 0;
    transform: translateY(40px);
}

/* --- Visible / animated state --- */
.journey.journey--visible [role="heading"][aria-level="2"] {
    opacity: 1;
    transform: translateY(0);
}

.journey.journey--visible .journey__flow picture,
.journey.journey--visible .journey__flow > img,
.journey.journey--visible .journey__flow > video {
    opacity: 1;
    transform: scale(1);
}

.journey.journey--visible .journey__overlay {
    opacity: 1;
    transform: translateY(0);
}

/* Mobile Journey Part 2: button dots, active states, list animations (360-767px) */
@media (min-width: 360px) and (max-width: 767px) {
    /* Dot on button - positioned relative to button */
    .journey__btn::before {
        content: '';
        position: absolute;
        left: -25px; /* Align with timeline line */
        top: 50%;
        transform: translateY(-50%);
        width: 12px;
        height: 12px;
        border-radius: 50%;
        z-index: 1;
        background: radial-gradient(circle at center, #DA291C 0 50%, #ffffff 51% 70%, rgba(239, 239, 239, 1) 71% 100%);
        border: 5px solid rgba(239, 239, 239, 1);
        border-radius: 50%;
    }

    /* Active State Styling */
    .journey__item.is-active {
        height: auto;
        justify-content: flex-start;
        /* Card background animated via .journey__bg */
        background: transparent;
        border: none;
        border-radius: 16px;
        padding: 6px; /* Space inside the card */
        overflow: visible;
    }

    .journey__item.is-active .journey__btn {
        color: #DA291C;
        background: #f9f9f9; /* Keep grey background */
        border: 1px solid #eee; /* Keep border */
        border-radius: 30px; /* Keep Pill shape */
    }

    .journey__item.is-active .journey__btn::before {
        left: -33px; /* Compensate for 6px item padding + 1px border diff */
    }

    /* Red circle icon with white arrow - Match desktop style */
    .journey__btn::after {
        content: "";
        display: inline-block;
        width: 16px;
        height: 16px;
        background-color: #DA291C;
        background-image: url("/Style%20Library/OLL/img/icon-right.svg");
        background-repeat: no-repeat;
        background-position: 60%;
        background-size: 17px;
        border-radius: 50%;
        border: #E0E0E0 3px solid;
        transition: transform 0.3s ease;
    }


    .journey__list {
        display: block;
        position: relative;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        padding: 0 10px;
        background: transparent;
        border: none;
        margin: 0;
        -webkit-transition: max-height 0.35s cubic-bezier(0.77,0,0.175,1),
                    opacity 0s,
                    padding 0.25s ease;
        transition: max-height 0.35s cubic-bezier(0.77,0,0.175,1),
                    opacity 0s,
                    padding 0.25s ease;
    }

    .journey__item.is-active .journey__list {
        max-height: 300px;
        overflow: visible;
        opacity: 1;
        padding: 5px 12px;
        -webkit-transition: max-height 0.5s cubic-bezier(0.77,0,0.175,1) 0.05s,
                    opacity 0.4s ease 0.55s,
                    padding 0.35s ease 0.05s;
        transition: max-height 0.5s cubic-bezier(0.77,0,0.175,1) 0.05s,
                    opacity 0.4s ease 0.55s,
                    padding 0.35s ease 0.05s;
    }

    .journey [role="heading"][aria-level="2"] {
        margin-top: 48px;
        margin-bottom: 11px;
        line-height: 1.3; /* default slightly tighter */
    }
}

/* When heading wraps to two lines on very small screens, increase spacing */
@media (max-width: 420px) {
    .journey [role="heading"][aria-level="2"] {
        line-height: 1.6 !important;
        margin-bottom: 14px !important;
    }
}

/* Prevent button squeezing on small screens (<400px) */
@media (max-width: 400px) {
    .journey__btn {
        width: 100% !important; /* Fixed width relative to container */
        white-space: normal !important; /* Allow text wrap */
        height: auto !important; /* Allow dynamic height */
        padding-top: 5px;
        padding-bottom: 5px;
        line-height: 1.2; 
    }

    /* Prevent icon from shrinking or getting smashed */
    .journey__btn::after {
        flex-shrink: 0;
        margin-left: 8px;
    }
}