/* ==========================================================================
   COMPONENTS · GLOSSARY — the medical-terms dictionary: an A-Z jump index over
   serif letter groups, each a <dl> of run-down entries. Terms in serif with a
   trailing mono abbreviation; definitions in the reading voice, hung under a
   hairline; cross-references are ordinary ink-with-rubric links. A calm,
   printed-dictionary register — apparatus, not chrome.
   ========================================================================== */

.op-glossary {
  display: grid;
  gap: var(--space-lg);
}

/* — The A-Z jump index: a sunken register strip of mono letters — */
.op-glossary__index {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  background: var(--surface-sunken);
  border: 1px solid var(--rule);
  border-radius: var(--radius-xs);
  box-shadow: var(--shadow-deboss);
}
.op-glossary__jump {
  font-family: var(--font-data);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--text);
  text-decoration: none;
  text-align: center;
  min-inline-size: 1.7em;
  padding: var(--space-2xs) var(--space-3xs);
  border-inline-end: 1px solid var(--rule-faint);
  transition: var(--transition-ink);
}
.op-glossary__jump:last-child { border-inline-end: 0; }
.op-glossary__jump:hover { color: var(--accent); }
/* A letter with no entries reads dimmed AND inert — colour is not the only cue */
.op-glossary__jump[aria-disabled="true"],
.op-glossary__jump[data-empty] {
  color: var(--text-muted);
  pointer-events: none;
  cursor: default;
}

/* — A letter group header: a big serif initial trailed by a hairline struck
     through its optical centre — */
.op-glossary__letter {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-family: var(--font-reading);
  font-weight: var(--weight-bold);
  font-size: var(--text-2xl);
  line-height: var(--leading-solid);
  color: var(--text);
  scroll-margin-top: var(--space-lg);
}
.op-glossary__letter::after {
  content: "";
  flex: 1;
  block-size: 2px;
  background: var(--rule-strong);
  /* align-items:center sits the rule on the line-box centre, which is low on an
     all-caps initial (the line box carries descender + leading below the
     baseline). Lift it to the cap-height midpoint of the letterform. */
  transform: translateY(-0.12em);
}

/* — The entry list: a real <dl>, one bordered group per term — */
/* Reset the base dl's `auto 1fr` ledger grid (04-elements/_lists.css): the
   entries here are <div> wrappers (dt + hung dd), not flat dt|dd pairs, so the
   default two-column grid would deal them left/right instead of stacking. */
.op-glossary__list { margin: 0; display: grid; grid-template-columns: 1fr; gap: 0; }
.op-glossary__entry {
  padding-block: var(--space-sm);
  border-bottom: 1px solid var(--rule-faint);
}
.op-glossary__entry:last-child { border-bottom: 0; }

.op-glossary__term {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5em;
  margin: 0;
  font-family: var(--font-reading);
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-tight);
  color: var(--text);
}
/* The trailing abbreviation / pronunciation, in the mono data register */
.op-glossary__abbr {
  font-family: var(--font-data);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums lining-nums;
  font-weight: var(--weight-regular);
  color: var(--text-muted);
}

/* The definition, hung and indented under its term in the reading voice */
.op-glossary__def {
  margin: var(--space-3xs) 0 0;
  padding-inline-start: var(--space-md);
  font-family: var(--font-reading);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--text-secondary);
}

/* A "see also" run-in: a small-caps furniture lead-in before the cross-links */
.op-glossary__see {
  font-family: var(--font-furniture);
  font-size: var(--text-3xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-muted);
  margin-inline-end: 0.5em;
}
