/* ==========================================================================
   glossary.css — Container Glossary silo (/glossary/)
   Ships as a NEW FILE, not a ?v bump: CF Pages serves an already-cached
   stylesheet regardless of the query string, so site.css stays byte-frozen.
   Loaded only by pages whose spec declares "css": ["glossary"].
   Uses the site's existing custom properties; defines no new colours.

   A term page leads with the definition, the way a dictionary does. The
   DefinedTerm schema on the page quotes the same words the reader sees.
   ========================================================================== */

.term-top {
  background: linear-gradient(180deg, var(--cream) 0%, var(--white) 100%);
  padding-block: clamp(26px, 3.5vw, 44px) clamp(30px, 4vw, 48px);
}

.term-head { max-width: 74ch; margin-inline: auto; }

.term-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--rust-soft);
  color: var(--rust);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 16px;
  transition: background .2s, color .2s;
}

.term-kicker:hover { background: var(--rust); color: #fff; }
.term-kicker svg { width: 13px; height: 13px; flex-shrink: 0; }

.term-word {
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.025em;
  margin-bottom: 10px;
}

.term-aka {
  font-size: .95rem;
  color: var(--ink-dim);
  font-weight: 600;
  margin-bottom: 24px;
}

.term-aka strong { color: var(--ink-2); font-weight: 700; }

/* -------------------------------------------------------- the definition */
.term-def {
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 5px solid var(--rust);
  border-radius: var(--r-md);
  padding: 24px 26px 26px;
  box-shadow: var(--shadow-sm);
}

.td-label {
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--rust);
  font-weight: 800;
  margin-bottom: 10px;
}

.term-def p {
  font-size: clamp(1.04rem, 1.5vw, 1.16rem);
  line-height: 1.62;
  color: var(--ink);
  font-weight: 500;
}

.term-def strong { font-weight: 700; }

/* -------------------------------------------------------- quick facts */
.term-facts {
  /* The section's own top padding opens the gap above; this only has to keep
     the following h2 off the strip. */
  margin: 0 0 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}

.term-fact { background: var(--white); padding: 18px 20px; }

.term-fact .k {
  font-size: .7rem;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-dim);
  font-weight: 700;
  margin-bottom: 6px;
}

.term-fact .v {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
}

/* -------------------------------------------------------- see also */
.term-also { margin-top: 44px; }
.term-also h3 { font-size: 1.06rem; margin-bottom: 14px; }

.term-links {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.term-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .87rem;
  font-weight: 600;
  color: var(--ink-2);
  transition: border-color .25s, color .25s, background .25s;
}

.term-link:hover { border-color: var(--rust); color: var(--rust); background: var(--rust-soft); }
.term-link svg { width: 13px; height: 13px; flex-shrink: 0; opacity: .7; }

/* -------------------------------------------------------- the hub index */
.gloss-alpha {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 30px;
}

.gloss-alpha a,
.gloss-alpha span {
  min-width: 36px;
  padding: 7px 10px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--white);
  font-size: .88rem;
  font-weight: 700;
  color: var(--ink-2);
  transition: border-color .25s, color .25s, background .25s;
}

.gloss-alpha a:hover { border-color: var(--rust); color: var(--rust); background: var(--rust-soft); }
.gloss-alpha span { color: var(--ink-dim); opacity: .45; }

.gloss-group { margin-top: 50px; }
.gloss-group:first-of-type { margin-top: 0; }

.gloss-letter {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--line);
  margin-bottom: 20px;
}

.gloss-letter h2 {
  font-size: 1.6rem;
  color: var(--rust);
  letter-spacing: -.02em;
}

.gloss-letter .count {
  font-size: .76rem;
  font-weight: 700;
  color: var(--ink-dim);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.gloss-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.gloss-card {
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--white);
  transition: border-color .25s, transform .25s var(--ease), box-shadow .25s;
}

.gloss-card:hover {
  border-color: var(--rust);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.gloss-card .t {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 5px;
}

.gloss-card:hover .t { color: var(--rust); }

.gloss-card .d {
  font-size: .86rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

@media (max-width: 640px) {
  .term-def { padding: 20px 20px 22px; border-left-width: 4px; }
  .gloss-grid { grid-template-columns: 1fr; }
}
