/* Animationen und Interaktion (Quick-Wins Paket 1, eingebunden von crawl/clean_hooks/animation.py, Skript animation.js).
   2026-11-13 stärker: Auftakt beim Öffnen jeder Seite, kräftigeres Einblenden beim Scrollen, Seitenwechsel.
   Grundsätze: nur transform/opacity/clip-path (kein Layout-Springen), alle Bewegung nur ohne "Bewegung reduzieren",
   ohne JavaScript ist nichts ausgeblendet (der Auftakt ist reines CSS und endet sichtbar), Druck ohne Animation.
   Auftakt-Animationen laufen mit fill-mode backwards: danach gilt wieder das normale CSS (Hover-Effekte bleiben frei). */
:root { --tg-aus: cubic-bezier(.16, 1, .3, 1); --tg-weich: cubic-bezier(.65, 0, .35, 1); --tg-feder: cubic-bezier(.34, 1.56, .64, 1); }

/* 0) Schrift der Seite früh da, damit der Auftakt nicht springt. Interstate hat kein @font-face (nur installiert), sichtbar
      ist PT Sans Narrow. style.min.css nennt TTF vor WOFF, Browser luden die doppelt so große TTF und erst spät: bis dahin
      brachen die Menüpunkte zweizeilig um (Layout-Verschiebung 0,11 auf der Startseite). Gleiche Familie und Gewichte wie
      dort, später definiert, also gilt diese Regel; animation.py lädt beide WOFF per preload im <head> vor. */
@font-face { font-family: "PT Sans Narrow"; src: url(/_Resources/Static/Packages/RaphaelGmbH.TraumgartenSite/fonts/PTN57F-webfont.woff) format("woff");
  font-style: normal; font-weight: 400; }
@font-face { font-family: "PT Sans Narrow Bold"; src: url(/_Resources/Static/Packages/RaphaelGmbH.TraumgartenSite/fonts/PTN77F-webfont.woff) format("woff");
  font-style: normal; font-weight: 700; }

@keyframes tg-auf { from { opacity: 0; translate: 0 32px; } }
@keyframes tg-runter { from { opacity: 0; translate: 0 -16px; } }
@keyframes tg-links { from { opacity: 0; translate: -28px 0; } }
@keyframes tg-ein { from { opacity: 0; } }
@keyframes tg-wort { from { transform: translateY(108%) rotate(4deg); } }
@keyframes tg-logo { from { opacity: 0; scale: .7; rotate: -10deg; } }
@keyframes tg-rahmen { from { clip-path: inset(9% 9% 9% 9% round 8px); } to { clip-path: inset(0 0 0 0 round 0); } }
@keyframes tg-zoom { from { scale: 1.18; } }
@keyframes tg-zoom-klein { from { scale: 1.08; clip-path: inset(6% 6% 6% 6% round 6px); } to { clip-path: inset(0 0 0 0 round 0); } }
@keyframes tg-pop { from { scale: 0; } }
@keyframes tg-balken { from { scale: 1 1; } }
@keyframes tg-glanz { from { background-position: 135% 0; } to { background-position: -35% 0; } }

