/* ===============================
   Glossar: Grundabstände & Anker
   =============================== */
#glossar {
  /* margin-top / scroll-margin-top optional */
  /* scroll-margin-top: 180px; */
}

.glossar-section {
  margin-top: 32px;
  margin-bottom: 9px;

  /* Wichtig:
     - nutzt dynamischen Offset aus JS (CSS-Variable)
     - fällt zurück auf bisherigen Wert, falls JS mal nicht greift */
  scroll-margin-top: var(--anchor-offset, 404px);
}

@media (max-width: 991.98px) {
  .glossar-section {
    scroll-margin-top: var(--anchor-offset, 450px);
  }
}

/* ==========================================
   Buttons: "Mehr Informationen" nur im Glossar
   ========================================== */
#glossar .open-modal-btn.btn-outline-primary.btn-sm {
  font-family: 'Roboto', sans-serif !important;
  font-weight: 500 !important;
  font-size: 0.875rem !important;     /* 14px (btn-sm) */
  line-height: 1.4 !important;

  border: 1px solid #004c97 !important;
  color: #004c97 !important;
  background-color: #fff !important;
  border-radius: 0.25rem !important;

  padding: 0.25rem 0.75rem !important; /* 4px 12px */
  height: 31px !important;             /* fixe Höhe wie Original */
  min-width: 143px !important;         /* fixe Breite wie Original */
  text-align: center;
  transition: all 0.2s ease-in-out;
}

#glossar .open-modal-btn.btn-outline-primary.btn-sm:hover {
  background-color: #004c97 !important;
  color: #fff !important;
  border-color: #004c97 !important;
}

/* ======================================
   Karteninhalte (nur im Glossar-Bereich)
   ====================================== */
#glossar .card .card-text.truncate-text {
  font-family: "Roboto Flex", sans-serif !important;
  font-weight: 500 !important;
}

/* Abstand im Card-Body wiederherstellen */
#glossar .card .card-body {
  padding: 1rem !important;
}

/* Card-Titel im Header */
#glossar .card .card-header .card-title {
  font-size: 1.25rem !important;
  font-family: 'Roboto', sans-serif !important;
  font-weight: 800;
  margin: 0;
  line-height: 1.2;
}

/* =========================================================
   Card-Header Layout (sicher: Share-Button wirklich rechts)
   ========================================================= */
#glossar .card .card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==========================================
   Zielkarten-Highlight (Pulse) bei Ansprung
   – auf #glossar gescopet, damit global nichts
     unerwartet pulst.
   ========================================== */

/* :target-Variante */
#glossar .card[id]:target {
  position: relative;
  animation: cardPulse 1.2s ease-out;
}

/* Klassen-Variante (per JS setz-/entfernbar) */
#glossar .card.is-target {
  position: relative;
  animation: cardPulse 1.2s ease-out;
}

@keyframes cardPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 76, 151, 0.35);
    outline: 2px solid #004c97;
    outline-offset: 2px;
  }
  40% {
    box-shadow: 0 0 0 12px rgba(0, 76, 151, 0.16);
    outline: 2px solid #004c97;
  }
  70% {
    box-shadow: 0 0 0 4px rgba(0, 76, 151, 0.10);
    outline: 1px solid rgba(0, 76, 151, 0.5);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 76, 151, 0);
    outline: none;
  }
}

/* =========================================================
   SHARE BUTTON (24x24) + TOOLTIP
   ========================================================= */

/* Share-Button im Card-Header */
.card-header .share-card-btn {
  /* Button ganz nach rechts */
  margin-left: auto;

  /* Layout */
  display: inline-flex;
  align-items: center;
  justify-content: center;

  /* Größe */
  width: 24px;
  height: 24px;

  /* Optik im blauen Header */
  border: 1px solid rgba(255,255,255,0.55);
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
  color: #fff;

  /* Wichtig: keine Innenabstände, sonst wird es bei 24px “eng” */
  padding: 0;

  /* Interaktion */
  cursor: pointer;
  transition: transform .12s ease, background-color .12s ease, border-color .12s ease;
}

.card-header .share-card-btn:hover {
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.75);
  transform: translateY(-1px);
}

.card-header .share-card-btn:active {
  transform: translateY(0);
}

/* Icon-Größe im Button */
.card-header .share-card-btn i {
  font-size: 14px;
  line-height: 1;
}

/* Optional: schöner Fokus-Ring für Tastatur */
.card-header .share-card-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.35);
}

/* ---------------------------------------------------------
   Tooltip (kleines “Bubbles” direkt am Icon)
   --------------------------------------------------------- */
.share-tooltip {
  position: fixed;            /* fixed = unabhängig von Container-Overflow */
  z-index: 9999;

  /* Tooltip-Look */
  background: rgba(0,0,0,0.82);
  color: #fff;
  font-family: "Roboto Flex", "Roboto", sans-serif;
  font-size: 12px;
  line-height: 1;
  padding: 8px 10px;
  border-radius: 10px;

  /* Startzustand: unsichtbar */
  opacity: 0;
  transform: translateY(4px) scale(0.98);
  pointer-events: none;

  /* Animation */
  transition: opacity .12s ease, transform .12s ease;
  white-space: nowrap;
}

/* Sichtbar-Zustand */
.share-tooltip.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Kleiner Pfeil */
.share-tooltip::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  background: rgba(0,0,0,0.82);
  transform: rotate(45deg);
}

/* Pfeil je nach Position (wir nutzen standardmäßig "top") */
.share-tooltip[data-placement="top"]::after {
  left: 50%;
  bottom: -5px;
  transform: translateX(-50%) rotate(45deg);
}

.share-tooltip[data-placement="bottom"]::after {
  left: 50%;
  top: -5px;
  transform: translateX(-50%) rotate(45deg);
}

/* =========================================================
   OPTIONAL: Highlight beim Ankommen via #hash
   ========================================================= */
.share-highlight {
  outline: 3px solid rgba(0, 76, 151, 0.35);
  outline-offset: 3px;
  border-radius: 12px;
  transition: outline-color .25s ease;
}

/* =========================================================
   Deep-Link Offset auch für Karten (wenn direkt #cardId)
   - nutzt dieselbe JS-Variable wie die H2-Überschriften
   - fallback = wie oben (404/450), falls JS nicht greift
   ========================================================= */
#glossar .card.h-100 {
  scroll-margin-top: var(--anchor-offset, 404px);
}

@media (max-width: 991.98px) {
  #glossar .card.h-100 {
    scroll-margin-top: var(--anchor-offset, 450px);
  }
}