/* Word Help — highlight difficult English words + a bilingual (EN + हिंदी) hover flap.
 * Themed to the AstroAsk palette; theme-aware via the shared CSS variables. */
.wh-word {
  border-bottom: 1.5px dotted var(--saffron, #c98a2e);
  cursor: help;
  background: linear-gradient(transparent 62%, rgba(224, 150, 60, 0.16) 0);
  border-radius: 2px;
}
.wh-word:hover,
.wh-word:focus { background: rgba(224, 150, 60, 0.26); outline: none; }

/* the flap (popover) */
.wh-flap {
  position: absolute;
  z-index: 9000;
  max-width: 300px;
  width: max-content;
  background: var(--panel, #fff);
  color: var(--ink, #15233b);
  border: 1px solid var(--edge, #e6dcc6);
  border-radius: 14px;
  box-shadow: 0 16px 44px -14px rgba(60, 40, 20, 0.4);
  padding: 13px 15px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13.5px;
  line-height: 1.55;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .14s ease, transform .14s ease;
  pointer-events: none;
}
.wh-flap.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.wh-flap .wh-head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.wh-flap .wh-word { font-family: var(--serif, 'Marcellus', serif); font-weight: 700; font-size: 17px; color: var(--maroon, #7a241a); border: 0; background: none; cursor: default; }
.wh-flap .wh-pos { font-size: 11px; font-style: italic; color: var(--muted, #8a8aa0); }
.wh-flap .wh-speak {
  margin-left: auto; border: 1px solid var(--edge, #e6dcc6); background: var(--field, #f6eede); color: var(--maroon, #7a241a);
  width: 30px; height: 30px; border-radius: 9px; cursor: pointer; font-size: 15px;
  display: grid; place-items: center; flex-shrink: 0;
}
.wh-flap .wh-speak:hover { background: var(--maroon, #7a241a); color: #fff; border-color: var(--maroon, #7a241a); }
.wh-flap .wh-ipa { color: var(--muted, #8a8aa0); font-size: 12px; margin-bottom: 6px; }
.wh-flap .wh-en { margin: 0; }
.wh-flap .wh-hi {
  margin: 8px 0 0; padding-top: 8px; border-top: 1px solid var(--edge, #f0ead9);
  font-family: 'Noto Sans Devanagari', 'Inter', sans-serif; color: var(--saffron, #b45309); font-size: 15px;
}
.wh-flap .wh-hi b { color: var(--maroon, #8a6a20); font-weight: 700; font-size: 10.5px; letter-spacing: .5px; text-transform: uppercase; display: block; margin-bottom: 2px; }

/* nav toggle button (replaces the old EN/हिं tab) */
.aa-wordhelp {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 40px; padding: 0 .6rem; margin-right: .15rem;
  border-radius: 11px; border: 1px solid var(--edge); background: var(--panel);
  color: var(--maroon); font-weight: 700; font-size: .9rem; letter-spacing: .01em;
  cursor: pointer; transition: color .15s, border-color .15s, background .15s;
}
.aa-wordhelp:hover { border-color: var(--maroon); background: rgba(122, 36, 26, .06); }
.aa-wordhelp.on { background: var(--maroon); color: #fff; border-color: var(--maroon); }

/* when Word Help is switched off, neutralise the highlights */
.wordhelp-off .wh-word { border-bottom: 0; background: none; cursor: auto; }

@media (max-width: 520px) { .wh-flap { max-width: 86vw; } }
@media (prefers-reduced-motion: reduce) { .wh-flap { transition: none; } }
