/* ==========================================================================
   Route – ein Bauteil für Abläufe ("So läuft's ab"), Zeitpläne und die Chronik.
   Feine Linie, kleine Knoten, leichte Ziffern. Die Strecke voraus ist gestrichelt,
   die gefahrene Strecke füllt sich beim Scrollen durchgehend rot (js/route.js).
   Ohne JavaScript oder bei reduzierter Bewegung: alles gefüllt, nichts bewegt sich.
   ========================================================================== */

.route {
  --rt-line: rgba(47, 50, 56, .3);        /* Strecke voraus */
  --rt-ring: rgba(47, 50, 56, .5);
  --rt-fill: var(--red);                  /* gefahrene Strecke */
  --rt-glow: rgba(198, 38, 47, .16);
  --rt-bg: var(--surface);                /* Fläche hinter den Knoten */
  --rt-ink: var(--ink);
  --rt-text: var(--ink-soft);
  --rt-accent: var(--red);
  --rt-off: rgba(47, 50, 56, .3);         /* Ziffer, noch nicht erreicht */
  --rt-node: 13px;
  --cx: 15px;                             /* Knotenmitte */
  --cy: 16px;
  --P: 99;                                /* Fortschritt in Abschnitten; 99 = alles gefüllt */
  position: relative;
}
.section-dark .route {
  --rt-line: rgba(255, 255, 255, .3);
  --rt-ring: rgba(255, 255, 255, .55);
  --rt-fill: var(--red-signal);
  --rt-glow: rgba(237, 31, 37, .24);
  --rt-bg: var(--dark);
  --rt-ink: #fff;
  --rt-text: var(--on-dark-soft);
  --rt-accent: #ff6a71;
  --rt-off: rgba(255, 255, 255, .3);
}
.route-list { list-style: none; margin: 0; padding: 0; }
.route-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Grundform: senkrecht (Handy, Tablet, Chronik) ---------- */
.route-step { position: relative; padding: 0 0 36px 48px; }
.route-step:last-child { padding-bottom: 0; }
.route-step::before, .route-step::after { content: ""; position: absolute; z-index: 0; left: calc(var(--cx) - 1px); top: var(--cy); width: 2px; height: 100%; pointer-events: none; }
.route-step:last-child::before, .route-step:last-child::after { display: none; }
.route-step::before { background: repeating-linear-gradient(180deg, var(--rt-line) 0 6px, transparent 6px 12px); }
.route-step::after { background: var(--rt-fill); transform-origin: 50% 0; }
.route.is-live .route-step::after { transform: scaleY(clamp(0, calc(var(--P) - var(--i)), 1)); }