/* Reihenfolge im ersten Bildschirm: Zeile (--tg-r), Spalte (--tg-s), Position in der Spalte (--tg-p), Listenpunkt (--tg-k) */
#content .neos-contentcollection > * { --tg-p: 0; }
#content .neos-contentcollection > :nth-child(2) { --tg-p: 1; }
#content .neos-contentcollection > :nth-child(3) { --tg-p: 2; }
#content .neos-contentcollection > :nth-child(4) { --tg-p: 3; }
#content .neos-contentcollection > :nth-child(n+5) { --tg-p: 4; }
#content .grid > .grid__column { --tg-s: 0; }
#content .grid > .grid__column:nth-child(2) { --tg-s: 1; }
#content .grid > .grid__column:nth-child(3) { --tg-s: 2; }
#content .grid > .grid__column:nth-child(n+4) { --tg-s: 3; }
#content > .neos-contentcollection > :nth-child(2) { --tg-r: 1; }
#content > .neos-contentcollection > :nth-child(3) { --tg-r: 2; }
#content > .neos-contentcollection > :nth-child(n+4) { --tg-r: 3; }
#content .product__title ~ .grid > .grid__column > :nth-child(2) { --tg-p: 1; }
#content .product__title ~ .grid > .grid__column > :nth-child(3) { --tg-p: 2; }
#content .product__title ~ .grid > .grid__column > :nth-child(4) { --tg-p: 3; }
#content .product__title ~ .grid > .grid__column > :nth-child(n+5) { --tg-p: 4; }
:is(#content ul.tg-checkliste, #subNavigation > ul > li > ul, #lvl-0, ul.tabs) > li:nth-child(2) { --tg-k: 1; }
:is(#content ul.tg-checkliste, #subNavigation > ul > li > ul, #lvl-0, ul.tabs) > li:nth-child(3) { --tg-k: 2; }
:is(#content ul.tg-checkliste, #subNavigation > ul > li > ul, #lvl-0, ul.tabs) > li:nth-child(4) { --tg-k: 3; }
:is(#content ul.tg-checkliste, #subNavigation > ul > li > ul, #lvl-0, ul.tabs) > li:nth-child(5) { --tg-k: 4; }
:is(#content ul.tg-checkliste, #subNavigation > ul > li > ul, #lvl-0, ul.tabs) > li:nth-child(6) { --tg-k: 5; }
:is(#content ul.tg-checkliste, #subNavigation > ul > li > ul, #lvl-0, ul.tabs) > li:nth-child(7) { --tg-k: 6; }
:is(#content ul.tg-checkliste, #subNavigation > ul > li > ul, #lvl-0, ul.tabs) > li:nth-child(8) { --tg-k: 7; }
:is(#content ul.tg-checkliste, #subNavigation > ul > li > ul, #lvl-0, ul.tabs) > li:nth-child(n+9) { --tg-k: 8; }
#content figure { overflow: hidden; }

@media (prefers-reduced-motion: no-preference) {
  /* 1) Auftakt der Kopfzeile, nur auf der ersten Seite einer Sitzung (sonst html.tg-wieder, Inline-Skript im <head>) */
  html:not(.tg-wieder) #headerbadge #logo img { animation: tg-logo 1.1s var(--tg-feder) .05s backwards; }
  html:not(.tg-wieder) #headerbadge :is(#headSearchForm, #headNotepad, .language-navigation, .tg-kopf-aktionen) {
    animation: tg-runter .8s var(--tg-aus) .25s backwards; }
  html:not(.tg-wieder) #headerbadge #headNotepad { animation-delay: .32s; }
  html:not(.tg-wieder) #headerbadge .language-navigation { animation-delay: .39s; }
  @media (min-width: 1080px) {
    /* Farbbalken des Menüs zeichnen sich von links nach rechts: weiße Abdeckung über dem Balken schrumpft nach rechts */
    html:not(.tg-wieder) #lvl-0 > li { position: relative; }
    html:not(.tg-wieder) #lvl-0 > li::after { content: ""; position: absolute; left: 0; right: 0; bottom: -7px; height: 7px;
      background: #fff; transform-origin: 100% 50%; scale: 0 1; pointer-events: none;
      animation: tg-balken .9s var(--tg-weich) backwards; animation-delay: calc(.2s + var(--tg-k, 0) * 70ms); }
    html:not(.tg-wieder) #lvl-0 > li > a { animation: tg-auf .8s var(--tg-aus) backwards; animation-delay: calc(.15s + var(--tg-k, 0) * 55ms); }
  }

  /* 2) Hauptüberschrift Wort für Wort aus einer Maske (Spans setzt animation.py). Polster und Gegenrand: Umlaute und
        Unterlängen werden nicht abgeschnitten, die Zeilen bleiben gleich hoch. */
  #content h1 .tg-wort { display: inline-block; overflow: hidden; vertical-align: top; padding: .14em .04em .16em; margin: -.14em -.04em -.16em; }
  #content h1 .tg-wort > span { display: inline-block; animation: tg-wort 1s var(--tg-aus) backwards;
    animation-delay: calc(.12s + var(--w, 0) * 60ms); }
  #breadcrumb { animation: tg-ein .9s ease-out .05s backwards; }

  /* 3) Blöcke des ersten Bildschirms steigen nacheinander auf (darunter übernimmt animation.js mit tg-einblenden) */
  #content :is(.neos-nodetypes-headline:not(:has(h1)), .neos-nodetypes-text, .neos-nodetypes-textwithimage, .highlightbox,
      a.tg-btn, a.tg-link, .tg-haendlerbox):not(:is(.neos-nodetypes-textwithimage, .neos-nodetypes-image, .highlightbox,
      .neos-nodetypes-text, .tg-haendlerbox) *),
  #content .product__title ~ .grid > .grid__column > :not(.grid):not(.tg-haendlerbox),
  #content .product__title ~ .grid > .grid__column > .grid > .grid__column {
    --tg-d: calc(.15s + var(--tg-r, 0) * .1s + var(--tg-s, 0) * .08s + var(--tg-p, 0) * .06s);
    animation: tg-auf 1s var(--tg-aus) backwards; animation-delay: var(--tg-d); }
  /* Bilder: von Anfang an sichtbar (zählt für die Ladezeit), Rahmen öffnet sich, Bild zoomt zurück */
  #content .neos-nodetypes-image:not(:is(.neos-nodetypes-textwithimage, .highlightbox) *) {
    --tg-d: calc(.08s + var(--tg-r, 0) * .1s + var(--tg-s, 0) * .08s + var(--tg-p, 0) * .06s); }
  #content .neos-nodetypes-image:not(:is(.neos-nodetypes-textwithimage, .highlightbox) *) figure {
    animation: tg-rahmen 1.5s var(--tg-aus) backwards; animation-delay: var(--tg-d); }
  #content .neos-nodetypes-image:not(:is(.neos-nodetypes-textwithimage, .highlightbox) *) figure :is(img, video) {
    animation: tg-zoom 2s var(--tg-aus) backwards; animation-delay: var(--tg-d); }
  #content .product__title ~ .grid img.imageToZoom { animation: tg-zoom-klein 1.2s var(--tg-aus) .2s backwards; }
  #content .product__title ~ .grid .grid__column + .grid__column > img.imageToZoom { animation-delay: .32s; }
  /* Listen mit Häkchen: Punkte nacheinander, das Häkchen springt auf */
  #content ul.tg-checkliste > li { animation: tg-links .8s var(--tg-aus) backwards;
    animation-delay: calc(var(--tg-d, .3s) + .12s + var(--tg-k, 0) * 70ms); }
  #content ul.tg-checkliste > li::before { animation: tg-pop .55s var(--tg-feder) backwards;
    animation-delay: calc(var(--tg-d, .3s) + .35s + var(--tg-k, 0) * 70ms); }
  /* Haupt-Button: nach dem Aufsteigen läuft einmal ein Lichtstreif darüber */
  html body #content a.tg-btn.tg-btn--primaer:not(:is(.neos-nodetypes-text, .tg-haendlerbox) *) {
    animation: tg-auf 1s var(--tg-aus) backwards, tg-glanz 1.3s var(--tg-weich) backwards;
    animation-delay: var(--tg-d), calc(var(--tg-d) + .9s); }
  /* Seitenleiste der Kategorien und Reiter der Serienseiten */
  #subNavigation > ul > li > a { animation: tg-ein .8s ease-out .1s backwards; }
  #subNavigation > ul > li > ul > li { animation: tg-links .8s var(--tg-aus) backwards; animation-delay: calc(.18s + var(--tg-k, 0) * 40ms); }
  #content .tabgrid ul.tabs > li { animation: tg-auf .8s var(--tg-aus) backwards; animation-delay: calc(.2s + var(--tg-k, 0) * 60ms); }
  #content .tabgrid .tab_container { animation: tg-auf .9s var(--tg-aus) .18s backwards; }

  /* 4) Einblenden beim Scrollen: animation.js setzt tg-einblenden nur auf Blöcke unterhalb des ersten Bildschirms (die
        sind beim Laden nicht zu sehen, also flackert nichts) und tg-sichtbar, sobald sie ins Bild kommen. */
  .tg-einblenden, .tg-einblenden :is(img, video, li, h2), .tg-einblenden li::before { animation: none !important; }
  .tg-einblenden { opacity: 0; translate: 0 48px; transition: opacity .9s cubic-bezier(.33, 1, .68, 1), translate 1.2s var(--tg-aus);
    transition-delay: var(--tg-verzoegerung, 0s); }
  .tg-einblenden.tg-sichtbar { opacity: 1; translate: 0 0; }
  .tg-einblenden figure { clip-path: inset(9% 9% 9% 9% round 8px); transition: clip-path 1.4s var(--tg-aus) var(--tg-verzoegerung, 0s); }
  .tg-einblenden.tg-sichtbar figure { clip-path: inset(0 0 0 0 round 0); }
  .tg-einblenden figure :is(img, video), .tg-einblenden .product__image img { scale: 1.2;
    transition: scale 2s var(--tg-aus) var(--tg-verzoegerung, 0s), transform .6s var(--tg-aus); }
  .tg-einblenden.tg-sichtbar figure :is(img, video), .tg-einblenden.tg-sichtbar .product__image img { scale: 1; }
  .tg-einblenden h2 { clip-path: inset(0 0 100% 0); translate: 0 .6em;
    transition: clip-path 1.1s var(--tg-aus) calc(var(--tg-verzoegerung, 0s) + .08s), translate 1.1s var(--tg-aus) calc(var(--tg-verzoegerung, 0s) + .08s); }
  .tg-einblenden.tg-sichtbar h2 { clip-path: inset(-20% -5% -30% -5%); translate: 0 0; }
  .tg-einblenden ul.tg-checkliste > li { opacity: 0; translate: -28px 0; transition: opacity .7s ease-out, translate .9s var(--tg-aus);
    transition-delay: calc(var(--tg-verzoegerung, 0s) + .2s + var(--tg-k, 0) * 70ms); }
  .tg-einblenden.tg-sichtbar ul.tg-checkliste > li { opacity: 1; translate: 0 0; }
  .tg-einblenden ul.tg-checkliste > li::before { scale: 0; transition: scale .55s var(--tg-feder) calc(var(--tg-verzoegerung, 0s) + .45s + var(--tg-k, 0) * 70ms); }
  .tg-einblenden.tg-sichtbar ul.tg-checkliste > li::before { scale: 1; }

  /* 5) Großes Bild oben (Video der Startseite, Kategoriebild) tritt beim Weiterscrollen zurück: wird kleiner und blasser.
        Scroll-gesteuert ohne JavaScript, nur wo der Browser es kann (Chrome, Edge, Safari 26), sonst ruhig. */
  @supports (animation-timeline: view()) {
    @media (min-width: 750px) {
      #content > .neos-contentcollection > .grid--big:nth-child(-n+2) > .grid__column:first-child .neos-nodetypes-image figure {
        animation: tg-rahmen 1.5s var(--tg-aus) backwards, tg-zurueck linear both;
        animation-delay: var(--tg-d), 0s; animation-timeline: auto, view(); animation-range: normal, exit 0% exit 100%; }
    }
  }
  @keyframes tg-zurueck { to { scale: .9; opacity: .4; } }

  /* 6) Seitenwechsel: alte Seite blendet nach oben aus, neue steigt auf, die Kopfzeile bleibt stehen
        (View Transitions zwischen Seiten: Chrome/Edge 126+, Safari 18.2+, andere wechseln wie bisher) */
  @view-transition { navigation: auto; }
  #header { view-transition-name: tg-kopf; }
  ::view-transition-old(root) { animation: tg-vt-aus .25s var(--tg-weich) both; }
  ::view-transition-new(root) { animation: tg-vt-ein .45s var(--tg-aus) both; }
  ::view-transition-group(tg-kopf) { animation-duration: .3s; }
}
@keyframes tg-vt-aus { to { opacity: 0; translate: 0 -14px; } }
@keyframes tg-vt-ein { from { opacity: 0; translate: 0 22px; } }
@media print {
  .tg-einblenden, .tg-einblenden * { opacity: 1 !important; translate: none !important; scale: none !important; clip-path: none !important; }
  * { animation: none !important; }
}

