/* Reference tooltip styles — interactive version */

.ref-tooltip-trigger {
  cursor: help;
  color: #8b2c1a;
  transition: color 0.15s;
}
.ref-tooltip-trigger:hover {
  color: #a0361f;
}

/* Tooltip container */
.ref-tooltip {
  position: absolute;
  z-index: 10000;
  background: #1a1a1a;
  color: #f0ebe3;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  max-width: 420px;
  width: max-content;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: auto;
  font-family: 'DM Sans', sans-serif;
}
.ref-tooltip-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Content area */
.ref-tooltip-content {
  padding: 12px 16px;
  font-size: 0.78rem;
  line-height: 1.55;
  font-weight: 400;
  font-style: normal;
}
.ref-tooltip-content em {
  font-style: italic;
}
.ref-tooltip-num {
  color: #8b2c1a;
  font-weight: 700;
}

/* Links bar */
.ref-tooltip-links {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 8px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}
.ref-tooltip-link {
  font-size: 0.72rem;
  font-weight: 500;
  color: #d4cfc8;
  text-decoration: none;
  transition: color 0.15s;
  white-space: nowrap;
}
.ref-tooltip-link:hover {
  color: #fff;
}
.ref-tooltip-link-ext {
  color: #c9a96e;
}
.ref-tooltip-link-ext:hover {
  color: #e8c98a;
}

/* Return bar (shown on vol3 when coming from another volume) */
.ref-return-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #1a1a1a;
  padding: 12px 24px;
  text-align: center;
  z-index: 10001;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.2);
}
.ref-return-bar-visible {
  transform: translateY(0);
}
.ref-return-link {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: #f0ebe3;
  text-decoration: none;
  padding: 6px 20px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  transition: background 0.15s, border-color 0.15s;
}
.ref-return-link:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.4);
}

/* Anchor highlight animation */
@keyframes anchor-flash {
  0%, 30% { background-color: rgba(139,44,26,0.2); }
  100% { background-color: transparent; }
}
.ref-anchor-highlight {
  animation: anchor-flash 3s ease-out both;
  border-radius: 4px;
}

/* Mobile */
@media (max-width: 640px) {
  .ref-tooltip {
    max-width: calc(100vw - 32px);
    left: 16px !important;
    right: 16px;
  }
}
