/* glossary.css: special education glossary (js/glossary.js). Every class starts with gl-.
   Colors come from the tokens in css/pages.css, so light and dark mode follow html[data-theme]. */

.gl-box { min-width: 0; }
.gl-intro { margin: 0 0 12px; line-height: 1.55; }
.gl-search { display: flex; flex-direction: column; gap: 5px; max-width: 480px; }
.gl-search label { font-weight: 600; font-size: .9rem; }
.gl-search input { min-height: 44px; }
.gl-count { margin: 8px 0 6px; font-size: .86rem; color: var(--muted); }

.gl-az ul { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.gl-az a { display: grid; place-items: center; min-width: 44px; min-height: 44px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--ink); font-weight: 700; text-decoration: none; }
.gl-az a:hover { border-color: var(--accent); background: var(--hover); }

.gl-group { margin-top: 8px; }
.gl-letter { margin: 14px 0 6px; font-size: 1.1rem; color: var(--ink); border-bottom: 2px solid var(--border); padding-bottom: 4px; scroll-margin-top: 12px; }
.gl-letter:focus { outline: none; }
.gl-letter:focus-visible { outline: 3px solid var(--focus-ring, var(--accent)); outline-offset: 2px; }
.gl-list dl { margin: 0; }
.gl-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.gl-item dt { font-weight: 700; color: var(--ink); }
.gl-item dd { margin: 4px 0 0; line-height: 1.55; }
.gl-item dd p { margin: 0; }
.gl-src { margin-top: 4px !important; font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; }
.gl-src a, .gl-pop-src a { display: inline-block; min-height: 24px; padding: 2px 0; }
.gl-ext { color: var(--muted); font-size: .8em; }
.gl-foot { margin: 12px 0 0; font-size: .84rem; }

/* annotate(): a term in running text is a button that looks like a dotted-underlined word */
.gl-wrap { position: relative; display: inline; }
/* At least 24 x 24 px (WCAG 2.5.8) without changing the line height; words in a sentence. */
.gl-term { display: inline-block; min-width: 24px; min-height: 24px; font: inherit; line-height: inherit; color: inherit; background: none; border: 0;
  padding: 0 1px; margin: 0; cursor: help; text-align: center;
  text-decoration: underline dotted var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.gl-term:hover { color: var(--accent); }
.gl-term:focus-visible { outline: 3px solid var(--focus-ring, var(--accent)); outline-offset: 2px; border-radius: 3px; }
.gl-term[aria-expanded="true"] { background: var(--info-bg); border-radius: 3px; }

.gl-pop { position: absolute; z-index: 60; top: calc(100% + 8px); left: 0; display: block; width: min(340px, calc(100vw - 32px));
  padding: 12px 14px; border-radius: 12px; background: var(--surface); color: var(--text); border: 1px solid var(--border);
  box-shadow: var(--shadow); font-size: .9rem; line-height: 1.5; font-weight: 400; text-align: left; white-space: normal; }
.gl-pop[hidden] { display: none; }
.gl-pop-head { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; }
.gl-pop-term { color: var(--ink); padding-top: 10px; }
.gl-pop-close { flex: none; width: 44px; height: 44px; margin: -6px -8px 0 0; border: 0; border-radius: 10px; background: none; color: var(--muted);
  font-size: 1.4rem; line-height: 1; cursor: pointer; }
.gl-pop-close:hover { background: var(--hover); color: var(--ink); }
.gl-pop-close:focus-visible { outline: 3px solid var(--focus-ring, var(--accent)); outline-offset: 0; }
.gl-pop-def, .gl-pop-src { display: block; margin-top: 4px; }
.gl-pop-src { font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; }

@media print {
  .gl-az, .gl-search, .gl-count, .gl-pop { display: none !important; }
  .gl-term { text-decoration: none; }
  .gl-item { break-inside: avoid; }
}
