/* ============================================================
   File: assets/css/glossary.css
   Purpose: The glossary's own two surfaces — the A-Z index additions
            (term-name links, layer chips, the count lede) and the
            per-term page at /glossary/<slug>: definition callout, cited
            source, "where this comes up", related-term cards, prev/next
            pager, soft CTA, and the browse sidebar with its letter jump.
            Loaded from the styles section of BOTH glossary views.
   Scope:   Additive to assets/css/blog.css, which already owns the index's
            letter nav, group headings and .glossary-term-block/-name/-def/
            -source rules. Nothing here redefines those — this file only
            adds what the per-term pages and the new index affordances need.
   Tokens:  --wwa-* from assets/css/site.css :root. Class roles ported from
            the CCC base 2026-10-04 and re-themed;
            that file's token names map onto this site's as:
              --ink        -> --wwa-ink          --line      -> --wwa-border
              --ink-soft   -> --wwa-body-soft    --paper     -> #ffffff
              --muted      -> --wwa-muted        --band      -> --wwa-ink
              --teal       -> --wwa-accent         --surface   -> --wwa-surface
              --teal-deep  -> --wwa-accent-strong
              --teal-tint  -> --wwa-callout-tint
            the original --serif/--display split maps to --wwa-font-display / --wwa-font-body
            (this site is Inter only), and its inline SVG icons become
            Font Awesome 7 solid glyphs, which the layout already loads.
   Author:  Juhriah Web Solutions
   Created: 2026-09-26
   Last Modified: 2026-10-04 — glossary batch 05 ("A note on evidence"
            callout, last block of the file); batch 01 added the
            pronunciation line under the term H1 and the "Read the guide"
            link
   Last Modified: 2026-10-05 — content round 5: index category
            filters + search (glossary-index.js) — chip count selector
            now .glossary-layer-count; INDEX FILTERS + SEARCH block at
            the end of the file
   ============================================================ */

/* ── INDEX ADDITIONS ─────────────────────────────────────── */
/* The lede line above the A-Z run: "468 terms, A to Z…". */
.glossary-lede {
  color: var(--wwa-on-dark-soft);
  margin-bottom: 0;
  max-width: 620px;
}
.glossary-count {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--wwa-muted);
  margin-bottom: 20px;
}

/* Term names are links to their own page now; the heading keeps its size
   from blog.css (.glossary-term-name) and only the anchor is styled. */
.glossary-term-name a {
  color: var(--wwa-ink);
}
.glossary-term-name a:hover,
.glossary-term-name a:focus {
  color: var(--wwa-accent-strong);
  text-decoration: none;
}

/* Layer chip beside a term name on the index, and the legend above it. */
.glossary-term-layer {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--wwa-callout-tint);
  color: var(--wwa-accent-strong);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: middle;
}
.glossary-layer-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
}
.glossary-layer-legend li {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--wwa-border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--wwa-body-soft);
}
.glossary-layer-count {
  font-weight: 600;
  color: var(--wwa-accent-strong);
}

/* ── TERM PAGE — LAYOUT ──────────────────────────────────── */
.term-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
@media (min-width: 992px) {
  .term-layout { grid-template-columns: minmax(0, 1fr) 280px; gap: 48px; }
}
.term-article {
  max-width: 780px;
  min-width: 0;
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--wwa-body-soft);
}
.term-article h2 {
  font-size: 1.5rem;
  margin: 0 0 16px;
}
.term-article h3 {
  font-size: 1.05rem;
  margin: 0 0 8px;
}

/* ── TERM PAGE — DEFINITION CALLOUT ──────────────────────── */
/* The snippet target: the whole point of the page, so it leads. */
.term-definition {
  margin: 0 0 16px;
  padding: 22px 26px;
  border-left: 4px solid var(--wwa-accent);
  border-radius: 0 6px 6px 0;
  background: var(--wwa-callout-tint);
}
.term-definition-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--wwa-accent-strong);
  margin-bottom: 8px;
}
.term-definition p {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--wwa-ink);
}
.term-source {
  font-size: 14px;
  color: var(--wwa-muted);
  margin-bottom: 0;
}
.term-source a {
  color: var(--wwa-accent-strong);
  word-break: break-word;
}
.term-source .fa-arrow-up-right-from-square {
  font-size: 0.7em;
  margin-left: 2px;
}

.term-section { margin-top: 40px; }

/* ── TERM PAGE — WHERE THIS COMES UP ─────────────────────── */
.term-usage {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.term-usage a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--wwa-border);
  border-radius: 999px;
  background: var(--wwa-card);
  color: var(--wwa-accent-strong);
  font-size: 14px;
  font-weight: 600;
  transition: border-color 0.2s, background 0.2s;
}
.term-usage a:hover,
.term-usage a:focus {
  border-color: var(--wwa-accent);
  background: var(--wwa-callout-tint);
  text-decoration: none;
}
.term-usage-kind {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--wwa-muted);
}

