/* CORNER – Monk-Effekte (fx.css). Abschaltbar über FX = False in qa/v2/build_v2.py,
   einzeln über das FX-Objekt in fx.js (Klassen fx-stitch, fx-seam, fx-progress, fx-shoplight, fx-tape auf <html>).
   Ruhezustand jedes Effekts = heutiges Aussehen der Seite (bis auf die Haarlinien von Maßband und Naht). */

/* ---------- 1 Gertis Nahtstich: .rule wird einmal in 8 Stichen genäht, endet als heutiger Strich ---------- */
/* 64 px / 8 px Raster = 8 Stiche à 6 px Stich + 2 px Lücke; die Lücken schließen sich am Ende in 120 ms (Faden gezogen). */
@property --fx-gap{syntax:'<length>';inherits:false;initial-value:2px}
html.fx-stitch .rule.fx-wait{
  --fx-gap:2px;
  -webkit-mask:repeating-linear-gradient(90deg,#000 0 calc(8px - var(--fx-gap)),transparent calc(8px - var(--fx-gap)) 8px);
          mask:repeating-linear-gradient(90deg,#000 0 calc(8px - var(--fx-gap)),transparent calc(8px - var(--fx-gap)) 8px);
  clip-path:inset(0 100% 0 0)
}
html.fx-stitch .rule.fx-wait.fx-sew{animation:fxSew .7s steps(8,end) .25s both,fxPull .12s ease-out .95s both}
@keyframes fxSew{from{clip-path:inset(0 100% 0 0)}to{clip-path:inset(0 0 0 0)}}
@keyframes fxPull{from{--fx-gap:2px}to{--fx-gap:0px}}
@media (prefers-reduced-motion:reduce){
  html.fx-stitch .rule.fx-wait{-webkit-mask:none;mask:none;clip-path:none;animation:none}
}

/* ---------- 2 Die Naht im Haus: gestrichelte 1-px-Naht zwischen den Kopfbildern der Startseite ---------- */
@media (hover:hover) and (pointer:fine) and (min-width:821px){
  html.fx-seam .heroSplit{position:relative}
  html.fx-seam .heroSplit::after{
    content:"";position:absolute;top:0;bottom:0;left:calc(50% - .5px);width:1px;z-index:2;pointer-events:none;
    background-color:rgba(236,234,228,.16);
    -webkit-mask:repeating-linear-gradient(180deg,#000 0 7px,transparent 7px 11px);
            mask:repeating-linear-gradient(180deg,#000 0 7px,transparent 7px 11px);
    transition:background-color .2s ease
  }
  html.fx-seam .heroSplit:has(.hcell.mo:hover)::after,html.fx-seam .heroSplit:has(.hcell.mo:focus-visible)::after{background-color:var(--corner-red)}
  html.fx-seam .heroSplit:has(.hcell.pi:hover)::after,html.fx-seam .heroSplit:has(.hcell.pi:focus-visible)::after{background-color:#3FB6A8}
}

/* ---------- 3 38/76-Lesefortschritt: Haarlinie unter der Kopfzeile, Proportionen des CI-Streifens ---------- */
.fx-bar{display:none}
html.fx-progress .fx-bar{
  display:block;position:fixed;left:0;right:0;top:var(--fx-top,64px);height:1px;z-index:59;pointer-events:none;
  --fx-mid:var(--corner-red);--fx-inkedge:#464955;
  background:
    linear-gradient(90deg,var(--corner-yellow) 0 38%,var(--fx-mid) 38% 76%,var(--fx-inkedge) 76%);
  clip-path:inset(0 calc(100% - var(--fx-p,0) * 100%) 0 0);
  opacity:0;transition:opacity .25s ease
}
html.fx-progress .fx-bar.on{opacity:.55}
body.page-piercing .fx-bar{--fx-mid:var(--pier)}
body.page-team .fx-bar{
  background:
    linear-gradient(90deg,var(--corner-yellow) 0 38%,var(--corner-red) 38% 57%,var(--pier) 57% 76%,var(--fx-inkedge) 76%)
}
html[data-saison="fruehling"] .fx-bar{--fx-inkedge:var(--corner-ink)}
@supports (animation-timeline:scroll()){
  html.fx-progress .fx-bar.sd{animation:fxProg linear both;animation-timeline:scroll(root block)}
  @keyframes fxProg{from{clip-path:inset(0 100% 0 0)}to{clip-path:inset(0 0 0 0)}}
}
@media (max-width:820px){html.fx-progress .fx-bar{display:none}}
@media (prefers-reduced-motion:reduce){html.fx-progress .fx-bar{display:none}}
@media print{.fx-bar{display:none!important}}

/* ---------- 5 Maßband unter dem Service-Trenner: ganzzahliges Pixelraster 20 / 40 / 200 px (rund 0,5 / 1 / 5 cm, die echte Länge hängt vom Bildschirm ab), Strichhöhen 2 / 4 / 6 px; durch 4 teilbar, damit die Striche auch bei 125 % und 150 % Skalierung gleich stark sind ---------- */
html.fx-tape #service .rule{position:relative}
html.fx-tape #service .rule::after{
  content:"";position:absolute;left:0;top:calc(100% + 3px);width:401px;height:6px;pointer-events:none;
  translate:var(--fx-snap,0px) 0; /* fx.js richtet den Startpunkt auf ganze Gerätepixel aus */
  color:var(--mut);opacity:.32;
  background:
    repeating-linear-gradient(90deg,currentColor 0 1px,transparent 1px 200px) 0 0/100% 6px no-repeat,
    repeating-linear-gradient(90deg,currentColor 0 1px,transparent 1px 40px) 0 0/100% 4px no-repeat,
    repeating-linear-gradient(90deg,currentColor 0 1px,transparent 1px 20px) 0 0/100% 2px no-repeat;
  transition:opacity .6s ease
}
html.fx-tape.fx-stitch #service .rule.fx-wait::after{opacity:0}
@media (max-width:520px){html.fx-tape #service .rule::after{width:201px}}
/* Druck: site.css setzt im Druck alle Hintergründe transparent; Striche und Maßband hier mit höherer Spezifität zurückholen */
@media print{
  html.fx-stitch .rule.fx-wait{clip-path:none!important;-webkit-mask:none!important;mask:none!important;animation:none!important}
  html body .rule{background:var(--acc)!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}
  html body .rule.yellow{background:linear-gradient(90deg,var(--corner-red) 60%,var(--corner-yellow) 60%)!important}
  html body .rule.pier{background:var(--pier)!important}
  html.fx-tape #service .rule::after{
    opacity:.32!important;-webkit-print-color-adjust:exact;print-color-adjust:exact; /* Farbe #000 aus site.css, mit .32 dezent grau */
    background:
      repeating-linear-gradient(90deg,currentColor 0 1px,transparent 1px 200px) 0 0/100% 6px no-repeat,
      repeating-linear-gradient(90deg,currentColor 0 1px,transparent 1px 40px) 0 0/100% 4px no-repeat,
      repeating-linear-gradient(90deg,currentColor 0 1px,transparent 1px 20px) 0 0/100% 2px no-repeat!important
  }
}
