/* ==========================================================================
   ProntoSite-Ergänzungen zu Theme-CSS (The7 / WPBakery)
   Ersetzt die JS-abhängigen Theme-Komponenten durch CSS-Lösungen.
   ========================================================================== */

/* ---------- Header: Navigationsleiste bleibt beim Scrollen oben ------------ */
@media screen and (min-width: 991px) {
  .masthead { position: sticky; top: 0; z-index: 500; }
}

/* ---------- Mobile Navigation: Drawer von rechts --------------------------- */
.masthead .mobile-header-bar .dt-mobile-menu-icon {
  border: 0; background: none; padding: 0; cursor: pointer; font: inherit;
}
.tp-drawer-backdrop {
  display: none; position: fixed; inset: 0; z-index: 10000;
  background: rgba(19, 37, 70, .5);
}
.tp-drawer {
  display: none; position: fixed; top: 0; right: 0; bottom: 0; z-index: 10001;
  width: min(330px, 86vw); overflow-y: auto; box-sizing: border-box;
  padding: 70px 30px 40px; background: #fff;
  box-shadow: -10px 0 40px rgba(0, 0, 0, .25);
  transform: translateX(0);
  transition: transform .3s ease, display .3s allow-discrete;
}
body:has([data-tp-menu-toggle][aria-expanded="true"]) .tp-drawer,
body:has([data-tp-menu-toggle][aria-expanded="true"]) .tp-drawer-backdrop { display: block; }
@starting-style {
  body:has([data-tp-menu-toggle][aria-expanded="true"]) .tp-drawer { transform: translateX(100%); }
}
html:has([data-tp-menu-toggle][aria-expanded="true"]) { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .tp-drawer { transition: none; } }
.tp-drawer-close {
  position: absolute; top: 14px; right: 16px; width: 40px; height: 40px;
  border: 0; background: none; cursor: pointer; color: #77c0df;
  font-size: 36px; line-height: 40px; padding: 0;
}
.tp-drawer-close:hover { color: #132546; }
.tp-drawer-menu { list-style: none; margin: 0; padding: 0; }
.tp-drawer-menu li { margin: 0; padding: 0; border-bottom: 1px solid rgba(119, 192, 223, .25); }
.tp-drawer-menu a {
  display: block; padding: 12px 0; text-decoration: none;
  font-family: "Lobster", Helvetica, Arial, sans-serif; font-size: 22px; line-height: 1.3;
  color: #132546;
}
.tp-drawer-menu a:hover,
.tp-drawer-menu .current-menu-item > a { color: #77c0df; }
@media screen and (min-width: 991px) {
  .tp-drawer, .tp-drawer-backdrop { display: none !important; }
}

/* ---------- Galerie (Startseite): Justified Grid ohne JS ------------------- */
.tp-jgrid { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 -2px 30px; }
.tp-jgrid::after { content: ""; flex-grow: 999999; }
.tp-jgrid-item {
  margin: 0; position: relative; overflow: hidden;
  flex-grow: calc(var(--r) * 100); flex-basis: calc(var(--r) * 180px);
}
.tp-jgrid-item img {
  display: block; width: 100%; height: auto; aspect-ratio: var(--r);
  object-fit: cover; cursor: zoom-in; transition: opacity .3s ease;
}
.tp-jgrid-item:hover img, .tp-mgrid-item:hover img { opacity: .8; }

/* ---------- Bildraster (Therapieangebot, BerlingerHof) --------------------- */
.tp-mgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin: 0 0 35px; }
.tp-mgrid-item { margin: 0; overflow: hidden; }
.tp-mgrid-item img {
  display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover;
  cursor: zoom-in; transition: opacity .3s ease;
}
@media screen and (max-width: 479px) { .tp-mgrid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Karussell / Diashow (funktioniert per Wischen auch ohne JS) ---- */
.tp-carousel { position: relative; margin: 0 0 35px; }
.tp-car-track {
  display: flex; gap: 10px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-blocked: smooth; scrollbar-width: none;
}
.tp-car-track::-webkit-scrollbar { display: none; }
.tp-car-item { margin: 0; flex: 0 0 auto; scroll-snap-align: start; }
.tp-car-item img { display: block; width: 100%; height: auto; }
@media (prefers-reduced-motion: reduce) { .tp-car-track { scroll-blocked: auto; } }

/* Mehrspaltig (Qualifizierungsnachweise) */
.tp-carousel--multi .tp-car-track { padding: 15px 0; }
.tp-carousel--multi .tp-car-item { width: calc((100% - 5 * 10px) / 6); }
.tp-carousel--multi .tp-car-item img {
  aspect-ratio: 1 / 1; object-fit: cover; cursor: zoom-in;
  box-shadow: 0 0 12px 3px rgba(0, 0, 0, .1);
}
@media screen and (max-width: 1199px) { .tp-carousel--multi .tp-car-item { width: calc((100% - 4 * 10px) / 5); } }
@media screen and (max-width: 990px)  { .tp-carousel--multi .tp-car-item { width: calc((100% - 3 * 10px) / 4); } }
@media screen and (max-width: 767px)  { .tp-carousel--multi .tp-car-item { width: calc((100% - 2 * 10px) / 3); } }
@media screen and (max-width: 479px)  { .tp-carousel--multi .tp-car-item { width: 100%; } }
.tp-carousel--multi .tp-car-nav button {
  position: absolute; top: 50%; margin-top: -18px; width: 36px; height: 36px; padding: 0;
  border: 0; border-radius: 500px; background: #77c0df; color: #fff; cursor: pointer;
  font-size: 18px; line-height: 36px; text-align: center; z-index: 2;
}
.tp-carousel--multi .tp-car-nav button:hover { color: rgba(255, 255, 255, .75); }
.tp-carousel--multi .tp-car-prev { left: -43px; }
.tp-carousel--multi .tp-car-next { right: -43px; }
@media screen and (max-width: 990px) {
  .tp-carousel--multi .tp-car-prev { left: -10px; }
  .tp-carousel--multi .tp-car-next { right: -10px; }
}

/* Einzelbild-Diashow (Tierphysiotherapie, Zur Person) */
.tp-carousel--slider .tp-car-track { gap: 0; }
.tp-carousel--slider .tp-car-item { width: 100%; }
.tp-carousel--slider .tp-car-item img { aspect-ratio: var(--ar); object-fit: cover; }
.tp-carousel--slider .tp-car-nav {
  position: absolute; right: 15px; bottom: 15px; display: flex; gap: 6px; z-index: 2;
}
.tp-carousel--slider .tp-car-nav button {
  width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, .4); color: #fff; cursor: pointer;
  font-size: 14px; line-height: 30px; text-align: center; position: relative;
}
.tp-carousel--slider .tp-car-nav button:hover { background: rgba(0, 0, 0, .6); }
.tp-car-pause::before, .tp-car-pause::after {
  content: ""; position: absolute; top: 10px; width: 3px; height: 10px; background: #fff;
}
.tp-car-pause::before { left: 11px; }
.tp-car-pause::after { left: 16px; }
.tp-car-pause.is-paused::after { display: none; }
.tp-car-pause.is-paused::before {
  left: 12px; width: 0; height: 0; background: none;
  border-style: solid; border-width: 5px 0 5px 8px; border-color: transparent transparent transparent #fff;
}

/* ---------- Akkordeon: Fallback ohne JS über :target ----------------------- */
.wpb-js-composer .vc_tta.vc_general .vc_tta-panel-body:target { display: block; }
.vc_tta-panel-title > a[data-tp-accordion] { cursor: pointer; }

/* ---------- Footer / Badge -------------------------------------------------- */
#bottom-bar .wf-container-bottom { align-items: center; }
#bottom-bar .wf-float-right { line-height: 1; }

/* Pfeile als CSS-Chevron (kein Icon-Font nötig) */
.tp-car-prev::before, .tp-car-next::before {
  content: ""; position: absolute; top: 50%; left: 50%; width: 8px; height: 8px;
  border: solid currentColor; border-width: 2px 2px 0 0;
}
.tp-car-prev::before { transform: translate(-30%, -50%) rotate(-135deg); }
.tp-car-next::before { transform: translate(-70%, -50%) rotate(45deg); }
.tp-carousel--multi .tp-car-nav button { position: absolute; }
.tp-carousel--slider .tp-car-prev::before, .tp-carousel--slider .tp-car-next::before { width: 6px; height: 6px; }

/* Kurze Seiten (Rechtstexte, Danke, 404): Footer nicht mitten im Bild */
#main { min-height: calc(100vh - 160px); box-sizing: border-box; }

/* ---------- Lightbox-Ersatz (nur lokale Vorschau, live: ProntoSite) ------- */
img[data-ps-zoom] { cursor: zoom-in; }
.tp-lb {
  display: none; position: fixed; inset: 0; z-index: 20000;
  background: rgba(0, 0, 0, .9); align-items: center; justify-content: center;
}
.tp-lb.is-open { display: flex; }
html.tp-lb-lock { overflow: hidden; }
.tp-lb-fig { margin: 0; text-align: center; }
.tp-lb-fig img { display: block; max-width: 92vw; max-height: 86vh; width: auto; height: auto; margin: 0 auto; }
.tp-lb-fig figcaption { color: #fff; font-size: 14px; padding-top: 10px; }
.tp-lb-fig figcaption:empty { display: none; }
.tp-lb button {
  position: absolute; border: 0; background: rgba(255, 255, 255, .12); color: #fff;
  cursor: pointer; border-radius: 50%; width: 44px; height: 44px; padding: 0;
}
.tp-lb button:hover, .tp-lb button:focus-visible { background: rgba(255, 255, 255, .3); outline: none; }
.tp-lb-close { top: 16px; right: 16px; font-size: 30px; line-height: 44px; }
.tp-lb-prev { left: 16px; top: 50%; margin-top: -22px; }
.tp-lb-next { right: 16px; top: 50%; margin-top: -22px; }
.tp-lb-prev::before, .tp-lb-next::before {
  content: ""; position: absolute; top: 50%; left: 50%; width: 10px; height: 10px;
  border: solid #fff; border-width: 2px 2px 0 0;
}
.tp-lb-prev::before { transform: translate(-30%, -50%) rotate(-135deg); }
.tp-lb-next::before { transform: translate(-70%, -50%) rotate(45deg); }
.tp-lb--single .tp-lb-prev, .tp-lb--single .tp-lb-next { display: none; }

/* Startseite: Vorschaubilder im Format 3:2 */
.tp-mgrid--3x2 .tp-mgrid-item img { aspect-ratio: 3 / 2; }

/* Startseite: 4 Spalten, 3:2, nur volle Reihen (unvollständige letzte Reihe ausgeblendet) */
.tp-mgrid--home { grid-template-columns: repeat(4, 1fr); gap: 4px; }
.tp-mgrid--home .tp-mgrid-item:nth-child(n+17) { display: none; }
@media screen and (max-width: 479px) { .tp-mgrid--home { grid-template-columns: repeat(2, 1fr); } }

/* Logo im Papier-Header klickbar (zur Startseite) – Position relativ zum Headerbild */
.paper-item .tp-logo-link {
  position: absolute; left: 10%; top: 12%; width: 18.5%; height: 32%;
  display: block; z-index: 1000;
}

/* Aufzählungen im Inhalt mit Häkchen statt Punkt */
#content .wpb_text_column ul { list-style: none; margin-left: 0; padding-left: 0; }
#content .wpb_text_column ul > li { position: relative; padding-left: 26px; margin-left: 0; list-style: none; }
#content .wpb_text_column ul > li::before {
  content: ""; position: absolute; left: 4px; top: .45em; width: 6px; height: 11px;
  border: solid #77c0df; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}

/* Kontakt: Icons vor Adresse, Termin, Telefon, E-Mail */
#content p.tp-ci { position: relative; padding-left: 30px; }
#content .tp-ci-icon { position: absolute; left: 0; top: .2em; color: #77c0df; line-height: 0; }
#content p.tp-ci a[href^="tel:"] { color: inherit; text-decoration: none; }
#content p.tp-ci a[href^="tel:"]:hover { color: #77c0df; }

/* VFTP-Logo im Papier-Header: öffnet den Nachweis in der Lightbox (unsichtbares Bild über dem Logo) */
.paper-item img.tp-vftp-zoom {
  position: absolute; left: 66%; top: 14%; width: 25%; height: 14%; max-width: none;
  opacity: 0; z-index: 1000; cursor: zoom-in; object-fit: cover;
}

/* Footer rechts: Copyright + Badge in einer Zeile */
#bottom-bar .wf-float-right { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; justify-content: flex-end; }
@media screen and (max-width: 778px) { #bottom-bar .wf-float-right { justify-content: center; } }

/* ---------- ProntoSite Cookie-Banner & Karten-Platzhalter im Look der Website ---------- */
:root, html body .ps-c-banner, html body .ps-c-modal, html body .ps-c-modal-overlay,
html body .ps-c-reopen-fixed, html body .ps-embed-ph {
  --ps-w-font: "Trebuchet MS", Helvetica, Arial, Verdana, sans-serif !important;
  --ps-w-font-headline: "Lobster", Helvetica, Arial, sans-serif !important;
  --ps-w-primary: #77c0df !important;
  --ps-w-on-primary: #132546 !important;
  --ps-w-text: #132546 !important;
  --ps-w-link: #2f7fa6 !important;
  --ps-w-surface: #ffffff !important;
  --ps-w-radius-surface: 6px !important;
  --ps-w-radius-control: 4px !important;
}
html body .ps-c-banner .ps-c-title, html body .ps-c-modal .ps-c-title {
  font-size: 22px !important; font-weight: 400 !important; line-height: 1.2 !important;
  color: #77c0df !important; margin-bottom: 10px !important;
}
html body .ps-c-banner { border-top: 4px solid #77c0df !important; box-shadow: 0 10px 40px rgba(19, 37, 70, .25) !important; }
html body .ps-c-banner .ps-c-btn, html body .ps-c-modal .ps-c-btn { font-weight: 700 !important; transition: background-color .2s, border-color .2s !important; }
html body .ps-c-banner .ps-c-btn-primary:hover, html body .ps-c-modal .ps-c-btn-primary:hover {
  background: #5fb2d6 !important; border-color: #5fb2d6 !important;
}
html body .ps-c-banner .ps-c-btn-ghost:hover, html body .ps-c-modal .ps-c-btn-ghost:hover { border-color: #77c0df !important; }
html body .ps-c-banner .ps-c-actions .ps-c-btn { flex: 1 1 auto; }

/* Papier-Hintergrund über die ganze Seitenhöhe (nicht nur Fensterhöhe) */
body { position: relative; }
.paper.middle { height: auto; bottom: 0; }

/* Mobil: Logos im Papier-Header nicht unter der Menüleiste verstecken
   (Headerbild so weit nach unten schieben, dass die Logos unter der 60px-Leiste beginnen) */
@media screen and (max-width: 815px) {
  body > .paper:not(.middle):not(.bottom) { top: calc(64px - 7.34vw); }
  #main { padding-top: calc(180px + 64px - 7.34vw); }
}
@media screen and (max-width: 778px) { #main { padding-top: calc(160px + 64px - 7.34vw); } }
@media screen and (max-width: 480px) { #main { padding-top: calc(70px + 64px - 7.34vw); } }
@media screen and (max-width: 380px) { #main { padding-top: calc(60px + 64px - 7.34vw); } }

/* ProntoSite-Laufzeit: fälschlich erkannter Slider auf der Startseite – Pfeile und Ausblendung neutralisieren */
.ps-slider-btn { display: none !important; }
[data-ps-behavior="slide"] { display: revert !important; }

/* Papierfläche unter dem Header-Blatt: einfarbig, exakt so breit wie das Blatt
   (statt des gestreckten Theme-PNGs mit weichen, halbtransparenten Rändern) */
.paper.middle .paper-item, .paper.bottom .paper-item {
  background: linear-gradient(#f7f7f7, #f7f7f7) 55.26% 0 / 93.67% 100% no-repeat !important;
}
