:root {
  --glossary-color: currentColor;
  --glossary-icon-bg: #5b7fa6;
  --glossary-icon-color: #fff;
  --glossary-icon-size: 10px;
}

.glossary-tooltip {
  cursor: help;
  white-space: nowrap;
}

.glossary-tooltip__text {
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  cursor: help;
  transition: color 0.3s ease;

  &:hover {
    color: var(--wp--preset--color--primario);
  }
}

/* .glossary-tooltip::after {
  content: "?";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--glossary-icon-size);
  height: var(--glossary-icon-size);
  border-radius: 50%;
  background: var(--glossary-icon-bg);
  color: var(--glossary-icon-color);
  font-size: 9px;
  font-weight: 700;
  font-style: normal;
  line-height: 1;
  margin-left: 3px;
  vertical-align: super;
  text-decoration: none;
  opacity: 0.8;
} */

/* Tema Tippy personalizzato */
.tippy-box[data-theme~="glossary"] {
  background-color: #1a2b3c;
  color: #f5f5f5;
  font-size: 0.85rem;
  line-height: 1.5;
  border-radius: 4px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  max-width: 280px;
}

.tippy-box[data-theme~="glossary"] .tippy-content {
  padding: 10px 14px;
}

.tippy-box[data-theme~="glossary"] > .tippy-arrow::before {
  color: #1a2b3c;
}

/* ----------------------------------------
   Shortcode [t99_glossario]
---------------------------------------- */

.t99-glossary__nav {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 2rem;
  align-items: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.t99-glossary__nav::-webkit-scrollbar {
  display: none;
}

.t99-glossary__nav-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
}

.t99-glossary__nav-item:hover,
.t99-glossary__nav-item.is-active {
  color: var(--wp--preset--color--primario);
}

.t99-glossary__nav-item.is-active {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ----------------------------------------
   Vertical sidebar nav
---------------------------------------- */

.t99-glossary__sidebar {
  position: fixed;
  left: 0;
  top: 50%;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 4px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) translateX(-100%);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

.t99-glossary__sidebar.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}

.t99-glossary__sidebar .t99-glossary__nav-item {
  width: 28px;
  height: 28px;
  font-size: 0.8rem;
  font-weight: 500;
}

.t99-glossary__group {
  margin-bottom: 2.5rem;
  scroll-margin-top: 80px;

  & {
    @media screen and (max-width: 781px) {
      margin-left: 30px;
    }
  }
}

.t99-glossary__letter {
  font-size: 1.4rem;
  font-weight: 700;
  color: inherit;
  border-bottom: 1px solid currentColor;
  padding-bottom: 4px;
  margin-bottom: 1rem;
}

.t99-glossary__list {
  margin: 0;
}

.t99-glossary__item {
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.t99-glossary__item:last-child {
  border-bottom: none;
}

.t99-glossary__term {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.t99-glossary__desc {
  margin: 0;
  color: #444;
  line-height: 1.6;
}
