/*!
 * twf-glossary.css - 2026-08-20
 *
 * A marked term is a button, not a link: it opens a definition in place rather
 * than navigating. It is styled to read as "this word has more behind it"
 * without competing with real links or shouting through a page of policy text.
 *
 * The magnifier is a desktop hover affordance ONLY. Every behaviour here works
 * on tap and on keyboard, because the people who read this handbook are on
 * phones. Hover decorates; it never gates.
 */

.twf-gl-term {
  /* strip button chrome so it reads as prose */
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: help;
  display: inline;
  text-align: inherit;
  /* the signal: dotted, gold, deliberately NOT link-blue */
  border-bottom: 1px dotted rgba(138, 117, 48, .75);
  text-decoration: none;
}

.twf-gl-term:hover,
.twf-gl-term:focus-visible {
  border-bottom-color: #8A7530;
  background: rgba(201, 168, 76, .14);
  border-radius: 3px;
}

.twf-gl-term:focus-visible {
  outline: 2px solid #8A7530;
  outline-offset: 2px;
}

/* Desktop-only magnifier. Pointer:fine keeps it away from touch, where a
   hover state can stick after a tap and look like a rendering fault. */
@media (hover: hover) and (pointer: fine) {
  .twf-gl-term::after {
    content: "\1F50D";
    font-size: .78em;
    margin-left: 2px;
    opacity: 0;
    transition: opacity .14s ease;
  }
  .twf-gl-term:hover::after,
  .twf-gl-term:focus-visible::after { opacity: .75; }
}

.twf-gl-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 18, 32, .42);
  z-index: 9998;
  animation: twfGlFade .16s ease;
}

.twf-gl-sheet {
  position: fixed;
  z-index: 9999;
  background: #fff;
  color: #0C1220;
  box-shadow: 0 -8px 40px rgba(12, 18, 32, .22);
  animation: twfGlUp .2s cubic-bezier(.22, .8, .3, 1);
  /* Mobile default: bottom sheet, thumb-reachable, never taller than half the
     screen so the reader keeps their place in the document behind it. */
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 16px 16px 0 0;
  padding: 10px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  max-height: 55vh;
  overflow-y: auto;
}

.twf-gl-grip {
  width: 38px;
  height: 4px;
  border-radius: 2px;
  background: rgba(12, 18, 32, .18);
  margin: 2px auto 12px;
}

.twf-gl-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.twf-gl-term-name {
  font-family: var(--font-display, Georgia, serif);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.25;
}

.twf-gl-full {
  font-size: 13px;
  color: #5A6270;
  margin-top: 2px;
}

.twf-gl-close {
  flex: 0 0 auto;
  width: 44px;             /* 44px: the tap target, not the glyph */
  height: 44px;
  border: 0;
  background: rgba(12, 18, 32, .05);
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  color: #0C1220;
  cursor: pointer;
}

.twf-gl-close:hover { background: rgba(12, 18, 32, .1); }

.twf-gl-def {
  font-size: 15px;
  line-height: 1.62;
  margin-top: 12px;
}

.twf-gl-meta {
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #7A8290;
  margin-top: 12px;
}

.twf-gl-all {
  margin-top: 16px;
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(12, 18, 32, .14);
  border-radius: 8px;
  background: #fff;
  color: #0C1220;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}

.twf-gl-all:hover { background: rgba(201, 168, 76, .1); border-color: #C9A84C; }

/* Desktop: a centred card rather than a sheet stuck to the bottom edge. */
@media (min-width: 700px) {
  .twf-gl-sheet {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(460px, calc(100vw - 48px));
    border-radius: 14px;
    padding: 20px 24px 24px;
    max-height: 70vh;
    animation: twfGlPop .18s cubic-bezier(.22, .8, .3, 1);
  }
  .twf-gl-grip { display: none; }
}

@keyframes twfGlFade { from { opacity: 0 } to { opacity: 1 } }
@keyframes twfGlUp   { from { transform: translateY(14px); opacity: .6 } to { transform: translateY(0); opacity: 1 } }
@keyframes twfGlPop  { from { transform: translate(-50%, -50%) scale(.97); opacity: .6 }
                       to   { transform: translate(-50%, -50%) scale(1);   opacity: 1 } }

@media (prefers-reduced-motion: reduce) {
  .twf-gl-backdrop, .twf-gl-sheet { animation: none; }
  .twf-gl-term::after { transition: none; }
}
