/* ============================================================
   Journey Steps — Frontend Styles
   ============================================================ */

.journey-steps {
    --js-icon-size: 90px;
    --js-active: #1a3a6c;
    --js-title:  #1a3a6c;
    --js-text:   #333333;
    --js-gap-y:  24px;

    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
    box-sizing: border-box;
}

.journey-steps.js-align-left { margin-left: 0; }

/* ---------- Track + SVG line ---------- */
.journey-steps .js-track-wrap {
    position: relative;
    width: 100%;
    min-height: calc(var(--js-icon-size) + 40px);
}

.journey-steps .js-line {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: visible;
}

/* ---------- Icon row (desktop) ---------- */
.journey-steps .js-icons {
    position: relative;
    z-index: 2;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 20px 0;
}

.journey-steps .js-icon {
    flex: 0 0 auto;
    background: transparent;
    border: none;
    padding: 6px;
    cursor: pointer;
    transition: transform 0.25s ease, filter 0.25s ease, background 0.2s ease;
    border-radius: 50%;
    width: var(--js-icon-size);
    height: var(--js-icon-size);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.journey-steps .js-icon-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    overflow: hidden;
}

.journey-steps .js-icon-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.25s ease;
}

/* Title is only shown in mobile layout */
.journey-steps .js-icon-title { display: none; }

.journey-steps .js-icon:hover { transform: translateY(-4px); }
.journey-steps .js-icon:hover .js-icon-image img { transform: scale(1.05); }

.journey-steps .js-icon.is-active {
    transform: translateY(-4px);
    filter: drop-shadow(0 6px 14px rgba(26, 58, 108, 0.25));
}

.journey-steps .js-icon.is-active::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--js-active);
    box-shadow: 0 0 0 4px rgba(26, 58, 108, 0.15);
}

.journey-steps .js-icon:focus-visible {
    outline: 2px solid var(--js-active);
    outline-offset: 4px;
}

.journey-steps .js-icon-fallback {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #f0f0f0;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: calc(var(--js-icon-size) * 0.35);
}

/* ---------- Message area ---------- */
.journey-steps .js-message-area {
    position: relative;
    margin-top: var(--js-gap-y);
    min-height: 120px;
    text-align: center;
    padding: 0 20px;
}

.journey-steps.js-align-left .js-message-area { text-align: left; padding-left: 0; }

.journey-steps .js-message {
    display: none;
    animation: js-fade-in 0.35s ease;
}

.journey-steps .js-message.is-active { display: block; }

.journey-steps .js-message-title {
    color: var(--js-title);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 12px;
    line-height: 1.3;
}

.journey-steps .js-message-body {
    color: var(--js-text);
    font-size: 1rem;
    line-height: 1.6;
    max-width: 560px;
    margin: 0 auto;
}

.journey-steps.js-align-left .js-message-body { margin-left: 0; }

.journey-steps .js-message-body p { margin: 0 0 8px; }
.journey-steps .js-message-body a { color: var(--js-active); }
.journey-steps .js-message-body strong { color: var(--js-active); }

@keyframes js-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Mobile layout — vertical timeline (≤ 768px)
   Icons stack in a column. Each row is [icon] [title].
   The SVG line is redrawn vertically between icon edges.
   ============================================================ */
@media (max-width: 768px) {
    .journey-steps {
        --js-icon-size: 56px;
        --js-gap-y: 20px;
        padding: 12px 0;
    }

    .journey-steps .js-track-wrap {
        min-height: 0;
    }

    .journey-steps .js-icons {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 18px;
        padding: 12px 0;
    }

    .journey-steps .js-icon {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 14px;
        width: 100%;
        height: auto;
        padding: 6px 10px;
        border-radius: 12px;
        text-align: left;
    }

    .journey-steps .js-icon-image {
        flex: 0 0 var(--js-icon-size);
        width: var(--js-icon-size);
        height: var(--js-icon-size);
        position: relative;
        z-index: 3; /* above the SVG vertical line */
    }

    .journey-steps .js-icon-title {
        display: block;
        flex: 1 1 auto;
        min-width: 0;
        font-size: 1rem;
        font-weight: 500;
        color: var(--js-text);
        line-height: 1.3;
        transition: color 0.2s ease, font-weight 0.2s ease;
    }

    /* Override desktop hover/active visuals for the row format */
    .journey-steps .js-icon:hover {
        transform: none;
        background: rgba(0, 0, 0, 0.03);
    }
    .journey-steps .js-icon:hover .js-icon-image img { transform: none; }

    .journey-steps .js-icon.is-active {
        transform: none;
        filter: none;
        background: rgba(26, 58, 108, 0.07);
    }

    .journey-steps .js-icon.is-active::after { display: none; }

    .journey-steps .js-icon.is-active .js-icon-image {
        filter: drop-shadow(0 3px 8px rgba(26, 58, 108, 0.22));
    }
    .journey-steps .js-icon.is-active .js-icon-title {
        color: var(--js-active);
        font-weight: 700;
    }

    .journey-steps .js-message-area {
        margin-top: 8px;
        padding: 16px 12px 0;
        min-height: 80px;
    }
    .journey-steps .js-message-title {
        font-size: 1.2rem;
    }
}

/* Very small screens — slight further tightening */
@media (max-width: 380px) {
    .journey-steps { --js-icon-size: 48px; }
    .journey-steps .js-icon { gap: 12px; padding: 6px 8px; }
    .journey-steps .js-icon-title { font-size: 0.95rem; }
}
