/* ============================================================
   BRAND — GLOSSARY + HOVER TOOLTIPS
   ============================================================ */

.glossary-hero {
  background: var(--brand-700);
  padding-top: calc(var(--nav-h) + var(--sp-12));
  padding-bottom: var(--sp-12);
}

.glossary-hero__h1 {
  font-size: clamp(var(--text-4xl), 5vw, var(--text-6xl));
  font-weight: 800;
  color: var(--color-white);
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin-bottom: var(--sp-4);
}

.glossary-hero__sub {
  font-size: var(--text-lg);
  color: rgba(255,255,255,.65);
  max-width: 560px;
  line-height: 1.65;
}

/* ── Alpha Nav ───────────────────────────────────────────────── */
.glossary-alpha-nav {
  position: sticky;
  top: var(--nav-h);
  z-index: 100;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  padding-block: var(--sp-3);
}

.glossary-alpha-nav__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
  align-items: center;
}

.alpha-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--sv-600);
  text-decoration: none;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.alpha-link:hover,
.alpha-link--active {
  background: var(--brand-700);
  color: var(--color-white);
}

/* ── Glossary Content ────────────────────────────────────────── */
.glossary-content {
  padding-block: var(--sp-12);
}

.glossary-section {
  margin-bottom: var(--sp-12);
}

.glossary-section__letter {
  font-size: var(--text-4xl);
  font-weight: 800;
  color: var(--brand-700);
  letter-spacing: -0.03em;
  border-bottom: 2px solid var(--brand-200);
  padding-bottom: var(--sp-3);
  margin-bottom: var(--sp-6);
}

.gloss-entries {
  display: flex;
  flex-direction: column;
  gap: var(--sp-6);
}

.gloss-entry {
  border-left: 3px solid var(--brand-700);
  padding-left: var(--sp-5);
}

.gloss-entry__term {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--sp-2);
  letter-spacing: -0.01em;
}
.gloss-entry__term span {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--sv-500);
  font-style: italic;
  margin-left: var(--sp-2);
}

.gloss-entry__def {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: var(--sp-3);
  max-width: 680px;
}

.gloss-entry__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.gloss-entry__link {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--brand-700);
  text-decoration: none;
  padding: 2px var(--sp-2);
  border: 1px solid var(--brand-200);
  border-radius: var(--radius-sm);
  background: var(--brand-50);
  transition: all var(--dur-fast);
}
.gloss-entry__link:hover {
  background: var(--brand-100);
  border-color: var(--brand-400);
}

/* ── Hover Tooltip System (used site-wide) ───────────────────── */
.gloss-hover-term {
  border-bottom: 1.5px dashed var(--brand-500);
  cursor: help;
  position: relative;
  white-space: nowrap;
  color: inherit;
  text-decoration: none;
}

.gloss-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 260px;
  max-width: 320px;
  background: var(--brand-800);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-base) var(--ease-out),
              visibility var(--dur-base),
              transform var(--dur-base) var(--ease-out);
  transform: translateX(-50%) translateY(4px);
  z-index: 500;
  pointer-events: none;
  white-space: normal;
}

.gloss-hover-term:hover .gloss-tooltip,
.gloss-hover-term:focus .gloss-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Tooltip arrow */
.gloss-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--brand-800);
}

.gloss-tooltip__term {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--brand-200);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: var(--sp-1);
}

.gloss-tooltip__def {
  font-size: var(--text-sm);
  color: rgba(255,255,255,.75);
  line-height: 1.5;
}

.gloss-tooltip__link {
  display: inline-block;
  margin-top: var(--sp-2);
  font-size: var(--text-xs);
  color: var(--brand-300);
  font-weight: 600;
  text-decoration: none;
}
.gloss-tooltip__link:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .gloss-tooltip { display: none; } /* disable on mobile */
}