/* ── TERM PAGE — RELATED TERM CARDS ──────────────────────── */
.term-related {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (min-width: 640px) {
  .term-related { grid-template-columns: 1fr 1fr; }
}
.term-card {
  padding: 18px 20px;
  border: 1px solid var(--wwa-border);
  border-top: 3px solid var(--wwa-accent);
  border-radius: 6px;
  background: var(--wwa-card);
  transition: transform 0.2s, box-shadow 0.2s;
}
.term-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
.term-card h3 { margin-bottom: 6px; }
.term-card h3 a { color: var(--wwa-ink); }
.term-card h3 a:hover,
.term-card h3 a:focus { color: var(--wwa-accent-strong); text-decoration: none; }
.term-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--wwa-muted);
}

/* ── TERM PAGE — PREV / NEXT ─────────────────────────────── */
.term-pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--wwa-border);
}
.term-pager a {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 48%;
  color: var(--wwa-ink);
}
.term-pager-next { margin-left: auto; text-align: right; align-items: flex-end; }
.term-pager-kicker {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--wwa-muted);
}
.term-pager-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--wwa-accent-strong);
}
.term-pager a:hover .term-pager-label,
.term-pager a:focus .term-pager-label { text-decoration: underline; }

/* ── TERM PAGE — SOFT CTA ────────────────────────────────── */
/* Quiet register: it points at this site's own guides and cost pages, not
   at the guides and services, never a sales pitch (brief §11). */
.term-cta {
  margin-top: 48px;
  padding: 32px 28px;
  border-radius: 6px;
  background: var(--wwa-moss-deep);
  color: var(--wwa-on-dark-soft);
  text-align: center;
}
.term-cta h2 { color: var(--wwa-on-dark); margin-bottom: 10px; }
.term-cta p {
  max-width: 620px;
  margin: 0 auto 20px;
  color: var(--wwa-on-dark-soft);
}
.term-cta-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.term-cta-actions a {
  display: inline-block;
  padding: 11px 22px;
  border: 1px solid var(--wwa-accent);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.term-cta-primary { background: var(--wwa-paper); color: var(--wwa-moss-deep); }
.term-cta-primary:hover,
.term-cta-primary:focus { background: var(--wwa-card); color: var(--wwa-forest-ink); text-decoration: none; }
.term-cta-secondary { background: transparent; color: var(--wwa-on-dark); border: 1px solid var(--wwa-on-dark-label); } /* paper on deep moss: AA (was sage on moss, ~2:1) */
.term-cta-secondary:hover,
.term-cta-secondary:focus { background: var(--wwa-paper); color: var(--wwa-moss-deep); border-color: var(--wwa-paper); text-decoration: none; }

/* ── TERM PAGE — BROWSE SIDEBAR ──────────────────────────── */
.term-side {
  border: 1px solid var(--wwa-border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--wwa-card);
}
@media (min-width: 992px) {
  .term-side { position: sticky; top: 24px; }
}
.term-side-title {
  margin: 0;
  padding: 14px 20px;
  background: var(--wwa-moss-deep);
  color: var(--wwa-on-dark);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.term-letters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 16px 20px 8px;
}
.term-letters a {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--wwa-border);
  border-radius: 4px;
  color: var(--wwa-accent-strong);
  font-size: 0.8rem;
  font-weight: 600;
}
.term-letters a:hover,
.term-letters a:focus {
  background: var(--wwa-accent);
  border-color: var(--wwa-accent);
  color: var(--wwa-ink);
  text-decoration: none;
}
.term-side-all {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--wwa-border);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--wwa-accent-strong);
}
.term-side-all:hover,
.term-side-all:focus { color: var(--wwa-accent); text-decoration: none; }

/* ── GLOSSARY BATCH 01 2026-10-04 ── */
/* Pronunciation line inside the hero panel, directly under the term H1
   (.page-hero h1 already leaves 10px below itself). */
.term-pronunciation {
  margin: 0 0 10px;
  font-size: 0.95rem;
  color: var(--wwa-muted);
}
.term-pronunciation-guide {
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--wwa-accent-strong);
}

/* "Read the guide" — one link after the explanation sections: book icon,
   a small kicker, then the guide's full title (titles run long, so this is
   a rounded block that may wrap, not a pill). */