.route-node { position: absolute; z-index: 1; left: calc(var(--cx) - var(--rt-node) / 2); top: calc(var(--cy) - var(--rt-node) / 2); display: grid; place-items: center; width: var(--rt-node); height: var(--rt-node); border-radius: 50%; background: var(--rt-fill); color: #fff; box-shadow: 0 0 0 5px var(--rt-glow); transition: background-color .4s var(--ease-out), box-shadow .4s var(--ease-out), color .4s var(--ease-out); }
.route-node .ico { width: 15px; height: 15px; }
.route.is-live .route-step:not(.is-on) .route-node { background: var(--rt-bg); color: var(--rt-ring); box-shadow: inset 0 0 0 2px var(--rt-ring); }
.route-step.is-goal { --rt-node: 32px; }

.route-idx, .route-year { display: block; height: 32px; font-family: var(--font-display); font-weight: 300; font-size: 2rem; line-height: 32px; letter-spacing: -.02em; font-variant-numeric: tabular-nums lining-nums; color: var(--rt-ink); transition: color .5s var(--ease-out); }
.route.is-live .route-step:not(.is-on) .route-idx, .route.is-live .route-step:not(.is-on) .route-year { color: var(--rt-off); }
.route-step h3 { margin-top: 10px; font-family: var(--font-display); font-weight: 650; font-size: 1.2rem; line-height: 1.25; color: var(--rt-ink); text-wrap: balance; }
.route-step p { margin-top: 6px; max-width: 60ch; font-size: .95rem; line-height: 1.6; color: var(--rt-text); }
.route-step .step-link { margin-top: 2px; }

/* Lichtpunkt an der Spitze der gefahrenen Strecke (nur mit JS) */
.route-head { position: absolute; z-index: 2; left: 0; top: 0; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px var(--rt-fill), 0 0 22px 7px rgba(237, 31, 37, .55); opacity: 0; pointer-events: none; transition: opacity .3s; will-change: transform; }
.route-head.is-on { opacity: 1; }

/* ---------- Ablauf waagerecht (ab 1024 px, bis fünf Schritte) ---------- */
@media (min-width: 1024px) {
  .route-flow:not(.route-long) { --cx: 6.5px; --idx-h: 56px; --cy: calc(var(--idx-h) + 30px); }
  .route-flow:not(.route-long) .route-list { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
  .route-flow:not(.route-long) .route-step { padding: 0 clamp(20px, 2.4vw, 40px) 0 0; }
  .route-flow:not(.route-long) .route-step.is-goal { --cx: 16px; }
  .route-flow:not(.route-long) .route-step::before, .route-flow:not(.route-long) .route-step::after { left: 6.5px; top: calc(var(--cy) - 1px); width: 100%; height: 2px; }
  .route-flow:not(.route-long) .route-step::before { background: repeating-linear-gradient(90deg, var(--rt-line) 0 7px, transparent 7px 14px); }
  .route-flow:not(.route-long) .route-step::after { background: var(--rt-fill); transform-origin: 0 50%; }
  .route-flow.is-live:not(.route-long) .route-step::after { transform: scaleX(clamp(0, calc(var(--P) - var(--i)), 1)); }
  .route-flow:not(.route-long) .route-idx { height: var(--idx-h); font-size: 3.5rem; line-height: var(--idx-h); letter-spacing: -.04em; }
  .route-flow:not(.route-long) h3 { margin-top: 60px; font-size: 1.25rem; }
  .route-flow:not(.route-long) p { margin-top: 8px; font-size: .94rem; }
}

/* ---------- Zeitplan mit Status (erledigt, als Nächstes, geplant) ---------- */
.route-dated { --rt-node: 22px; --cy: 12px; }
.route-dated .route-step { padding: 0 0 26px 50px; }
.route-dated .route-step:last-child { padding-bottom: 0; }
.route-dated .route-step::after { display: none; transition: transform .8s var(--ease-out) calc(var(--i) * .3s + .25s); }
.route-dated .seg-done::after, .route-dated .seg-now::after { display: block; }
.route-dated .seg-now::before { display: none; }
.route-dated .seg-now::after { background: repeating-linear-gradient(180deg, var(--rt-fill) 0 6px, transparent 6px 12px); animation: rt-march-v 1.5s linear infinite; }
html:not(.no-js) .route-dated.reveal:not(.is-in) .route-step::after { transform: scaleY(0); }
.route-dated .route-node { box-shadow: none; }
.route-dated .route-node .ico { width: 12px; height: 12px; }
.route-dated .is-next .route-node { background: var(--rt-bg); box-shadow: inset 0 0 0 2px var(--rt-fill); animation: rt-pulse 2.2s var(--ease-out) infinite; }
.route-dated .is-next .route-node::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--rt-fill); }
.route-dated .is-plan .route-node { background: var(--rt-bg); border: 2px dashed var(--rt-ring); }
.route-date { display: block; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; line-height: 24px; color: var(--rt-ink); }
.route-dated .is-next .route-date { color: var(--rt-accent); }
.route-what { display: block; margin-top: 2px; max-width: 46ch; font-size: .94rem; line-height: 1.5; color: var(--rt-text); }
.section-reform .route-dated { margin-bottom: 56px; }
@keyframes rt-pulse { 0% { box-shadow: inset 0 0 0 2px var(--rt-fill), 0 0 0 0 rgba(237, 31, 37, .45); } 80%, 100% { box-shadow: inset 0 0 0 2px var(--rt-fill), 0 0 0 12px rgba(237, 31, 37, 0); } }
@keyframes rt-march-v { to { background-position: 0 12px; } }
@keyframes rt-march-h { to { background-position: 14px 0; } }

