/* SEÑAL — Glosario tooltip compartido */
/* Incluir en todos los artículos: <link rel="stylesheet" href="glosario-tooltip.css"> */

.glos-link {
  color: #1a6ebb;
  text-decoration: none;
  border-bottom: 1px dashed rgba(26,110,187,0.45);
  position: relative;
  cursor: help;
  transition: border-color 0.15s, color 0.15s;
}
.glos-link:hover {
  color: #1254a4;
  border-bottom-color: rgba(26,110,187,0.9);
}

/* Tooltip box */
.glos-link::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: #0d0c0b;
  color: #e8e6df;
  font-family: 'DM Mono', monospace;
  font-style: normal;
  font-weight: 400;
  font-size: 0.72rem;
  line-height: 1.55;
  padding: 0.65rem 0.9rem;
  border: 1px solid #2a2a26;
  border-left: 2px solid #d4f060;
  width: 230px;
  z-index: 500;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  white-space: normal;
  text-align: left;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

/* Arrow */
.glos-link::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #2a2a26;
  z-index: 501;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}

.glos-link:hover::after,
.glos-link:hover::before,
.glos-link.tip-visible::after,
.glos-link.tip-visible::before {
  opacity: 1;
}

/* Flip tooltip below when near top of viewport */
.glos-link.tip-below::after {
  bottom: auto;
  top: calc(100% + 10px);
}
.glos-link.tip-below::before {
  bottom: auto;
  top: calc(100% + 4px);
  border-top-color: transparent;
  border-bottom-color: #2a2a26;
}

/* Pequeño indicador visual "ver en glosario" */
.glos-link::after {
  /* append a footer note inside the tooltip */
}

/* Adaptación para fondos oscuros (index.html) */
.glos-link-light {
  border-bottom-color: rgba(255,255,255,0.3);
}
.glos-link-light:hover {
  border-bottom-color: rgba(212,240,96,0.7);
}
