/*
 * straka.la framework glossary — popup styles
 *
 * Trigger terms get a subtle dotted underline in the muted palette color.
 * Popup uses the cream + dark palette and the site's two typefaces.
 */

/* ------------------------------------------------------------
 * TRIGGER TERMS
 * ------------------------------------------------------------ */

.glossary-term {
  cursor: help;
  border-bottom: 1px dotted rgba(122, 114, 104, 0.55);
  padding-bottom: 1px;
  transition: border-color 0.2s ease, background-color 0.15s ease;
  outline: none;
}

.glossary-term:hover,
.glossary-term:focus-visible,
.glossary-term.active {
  border-bottom-color: rgba(193, 122, 62, 0.7);
}

.glossary-term:focus-visible {
  outline: 2px solid rgba(193, 122, 62, 0.5);
  outline-offset: 2px;
  border-radius: 1px;
}

/* Touch devices: background tint confirms tap registered. */
@media (hover: none) {
  .glossary-term.active {
    background-color: rgba(193, 122, 62, 0.08);
    border-bottom-color: rgba(193, 122, 62, 0.7);
  }
}

/* ------------------------------------------------------------
 * POPUP
 * ------------------------------------------------------------ */

.glossary-popup {
  position: absolute;
  z-index: 200;
  display: none;
  max-width: 320px;
  min-width: 240px;
  padding: 1.1rem 1.25rem 1rem;
  background: #F4EFE6;
  border: 1px solid rgba(26, 24, 20, 0.12);
  border-radius: 2px;
  box-shadow: 0 8px 28px rgba(26, 24, 20, 0.14), 0 2px 6px rgba(26, 24, 20, 0.06);
  color: #1A1814;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.glossary-popup.visible {
  display: block;
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0);
}

/* Small inversion when popup sits above the term (subtle, matches the site's quiet vocabulary). */
.glossary-popup.above {
  transform: translateY(-4px);
}
.glossary-popup.above.visible {
  transform: translateY(0);
}

.glossary-popup-term {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 400;
  font-style: italic;
  color: #C17A3E;
  line-height: 1.2;
  margin-bottom: 0.55rem;
}

.glossary-popup-def {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 300;
  line-height: 1.6;
  color: #3A3530;
  margin-bottom: 0.75rem;
}

.glossary-popup-link {
  display: inline-block;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #C17A3E;
  text-decoration: none;
  border-bottom: 1px solid rgba(193, 122, 62, 0.3);
  padding-bottom: 1px;
  transition: border-color 0.2s ease;
}

.glossary-popup-link:hover,
.glossary-popup-link:focus-visible {
  border-bottom-color: #C17A3E;
}

.glossary-popup-link:focus-visible {
  outline: 2px solid rgba(193, 122, 62, 0.5);
  outline-offset: 2px;
}

/* Mobile: allow the popup to be a bit narrower and keep padding comfortable. */
@media (max-width: 480px) {
  .glossary-popup {
    max-width: calc(100vw - 32px);
    padding: 1rem 1.1rem 0.9rem;
  }
  .glossary-popup-term {
    font-size: 1.08rem;
  }
  .glossary-popup-def {
    font-size: 0.8rem;
  }
}
