/* ============================================================
   ACADEMYSHIP JOURNEY SECTION
   Every selector is scoped under .journey-flow so it cannot
   collide with the host page's generic classes (.node, .row, .dot …).
   Desktop  : snake / S-curve timeline drawn with an SVG path
   <=1024px : clean vertical timeline (rail + numbered badges)
============================================================ */

/* Fonts (Welfare / NibPro / AnekBangla) are already declared globally by the page.
   This section follows the page's type system:
     main title  -> Welfare
     step headers -> AnekBangla
     everything else (regular) -> NibPro
     numbers      -> Welfare */

.journey-flow {
    --jf-green: #16a34a;
    --jf-red: #ef4444;
    --jf-line: #4b5563;
    --jf-ink: #1f2937;
    --jf-muted: #374151;
    font-family: 'NibPro', Georgia, 'Times New Roman', serif;
    background-color: #ffffff;
    color: var(--jf-ink);
    padding: 36px 20px 44px;
    box-sizing: border-box;
    overflow-x: hidden;
}
.journey-flow *, .journey-flow *::before, .journey-flow *::after { box-sizing: border-box; }

/* keep the host page's global element styles from leaking into the section */
.journey-flow h2,
.journey-flow h3,
.journey-flow h4,
.journey-flow p,
.journey-flow span,
.journey-flow a,
.journey-flow strong,
.journey-flow b { font-family: inherit; }

