/* ==========================================================================
   PSW Energy – Moderne Effekte (07.11.2026)
   1) Sanftes Einblenden beim Scrollen   2) Aktiver Menüpunkt
   3) Weiche Seitenwechsel (View Transitions)
   Zurücknehmen: in den Seiten die Zeilen mit "fx.css" und "fx.js" entfernen
   (oder diese beiden Dateien leeren). Alles andere bleibt unverändert.
   ========================================================================== */

/* 3) Weiche Seitenwechsel zwischen Startseite, EN, Impressum, Datenschutz */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 280ms; }

/* 1) Einblenden: nur aktiv, wenn fx.js läuft (Klasse fx-on), sonst alles sofort sichtbar */
.fx-on .fx-r {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 700ms var(--ease-out, ease-out), transform 700ms var(--ease-out, ease-out);
  transition-delay: calc(var(--fx-i, 0) * 80ms);
}
.fx-on .fx-r.fx-in { opacity: 1; transform: none; }
[data-editing] .fx-r { opacity: 1 !important; transform: none !important; transition: none !important; }

/* 2) Aktiver Menüpunkt (Abschnitt, in dem man gerade ist) */
.nav > a.is-active, .nav__item > a.is-active { color: var(--psw-blue); }
.nav > a.is-active::after, .nav__item > a.is-active::after { transform: scaleX(1); }
.nav .nav__sub a.is-active { color: var(--psw-blue); background: var(--psw-blue-soft); }
.mobile-nav a.is-active { color: #6db4dd; }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .fx-on .fx-r { opacity: 1; transform: none; transition: none; }
}
@media print {
  .fx-r { opacity: 1 !important; transform: none !important; }
}

/* 4) Hover-Effekte für Themen- und Seminarkacheln (07.11.2026)
   Seminarkarten heben sich leicht an, die blaue Linie oben wird kräftiger.
   Themenfelder: blaue Linie läuft oben von links ein. Nur mit Maus, nicht auf Touch-Geräten. */
.kurs, .schul__kacheln li {
  transition: translate 220ms var(--ease-out, ease-out), box-shadow 220ms var(--ease-out, ease-out);
}
.fx-on .kurs.fx-r, .fx-on .schul__kacheln li.fx-r {
  transition-property: opacity, transform, translate, box-shadow;
  transition-duration: 700ms, 700ms, 220ms, 220ms;
  transition-delay: calc(var(--fx-i, 0) * 80ms), calc(var(--fx-i, 0) * 80ms), 0s, 0s;
}
.thema::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: var(--psw-blue);
  transform: scaleX(0); transform-origin: left;
  transition: transform 320ms var(--ease-out, ease-out);
  pointer-events: none;
}
@media (hover: hover) {
  .kurs:hover, .schul__kacheln li:hover {
    translate: 0 -4px;
    box-shadow: 0 14px 30px rgba(12,40,69,0.12), inset 0 2px 0 var(--psw-blue);
  }
  .thema:hover::before { transform: scaleX(1); }
}
[data-editing] .kurs:hover, [data-editing] .schul__kacheln li:hover { translate: none; box-shadow: none; }
[data-editing] .thema::before { display: none; }
@media (prefers-reduced-motion: reduce) {
  .kurs:hover, .schul__kacheln li:hover { translate: none; }
  .thema::before { transition: none; }
}

/* 5) Bereichsanzeige am rechten Rand (07.11.2026), nur auf großen Bildschirmen */
.sec-dots { display: none; }
@media (min-width: 1360px) {
  .sec-dots {
    display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
    position: fixed; right: 18px; top: 50%; transform: translateY(-50%); z-index: 45;
  }
}
.sec-dots a {
  display: flex; align-items: center; gap: 10px; padding: 4px 0;
  text-decoration: none; font-family: var(--psw-font-arial, Arial, sans-serif);
  font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--psw-blue);
}
.sec-dots a span {
  padding: 4px 8px; border-radius: 3px; background: rgba(255,255,255,.94);
  box-shadow: 0 1px 3px rgba(12,40,69,.12);
  opacity: 0; transform: translateX(6px); pointer-events: none;
  transition: opacity 180ms var(--ease-out, ease-out), transform 180ms var(--ease-out, ease-out);
}
.sec-dots a::after {
  content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none;
  border: 1.5px solid rgba(12,40,69,.4); background: rgba(255,255,255,.7);
  box-shadow: 0 0 0 2px rgba(255,255,255,.35);
  transition: transform 180ms var(--ease-out, ease-out), background 180ms, border-color 180ms;
}
.sec-dots a:hover span, .sec-dots a:focus-visible span { opacity: 1; transform: none; }
/* Beschriftung des aktuellen Bereichs dauerhaft nur, wenn rechts genug Platz neben dem Inhalt ist */
@media (min-width: 1540px) { .sec-dots a.is-active span { opacity: 1; transform: none; } }
.sec-dots a:hover::after { border-color: var(--psw-blue); }
.sec-dots a.is-active::after { background: var(--psw-blue); border-color: var(--psw-blue); transform: scale(1.3); }
[data-editing] .sec-dots { display: none; }
@media print { .sec-dots { display: none !important; } }

/* 6) Bereichsleiste unter dem Menü für schmalere Bildschirme (unter 1360 px, statt der Punkte) */
.sec-bar {
  position: fixed; left: 0; right: 0; top: 76px; z-index: 49; height: 30px;
  background: rgba(255,255,255,0.95);
  -webkit-backdrop-filter: saturate(140%) blur(8px); backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid rgba(162,162,162,0.25);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity 200ms var(--ease-out, ease-out), transform 200ms var(--ease-out, ease-out), visibility 0s linear 200ms;
  pointer-events: none;
}
.sec-bar.is-on { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.sec-bar__inner { height: 100%; display: flex; align-items: center; }
.sec-bar__label {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--psw-font-arial, Arial, sans-serif); font-size: 10.5px;
  letter-spacing: .16em; text-transform: uppercase; color: var(--psw-blue);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sec-bar__label::before { content: ""; width: 20px; height: 1px; background: currentColor; flex: none; }
.sec-bar__label b { font-weight: 400; color: var(--psw-ink, #0C2845); }
.sec-bar__prog { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; background: var(--psw-blue); }
@media (min-width: 1360px) { .sec-bar { display: none; } }
body.nav-open .sec-bar, [data-editing] .sec-bar { display: none; }
@media print { .sec-bar { display: none !important; } }
