/* Abireg NER — стили разметки сущностей */

/* Базовая ссылка сущности */
.ner-entity {
  position: relative;
  display: inline;
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
  cursor: pointer;
}

/* Цвета по типу */
.ner-entity.ner-person  { color: #1a6ed8; }
.ner-entity.ner-company { color: #0a7c4b; }
.ner-entity.ner-gov     { color: #8b4513; }

/* Повторные упоминания — без нижней черты, только цвет */
.ner-entity.ner-repeat {
  border-bottom: none;
  text-decoration: none;
}

/* Tooltip */
.ner-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  padding: 10px 14px;
  min-width: 180px;
  max-width: 260px;
  white-space: normal;
  text-align: left;
  pointer-events: none;
  font-size: 13px;
  line-height: 1.4;
}

/* Стрелка tooltip */
.ner-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #fff;
}
.ner-tooltip::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: #e0e0e0;
}

/* Показываем tooltip на hover (desktop) */
@media (hover: hover) {
  .ner-entity[data-ner-slug]:hover .ner-tooltip {
    display: block;
    pointer-events: auto;
  }
}

/* Показываем tooltip при .ner-active (мобильные) */
.ner-entity.ner-active .ner-tooltip {
  display: block;
  pointer-events: auto;
}

.ner-tooltip-label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #999;
  margin-bottom: 3px;
}

.ner-tooltip-name {
  display: block;
  font-weight: 600;
  color: #222;
  margin-bottom: 6px;
}

.ner-tooltip-link {
  display: inline-block;
  font-size: 12px;
  color: #1a6ed8;
  text-decoration: none;
  border-bottom: none !important;
}
.ner-tooltip-link:hover {
  text-decoration: underline;
}

/* Мобильные: tooltip снизу если нет места сверху */
@media (max-width: 767px) {
  .ner-tooltip {
    bottom: auto;
    top: calc(100% + 6px);
    max-width: 220px;
  }
  .ner-tooltip::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: #fff;
  }
  .ner-tooltip::before {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: #e0e0e0;
  }
}
