/* The glossary page (M2-LEARN): the design system's tokens only. The filter bar, the count line, the tags, the empty state and
   the pagination are the kit's (components.css); the publication line is institution.css's. */

.glossary-head {
  padding-block: var(--spacing-24);
}

.glossary-head h1 {
  max-width: 24ch;
  margin-bottom: var(--spacing-16);
  overflow-wrap: anywhere;
  hyphens: auto;
}

.glossary-head .lead {
  max-width: var(--size-44rem);
  margin-bottom: 0;
}

.glossary-body {
  display: grid;
  gap: var(--spacing-24);
  padding-bottom: var(--spacing-48);
}

/* The letter choice: a link for each letter a term starts with, plain muted text for the others */
.glossary-letters ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-8);
  margin: 0 0 var(--spacing-16);
  padding: 0;
  list-style: none;
}

.glossary-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--size-2-75rem);
  min-height: var(--size-2-75rem);
  padding: var(--spacing-4) var(--spacing-8);
  border: var(--border-width-1) solid var(--color-border);
  border-radius: var(--border-radius-8);
  font-size: var(--font-size-16);
  line-height: var(--line-height-24);
  font-weight: var(--font-weight-medium);
}

a.glossary-letter {
  border-color: var(--color-info-border);
  background: var(--color-surface);
  color: var(--color-link);
  text-decoration: none;
}

a.glossary-letter:hover {
  background: var(--color-background-action-hover);
  text-decoration: underline;
}

a.glossary-letter[aria-current="true"] {
  border-color: var(--color-action);
  background: var(--color-action);
  color: var(--color-action-text);
}

.glossary-letter.none {
  border-color: transparent;
  background: transparent;
  color: var(--color-text-muted);
  font-weight: var(--font-weight-regular);
}

.glossary-all {
  margin: 0 0 var(--spacing-16);
}

/* A term: the word on the left, its definition on the right from 768 px */
.glossary-list {
  display: grid;
  max-width: var(--size-56rem);
  margin: 0;
}

.glossary-term {
  display: grid;
  gap: var(--spacing-8) var(--spacing-24);
  padding-block: var(--spacing-24);
  border-top: var(--border-width-1) solid var(--color-border);
  min-width: 0;
}

.glossary-term dt {
  margin: 0;
  font-size: var(--font-size-20);
  line-height: var(--line-height-28);
  font-weight: var(--font-weight-semibold);
  overflow-wrap: anywhere;
}

.glossary-term dd {
  margin: 0;
  min-width: 0;
}

.glossary-term dd p {
  margin: 0 0 var(--spacing-12);
}

.glossary-term dd p:last-child {
  margin-bottom: 0;
}

.glossary-source {
  color: var(--color-text-secondary);
  font-size: var(--font-size-14);
  line-height: var(--line-height-20);
}

.glossary-term:target {
  background: var(--color-info-surface);
}

@media (min-width: 768px) {
  .glossary-term {
    grid-template-columns: var(--size-11rem) minmax(0, 1fr);
  }
}