.term-guide { margin: 32px 0 0; }
.term-guide-link {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  max-width: 100%;
  padding: 14px 20px;
  border: 1px solid var(--wwa-accent);
  border-radius: 6px;
  background: var(--wwa-callout-tint);
  color: var(--wwa-accent-strong);
  line-height: 1.35;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.term-guide-link .fa-book-open {
  flex-shrink: 0;
  font-size: 1.25rem;
}
.term-guide-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.term-guide-kicker {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.term-guide-title {
  font-size: 1rem;
  font-weight: 600;
}
/* Hover fills with the deep moss surface, not sage: sage is large-text-only
   for contrast (site.css token note). Kicker and title inherit the colour. */
.term-guide-link:hover,
.term-guide-link:focus {
  background: var(--wwa-ink-deep);
  border-color: var(--wwa-ink-deep);
  color: var(--wwa-on-dark);
  text-decoration: none;
}

/* ── GLOSSARY BATCH 05 2026-10-04 ── */
/* "A note on evidence" — the owner's evidence / framing note. Deliberately
   quieter than .term-definition: neutral surface instead of the sage tint,
   smaller type, a thinner rule, so it reads as a footnote-weight aside. The
   .term-article h2 rule above sets 1.5rem headings; the compound selectors
   here outrank it. */
.term-framing-note {
  margin: 32px 0 0;
  padding: 14px 18px;
  border-left: 3px solid var(--wwa-accent);
  border-radius: 0 6px 6px 0;
  background: var(--wwa-surface);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--wwa-body-soft);
}
.term-framing-note .term-framing-heading {
  margin: 0 0 6px;
  font-family: var(--wwa-font-body);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--wwa-accent-strong);
}
.term-framing-note p {
  margin: 0;
}

/* ── INDEX FILTERS + SEARCH (content round 5, 2026-10-05) ── */
/* Progressive enhancement from public/js/glossary-index.js (SEO index §5
   "category filters + search"). The search panel, status line and empty
   state ship with the HTML `hidden` attribute and appear only once the
   script runs; with JS off the chips above stay plain labels. */
.glossary-search {
  margin: 0 0 18px;
  max-width: 480px;
}
.glossary-search-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wwa-body-soft);
  margin-bottom: 6px;
}
.glossary-search-input {
  background-color: var(--wwa-card);
  border: 1px solid var(--wwa-border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--wwa-ink);
  font-size: 15px;
}
.glossary-search-input::placeholder { color: var(--wwa-muted); }
.glossary-search-input:focus {
  background-color: var(--wwa-card);
  border-color: var(--wwa-accent-strong);
  box-shadow: 0 0 0 3px var(--wwa-callout-tint);
  color: var(--wwa-ink);
}

/* Upgraded chips: the pill look moves from the <li> to its toggle button,
   so the chip reads exactly as the static legend does. */
.glossary-layer-legend[data-state="interactive"] {
  margin-bottom: 12px;
}
.glossary-layer-legend[data-state="interactive"] li {
  padding: 0;
  border: 0;
}
.glossary-layer-toggle {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--wwa-border);
  border-radius: 999px;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--wwa-body-soft);
  cursor: pointer;
}
.glossary-layer-toggle:hover {
  border-color: var(--wwa-accent);
  color: var(--wwa-accent-strong);
}
.glossary-layer-toggle:focus-visible {
  outline: 2px solid var(--wwa-accent-strong);
  outline-offset: 2px;
}
/* Pressed = the active filter: paper on moss (AA). */
.glossary-layer-toggle[aria-pressed="true"],
.glossary-layer-toggle[aria-pressed="true"] .glossary-layer-count {
  color: var(--wwa-on-dark);
}
.glossary-layer-toggle[aria-pressed="true"] {
  background: var(--wwa-accent-strong);
  border-color: var(--wwa-accent-strong);
}

/* "N of M terms" — the polite live region under the chips. */
.glossary-filter-status {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--wwa-muted);
  margin: 0 0 24px;
}

/* A term block or letter group the active filter leaves out. */
.glossary-filtered-out {
  display: none;
}

/* Jump link whose letter group is currently empty. */
.glossary-letter[data-state="empty"] {
  opacity: 0.35;
  pointer-events: none;
}

/* "No terms match" — honest empty state with a one-click reset. */
.glossary-no-match {
  margin: 0 0 32px;
  padding: 22px 26px;
  border: 1px dashed var(--wwa-border);
  border-radius: 6px;
  background: var(--wwa-card);
}
.glossary-no-match-text {
  margin: 0 0 10px;
  color: var(--wwa-body-soft);
}
.glossary-clear-filters {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--wwa-accent-strong);
  text-align: left;
  text-decoration: underline;
  cursor: pointer;
}
.glossary-clear-filters:hover,
.glossary-clear-filters:focus-visible {
  color: var(--wwa-moss-deep);
}