@media (min-width: 860px) {
  .route-dated { --cx: 11px; --cy: 11px; }
  .route-dated .route-list { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
  .route-dated .route-step, .route-dated .route-step:last-child { padding: 42px clamp(20px, 2.4vw, 40px) 0 0; }
  .route-dated .route-step::before, .route-dated .route-step::after { left: 11px; top: calc(var(--cy) - 1px); width: 100%; height: 2px; transform-origin: 0 50%; }
  .route-dated .route-step::before { background: repeating-linear-gradient(90deg, var(--rt-line) 0 7px, transparent 7px 14px); }
  .route-dated .seg-now::after { background: repeating-linear-gradient(90deg, var(--rt-fill) 0 7px, transparent 7px 14px); animation-name: rt-march-h; }
  html:not(.no-js) .route-dated.reveal:not(.is-in) .route-step::after { transform: scaleX(0); }
  .route-date { font-size: 1.15rem; }
}

/* ---------- Chronik: Jahre links, Linie, Text rechts; Kopf bleibt auf großen Bildschirmen stehen ---------- */
.chronik-grid { display: grid; grid-template-columns: minmax(0, 1fr); }
.chronik-now { display: none; }
.route-chronik { --cy: 17px; }
.route-chronik .route-step { padding-bottom: 32px; }
.route-chronik .route-year { height: 34px; font-size: 2.1rem; line-height: 34px; }
.route-chronik h3 { margin-top: 8px; }

@media (min-width: 700px) {
  .route-chronik { --yw: 128px; --cx: calc(var(--yw) + 36px); --cy: 22px; }
  .route-chronik .route-step { padding: 0 0 44px calc(var(--yw) + 76px); }
  .route-chronik .route-step:last-child { padding-bottom: 0; }
  .route-chronik .route-year { position: absolute; left: 0; top: 0; width: var(--yw); height: 44px; font-size: 2.9rem; line-height: 44px; letter-spacing: -.035em; text-align: right; }
  .route-chronik h3 { margin-top: 0; padding-top: 8px; font-size: 1.3rem; }
  .route-chronik p { font-size: 1rem; }
}
@media (min-width: 1024px) {
  .chronik-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: clamp(40px, 6vw, 104px); align-items: start; }
  .chronik-head { position: sticky; top: calc(var(--header-h) + 72px); }
  .chronik-head .sec-head { margin-bottom: 0; }
  .section.chronik-sec .chronik-head .sec-head .h2 { font-size: clamp(2.1rem, 1rem + 2.2vw, 2.9rem); }
  .chronik-now { display: block; margin-top: clamp(32px, 4vw, 56px); font-family: var(--font-display); font-weight: 200; font-size: clamp(5rem, 9vw, 8.5rem); line-height: .9; letter-spacing: -.05em; font-variant-numeric: tabular-nums lining-nums; color: #fff; }
  .chronik-now span { display: inline-block; margin-left: -.06em; }
  .chronik-now span.tick { animation: rt-tick .45s var(--ease-out); }
  .route-chronik { padding-top: 6px; }
}
@keyframes rt-tick { from { opacity: .25; transform: translateY(.12em); } to { opacity: 1; transform: none; } }

@media (max-width: 600px) {
  .route-step { padding-bottom: 30px; }
  .route-step h3 { font-size: 1.12rem; }
  .route-step p { font-size: .93rem; }
  .section-reform .route-dated { margin-bottom: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .route-dated .is-next .route-node, .route-dated .seg-now::after, .chronik-now span.tick { animation: none; }
}
