/* ==========================================================================
   skins/journey.css — the bus journey strip. Transit-map colouring: one line,
   beads for stops, a two-colour ratio bar.
   ========================================================================== */

[data-skin=journey] {
    --jr-moving: #2f7ed8;
    --jr-stopped: #b0563a;
    --chart-line: #2f7ed8;
}

.hero--journey {
    max-width: 540px;
    align-items: stretch;
}

.jr-top {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.jr-speed {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.jr-value {
    font-family: var(--font-mono);
    font-size: clamp(2.6rem, 13vw, 3.8rem);
    font-weight: 500;
    line-height: 1;
    font-feature-settings: "tnum";
    letter-spacing: -.02em;
}

.jr-value.over {
    color: var(--error-color);
}

.jr-unit {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color-secondary);
}

.jr-stops {
    text-align: right;
}

.jr-stops-n {
    display: block;
    font-family: var(--font-mono);
    font-size: clamp(2rem, 10vw, 2.8rem);
    font-weight: 500;
    line-height: 1;
    color: var(--jr-moving);
    font-feature-settings: "tnum";
}

.jr-stops-k {
    display: block;
    font-size: .625rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-color-secondary);
    margin-top: 4px;
}

/* ---------------- rolling against standing ---------------- */
.jr-ratio {
    display: flex;
    height: 34px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--jr-stopped);
}

/* Before the first second is timed the split is meaningless — an all-red bar
   would announce that you spent the whole journey stopped. */
.jr-ratio[data-idle=true] {
    background: var(--track-color);
}

.jr-ratio-moving,
.jr-ratio-stopped {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: .75rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
}

.jr-ratio-moving {
    width: 0;
    background: var(--jr-moving);
    transition: width .3s linear;
    flex-shrink: 0;
}

.jr-ratio-stopped {
    flex: 1 1 auto;
}

.jr-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: .8125rem;
    color: var(--text-color-secondary);
    margin-top: 10px;
}

.jr-legend b {
    font-family: var(--font-mono);
    font-weight: 500;
    color: var(--text-color);
    margin-left: 4px;
}

.jr-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}

.jr-dot--moving {
    background: var(--jr-moving);
}

.jr-dot--stopped {
    background: var(--jr-stopped);
}

/* ---------------- the route as beads ---------------- */
.jr-route {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    min-height: 20px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--divider-color);
}

.jr-bead {
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--jr-moving);
    opacity: .45;
    flex-shrink: 0;
}

.jr-bead--start {
    width: 14px;
    height: 14px;
    opacity: 1;
    border: 3px solid var(--jr-moving);
    background: var(--bg-color);
}

.jr-bead--now {
    width: 14px;
    height: 14px;
    opacity: 1;
    background: var(--error-color);
}

/* ---------------- figures ---------------- */
.jr-figures {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.jr-fig {
    padding: 10px 8px;
    border-radius: 12px;
    background: var(--surface-raised);
    text-align: center;
    min-width: 0;
}

.jr-fig .k {
    display: block;
    font-size: .625rem;
    font-weight: 600;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--text-color-secondary);
    margin-bottom: 3px;
}

.jr-fig .v {
    display: block;
    font-family: var(--font-mono);
    font-size: 1.0625rem;
    font-weight: 500;
    font-feature-settings: "tnum";
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.jr-note {
    font-size: .8125rem;
    line-height: 1.5;
    color: var(--text-color-secondary);
    margin-top: 14px;
}

@media (prefers-reduced-motion: reduce) {
    .jr-ratio-moving {
        transition: none;
    }
}

/* ---------------- the page around it ---------------- */
[data-skin=journey] .stat[data-stat=stops] .v {
    color: var(--jr-moving);
}