/* 7) Kacheln: verlinkte Bilder zoomen langsam, Produktkacheln (Serienseiten) heben sich mit Schatten und grünem Text;
      bei Fingertipp eine kurze Druck-Rückmeldung */
#content figure:has(> a) img, #content a.product-links-tile .product__image img {
  transition: transform .9s var(--tg-aus), scale 2s var(--tg-aus) var(--tg-verzoegerung, 0s); }
#content a.product-links-tile .product__image { overflow: hidden; border-radius: 4px; transition: box-shadow .35s var(--tg-aus); }
#content a.product-links-tile .product-links-tile-link { transition: color .2s ease-out; }
#content a.product-links-tile { transition: transform .15s ease-out, translate .45s var(--tg-aus), opacity .9s cubic-bezier(.33, 1, .68, 1); }
#content a.product-links-tile.tg-einblenden { transition: transform .15s ease-out, translate 1.2s var(--tg-aus) var(--tg-verzoegerung, 0s),
  opacity .9s cubic-bezier(.33, 1, .68, 1) var(--tg-verzoegerung, 0s); }
@media (hover: hover) {
  #content a.product-links-tile:hover .product__image { box-shadow: 0 14px 30px rgba(0, 0, 0, .18); }
  #content a.product-links-tile:hover .product-links-tile-link { color: #004e2d; text-decoration: underline; text-underline-offset: 3px; }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  #content figure:has(> a):hover img { transform: scale(1.07); }
  #content a.product-links-tile:hover { translate: 0 -5px; }
  #content a.product-links-tile:hover .product__image img { transform: scale(1.08); }
}
@media (prefers-reduced-motion: no-preference) {
  #content figure > a:active img, #content a.product-links-tile:active { transform: scale(.98); }
}
#content a.product-links-tile:focus-visible { outline: 3px solid #ee7f00; outline-offset: 2px; }

