/* Journey2Health — glossary teaching aid (2026-10-05).
   Scoped to .j2h-term / .j2h-term-pop / .j2h-gloss-* only. No shared-class restyles. */

/* Inline term (added by assets/js/glossary.js) */
.j2h-term {
  color: inherit;
  cursor: help;
  border-radius: 3px;
  -webkit-text-decoration-line: underline;
  text-decoration-line: underline;
  -webkit-text-decoration-style: dotted;
  text-decoration-style: dotted;
  -webkit-text-decoration-color: #74c297;
  text-decoration-color: #74c297;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.22em;
  -webkit-tap-highlight-color: rgba(116, 194, 151, 0.18);
  touch-action: manipulation;
  transition: background-color 0.15s ease;
}
.j2h-term:hover,
.j2h-term[aria-expanded="true"] {
  background-color: rgba(116, 194, 151, 0.16);
  -webkit-text-decoration-style: solid;
  text-decoration-style: solid;
}
.j2h-term:focus { outline: none; }
.j2h-term:focus-visible {
  outline: 2px solid #74c297;
  outline-offset: 2px;
}

/* Popup (one shared element appended to <body>) */
.j2h-term-pop {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 260;
  box-sizing: border-box;
  width: 340px;
  max-width: calc(100vw - 24px);
  overflow-y: auto;
  padding: 0.85rem 2.6rem 0.75rem 1rem;
  background: #12201c;
  color: #f8fcf9;
  border: 1px solid rgba(116, 194, 151, 0.5);
  border-radius: 12px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
  font-family: "Source Sans 3", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  text-align: left;
  overflow-wrap: break-word;
  -webkit-overflow-scrolling: touch;
}
.j2h-term-pop[hidden] { display: none; }
.j2h-term-pop::before {
  content: "";
  position: absolute;
  left: var(--j2h-arrow-x, 50%);
  width: 12px;
  height: 12px;
  margin-left: -6px;
  background: #12201c;
  border: 1px solid rgba(116, 194, 151, 0.5);
  transform: rotate(45deg);
  pointer-events: none;
}
.j2h-term-pop[data-placement="below"]::before { top: -7px; border-right: 0; border-bottom: 0; }
.j2h-term-pop[data-placement="above"]::before { bottom: -7px; border-left: 0; border-top: 0; }
.j2h-term-pop .j2h-term-pop__title {
  margin: 0 0 0.3rem;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.3;
  color: #74c297;
}
.j2h-term-pop .j2h-term-pop__def {
  margin: 0 0 0.55rem;
  color: #e6efe9;
}
.j2h-term-pop .j2h-term-pop__link {
  display: inline-block;
  padding: 0.3rem 0;
  font-weight: 600;
  color: #98dcbd;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
.j2h-term-pop .j2h-term-pop__link:hover { color: #d4f0e3; }
.j2h-term-pop .j2h-term-pop__close {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  width: 2.25rem;
  height: 2.25rem;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: #e6efe9;
  font: inherit;
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
}
.j2h-term-pop .j2h-term-pop__close:hover { background: rgba(116, 194, 151, 0.14); }
.j2h-term-pop .j2h-term-pop__close:focus-visible,
.j2h-term-pop .j2h-term-pop__link:focus-visible {
  outline: 2px solid #74c297;
  outline-offset: 2px;
}

/* ---------- glossary.html ---------- */
.j2h-gloss-tip { margin-top: 1rem; }
.j2h-gloss-tip .j2h-gloss-sample {
  -webkit-text-decoration-line: underline;
  text-decoration-line: underline;
  -webkit-text-decoration-style: dotted;
  text-decoration-style: dotted;
  -webkit-text-decoration-color: #74c297;
  text-decoration-color: #74c297;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.22em;
}
.j2h-gloss-filter-wrap { margin: 0 0 1rem; max-width: 34rem; }
.j2h-gloss-filter-wrap[hidden] { display: none; }
.j2h-gloss-filter-wrap label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.j2h-gloss-filter-wrap input {
  width: 100%;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  padding: 0.7rem 1rem;
  font: inherit;
  font-size: 1.05rem;
  color: #f8fcf9;
  background: rgba(22, 40, 35, 0.85);
  border: 1px solid rgba(116, 194, 151, 0.35);
  border-radius: 999px;
}
.j2h-gloss-filter-wrap input:focus {
  outline: none;
  border-color: #74c297;
  box-shadow: 0 0 0 2px rgba(116, 194, 151, 0.2);
}
.j2h-gloss-az {
  position: -webkit-sticky;
  position: sticky;
  top: var(--header-h, 64px);
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 1.5rem;
  padding: 0.6rem 0;
  background: #0c1614;
  border-bottom: 1px solid rgba(116, 194, 151, 0.18);
}
.j2h-gloss-az a,
.j2h-gloss-az span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.3rem;
  height: 2.3rem;
  padding: 0 0.35rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
}
.j2h-gloss-az a {
  color: #f8fcf9;
  background: #162823;
  border: 1px solid rgba(116, 194, 151, 0.25);
}
.j2h-gloss-az a:hover,
.j2h-gloss-az a:focus-visible { border-color: #74c297; color: #74c297; }
.j2h-gloss-az span { color: rgba(230, 239, 233, 0.35); border: 1px solid transparent; }
@media (max-width: 640px) {
  .j2h-gloss-az {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .j2h-gloss-az a,
  .j2h-gloss-az span { flex: 0 0 auto; }
}
.j2h-gloss-letter { margin: 0 0 2rem; scroll-margin-top: calc(var(--header-h, 64px) + 4.5rem); }
.j2h-gloss-letter[hidden] { display: none; }
.j2h-gloss-letter > h2 {
  margin: 0 0 0.75rem;
  font-size: 1.6rem;
  color: #74c297;
}
.j2h-gloss-list { margin: 0; padding: 0; }
.j2h-gloss-item {
  margin: 0 0 0.75rem;
  padding: 0.9rem 1.1rem;
  background: #162823;
  border: 1px solid rgba(116, 194, 151, 0.18);
  border-radius: 12px;
  scroll-margin-top: calc(var(--header-h, 64px) + 4.5rem);
}
.j2h-gloss-item[hidden] { display: none; }
.j2h-gloss-item:target {
  border-color: #74c297;
  box-shadow: 0 0 0 2px rgba(116, 194, 151, 0.35);
}
.j2h-gloss-item dt {
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.35;
  color: #f8fcf9;
}
.j2h-gloss-item dd { margin: 0.3rem 0 0; color: #e6efe9; }
.j2h-gloss-item dd p { margin: 0 0 0.35rem; }
.j2h-gloss-item .j2h-gloss-aka { font-size: 0.92rem; color: rgba(230, 239, 233, 0.75); }
.j2h-gloss-item .j2h-gloss-more { margin: 0.2rem 0 0; font-size: 0.98rem; }
.j2h-gloss-item .j2h-gloss-more a { font-weight: 600; text-decoration: underline; text-underline-offset: 0.18em; }
.j2h-gloss-top { font-size: 0.95rem; margin: 0.25rem 0 0; }
