/* ============================================================
   glossary-tooltips.css  v3
   Styles for:
   1. Inline term highlights + hover tooltips (article pages)
   2. Glossary A-Z page (/docs/glossary)
   ============================================================ */


/* Term highlight in article body */
.glossary-tip {
  border-bottom: 1.5px dotted #2e75b6;
  color: inherit;
  cursor: help;
  transition: color 0.15s, border-color 0.15s;
}

.glossary-tip:hover,
.glossary-tip:focus {
  color: #2e75b6;
  outline: none;
  border-bottom-color: #2e75b6;
}

/* ── Shared tooltip div ─────────────────────────────────────── */
#glossary-shared-tooltip {
  position: absolute;
  width: 280px;
  background: #04203e;
  border-radius: 10px;
  padding: 0.9rem 1rem 0.75rem;
  box-shadow: 0 8px 32px rgba(4,32,62,0.25), 0 2px 8px rgba(4,32,62,0.15);
  z-index: 99999;
  pointer-events: none;

  /* Hidden by default */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

/* Arrow pointing down (default — tooltip above term) */
#glossary-shared-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #04203e;
}

/* Arrow pointing up (when tooltip is below term) */
#glossary-shared-tooltip.is-below::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: #04203e;
}

/* Visible state */
#glossary-shared-tooltip.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Term label */
.gtt-term {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #6ab0f5;
  margin-bottom: 0.45rem;
  padding-left: 0.6rem;
  border-left: 2px solid #6ab0f5;
}

/* Definition */
.gtt-def {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.75);
  line-height: 1.6;
  margin-bottom: 0.65rem;
}

/* Full definition link */
.gtt-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: rgba(255,255,255,0.45);
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 0.15s;
  border-bottom: none;
}

.gtt-link:hover {
  color: rgba(255,255,255,0.85);
  border-bottom: none;
}

/* Mobile: fixed bottom sheet */
@media (max-width: 600px) {
  #glossary-shared-tooltip {
    position: fixed !important;
    bottom: 1rem;
    left: 1rem;
    right: 1rem;
    top: auto !important;
    width: auto;
  }

  #glossary-shared-tooltip::after {
    display: none;
  }
}


/* ============================================================
   GLOSSARY A-Z PAGE (shortcode + page template)
   ============================================================ */

.glossary-page .docs-hero {
  padding-bottom: 2rem;
}

.glossary-alpha-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3rem;
  margin-top: 1.75rem;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.glossary-alpha-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  transition: all 0.15s;
}

.glossary-alpha-link.is-active {
  background: rgba(46,117,182,0.08);
  color: #2e75b6;
  border: 1px solid rgba(46,117,182,0.2);
}

.glossary-alpha-link.is-active:hover {
  background: #2e75b6;
  color: #fff;
}

.glossary-alpha-link.is-empty {
  color: rgba(4,32,62,0.12);
  cursor: default;
  pointer-events: none;
}

.glossary-content-wrap {
  padding: 3.5rem 0 5rem;
}

.glossary-letter-group {
  margin-bottom: 3rem;
  scroll-margin-top: 100px;
}

.glossary-letter-heading {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.65rem;
  border-bottom: 2px solid rgba(4,32,62,0.08);
}

.glossary-letter-heading span {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: #2e75b6;
  line-height: 1;
  min-width: 2.5rem;
}

.glossary-terms-list {
  display: flex;
  flex-direction: column;
}

.glossary-term {
  padding: 1.25rem 1rem;
  border-radius: 8px;
  border-bottom: 1px solid rgba(4,32,62,0.08);
  transition: background 0.15s;
  scroll-margin-top: 100px;
}

.glossary-term:last-child {
  border-bottom: none;
}

.glossary-term:hover {
  background: #F7F6F3;
}

.glossary-term-highlighted {
  background: rgba(46,117,182,0.08) !important;
  border-radius: 8px;
  outline: 2px solid rgba(46,117,182,0.2);
}

.glossary-term-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}

.glossary-term-name {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: #04203e;
  margin: 0;
  line-height: 1.3;
}

.glossary-term-anchor {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: #7a8fa3;
  text-decoration: none;
  border-bottom: none;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
}

.glossary-term:hover .glossary-term-anchor {
  opacity: 1;
}

.glossary-term-anchor:hover {
  color: #2e75b6;
  background: rgba(46,117,182,0.08);
  border-bottom: none;
}

.glossary-term-definition {
  font-size: 0.875rem;
  color: #4a6178;
  line-height: 1.75;
  max-width: 680px;
}

.glossary-term-definition p {
  margin: 0;
}

.glossary-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(4,32,62,0.08);
}

/* Shortcode extras */
.glossary-search-bar { margin-bottom: 1.5rem; }

.glossary-search-inner {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: #fff;
  border: 1.5px solid rgba(4,32,62,0.08);
  border-radius: 10px;
  padding: 0.6rem 1rem;
  max-width: 480px;
  transition: all 0.2s;
}

.glossary-search-inner:focus-within {
  border-color: #2e75b6;
  box-shadow: 0 0 0 3px rgba(46,117,182,0.08);
}

.glossary-search-inner svg { color: #7a8fa3; flex-shrink: 0; }

.glossary-search-inner input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.9rem;
  color: #04203e;
}

.glossary-search-inner input::placeholder { color: #7a8fa3; }

.glossary-filter-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: #7a8fa3;
  white-space: nowrap;
}

.glossary-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: #7a8fa3;
  margin-bottom: 2rem;
}

.glossary-no-results {
  padding: 3rem;
  text-align: center;
  color: #7a8fa3;
  font-size: 0.9rem;
}

.nomotic-glossary-wrap { padding: 2rem 0; }

@media (max-width: 768px) {
  .glossary-alpha-link { width: 30px; height: 30px; font-size: 0.72rem; }
  .glossary-letter-heading span { font-size: 1.5rem; }
  .glossary-term { padding: 1rem 0.5rem; }
}