/* The glossary: the hub at /glossary/ (search, A to Z, category filters,
   term cards) and the term pages (key facts, jump bar). Loaded only on
   glossary pages, after pages.css. One accent (purple). */

/* --- Hub: search ------------------------------------------------------------- */
.ts-g-search { position: relative; max-width: 640px; margin-top: 30px; }
.ts-g-search .ts-input { min-height: 58px; padding-left: 50px; font-size: 17px; box-shadow: inset 0 0 0 1px #d9d2cc, 0 12px 30px -24px rgba(17, 17, 17, .45); }
.ts-g-search .ts-input::-webkit-search-cancel-button { cursor: pointer; }
.ts-page .ts-g-search-i { position: absolute; left: 18px; top: 50%; translate: 0 -50%; width: 20px; height: 20px; color: var(--ts-muted); pointer-events: none; }

/* --- Hub: letters and category filters --------------------------------------------- */
.ts-g-body { padding-top: 8px; }
.ts-g-bar { position: sticky; top: 84px; z-index: 5; display: grid; gap: 10px; margin: 0 -8px 8px; padding: 10px 8px; border-radius: 16px; background: rgba(244, 242, 241, .94); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.ts-page .ts-g-az { position: static; margin: 0; padding: 0; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.ts-g-az a[aria-disabled="true"] { color: #c7bfb8; background: transparent; box-shadow: none; pointer-events: none; }
.ts-g-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.ts-g-cats button { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 13px; border: 0; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1px var(--ts-line); font: 500 13.5px/1 var(--ts-text); color: var(--ts-ink); cursor: pointer; white-space: nowrap; }
.ts-g-cats button:hover { box-shadow: inset 0 0 0 1px var(--ts-ink); }
.ts-g-cats button[aria-pressed="true"] { background: var(--ts-ink); color: #fff; box-shadow: none; }
.ts-g-cats button small { font-size: 12px; opacity: .65; font-variant-numeric: tabular-nums; }
.ts-g-cats button:focus-visible { outline: 2px solid var(--ts-purple); outline-offset: 2px; }
.ts-g-count { margin: 6px 0 0; font-size: 14px; color: var(--ts-muted); }

/* --- Hub: term cards ------------------------------------------------------------ */
.ts-g-letters { display: grid; gap: 36px; margin-top: 18px; }
.ts-g-letter { scroll-margin-top: 190px; }
.ts-g-L { margin: 0 0 14px; font: 600 28px/1 var(--ts-display); letter-spacing: -.02em; color: var(--ts-ink); }
.ts-g-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.ts-g-item[hidden] { display: none; }
.ts-g-card { display: flex; flex-direction: column; height: 100%; padding: 22px; text-decoration: none; scroll-margin-top: 200px; transition: translate .25s var(--ts-ease), box-shadow .25s var(--ts-ease); }
.ts-g-card:hover { translate: 0 -2px; box-shadow: 0 0 0 1px rgba(17, 17, 17, .08), var(--ts-shadow); }
.ts-g-card:target { box-shadow: 0 0 0 2px var(--ts-purple), var(--ts-shadow); }
.ts-g-cat { font: 600 11.5px/1.3 var(--ts-text); letter-spacing: .1em; text-transform: uppercase; color: var(--ts-purple); }
.ts-page .ts-g-term { display: block; margin: 10px 0 8px; font: 600 19px/1.3 var(--ts-display); letter-spacing: -.015em; color: var(--ts-ink); }
.ts-g-def { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; font-size: 14.5px; line-height: 1.6; color: var(--ts-muted); }
.ts-g-more { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 16px; font: 600 14px/1 var(--ts-text); color: var(--ts-ink); }
.ts-g-more svg { width: 16px; height: 16px; transition: translate .2s var(--ts-ease); }
.ts-g-card:hover .ts-g-more svg { translate: 3px 0; }
.ts-g-empty { display: grid; justify-items: start; gap: 12px; margin-top: 24px; padding: 28px; border-radius: 18px; background: #fff; box-shadow: inset 0 0 0 1px var(--ts-line); }
.ts-g-empty p { margin: 0; color: var(--ts-ink); font-weight: 500; }

/* --- Term pages ----------------------------------------------------------------- */
.ts-g-term-hero { padding-bottom: 40px; }
.ts-page .ts-g-short { max-width: 62ch; color: var(--ts-ink); font-size: clamp(18px, 1.6vw, 20px); }
.ts-g-facts { display: flex; flex-wrap: wrap; gap: 1px; margin: 0 0 8px; border-radius: 16px; overflow: hidden; background: var(--ts-line); box-shadow: inset 0 0 0 1px var(--ts-line); }
.ts-g-facts div { flex: 1 1 170px; padding: 14px 16px; background: #fff; }
.ts-g-facts dt { font: 600 11.5px/1.3 var(--ts-text); letter-spacing: .08em; text-transform: uppercase; color: var(--ts-muted); }
.ts-g-facts dd { margin: 6px 0 0; font: 500 15px/1.45 var(--ts-text); color: var(--ts-ink); overflow-wrap: anywhere; }
.ts-g-facts dd a { display: inline-flex; align-items: center; gap: 4px; color: var(--ts-purple); text-decoration: none; }
.ts-g-facts dd a:hover { text-decoration: underline; }
.ts-g-facts dd svg { width: 14px; height: 14px; }
.ts-g-jump { padding-top: 16px; }
.ts-g-jump-h { margin: 0 0 12px; font: 600 12.5px/1 var(--ts-text); letter-spacing: .12em; text-transform: uppercase; color: var(--ts-muted); }
.ts-page .ts-g-jump .ts-az { position: static; background: none; padding: 0; }

/* --- Responsive ---------------------------------------------------------------- */
@media (max-width: 1099.98px) {
  .ts-g-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 809.98px) {
  .ts-g-bar { top: 64px; margin: 0 -16px 8px; border-radius: 0; padding: 10px 16px; }
  .ts-g-az, .ts-g-cats { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .ts-g-cats::-webkit-scrollbar { display: none; }
  .ts-g-az::-webkit-scrollbar { display: none; }
  .ts-g-az a, .ts-g-az span { flex: none; min-width: 34px; height: 34px; }
  .ts-g-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .ts-g-card { padding: 18px; }
  .ts-g-letter { scroll-margin-top: 170px; }
  .ts-g-jump .ts-az { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  .ts-g-card, .ts-g-more svg { transition: none; }
}
