/* Life Stage Roadmap Section Styles - Version 4.0 */
/* Based on Figma node-id: 939-7076 and 939-6265 */

/* ==================== MAIN SECTION ==================== */
.lifestage-roadmap-section {
    position: relative;
    background: #fdf5f1;
    padding: 0;
    overflow-x: hidden;
    /* Prevent horizontal scroll */
    overflow-y: visible;
    /* Allow vertical content to extend */
}

/* ==================== TEXT SECTION ==================== */
.lifestage-text-section {
    position: relative;
    background: url('../images/roadmap-background.png') no-repeat center bottom;
    background-size: cover;
    padding: 95px 0 0;
    overflow: hidden;
    min-height: 600px;
    z-index: 1;
}

.lifestage-text-container {
    position: relative;
    max-width: 880px;
    margin: 0 auto;
    padding: 0 40px 120px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    text-align: center;
}

.lifestage-text-title {
    font-family: 'IvyOra Display', serif;
    font-size: 32px;
    font-weight: 500;
    line-height: normal;
    color: #005b68;
    margin: 0;
    max-width: 477px;
}

.lifestage-text-title .title-bold {
    font-weight: 700;
    font-style: normal;
}

.lifestage-text-title .title-italic {
    font-weight: 500;
    font-style: italic;
}

.lifestage-text-description {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: normal;
    color: #403936;
    width: 100%;
}

.lifestage-text-description p {
    margin: 0 0 16px;
}

.lifestage-text-description p:last-child {
    margin-bottom: 0;
}

.lifestage-text-description strong {
    font-weight: 700;
}

/* ==================== ROADMAP WRAPPER ==================== */
.lifestage-roadmap-wrapper {
    position: relative;
    width: 100%;
    max-width: 1440px;
    height: 666px;
    margin: 0 auto;
    overflow: visible;
    /* Allow cards to extend above wrapper */
    z-index: 2;
}

