/* ===========================================================================
   Notfallpraxis — Anrufleiste (Fassung 7.4, Bauvertrag §2.9, VORGABE-global §4)

   Bis 1024, fest unten, volle Breite, Weiss, oben Haarlinie 22 %, Schatten nach oben.
   64 hoch + Safe-Area, Polster 8 / 16, Lücke 8, Knöpfe 48 (Entscheid 4):
   gefüllt „☎ +41 44 666 95 95“ (füllt) · Kontur „Route ↗“ (umschliesst).
   Geschlossen: gefüllt „Notfallnummern →“ (npz-nur-zu). Variante /zuweiser:
   „Praxis anrufen“ · „HIN-Mail“.
   Weg (nach unten, 200 ms), solange Bühnen-, Anruf-Band-, Standort- oder
   Draht-Knöpfe sichtbar sind, das Mobil-Menü offen ist oder ein Feld den Fokus hat
   (anrufleiste.js). Ohne JavaScript immer da. Unter der ©-Zeile so viel Polster wie
   die Leiste hoch ist, scroll-padding-bottom gleich (WCAG 2.4.11).
   =========================================================================== */

.npz-anrufleiste { display: none; }

@media (max-width: 1024px) {
  html { scroll-padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  /* Platz für die Leiste unter der ©-Zeile (Slate statt eines weissen Streifens unter
     der Fusszeile); die Fusszeile wird nie verdeckt. */
  body.hbl-npz .site-footer .site-info .inside-site-info { padding-bottom: calc(22px + 64px + env(safe-area-inset-bottom, 0px)); }

  body.hbl-npz .npz-anrufleiste {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    display: flex;
    gap: 8px;
    box-sizing: border-box;
    min-height: calc(64px + env(safe-area-inset-bottom, 0px));
    padding: 8px 16px calc(8px + env(safe-area-inset-bottom, 0px));
    background: var(--white);
    border-top: 1px solid var(--npz-linie);
    box-shadow: 0 -8px 24px rgb(41 51 61 / .10);
    transition: transform .2s ease, visibility 0s linear 0s;
  }
  body.hbl-npz .npz-anrufleiste.npz-weg {
    transform: translateY(100%);
    visibility: hidden;
    transition: transform .2s ease, visibility 0s linear .2s;
  }
  /* Mobil-Menü offen: weg, auch quer (die Quer-Regel unten ist 0,3,1, diese 0,3,2).
     `npz-menue-offen` setzt kopf.js (bis 1279) auf <html>, `hbl-menue-offen` das Theme. */
  html:is(.npz-menue-offen, .hbl-menue-offen) body.hbl-npz .npz-anrufleiste { visibility: hidden; }

  body.hbl-npz .npz-anrufleiste-knopf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-sizing: border-box;
    height: 48px;
    padding: 0 16px;
    border: 1.5px solid var(--slate);
    border-radius: var(--hbl-radius, 12px);
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
    white-space: nowrap;
    text-decoration: none;
    color: var(--slate);
    background: transparent;
  }
  body.hbl-npz .npz-anrufleiste-knopf .npz-icon { flex: none; }
  body.hbl-npz .npz-anrufleiste-knopf .npz-icon-nach { margin-left: -4px; }
  body.hbl-npz .npz-anrufleiste-anruf {
    flex: 1 1 auto;
    border-color: var(--npz-bronze);
    background: var(--npz-bronze);
    color: var(--white);
  }
  body.hbl-npz .npz-anrufleiste-anruf:hover { background: var(--npz-bronze-hover); border-color: var(--npz-bronze-hover); color: var(--white); }
  body.hbl-npz .npz-anrufleiste-zweit { flex: 0 0 auto; }
  body.hbl-npz .npz-anrufleiste-zweit:hover { background: #F0F0F0; color: var(--slate); }
}

/* Unter 360: „Route“ nur als Icon, 48 × 48 — sonst lief der Knopf bei 320 über den Rand
   (QA responsive-7). Die Leiste bleibt einzeilig; der Name bleibt „Route (öffnet in neuem
   Tab)“ (Text sichtbar versteckt, nicht entfernt). */
@media (max-width: 359px) {
  body.hbl-npz .npz-anrufleiste-knopf.npz-anrufleiste-route {
    position: relative;
    width: 48px;
    padding: 0;
  }
  body.hbl-npz .npz-anrufleiste-route > span:not(.screen-reader-text) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  body.hbl-npz .npz-anrufleiste-route > .npz-icon-nach { display: none; }
}

/* Telefon quer: Kopf klebt nicht, die Leiste steht von Anfang an (l22). */
@media (max-width: 1024px) and (max-height: 499px) {
  body.hbl-npz .npz-anrufleiste.npz-weg { transform: none; visibility: visible; }
}

@media (prefers-reduced-motion: reduce) {
  body.hbl-npz .npz-anrufleiste,
  body.hbl-npz .npz-anrufleiste.npz-weg { transition: none; }
}
@media print { .npz-anrufleiste, .npz-pille { display: none !important; } }
