/* ============================================================
   Contact-Bar (Schnellkontakt-Leiste)
   1:1-Uebertragung des Sticky Contact-Bar aus dem Prototyp
   (jp-proto -> .contact-bar).

   Position: an der rechten Bildschirmkante, vertikal zentriert.
   Inhalt und Reihenfolge (Anrufen, E-Mail, Instagram, WhatsApp)
   kommen aus dem Customizer, die Icons aus jp_footer_icon().
   ============================================================ */
.contact-bar {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  background: var(--wp--preset--color--primary);
  box-shadow: -4px 0 16px rgba(3, 24, 42, 0.2);
}
.contact-bar *,
.contact-bar *::before,
.contact-bar *::after {
  box-sizing: border-box;
}
.contact-bar a {
  color: inherit;
  text-decoration: none;
}
.contact-bar.has-text-color {
  color: inherit;
}

.contact-bar a {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: var(--wp--preset--color--ivory);
  transition: all 0.25s ease;
}

.contact-bar a:not(:last-child) {
  border-bottom: 1px solid rgba(189, 144, 18, 0.2);
}

.contact-bar a:hover,
.contact-bar a:focus-visible {
  background: var(--wp--preset--color--accent);
  color: var(--wp--preset--color--primary-deep);
}

.contact-bar a:focus-visible {
  outline: 1px solid var(--wp--preset--color--accent);
  outline-offset: -1px;
}

.contact-bar a svg {
  width: 20px;
  height: 20px;
}

/* Tooltip: Blendet den data-label-Text links neben dem Icon ein. */
.contact-bar a::after {
  content: attr(data-label);
  position: absolute;
  right: calc(100% + 0.75rem);
  top: 50%;
  transform: translateY(-50%);
  background: var(--wp--preset--color--primary-deep);
  color: var(--wp--preset--color--ivory);
  padding: 0.4rem 0.75rem;
  font-family: var(--wp--preset--font-family--montserrat);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.contact-bar a:hover::after,
.contact-bar a:focus-visible::after {
  opacity: 1;
  transform: translateY(-50%) translateX(-4px);
}

@media (max-width: 640px) {
  .contact-bar a::after {
    display: none;
  }
}
@media (max-width: 640px) {
  .contact-bar {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    transform: none;
    flex-direction: row;
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -2px 12px rgba(3, 24, 42, 0.2);
  }
  .contact-bar a {
    flex: 1 1 0;
    width: auto;
    height: 44px;
  }
  .contact-bar a:not(:last-child) {
    border-bottom: 0;
    border-right: 1px solid rgba(189, 144, 18, 0.2);
  }
  body:has(.contact-bar) {
    padding-bottom: calc(44px + env(safe-area-inset-bottom, 0));
  }
}