/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   Ligo Info Icon — pulsing blue (?) with hover/tap tooltip
   Single source of truth. Linked from every Ligo-built site.
   Pair with /assets/js/ligo-info-icon.js
   Updated 2026-05-12 — David: blue pulse, draw the eye.

   Canonical markup:
     <span class="ligo-info-icon" data-tooltip="Explanation goes here">
       <span class="ligo-info-icon-marker">?</span>
     </span>

   Also supports <button class="ligo-info-icon" data-tooltip="...">.
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

:root {
  --ligo-info-blue:        #2563EB;   /* trust-blue, brand-cohesive */
  --ligo-info-blue-glow:   rgba(37, 99, 235, 0.55);
  --ligo-info-blue-soft:   rgba(37, 99, 235, 0.18);
  --ligo-info-blue-border: rgba(96, 165, 250, 0.65);
  --ligo-info-tip-bg:      #0A1628;
  --ligo-info-tip-border:  rgba(96, 165, 250, 0.42);
  --ligo-info-tip-text:    #F0F4F8;
}

/* ─── The icon itself ─────────────────────────────────────────────── */
.ligo-info-icon {
  /* Touch target: 40x40 minimum even though the visible disc is ~18px */
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  /* Pull the touch target back so the visual sits flush with surrounding text */
  margin: -11px -11px -11px -7px;
  padding: 0;
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  vertical-align: middle;
  -webkit-tap-highlight-color: transparent;
  appearance: none;
  font: inherit;
}

.ligo-info-icon:focus { outline: none; }
.ligo-info-icon:focus-visible .ligo-info-icon-marker {
  outline: 2px solid var(--ligo-info-blue);
  outline-offset: 2px;
}

/* The visible blue disc with the "?" glyph */
.ligo-info-icon .ligo-info-icon-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ligo-info-blue);
  color: #FFFFFF;
  font-family: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  border: 1px solid var(--ligo-info-blue-border);
  box-shadow: 0 0 0 0 var(--ligo-info-blue-glow);
  transition:
    transform 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease,
    -webkit-transform 0.18s ease;
  -webkit-transform: scale(1);
  transform: scale(1);
  pointer-events: none;       /* let clicks bubble to the .ligo-info-icon */
  user-select: none;
  -webkit-user-select: none;
}

/* ─── The pulse — 2-second cycle, opacity 1.0 → ~0.7, soft glow ring ─ */
@keyframes ligoInfoPulse {
  0%   { opacity: 1.0; box-shadow: 0 0 0 0   var(--ligo-info-blue-glow); }
  50%  { opacity: 0.7; box-shadow: 0 0 0 6px rgba(37, 99, 235, 0);       }
  100% { opacity: 1.0; box-shadow: 0 0 0 0   rgba(37, 99, 235, 0);       }
}

.ligo-info-icon .ligo-info-icon-marker {
  -webkit-animation: ligoInfoPulse 2s ease-in-out infinite;
          animation: ligoInfoPulse 2s ease-in-out infinite;
}

/* Hover (desktop) and active (tap) — stop the pulse, scale up */
.ligo-info-icon:hover .ligo-info-icon-marker,
.ligo-info-icon[data-active="true"] .ligo-info-icon-marker {
  -webkit-animation: none;
          animation: none;
  -webkit-transform: scale(1.10);
  transform: scale(1.10);
  opacity: 1;
  background: var(--ligo-info-blue);
  box-shadow: 0 0 0 4px var(--ligo-info-blue-soft);
}

/* Respect reduced-motion users — kill the pulse, keep the icon */
@media (prefers-reduced-motion: reduce) {
  .ligo-info-icon .ligo-info-icon-marker {
    -webkit-animation: none;
            animation: none;
  }
}

/* ─── The floating tooltip (one singleton injected by the JS) ──────── */
.ligo-info-tooltip {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 9999;
  max-width: 280px;
  padding: 10px 13px;
  background: var(--ligo-info-tip-bg);
  color: var(--ligo-info-tip-text);
  border: 1px solid var(--ligo-info-tip-border);
  border-radius: 10px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0;
  text-align: left;
  text-transform: none;
  white-space: normal;
  box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 150ms ease-out, visibility 150ms;
  /* Tooltips never leave the viewport — JS clamps the left/top */
}

.ligo-info-tooltip[data-active="true"] {
  opacity: 1;
  visibility: visible;
  transition: opacity 200ms ease-out, visibility 200ms;
}

/* Little arrow that flips based on data-pos */
.ligo-info-tooltip::after {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  left: var(--ligo-arrow-x, 50%);
  transform: translateX(-50%);
  border: 6px solid transparent;
}
.ligo-info-tooltip[data-pos="top"]::after {
  top: 100%;
  border-top-color: var(--ligo-info-tip-bg);
}
.ligo-info-tooltip[data-pos="bottom"]::after {
  bottom: 100%;
  border-bottom-color: var(--ligo-info-tip-bg);
}

/* Desktop gets a wider tip */
@media (min-width: 720px) {
  .ligo-info-tooltip { max-width: 360px; font-size: 13px; }
}

/* iOS Safari: ensure the pulse runs (some old WebKits drop unprefixed keyframes) */
@supports (-webkit-touch-callout: none) {
  .ligo-info-icon .ligo-info-icon-marker {
    -webkit-animation: ligoInfoPulse 2s ease-in-out infinite;
  }
}