/* 8) Buttons: weiche Übergänge, beim Überfahren angehoben, Haupt-Button mit Lichtstreif, beim Drücken eingedrückt;
      Textlinks schieben den Pfeil nach rechts */
html body :is(#body, #footer, #tg-naechster, #tg-sticky) a.tg-btn.tg-btn,
html body #body button.retailer-search__button, html body #body a.retailer-search__button,
html body #body a.nodepad-add__button, html body #body .nodepad-download__button a.button,
html body #body .tg-haendlerbox__form button.tg-btn--primaer, html body #body .tg-haendler-aktionen a.tg-aktion {
  transition: background-color .2s ease-out, color .2s ease-out, border-color .2s ease-out, box-shadow .3s var(--tg-aus), transform .3s var(--tg-aus),
    opacity .9s cubic-bezier(.33, 1, .68, 1) var(--tg-verzoegerung, 0s), translate 1.2s var(--tg-aus) var(--tg-verzoegerung, 0s);
}
/* Lichtstreif: Bild, Größe und Wiederholung auch im Hover-Zustand, weil buttons.css dort die Kurzform background setzt */
html body :is(#body, #footer, #tg-naechster, #tg-sticky) a.tg-btn.tg-btn--primaer,
html body #body .tg-haendlerbox__form button.tg-btn--primaer,
html body :is(#body, #footer, #tg-naechster, #tg-sticky) a.tg-btn.tg-btn--primaer:hover,
html body #body .tg-haendlerbox__form button.tg-btn--primaer:hover {
  background-image: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .3) 47%, rgba(255, 255, 255, .3) 53%, transparent 70%);
  background-size: 260% 100%; background-repeat: no-repeat; background-position: 135% 0;
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  html body :is(#body, #footer, #tg-naechster, #tg-sticky) a.tg-btn.tg-btn:hover,
  html body #body button.retailer-search__button:hover, html body #body a.retailer-search__button:hover,
  html body #body a.nodepad-add__button:hover, html body #body .tg-haendlerbox__form button.tg-btn--primaer:hover,
  html body #body .tg-haendler-aktionen a.tg-aktion:hover { transform: translateY(-2px); }
  html body :is(#body, #footer, #tg-naechster, #tg-sticky) a.tg-btn.tg-btn--primaer:hover,
  html body #body .tg-haendlerbox__form button.tg-btn--primaer:hover { box-shadow: 0 10px 24px rgba(0, 78, 45, .35);
    transition: background-color .2s ease-out, box-shadow .3s var(--tg-aus), transform .3s var(--tg-aus), background-position .9s var(--tg-weich); }
  html body :is(#body, #footer, #tg-naechster, #tg-sticky) a.tg-btn.tg-btn--primaer.tg-btn--primaer:hover,
  html body #body .tg-haendlerbox__form button.tg-btn--primaer.tg-btn--primaer:hover { background-position: -35% 0; }
  html :is(#body, #footer, #tg-naechster) a.tg-link.tg-link::after { transition: translate .35s var(--tg-aus); }
  html :is(#body, #footer, #tg-naechster) a.tg-link.tg-link:hover::after { translate: 5px 0; }
  #service .serviceicon { transition: translate .35s var(--tg-aus); }
  #service .serviceButton a:hover .serviceicon { translate: 0 -3px; }
}
@media (prefers-reduced-motion: no-preference) {
  html body :is(#body, #footer, #tg-naechster, #tg-sticky) a.tg-btn.tg-btn:active,
  html body #body button.retailer-search__button:active, html body #body a.retailer-search__button:active,
  html body #body a.nodepad-add__button:active, html body #body .tg-haendlerbox__form button.tg-btn--primaer:active,
  html body #body .tg-haendler-aktionen a.tg-aktion:active { transform: translateY(0) scale(.97); }
}

/* 9) Rückmeldung beim Merken: Button und Zähler im Kopf pulsieren, unten erscheint kurz "Hinzugefügt · Mein Merkzettel (n)" */
@keyframes tg-puls { 0% { transform: scale(1); } 40% { transform: scale(1.08); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: no-preference) {
  .tg-puls { animation: tg-puls .5s ease-out; }
}
html body #body a.nodepad-add__button.nodepad-added__button-icon { background: #004e2d; border-color: #004e2d; color: #fff; }
.tg-toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 7000; display: flex; align-items: center;
  gap: 12px; max-width: calc(100vw - 30px); box-sizing: border-box; padding: 12px 18px; border-radius: 6px; background: #004e2d; color: #fff;
  font-size: 18px; line-height: 1.3; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); opacity: 0; transform: translate(-50%, 16px);
  transition: opacity .2s ease-out, transform .2s ease-out; pointer-events: none; }
.tg-toast.tg-zeigen { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.tg-toast .fa { font-size: 22px; }
.tg-toast a { color: #fff; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.tg-toast a:focus-visible { outline: 3px solid #ee7f00; outline-offset: 2px; }
@media (min-width: 1080px) { .tg-toast { bottom: 110px; } }   /* über der Service-Leiste */
@media (prefers-reduced-motion: reduce) { .tg-toast { transition: none; transform: translate(-50%, 0); } }