/* ---------- Header ---------- */
.journey-flow .journey-header {
    max-width: 1640px;
    margin: 0 auto 28px;
    padding: 0 60px;
}
.journey-flow .journey-header .eyebrow {
    display: inline-block;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--jf-green);
    margin-bottom: 16px;
}
.journey-flow .journey-header .eyebrow::before {
    content: "";
    display: inline-block;
    width: 28px;
    height: 2px;
    background: var(--jf-green);
    vertical-align: middle;
    margin-right: 12px;
}
.journey-flow .journey-header h2 {
    font-family: 'Welfare', 'NibPro', serif;   /* main title -> Welfare */
    font-size: clamp(30px, 5vw, 52px);
    line-height: 1.04;
    font-weight: 400;
    letter-spacing: -0.005em;
    margin: 0 0 18px;
    color: var(--jf-ink);
}
.journey-flow .journey-header h2 .accent {
    background: linear-gradient(95deg, #ef4444 0%, #f97316 60%, #f59e0b 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.journey-flow .journey-header p {
    font-size: clamp(15px, 1.6vw, 19px);
    line-height: 1.6;
    color: var(--jf-muted);
    max-width: 760px;
    margin: 0;
}

/* ---------- Flowchart shell ---------- */
.journey-flow .flowchart-container {
    position: relative;
    max-width: 1640px;
    margin: 0 auto;
    padding: 16px 20px;
}

.journey-flow .svg-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}
.journey-flow .path-line {
    fill: none;
    stroke: url(#jfLineGradient);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ---------- Rows ---------- */
.journey-flow .row {
    display: flex;
    position: relative;
    z-index: 10;
    justify-content: space-between;
    padding-left: 64px;
    padding-right: 64px;
}
.journey-flow .row.bottom {
    margin-top: 52px;
    flex-direction: row-reverse;
}

/* ---------- Step node ---------- */
.journey-flow .node {
    display: grid;
    grid-template-rows: 60px 60px auto auto;
    justify-items: center;
    width: 262px;
    flex-shrink: 0;
}
.journey-flow .node.marker-node {
    width: 108px;
}

/* Scroll-reveal: nodes hide + stagger-in ONLY after JS confirms it's running
   (adds .jf-armed) AND the section enters the viewport (adds .jf-in).
   If scripts don't run, .jf-armed is never added, so content stays visible. */
.journey-flow.jf-armed .node { opacity: 0; }
.journey-flow.jf-armed.jf-in .node {
    animation: jfReveal .55s cubic-bezier(.2, .7, .2, 1) both;
    animation-delay: calc(var(--i, 0) * .07s);
}
@keyframes jfReveal {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ---------- Icon ---------- */
.journey-flow .icon-container {
    width: 54px;
    height: 54px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: end;
    margin-bottom: 6px;
    transition: transform .35s cubic-bezier(.2, .7, .2, 1);
}
.journey-flow .icon-svg {
    width: 44px;
    height: 44px;
    display: block;
}

/* ---------- Start / Finish markers ---------- */
.journey-flow .marker-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--jf-red);
    color: #fff;
    font-family: 'Welfare', 'NibPro', serif;
    font-size: 28px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid var(--jf-ink);
    position: relative;
    box-shadow: 0 0 0 6px #fee2e2;
    z-index: 2;
    align-self: center;
    transition: transform .35s ease;
    animation: jfPulse 2.6s ease-out infinite;
}
@keyframes jfPulse {
    0%   { box-shadow: 0 0 0 0 rgba(239,68,68,.45), 0 0 0 6px #fee2e2; }
    70%  { box-shadow: 0 0 0 16px rgba(239,68,68,0), 0 0 0 6px #fee2e2; }
    100% { box-shadow: 0 0 0 0 rgba(239,68,68,0), 0 0 0 6px #fee2e2; }
}
.journey-flow .marker-node:hover .marker-circle { transform: scale(1.06); }

.journey-flow .marker-title {
    font-family: 'AnekBangla', 'NibPro', sans-serif;
    font-size: 16px;
    font-weight: 900;
    color: var(--jf-ink);
    text-transform: uppercase;
    letter-spacing: 1px;
    align-self: end;
    margin-bottom: 15px;
}

/* ---------- Numbered dots ---------- */
.journey-flow .dot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #fff;
    border: 3px solid #cbd5e1;
    position: relative;
    z-index: 20;
    align-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Welfare', 'NibPro', serif;
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    color: #111827;
    transition: transform .35s cubic-bezier(.2, .7, .2, 1), box-shadow .35s ease, border-color .35s ease;
}

.journey-flow .step-title {
    font-family: 'AnekBangla', 'NibPro', sans-serif;   /* step headers -> AnekBangla */
    font-size: 19px;
    font-weight: 600;
    color: var(--jf-ink);
    margin: 10px 0 7px;
    text-align: center;
    padding: 0 6px;
    transition: color .3s ease;
}
.journey-flow .step-desc {
    font-size: 14.5px;
    color: var(--jf-muted);
    line-height: 1.5;
    max-width: 34ch;
    margin: 0 auto;
    text-align: center;
    padding: 0 6px;
}

/* ---------- Hover interactions ---------- */
.journey-flow .node:hover .icon-container {
    transform: translateY(-5px) scale(1.1);
}
.journey-flow .node:hover .dot {
    transform: scale(1.1);
    border-color: var(--accent, #cbd5e1);
    box-shadow: 0 0 0 5px var(--accent-soft, #f3f4f6);
}
.journey-flow .node:hover .step-title { color: var(--accent, var(--jf-ink)); }

/* ---------- Eligibility callout ---------- */
.journey-flow .journey-note {
    max-width: 1520px;
    margin: 36px auto 0;
    padding: 22px 28px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 18px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.journey-flow .journey-note .note-icon {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    color: var(--jf-green);
    margin-top: 2px;
}
.journey-flow .journey-note p {
    margin: 0;
    font-size: 15px;
    line-height: 1.65;
    color: #166534;
}
.journey-flow .journey-note strong { color: #14532d; font-weight: 800; }

/* ============================================================
   RESPONSIVE  — vertical timeline below 1024px
============================================================ */
@media (max-width: 1024px) {
    .journey-flow { padding: 56px 16px 64px; }
    .journey-flow .flowchart-container { padding: 8px 0; }
    .journey-flow .svg-container { display: none; }

    .journey-flow .row, .journey-flow .row.bottom {
        flex-direction: column;
        padding: 0;
        margin-top: 0;
        gap: 0;
    }

    .journey-flow .node {
        width: 100%;
        max-width: 560px;
        margin: 0 auto;
        display: grid;
        grid-template-columns: 54px auto 1fr;
        grid-template-rows: auto auto;
        grid-template-areas:
            "dot icon title"
            "sp  desc desc";
        column-gap: 12px;
        row-gap: 4px;
        padding-bottom: 30px;
        position: relative;
        align-items: center;
        justify-items: stretch;   /* override desktop centering so text wraps & left-aligns */
        min-width: 0;             /* allow the flex child to shrink below content size */
        padding-right: 4px;
    }
    .journey-flow .node > * { min-width: 0; }   /* let grid tracks shrink so text wraps */

    /* Hide START / FINISH markers on mobile */
    .journey-flow .node.marker-node { display: none; }

    /* continuous vertical rail running through the badges */
    .journey-flow .node::before {
        content: "";
        position: absolute;
        left: 26px;            /* centre of the 54px rail */
        top: 0;
        bottom: 0;
        width: 2px;
        background: #3b82f6;   /* blue */
        z-index: 1;
    }
    /* trim the rail so it starts at the first number and ends at the last */
    .journey-flow .start-marker + .node::before { top: 20px; }
    .journey-flow .node:has(+ .finish-marker)::before { bottom: calc(100% - 20px); }

    .journey-flow .icon-container {
        grid-area: icon;
        align-self: center;
        justify-self: start;
        width: auto;
        height: auto;
        margin-bottom: 0;
    }
    .journey-flow .icon-svg { width: 34px; height: 34px; }

    .journey-flow .dot {
        grid-area: dot;
        align-self: center;
        justify-self: center;
    }

    /* number + header on the same line, icon just in front of the header */
    .journey-flow .step-title {
        grid-area: title;
        align-self: center;
        margin: 0;
        padding: 0;
        text-align: left;
        font-size: 19px;
    }
    .journey-flow .step-desc {
        grid-area: desc;
        margin: 0;
        padding: 0;
        max-width: none;
        text-align: left;
        font-size: 14.5px;
    }

    /* Start / Finish markers (higher specificity so it overrides the .node step grid) */
    .journey-flow .node.marker-node {
        grid-template-columns: 54px 1fr;
        grid-template-rows: auto;
        grid-template-areas: "circle title";
        align-items: center;
        padding-bottom: 28px;
    }
    .journey-flow .marker-circle { grid-area: circle; align-self: center; justify-self: center; }
    .journey-flow .marker-title {
        grid-area: title;
        align-self: center;
        margin-bottom: 0;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .journey-flow { padding: 44px 14px 52px; }
    .journey-flow .node {
        grid-template-columns: 48px auto 1fr;
        column-gap: 10px;
    }
    .journey-flow .node.marker-node { grid-template-columns: 48px 1fr; }
    .journey-flow .node::before { left: 23px; }
    .journey-flow .icon-svg { width: 30px; height: 30px; }
    .journey-flow .step-title { font-size: 19px; }
    .journey-flow .journey-note { padding: 20px; border-radius: 14px; }
}

/* ---------- Respect reduced-motion ---------- */
@media (prefers-reduced-motion: reduce) {
    .journey-flow .node { animation: none !important; opacity: 1 !important; }
    .journey-flow .marker-circle { animation: none !important; }
    .journey-flow .path-line { stroke-dasharray: none !important; stroke-dashoffset: 0 !important; }
}
