/* ===== Glossary (works with <dl><dt><dd> and the minimal JS) ===== */

/* Layout */
.glossary { max-width: 900px; margin: 1rem auto; font: 16px/1.55 system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif; }
.glossary dl { margin: 0; padding: 0; }

/* Term rows */
.glossary dt {
  cursor: pointer;
  font-weight: 600;
  margin: .6rem 0 0;
  padding: .7rem .95rem;
  border: 1px solid #e6e6e6;
  border-radius: .55rem;
  background: #fff;
  position: relative;
  user-select: none;
}

/* Chevron indicator (driven by aria-expanded) */
.glossary dt::after {
  content: "▸";
  position: absolute;
  right: .75rem;
  top: 50%;
  transform: translateY(-50%) rotate(0deg);
  transition: transform .18s ease;
  pointer-events: none;
}
.glossary dt[aria-expanded="true"]::after {
  transform: translateY(-50%) rotate(90deg);
}

/* Focus and hover */
.glossary dt:hover { background: #fafafa; }
.glossary dt:focus-visible { outline: 3px solid #9bd; outline-offset: 2px; }

/* Definitions: hidden by [hidden] (toggled by JS) */
.glossary dd {
  margin: 0 0 .6rem 0;
  padding: .75rem 1rem 1rem 1rem;
  border: 1px solid #e0e0e0;
  border-top: 0;
  border-radius: 0 0 .55rem .55rem;
  background: #f9f9fc;             /* light bluish background */
  color: #2a2a2a;
  font-size: 0.95em;
  font-style: italic;
  line-height: 1.55;
  animation: slideFade .16s ease;
  border-left: 4px solid #88aaff;   /* accent color on left edge */
}

.glossary dd[hidden] { display: none; }

/* Subtle reveal animation */
@keyframes slideFade {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== Controls ===== */
.glossary-controls {
  display: flex;
  gap: .5rem;
  justify-content: flex-end;
  max-width: 900px;
  margin: 0 auto 1rem;
}
.glossary-controls button {
  padding: .42rem .8rem;
  border: 1px solid #cfcfcf;
  background: #f7f7f7;
  border-radius: .4rem;
  cursor: pointer;
  font: 14px/1.3 inherit;
}
.glossary-controls button:hover,
.glossary-controls button:focus-visible {
  outline: none;
  border-color: #888;
  background: #eee;
}

