/* =========================================================================
   dexwatch — Glossary styles: hub page + in-text tooltip links
   Built on the shared design tokens (styles.css). Mirrors the Academy look.
   ========================================================================= */

/* ===================================================== HUB ========= */
.gl-main { padding: 36px 0 48px; max-width: 1080px; }

.gl-hero { margin-bottom: 26px; }
.gl-kicker { font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: color-mix(in oklch, var(--accent) 70%, var(--ink)); }
.gl-title { font-size: clamp(30px, 4.4vw, 50px); letter-spacing: -0.03em; line-height: 1.03; margin: 12px 0 16px; }
.gl-lead { font-size: clamp(15px, 1.7vw, 18.5px); color: var(--ink-2); line-height: 1.55; max-width: 64ch; }
.gl-herostats { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 20px; font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-3); }
.gl-herostats b { color: var(--ink); font-weight: 700; }

/* sticky controls */
.gl-controls {
  position: sticky; top: 0; z-index: 30; margin: 26px 0 8px;
  padding: 14px 0 12px; background: color-mix(in oklch, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line);
}
.gl-search-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.gl-search { position: relative; flex: 1 1 280px; min-width: 220px; }
.gl-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--ink-faint); pointer-events: none; }
.gl-search input {
  width: 100%; height: 46px; padding: 0 44px 0 40px; font: inherit; font-size: 15px;
  color: var(--ink); background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--r-pill); outline: none; transition: border-color .15s, box-shadow .15s;
}
.gl-search input:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-wash); }
.gl-search input::placeholder { color: var(--ink-faint); }
.gl-search-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; border: none; background: transparent; color: var(--ink-faint); cursor: pointer; display: none; place-items: center; font-size: 16px; }
.gl-search-clear:hover { background: var(--bg-sunken); color: var(--ink-2); }
.gl-search.has-text .gl-search-clear { display: grid; }
.gl-count { font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint); white-space: nowrap; }

/* category filter chips */
.gl-cats { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 12px; }
.gl-cat {
  font-family: var(--font-ui); font-size: 12.5px; font-weight: 600; color: var(--ink-3);
  padding: 6px 13px; border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--bg-elev); cursor: pointer; transition: all .14s; white-space: nowrap;
}
.gl-cat:hover { border-color: var(--line-strong); color: var(--ink-2); }
.gl-cat.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* A–Z rail */
.gl-az { display: flex; gap: 2px; flex-wrap: wrap; margin-top: 12px; }
.gl-az a {
  font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--ink-3);
  width: 26px; height: 26px; display: grid; place-items: center; border-radius: var(--r-sm);
  transition: background .12s, color .12s;
}
.gl-az a:hover { background: var(--accent-wash); color: color-mix(in oklch, var(--accent) 65%, var(--ink)); }
.gl-az a.is-empty { opacity: .28; pointer-events: none; }

/* letter group */
.gl-group { margin-top: 30px; scroll-margin-top: 150px; }
.gl-group-h { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.gl-group-letter { font-family: var(--font-display, var(--font-ui)); font-size: 26px; font-weight: 800; letter-spacing: -0.02em; color: var(--accent); }
.gl-group-rule { flex: 1; }

/* term grid */
.gl-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (max-width: 800px){ .gl-grid { grid-template-columns: 1fr; } }

.gl-term {
  scroll-margin-top: 160px; padding: 20px 22px; background: var(--bg-elev);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  transition: border-color .15s, box-shadow .15s;
}
.gl-term:target { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.gl-term-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.gl-term-name { font-size: 18px; font-weight: 750; letter-spacing: -0.02em; color: var(--ink); line-height: 1.2; }
.gl-term-name a { color: inherit; }
.gl-term-name a:hover { color: var(--accent); }
.gl-term-cat { flex: none; font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-faint); border: 1px solid var(--line); border-radius: var(--r-pill); padding: 3px 9px; white-space: nowrap; margin-top: 2px; }
.gl-term-short { font-size: 14.5px; line-height: 1.55; color: var(--ink); font-weight: 550; margin-bottom: 10px; text-wrap: pretty; }
.gl-term-body { display: flex; flex-direction: column; gap: 9px; }
.gl-term-body p { font-size: 13.5px; line-height: 1.62; color: var(--ink-3); margin: 0; text-wrap: pretty; }
.gl-term-body strong { color: var(--ink-2); font-weight: 650; }
.gl-term-body em { font-style: normal; color: var(--ink-2); font-weight: 600; }

/* term footer: related / lessons / dexes */
.gl-term-foot { margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 9px; }
.gl-foot-row { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.gl-foot-label { flex: none; font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); width: 52px; padding-top: 2px; }
.gl-chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.gl-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600;
  color: var(--ink-2); background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r-pill); padding: 4px 11px; transition: border-color .14s, color .14s;
}
a.gl-chip:hover { border-color: var(--accent-line); color: var(--ink); }
.gl-chip-lesson { background: var(--accent-wash); border-color: var(--accent-line); color: color-mix(in oklch, var(--accent) 62%, var(--ink)); }
a.gl-chip-lesson:hover { border-color: var(--accent); color: color-mix(in oklch, var(--accent) 50%, var(--ink)); }
.gl-chip .mono-badge { width: 18px; height: 18px; font-size: 9px; border-radius: 5px; }

/* empty state */
.gl-empty { display: none; padding: 48px 24px; text-align: center; }
.gl-empty.show { display: block; }
.gl-empty h3 { font-size: 19px; margin-bottom: 6px; }
.gl-empty p { color: var(--ink-3); font-size: 14.5px; }

/* closing strip */
.gl-cross { margin-top: 44px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px){ .gl-cross { grid-template-columns: 1fr; } }
.gl-cross-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 24px; border-radius: var(--r-lg); background: var(--accent-wash); border: 1px solid var(--accent-line); }
.gl-cross-card h3 { font-size: 17px; }
.gl-cross-card p { font-size: 13.5px; color: var(--ink-2); margin-top: 3px; }

/* ============================== IN-TEXT TOOLTIP LINK (Academy prose) === */
.gl-link {
  color: inherit; font-weight: inherit;
  text-decoration: underline; text-decoration-style: dotted;
  text-decoration-color: var(--accent-line); text-underline-offset: 3px;
  cursor: help; transition: text-decoration-color .15s;
}
.gl-link:hover { text-decoration-color: var(--accent); }

.gl-pop {
  position: fixed; z-index: 200; max-width: 320px; padding: 13px 15px;
  background: var(--bg-elev); border: 1px solid var(--line-strong);
  border-radius: var(--r-md); box-shadow: var(--shadow-lg, 0 12px 34px rgba(0,0,0,.16));
  opacity: 0; transform: translateY(4px); pointer-events: none; transition: opacity .14s, transform .14s;
}
.gl-pop.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.gl-pop-term { font-size: 13.5px; font-weight: 700; color: var(--ink); letter-spacing: -0.01em; margin-bottom: 5px; }
.gl-pop-short { font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.gl-pop-more { display: inline-flex; align-items: center; gap: 5px; margin-top: 9px; font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: color-mix(in oklch, var(--accent) 62%, var(--ink)); }
.gl-pop-more:hover { color: var(--accent); }
