/* iRodopi.bg - the route timeline of the old «Маршрути» posts (owner 24.11). Linked ONLY by a page that has one (legacy.blade.php, `route_timeline`), so every other
   page keeps its stylesheet and its bytes. One row per route: the text on the left, on the right a rail whose line runs the whole length of the page; the card of the
   route (number, name, length, stops) travels down beside its own text (sticky inside its row). Below 1000 px the rail is not shown: the page reads as before. */
.story-body.route-body { display: block; }
.route-row { display: grid; grid-template-columns: minmax(0, 68ch); }
.route-row + .route-row > * { padding-top: clamp(30px, 3vw, 48px); }
.route-rail { display: none; }

@media (min-width: 1000px) {
    .route-row { grid-template-columns: minmax(0, 68ch) minmax(250px, 330px); column-gap: clamp(40px, 5vw, 96px); }
    .route-rail { display: block; position: relative; padding-left: 40px; view-timeline: --route block; view-timeline-inset: 42% 50%; }
    /* the line: it continues from row to row, starts at the first number and ends with a cap under the last route */
    .route-rail::before, .route-rail::after { content: ""; position: absolute; left: 13px; top: 0; bottom: 0; width: 2px; border-radius: 2px; }
    .route-rail::before { background: var(--line); }
    .route-rail::after { background: var(--terra); transform-origin: 50% 0; transform: scaleY(0); }
    .route-row--intro .route-rail::before, .route-row--intro .route-rail::after { display: none; }
    .route-row--first .route-rail::before, .route-row--first .route-rail::after { top: 14px; }
    .route-row--last .route-rail { padding-bottom: 28px; }
    .route-row--last .route-rail::before { bottom: 14px; }
    .route-row--last .route-rail::after { bottom: 14px; }
    .route-row--last .route-rail__end { position: absolute; left: 8px; bottom: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--pine); }

    /* the reading progress: the line turns terracotta while the route beside it is read (scroll-driven, where the browser has it; elsewhere the plain line) */
    @supports (animation-timeline: view()) {
        .route-rail::after { animation: route-fill linear both; animation-timeline: --route; animation-range: cover 0% cover 100%; }
    }

    .route-rail__card { position: sticky; top: 24px; }
    .route-rail__head { position: relative; margin: 0 0 14px; font-family: var(--serif); color: var(--pine); line-height: 1.2; }
    .route-rail__num { position: absolute; left: -40px; top: 0; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--pine); color: var(--white); font: 600 14px/1 var(--sans); box-shadow: 0 0 0 5px var(--bg); }
    .route-rail__name { display: block; font-size: 20px; font-weight: 600; }
    .route-rail__km { display: inline-block; margin-top: 6px; padding: 2px 10px; border-radius: 999px; background: var(--sage); color: var(--pine); font: 600 13px/1.5 var(--sans); letter-spacing: .02em; }

    .route-rail__stops { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
    .route-rail__stops li { position: relative; padding: 7px 0; font: 500 15px/1.35 var(--sans); color: var(--ink); }
    .route-rail__stops li::before { content: ""; position: absolute; left: -32px; top: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--card); border: 2px solid var(--muted); }
    .route-rail__stops li.is-start::before, .route-rail__stops li.is-end::before { background: var(--terra); border-color: var(--terra); }
    .route-rail__stops li.is-night::before { background: var(--pine); border-color: var(--pine); }
    .route-rail__stops small { display: block; margin-top: 1px; color: var(--terra-ink); font: 600 12px/1.4 var(--sans); letter-spacing: .03em; text-transform: uppercase; }
    .route-rail__stops em { display: block; margin-top: 1px; color: var(--muted); font: 400 13px/1.4 var(--sans); font-style: normal; }
}

@keyframes route-fill { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .route-rail::after { animation: none !important; transform: scaleY(0); } }
