/* ========================================================================
   hotel.css – Datenfluss-Schaubild fuer den Hotel-Abschnitt auf
   /ki-automatisierung. Nur dort eingebunden.

   Aufbau: ein Gleis (.hf-gleis) mit vier Knoten, darunter vier Karten
   (.hf-station). Gleis und Karten teilen sich DASSELBE Raster – die
   Knoten sitzen deshalb bei jeder Breite ueber ihrer Karte, ohne dass
   eine Zeichnung auf eine fremde Breite gestreckt wird.

   Bewegung ist Zierde, nie Traeger von Information: Wer
   prefers-reduced-motion gesetzt hat, sieht dasselbe Schaubild
   ohne Bewegung, alle Angaben stehen als Text da.
   ======================================================================== */

.hf {
  --hf-raster: repeat(4, minmax(0, 1fr));
  --hf-leucht: #8ec4e8;
  --hf-linie: rgba(142, 196, 232, .26);
  --hf-feld: rgba(255, 255, 255, .05);
  --hf-rand: rgba(255, 255, 255, .13);
  margin-top: var(--space-7);
}

/* Taktzeile ueber dem Schaubild --------------------------------------- */
.hf-takt {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3);
  margin-bottom: var(--space-6);
  font-size: var(--text-sm); color: rgba(255, 255, 255, .72);
}
.hf-marke {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--hf-rand); border-radius: var(--radius-pill);
  background: var(--hf-feld); color: #fff;
}
.hf-blinker {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
  background: var(--hf-leucht);
  animation: hf-puls 2.6s var(--ease-standard) infinite;
}
@keyframes hf-puls {
  0%   { box-shadow: 0 0 0 0 rgba(142, 196, 232, .55) }
  70%  { box-shadow: 0 0 0 9px rgba(142, 196, 232, 0) }
  100% { box-shadow: 0 0 0 0 rgba(142, 196, 232, 0) }
}

/* Das Gleis ------------------------------------------------------------ */
.hf-gleis {
  position: relative;
  display: grid; grid-template-columns: var(--hf-raster);
  /* derselbe Spaltenabstand wie .hf-reihe – sonst sitzen die Knoten
     nicht ueber ihrer Karte (gemessen: 26 px Versatz ohne diese Zeile) */
  gap: var(--space-5);
  margin-bottom: var(--space-4);
  height: 34px;
  overflow: hidden;              /* das Leuchtsegment bleibt im Kasten */
}
/* durchgehende Linie auf halber Hoehe */
.hf-gleis::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%;
  height: 2px; margin-top: -1px; background: var(--hf-linie);
}
/* Leuchtsegment, das die Linie entlanglaeuft */
.hf-gleis::after {
  content: ""; position: absolute; top: 50%; left: 0;
  height: 2px; margin-top: -1px; width: 42%;
  background: linear-gradient(90deg,
    rgba(142, 196, 232, 0), var(--hf-leucht), rgba(142, 196, 232, 0));
  animation: hf-lauf 6s linear infinite;
}
@keyframes hf-lauf {
  0%   { transform: translateX(-100%) }
  100% { transform: translateX(240%) }
}
.hf-knoten {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  min-width: 0;
}
.hf-knoten span {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--ink-900);
  border: 2px solid var(--hf-leucht);
  box-shadow: 0 0 0 5px rgba(35, 31, 32, 1);   /* stanzt die Linie frei */
}

/* Die vier Stationen ---------------------------------------------------- */
.hf-reihe {
  /* <ol> bringt Aufzaehlungszeichen und 40 px Einzug mit – beides muss weg,
     sonst laeuft das Raster der Reihe gegen das des Gleises (gemessener
     Versatz 35/25/15/5 px, also mitwachsend statt konstant) */
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: var(--hf-raster); gap: var(--space-5);
}
.hf-station {
  min-width: 0;
  background: var(--hf-feld);
  border: 1px solid var(--hf-rand);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}
.hf-nr {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; margin-bottom: var(--space-3);
  border-radius: 50%; background: var(--color-primary); color: #fff;
  font-size: var(--text-xs); font-weight: var(--weight-semibold);
}
.hf-station h3 {
  font-size: var(--text-h4); margin: 0 0 var(--space-2); color: #fff;
  line-height: var(--leading-snug);
}
.hf-station p {
  font-size: var(--text-sm); line-height: var(--leading-normal);
  color: rgba(255, 255, 255, .78); margin: 0;
}
.hf-zusatz {
  display: block; margin-top: var(--space-3);
  padding-top: var(--space-3); border-top: 1px solid var(--hf-rand);
  font-size: var(--text-xs); color: var(--hf-leucht);
  letter-spacing: var(--tracking-wide); text-transform: uppercase;
}

/* Zwei Nebenwege: Protokoll und Loeschung ------------------------------ */
.hf-nebenwege {
  display: grid; gap: var(--space-5); grid-template-columns: 1fr 1fr;
  margin-top: var(--space-5);
}
.hf-neben {
  min-width: 0;
  display: flex; gap: var(--space-4); align-items: flex-start;
  padding: var(--space-4) var(--space-5);
  border: 1px dashed var(--hf-rand); border-radius: var(--radius-lg);
}
.hf-neben svg {
  flex: 0 0 22px; width: 22px; height: 22px;
  stroke: var(--hf-leucht); fill: none; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}
.hf-neben h4 {
  margin: 0 0 var(--space-1); font-size: var(--text-base); color: #fff;
  font-weight: var(--weight-semibold);
}
.hf-neben p { margin: 0; font-size: var(--text-sm); color: rgba(255, 255, 255, .72) }

/* Belege: die echten n8n-Ansichten -------------------------------------- */
.hf-belege { margin-top: var(--space-8) }
.hf-beleg {
  min-width: 0;
  border: 1px solid var(--hf-rand); border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, .04); overflow: hidden;
  margin: 0 0 var(--space-5);
}
.hf-beleg > img {
  display: block; width: 100%; height: auto;
  border-bottom: 1px solid var(--hf-rand); background: #fff;
}
.hf-beleg figcaption {
  padding: var(--space-4) var(--space-5);
  font-size: var(--text-sm); color: rgba(255, 255, 255, .72);
  line-height: var(--leading-normal);
}
.hf-beleg figcaption b { color: #fff; font-weight: var(--weight-semibold) }
.hf-beleg-paar { display: grid; gap: var(--space-5); grid-template-columns: 1fr 1fr }
.hf-beleg-paar .hf-beleg { margin-bottom: 0 }

/* Schmale Bildschirme ---------------------------------------------------- */
@media (max-width: 1000px) {
  .hf { --hf-raster: repeat(2, minmax(0, 1fr)) }
  /* Bei zwei Spalten stapeln die Karten in zwei Zeilen – eine einzige
     waagerechte Bahn darueber waere dann falsch. Weg damit; die Nummern
     in den Karten tragen die Reihenfolge ohnehin. */
  .hf-gleis { display: none }
}
@media (max-width: 720px) {
  .hf { --hf-raster: minmax(0, 1fr) }
  .hf-nebenwege, .hf-beleg-paar { grid-template-columns: 1fr }
}

/* Wer keine Bewegung will, bekommt dasselbe Bild ohne Bewegung. */
@media (prefers-reduced-motion: reduce) {
  .hf-gleis::after { animation: none; opacity: .45; width: 100% }
  .hf-blinker { animation: none }
}