/* Picture element wrapper for responsive road images */
.roadmap-path-picture {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.roadmap-path-image {
    position: absolute;
    top: -94px;
    left: 50%;
    transform: translateX(-50%);
    width: 1369px;
    /* Fixed width matches design */
    max-width: 100%;
    /* Scale down on smaller screens */
    height: auto;
    z-index: 0;
    pointer-events: none;
}

/* Cards Container */
.roadmap-cards-container {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* ==================== INDIVIDUAL ROADMAP CARD ==================== */
.roadmap-card {
    position: absolute;
    width: fit-content;
    max-width: 600px;
    z-index: 2;
    transition:
        left 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        top 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: left, top, opacity;
}

/* ACTIVE POSITION - Where expanded card shows (bottom right of road curve) */
/* From Figma node-id: 939-7076 - Active card position */
/* Position uses calc() for responsive centering: 50% - 55px (offset from center at 1440px: 665 - 720 = -55) */

/* All cards start hidden except card 1 */
.roadmap-card[data-stage='1'] {
    left: calc(50% - 55px);
    top: 310px;
    opacity: 1;
}

.roadmap-card[data-stage='2'],
.roadmap-card[data-stage='3'],
.roadmap-card[data-stage='4'],
.roadmap-card[data-stage='5'],
.roadmap-card[data-stage='6'] {
    left: calc(50% - 55px);
    top: 310px;
    opacity: 0;
}

/* ==================== PIN/STEM CONNECTORS ==================== */
.roadmap-pin {
    position: absolute;
    background: url('../icons/roadmap-pin.svg') no-repeat center top;
    background-size: contain;
    z-index: -1;
    width: 54px;
    height: 252px;
    left: -56px;
    top: 50%;
    /* Pin TOP at card vertical center - stem extends down to road */
    transition:
        background-image 0.3s ease,
        width 0.4s ease,
        height 0.4s ease,
        left 0.4s ease,
        top 0.4s ease;
}

/* Grey pin for collapsed cards - smaller size */
.roadmap-card.collapsed .roadmap-pin {
    background-image: url('../icons/roadmap-pin-grey.svg');
    background-position: center top;
    width: 30px;
    height: 140px;
    left: -30px;
    top: 50%;
    /* Pin TOP at card vertical center */
}

/* ==================== CARD CONTENT STYLES ==================== */
/* Expanded state (full content visible) */
.roadmap-card-content {
    background: #ffffff;
    border: 1px solid #005b68;
    border-radius: 13px 150px 13px 13px;
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    transition:
        border-radius 0.4s ease,
        padding 0.4s ease,
        gap 0.4s ease,
        border-width 0.4s ease;
}

/* ==================== COLLAPSED STATE STYLES ==================== */
/* Collapsed cards are pill-shaped with only title visible */
/* Size varies by position - cards higher up the road are smaller */

.roadmap-card.collapsed .roadmap-card-content {
    gap: 0;
}

/* Card 1 collapsed - smallest (top of road) */
.roadmap-card[data-stage='1'].collapsed .roadmap-card-content {
    border-width: 0.447px;
    border-radius: 5.8px;
    padding: 7px 11px;
}

/* Card 2 collapsed */
.roadmap-card[data-stage='2'].collapsed .roadmap-card-content {
    border-width: 0.555px;
    border-radius: 7.2px;
    padding: 9px 13px;
}

/* Card 3 collapsed */
.roadmap-card[data-stage='3'].collapsed .roadmap-card-content {
    border-width: 0.722px;
    border-radius: 9.4px;
    padding: 12px 17px;
}

/* Card 4 collapsed */
.roadmap-card[data-stage='4'].collapsed .roadmap-card-content {
    border-width: 0.844px;
    border-radius: 11px;
    padding: 13.5px 20px;
}

/* Card 5 collapsed */
.roadmap-card[data-stage='5'].collapsed .roadmap-card-content {
    border-width: 0.844px;
    border-radius: 11px;
    padding: 13.5px 20px;
}

/* ==================== TITLE STYLES ==================== */
.roadmap-card-title {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 700;
    line-height: normal;
    margin: 0;
    transition:
        font-size 0.4s ease,
        color 0.3s ease;
    white-space: nowrap;
    word-wrap: break-word;
}

/* Expanded title */
.roadmap-card:not(.collapsed) .roadmap-card-title {
    font-size: 28px;
    color: #005b68;
    text-wrap: wrap;
    white-space: normal;
}

/* Collapsed title - constrain width and add ellipsis */
.roadmap-card.collapsed .roadmap-card-title {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Collapsed titles - size varies by card position */
/* Smaller cards higher up the road have smaller text */

.roadmap-card[data-stage='1'].collapsed .roadmap-card-title {
    font-size: 12px;
    color: #ed6a59;
    line-height: 14.7px;
}

.roadmap-card[data-stage='2'].collapsed .roadmap-card-title {
    font-size: 16px;
    color: #ed6a59;
    line-height: 18.3px;
}

.roadmap-card[data-stage='3'].collapsed .roadmap-card-title {
    font-size: 20px;
    color: #ed6a59;
    line-height: 23.8px;
}

.roadmap-card[data-stage='4'].collapsed .roadmap-card-title {
    font-size: 24px;
    color: #ed6a59;
    line-height: 27.8px;
}

.roadmap-card[data-stage='5'].collapsed .roadmap-card-title {
    font-size: 26px;
    color: #ed6a59;
    line-height: 27.8px;
}

/* ==================== LIST STYLES ==================== */
.roadmap-card-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: normal;
    color: #403936;
    max-height: 200px;
    overflow: hidden;
    transition:
        max-height 0.4s ease,
        opacity 0.3s ease,
        margin 0.4s ease;
}

/* Hide list when collapsed */
.roadmap-card.collapsed .roadmap-card-list {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
}

.roadmap-card-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 16px;
}

.roadmap-card-list li:before {
    content: '•';
    position: absolute;
    left: 5px;
    color: #005b68;
}

/* ==================== CTA BUTTON ==================== */
.roadmap-cta-button {
    position: absolute;
    top: 565px;
    right: 280px;
    z-index: 10;
}

.roadmap-cta-btn {
    background: #ed6a59;
    color: #ffffff;
}

/* ==================== LARGE DESKTOP (1200px - 1440px) ==================== */
@media (max-width: 1440px) and (min-width: 1200px) {
    .roadmap-path-image {
        width: 1300px;
        /* Slightly smaller for this range */
        max-width: 100%;
    }
}

/* ==================== MEDIUM DESKTOP (1024px - 1200px) ==================== */
@media (max-width: 1200px) and (min-width: 1025px) {
    .roadmap-path-image {
        width: 1200px;
        max-width: 100%;
    }

    .roadmap-cta-button {
        right: 200px;
    }
}

/* ==================== TABLET STYLES (768px - 1024px) ==================== */
@media (max-width: 1024px) and (min-width: 768px) {
    .lifestage-text-section {
        padding: 60px 0 0;
        min-height: 400px;
        background-size: cover;
    }

    .lifestage-text-container {
        padding: 0 32px 80px;
    }

    .lifestage-text-title {
        font-size: 28px;
    }

    .lifestage-text-description {
        font-size: 15px;
    }

    .lifestage-roadmap-section {
        padding: 0;
    }

    .lifestage-roadmap-wrapper {
        position: relative;
        width: 100%;
        max-width: 100%;
        height: 500px;
        margin: 0 auto;
        overflow: visible;
        /* Prevent horizontal scroll */
        z-index: 2;
    }

    .roadmap-path-image {
        display: block;
        width: 1200px;
        /* Smaller fixed width for tablet */
        max-width: 100%;
        /* Scale down if needed */
        height: auto;
        top: -70px;
        left: 50%;
        transform: translateX(-50%);
    }

    .roadmap-cards-container {
        position: relative;
        width: 100%;
        height: 100%;
        z-index: 1;
        overflow: visible;
    }

    .roadmap-card {
        position: absolute;
        max-width: 400px;
    }

    .roadmap-card.collapsed .roadmap-card-content {
        padding: 12px 16px;
        gap: 8px;
    }

    .roadmap-card.collapsed .roadmap-card-title {
        font-size: 14px;
    }

    .roadmap-card:not(.collapsed) .roadmap-card-content {
        padding: 20px;
        padding-right: 83px;
        gap: 12px;
    }

    .roadmap-card:not(.collapsed) .roadmap-card-title {
        font-size: 18px;
    }

    .roadmap-card-list {
        grid-template-columns: 1fr;
        font-size: 13px;
    }

    .roadmap-pin {
        display: block;
        width: 40px;
        height: 180px;
        left: -40px;
        top: 50%;
        /* Pin TOP at card vertical center */
    }

    .roadmap-card.collapsed .roadmap-pin {
        width: 24px;
        height: 110px;
        left: -24px;
        top: 50%;
        /* Pin TOP at card vertical center */
    }

    .roadmap-cta-button {
        position: absolute;
        top: 420px;
        right: 180px;
    }
}

/* ==================== MOBILE STYLES (below 768px) ==================== */
@media (max-width: 767px) {
    .lifestage-text-section {
        padding: 40px 0 0;
        min-height: 300px;
        background-size: cover;
    }

    .lifestage-text-container {
        padding: 0 16px 60px;
    }

    .lifestage-text-title {
        font-size: 24px;
    }

    .lifestage-text-description {
        font-size: 14px;
    }

    .lifestage-roadmap-section {
        padding: 0;
    }

    .lifestage-roadmap-wrapper {
        position: relative;
        width: 100%;
        height: 550px;
        margin: 0 auto;
        overflow: visible;
        /* Prevent horizontal scroll on mobile */
        z-index: 2;
    }

    .roadmap-path-picture {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }

    .roadmap-path-image {
        display: block;
        /* Mobile image is sized to fit the wrapper */
        min-width: auto;
        max-width: none;
        width: auto;
        height: 100%;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
    }

    .roadmap-cards-container {
        position: relative;
        width: 100%;
        height: 100%;
        z-index: 1;
        overflow: visible;
    }

    .roadmap-card {
        position: absolute;
        max-width: 280px;
    }

    .roadmap-card.collapsed .roadmap-card-content {
        padding: 8px 12px;
        gap: 4px;
    }

    .roadmap-card.collapsed .roadmap-card-title {
        font-size: 11px;
        text-wrap: wrap;
    }

    .roadmap-card:not(.collapsed) .roadmap-card-content {
        padding: 16px;
        padding-right: 83px;
        gap: 10px;
    }

    .roadmap-card:not(.collapsed) .roadmap-card-title {
        font-size: 16px;
    }

    .roadmap-card-list {
        grid-template-columns: 1fr;
        font-size: 12px;
    }

    .roadmap-pin {
        display: block;
        width: 30px;
        height: 130px;
        left: -30px;
        top: 50%;
        /* Pin TOP at card vertical center */
    }

    .roadmap-card.collapsed .roadmap-pin {
        width: 18px;
        height: 80px;
        left: -18px;
        top: 50%;
        /* Pin TOP at card vertical center */
    }

    .roadmap-cta-button {
        position: absolute;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        top: auto;
        right: auto;
    }

    .roadmap-cta-btn {
        font-size: 14px;
        padding: 12px 20px;
    }
}
