/**
 * CFE Tooltip — Foundation
 *
 * Direction A (Ink Slab) — pairs with the cfe-toast ink system.
 * One floating element class (.cfe-tt) driven by a JS helper that binds to
 * [data-cfe-tooltip] triggers. Position is fixed; auto-flip handled in JS.
 *
 * Tokens: --cfe-ds-* (canon namespace; see cfe-styles.css)
 */

.cfe-tt {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px) scale(0.98);
  transition: opacity .14s ease, transform .14s ease;
  max-width: 280px;
  font-family: var(--cfe-ds-font-body);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 400;
  will-change: opacity, transform;
}

.cfe-tt.is-on {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.cfe-tt__inner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--cfe-ds-radius-sm);
  background: var(--cfe-ds-color-ink);
  color: #fff;
  box-shadow:
    0 6px 18px rgba(27, 42, 59, 0.22),
    0 1px 3px  rgba(27, 42, 59, 0.16);
}

.cfe-tt__icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  margin-top: 2px;
  color: var(--cfe-ds-color-sky-border);
}
.cfe-tt__icon svg { width: 14px; height: 14px; }

.cfe-tt__title {
  display: block;
  margin-bottom: 3px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.8;
}

.cfe-tt__body { display: block; }

.cfe-tt__shortcut {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.15);
  font-family: inherit;
  font-size: 11px;
}

.cfe-tt__arrow {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--cfe-ds-color-ink);
}

.cfe-tt[data-side="top"]    .cfe-tt__arrow { bottom: -3px; left: 50%; transform: translateX(-50%) rotate(45deg); }
.cfe-tt[data-side="bottom"] .cfe-tt__arrow { top:    -3px; left: 50%; transform: translateX(-50%) rotate(45deg); }
.cfe-tt[data-side="left"]   .cfe-tt__arrow { right:  -3px; top:  50%; transform: translateY(-50%) rotate(45deg); }
.cfe-tt[data-side="right"]  .cfe-tt__arrow { left:   -3px; top:  50%; transform: translateY(-50%) rotate(45deg); }

/* Alert variant — for genuine warnings/errors */
.cfe-tt--alert .cfe-tt__inner { background: var(--cfe-ds-color-alert); }
.cfe-tt--alert .cfe-tt__arrow { background: var(--cfe-ds-color-alert); }
.cfe-tt--alert .cfe-tt__icon  { color: #fff; }
