/* ==========================================================================
   feature-tooltips.css -- inline game-term icons + hover popovers (gt-)
   ========================================================================== */

/* ---- Inline term wrapper ------------------------------------------------ */

.gt {
  position: relative;
  display: inline;
  cursor: help;
  white-space: nowrap;
}

/* Subtle underline so decorated terms are discoverable */
.gt .gt-text {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: var(--color-gold-700);
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

/* ---- Inline icon -------------------------------------------------------- */

.gt-icon {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 1px solid var(--color-gold-700);
  vertical-align: text-bottom;
  margin-right: 2px;
  display: inline;
  object-fit: cover;
  background: var(--color-bg);
}

/* ---- Popover (hidden by default, shown on hover) ----------------------- */

.gt-tip {
  display: none;
  position: fixed;
  z-index: 1000;
  width: max-content;
  max-width: 280px;
  padding: 10px 12px;
  background: var(--color-surface-1);
  border: 1px solid var(--color-gold-700);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  text-align: left;
  white-space: normal;
  line-height: 1.4;
}

/* Arrow at bottom of popover */
.gt-tip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: var(--arrow-left, 50%);
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--color-gold-700);
}

/* Show on focus for keyboard/touch accessibility (hover handled by JS) */
.gt:focus-within > .gt-tip {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ---- Popover internals -------------------------------------------------- */

.gt-tip-img {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  border: 1px solid var(--color-gold-700);
  background: var(--color-bg);
  flex: 0 0 auto;
  align-self: flex-start;
  object-fit: cover;
}

.gt-tip-head {
  font-family: var(--font-display);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-gold-200);
  line-height: 1.3;
}

.gt-tip-desc {
  font-size: var(--font-size-xs);
  color: var(--color-text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- Type-specific accent colours --------------------------------------- */

.gt-ability .gt-tip {
  border-color: var(--color-hextech);
}
.gt-ability .gt-tip::after {
  border-top-color: var(--color-hextech);
}

.gt-item .gt-tip {
  border-color: var(--color-gold);
}
.gt-item .gt-tip::after {
  border-top-color: var(--color-gold);
}

.gt-rune .gt-tip {
  border-color: #6b7ddf;
}
.gt-rune .gt-tip::after {
  border-top-color: #6b7ddf;
}

.gt-summoner .gt-tip {
  border-color: #4ecdc4;
}
.gt-summoner .gt-tip::after {
  border-top-color: #4ecdc4;
}

/* ---- Responsive --------------------------------------------------------- */

@media (max-width: 768px) {
  .gt-tip {
    max-width: 220px;
    padding: 8px 10px;
    font-size: var(--font-size-xs);
  }

  .gt-tip-img {
    width: 24px;
    height: 24px;
  }

  /* On mobile/touch, the hover is less useful -- make the icon slightly
     larger so tapping is easier; the popover shows on :focus-within */
  .gt-icon {
    width: 18px;
    height: 18px;
  }
}

/* ---- Print: strip interactive parts ------------------------------------ */

@media print {
  .gt-tip {
    display: none !important;
  }
  .gt .gt-text {
    text-decoration: none;
  }
}
