/* ─── GLOSSARY CSS ─────────────────────────────────────────────────────────
   Salt Water Power proposal — companion-wiki visual layer.
   Wave 30 Phase 1: tag styling + click-popover card.
   ───────────────────────────────────────────────────────────────────────── */

/* A wrapped term in body text — dotted underline + cursor:help to advertise
   that it's clickable. Color stays inherited so the term blends with prose. */
.glossary-term {
  text-decoration: underline dotted rgba(204, 136, 0, 0.55);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: help;
  transition: color 0.18s ease, text-decoration-color 0.18s ease;
}
.glossary-term:hover,
.glossary-term:focus {
  color: #cc8800;
  text-decoration-color: rgba(204, 136, 0, 0.95);
  outline: none;
}

/* The popover card itself — glass-morph styling, matches cell-popovers on
   hub/index.html so the visual language is consistent across the proposal. */
.glossary-popover {
  position: absolute;
  z-index: 9000;
  max-width: 360px;
  background: rgba(10, 14, 24, 0.92);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(204, 136, 0, 0.45);
  border-radius: 6px;
  padding: 14px 16px 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55), 0 0 24px rgba(204, 136, 0, 0.10);
  color: rgba(240, 236, 228, 0.94);
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 13.5px;
  line-height: 1.55;
  pointer-events: auto;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.glossary-popover.is-open {
  opacity: 1;
  transform: translateY(0);
}

.glossary-popover__label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(204, 136, 0, 0.85);
  margin: 0 0 6px;
}
.glossary-popover__title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 16px;
  font-weight: 600;
  color: #f0ece4;
  margin: 0 0 8px;
  line-height: 1.25;
  letter-spacing: -0.2px;
}
.glossary-popover__body {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(240, 236, 228, 0.85);
}
.glossary-popover__footer {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(240, 236, 228, 0.10);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: rgba(240, 236, 228, 0.45);
  letter-spacing: 0.5px;
}
.glossary-popover__footer a {
  color: rgba(204, 136, 0, 0.85);
  text-decoration: none;
  border-bottom: 1px dotted rgba(204, 136, 0, 0.5);
  padding-bottom: 1px;
}
.glossary-popover__footer a:hover { color: #e0a848; border-bottom-color: rgba(224, 168, 72, 0.9); }
.glossary-popover__close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: transparent;
  border: 0;
  color: rgba(240, 236, 228, 0.5);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 3px;
  transition: color 0.15s, background 0.15s;
}
.glossary-popover__close:hover { color: #cc8800; background: rgba(204, 136, 0, 0.10); }

/* Walkthrough 3D label — when a label is recognized as a glossary term,
   give it a subtle hover glow + clickable affordance. */
.label-3d.label-3d--glossary {
  pointer-events: auto;
  cursor: help;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.label-3d.label-3d--glossary:hover {
  box-shadow: 0 0 12px rgba(204, 136, 0, 0.55), 0 0 24px rgba(204, 136, 0, 0.20);
  border-color: rgba(204, 136, 0, 0.85);
}

/* On mobile, popover takes most of the screen width */
@media (max-width: 700px) {
  .glossary-popover {
    max-width: calc(100vw - 32px);
    font-size: 13px;
  }
}
