/* „Frag Tanja“: schwebender Kontaktknopf unten rechts, öffnet die Auswahl der Kontaktwege.
   Bewegung aus der Fotografie: Knopf und Karte stellen scharf (Unschärfe → scharf), der AF-Rahmen rastet ein. */
.ft {
  position: fixed; right: var(--seite, calc(var(--rand, 28px) + 22px)); bottom: calc(var(--rand, 28px) + env(safe-area-inset-bottom, 0px)); z-index: 52;
  display: flex; flex-direction: column; align-items: flex-end; gap: 12px;
  font-family: "Inter", sans-serif; color: var(--schwarz, #121212);
  pointer-events: none;   /* der Container reserviert Platz für die Karte, darf aber keine Klicks schlucken */
  transition: opacity .35s ease, filter .35s ease, transform .35s ease, bottom .45s cubic-bezier(.2,.7,.2,1);
}
.ft.ft-weg { opacity: 0; filter: blur(6px); transform: translateY(10px); pointer-events: none; }
.ft.ft-wartet { opacity: 0; filter: blur(8px); pointer-events: none; transition: none; }
.ft-knopf, .ft-karte { pointer-events: auto; }   /* geschlossene Karte ist per visibility nicht klickbar */
.ft.ft-weg > *, .ft.ft-wartet > * { pointer-events: none; }

/* ---------- Knopf ---------- */
.ft-knopf {
  display: inline-flex; align-items: center; gap: 14px; height: 58px; padding: 0 22px 0 7px;
  background: var(--schwarz, #121212); color: var(--papier, #F5F2ED);
  border: 1px solid rgba(245,242,237,.16); border-radius: 15px; cursor: pointer;
  box-shadow: 0 16px 34px -16px rgba(18,18,18,.6);
  font: 600 15px/1 "Inter", sans-serif; letter-spacing: .12em; text-transform: uppercase;
  transition: background-color .2s;
}
.ft-knopf:hover { background: #000; }
.ft-knopf:focus-visible, .ft-weg:focus-visible, .ft-zu:focus-visible { outline: 2px solid var(--rot, #E5322D); outline-offset: 3px; }
.ft-bild { position: relative; flex: none; width: 44px; height: 44px; }
.ft-bild img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }

/* AF-Rahmen: vier Ecken um das Porträt, rasten beim Hover bzw. beim Öffnen ein */
.ft-af { position: absolute; inset: -6px; pointer-events: none; opacity: 0; transform: scale(1.25); transition: opacity .2s, transform .3s cubic-bezier(.2,.8,.2,1); color: var(--rot-hell, #FF4438); }
.ft-af i { position: absolute; width: 10px; height: 10px; border: 0 solid currentColor; }
.ft-af i:nth-child(1) { left: 0; top: 0; border-left-width: 2px; border-top-width: 2px; }
.ft-af i:nth-child(2) { right: 0; top: 0; border-right-width: 2px; border-top-width: 2px; }
.ft-af i:nth-child(3) { left: 0; bottom: 0; border-left-width: 2px; border-bottom-width: 2px; }
.ft-af i:nth-child(4) { right: 0; bottom: 0; border-right-width: 2px; border-bottom-width: 2px; }
.ft-knopf:hover .ft-af, .ft-offen .ft-knopf .ft-af { opacity: 1; transform: none; }

/* ---------- Karte mit den Kontaktwegen ---------- */
.ft-karte {
  width: min(368px, calc(100vw - 24px)); padding: 18px; box-sizing: border-box;
  background: var(--papier, #F5F2ED); border-radius: 18px;
  box-shadow: 0 34px 64px -26px rgba(18,18,18,.55), 0 0 0 1px rgba(18,18,18,.08);
  transform-origin: 100% 100%;
  visibility: hidden; opacity: 0; filter: blur(10px); transform: translateY(10px) scale(.97);
  transition: opacity .3s ease, filter .4s ease, transform .4s cubic-bezier(.2,.8,.2,1), visibility 0s linear .4s;
}
.ft-offen .ft-karte { visibility: visible; opacity: 1; filter: none; transform: none; transition-delay: 0s; }

.ft-kopf { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 2px 2px 16px; margin-bottom: 8px; border-bottom: 1px solid rgba(18,18,18,.1); }
.ft-kopf .ft-bild { width: 56px; height: 56px; }
.ft-kopf .ft-bild img { border-radius: 12px; }
.ft-kopf .ft-af { color: var(--rot, #E5322D); }
.ft-offen .ft-kopf .ft-af { opacity: 1; transform: none; transition-delay: .25s; }
.ft-titel { margin: 0; font-size: 17px; font-weight: 750; line-height: 1.25; }
.ft-rolle { margin: 3px 0 0; font-size: 14px; line-height: 1.4; color: rgba(18,18,18,.65); }
.ft-rolle span { display: block; }
.ft-zu { display: grid; place-items: center; width: 40px; height: 40px; margin: -6px -6px 0 0; align-self: start; border: 0; border-radius: 10px; background: none; color: inherit; cursor: pointer; transition: background-color .2s; }
.ft-zu:hover { background: var(--flaeche, #E9E4DC); }
.ft-zu svg { width: 20px; height: 20px; }

.ft-wege { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ft-weg { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; align-items: center; padding: 9px; border-radius: 12px; color: inherit; text-decoration: none; transition: background-color .2s; }
.ft-weg:hover { background: var(--flaeche, #E9E4DC); }
.ft-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--schwarz, #121212); color: var(--papier, #F5F2ED); transition: background-color .2s; }
.ft-weg:hover .ft-icon { background: var(--rot, #E5322D); }
.ft-icon svg { width: 20px; height: 20px; }
.ft-icon .linie { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ft-icon .flaeche { fill: currentColor; }
.ft-weg-name { display: block; font-size: 16px; font-weight: 700; line-height: 1.3; }
.ft-weg-wert { display: block; font-size: 15px; line-height: 1.35; color: rgba(18,18,18,.68); overflow-wrap: anywhere; }

/* Artikelseiten mobil: über der Lesefortschritts-Leiste bleiben */
body:has(.ar-leiste.sichtbar) .ft { bottom: calc(12px + env(safe-area-inset-bottom, 0px) + var(--ft-leiste, 64px) + 12px); }

@media (max-width: 767px) {
  .ft.ft-nur-desktop { display: none; }   /* Schalter AUF_HANDY_ANZEIGEN in frag-tanja.js */
  /* Knopfmitte bei etwa 75 % der Bildschirmhöhe, damit er nicht am unteren Rand klebt */
  .ft, body:has(.ar-leiste.sichtbar) .ft { right: 12px; bottom: calc(25svh - 27px); gap: 10px; }
  .ft-karte { max-height: calc(75svh - 100px); overflow-y: auto; overscroll-behavior: contain; }
  .ft-knopf { height: 54px; padding: 0 18px 0 6px; gap: 12px; font-size: 14px; }
  .ft-bild { width: 42px; height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  .ft, .ft-karte, .ft-af { transition: none; filter: none; }
}
