/* =========================================================
   LeiKit - Info-Hinweis im Footer (Untere Leiste, Divi)
   Styleguide v1.1, Oktober 2026
   Einfuegen: Design, Customizer, Zusaetzliches CSS
   (oder Divi, Theme-Optionen, Allgemein, Benutzerdefiniertes CSS)
   ========================================================= */

/* ---------- Footer-Zeile: Abstaende und gemeinsame Grundlinie ---------- */
body #footer-bottom #footer-info {
  position: relative;          /* Bezugsrahmen fuer die mobile Darstellung */
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;       /* alle Eintraege auf einer Hoehe */
  column-gap: 1.75em;          /* Abstand zwischen den Eintraegen */
  row-gap: 0.35em;             /* Abstand, wenn am Handy umbrochen wird */
}

@media (max-width: 980px) {
  body #footer-bottom #footer-info {
    justify-content: center;   /* Divi zentriert den Footer ab Tablet */
  }
}

/* ---------- Ausloeser: sieht aus wie die Footer-Links ---------- */
.lk-info {
  position: relative;
  display: inline-block;
  vertical-align: baseline;
}

.lk-info__ausloeser,
body #footer-info .lk-info__ausloeser {
  display: inline;             /* Text bleibt auf der Grundlinie der anderen Links */
  margin: 0;
  padding: 0;
  font: inherit;            /* Roboto, 18 px wie der Footer */
  line-height: inherit;
  font-weight: 400;
  color: #6D37F1;           /* Primary, wie Impressum/Datenschutz */
  background: none;
  border: 0;
  border-radius: 4px;
  box-shadow: none;
  text-decoration: none;
  cursor: help;
  transition: opacity 0.4s ease-in-out;   /* wie Divi-Footer-Links */
  -webkit-appearance: none;
  appearance: none;
}

/* Info-Icon (Kreis mit i), faerbt sich ueber currentColor mit */
.lk-info__ausloeser::before {
  content: "";
  display: inline-block;
  width: 0.85em;               /* etwas kleiner als die Schrift */
  height: 0.85em;
  margin-right: 0.35em;
  vertical-align: -0.1em;      /* optisch mittig zur Textzeile */
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M12 11v6' stroke='black' stroke-width='2.2' stroke-linecap='round'/%3E%3Ccircle cx='12' cy='7.5' r='1.4' fill='black'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='10' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='M12 11v6' stroke='black' stroke-width='2.2' stroke-linecap='round'/%3E%3Ccircle cx='12' cy='7.5' r='1.4' fill='black'/%3E%3C/svg%3E") center / contain no-repeat;
}

.lk-info__ausloeser:hover {
  opacity: 0.7;             /* gleicher Hover wie die anderen Footer-Links */
}

.lk-info__ausloeser:focus {
  outline: none;
}

.lk-info__ausloeser:focus-visible {
  outline: 3px solid #CDBDFF;   /* Primary pastell */
  outline-offset: 3px;
}

/* ---------- Info-Text: eigenes Styling ---------- */
.lk-info__text {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  z-index: 1000;
  box-sizing: border-box;
  width: max-content;
  max-width: min(340px, calc(100vw - 32px));
  padding: 16px 20px;
  font-family: "Roboto VariableFont", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
  color: #FFFFFF;               /* Weiss auf Primary dunkel, Kontrast ab 6 : 1 */
  background-color: #63568F;    /* Primary dunkel */
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(28, 27, 32, 0.18);
  white-space: normal;
  pointer-events: none;

  /* Nur optisch ausgeblendet: Screenreader lesen den Text weiterhin
     direkt nach dem Link vor (WordPress entfernt aria-describedby). */
  opacity: 0;
  transform: translate(-50%, 6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

/* Pfeil nach unten zum Ausloeser */
.lk-info__text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -8px;
  border: 8px solid transparent;
  border-top-color: #63568F;
}

/* Unsichtbare Bruecke, damit der Text beim Ueberfahren offen bleibt */
.lk-info__text::before {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 16px;
}

/* Fett und Links innerhalb des Info-Texts */
.lk-info__text strong {
  font-weight: 600;
}

.lk-info__text a,
#footer-info .lk-info__text a {
  color: #FFFFFF !important;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Anzeigen: bei Hover, bei Tastatur-Fokus und beim Antippen am Handy */
.lk-info:hover .lk-info__text,
.lk-info:focus-within .lk-info__text {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

/* ---------- Mobil: volle Breite ueber der Footer-Zeile ---------- */
@media (max-width: 767px) {
  .lk-info {
    position: static;
  }

  .lk-info__text,
  .lk-info:hover .lk-info__text,
  .lk-info:focus-within .lk-info__text {
    left: 0;
    right: 0;
    bottom: calc(100% + 10px);
    width: auto;
    max-width: none;
    transform: none;
  }

  .lk-info__text::after {
    display: none;
  }
}

/* Weniger Bewegung, wenn im System eingestellt */
@media (prefers-reduced-motion: reduce) {
  .lk-info__ausloeser,
  .lk-info__text,
  .lk-info:hover .lk-info__text,
  .lk-info:focus-within .lk-info__text {
    transition: none;
  }
}
