/* ==========================================================================
   PEPTISSIMA — GLOSSARY
   Section styles ported verbatim from the {% stylesheet %} block of each
   Shopify section listed below. The shared .p-doc-* spine (hero, list,
   notice, CTA panel) lives in peptissima.css.
   ========================================================================== */

/* ---- sections/glossary-main.liquid ---- */

.glossary {
  background: var(--surface);
}

.glossary__tools {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: 24px 32px;
  align-items: center;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

.glossary__search {
  min-width: 0;
}

.glossary__jump {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.glossary__letter {
  display: grid;
  place-items: center;
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 2px;
  color: var(--text);
  opacity: 0.62;
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  transition: color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.glossary__letter:hover {
  color: var(--red);
  border-color: var(--line-strong);
  opacity: 1;
}

.glossary__letter[aria-disabled='true'] {
  opacity: 0.22;
  pointer-events: none;
}

.glossary__group {
  padding-top: 48px;
  /* The global scroll-padding-top already clears the sticky header; this is
     belt and braces for browsers that ignore it on anchor navigation. */
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.glossary__letter-head {
  color: var(--gold-deep);
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1;
  margin: 0 0 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

/* Two columns of definitions on desktop, per the spec. A CSS grid rather than
   `columns`, so an entry can never be split across the column break. */
.glossary__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px 48px;
  margin: 0;
  padding: 0;
}

.glossary__entry {
  min-width: 0;
}

/* The UA `[hidden] { display: none }` rule is weak; restating it here means a
   search that hides an entry cannot lose to a later grid rule. */
.glossary__entry[hidden] {
  display: none;
}

.glossary__term {
  color: var(--text);
  font-family: var(--font-serif);
  font-size: var(--text-md);
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
}

.glossary__aka {
  display: block;
  color: var(--gold-deep);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 600;
  font-style: normal;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.5;
  margin-top: 4px;
}

.glossary__def {
  margin: 8px 0 0;
}

.glossary__def p {
  color: var(--text);
  opacity: 0.78;
  font-size: var(--text-sm);
  line-height: 1.7;
  margin: 0;
}

.glossary__def p + p {
  margin-top: 8px;
}

.glossary__empty {
  color: var(--text);
  opacity: 0.7;
  font-size: var(--text-base);
  text-align: center;
  margin: 56px 0 0;
}

@media screen and (max-width: 1024px) {
  .glossary__tools {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .glossary__jump {
    justify-content: flex-start;
  }

  /* Single column below the desktop width, as the spec asks. Kept on the same
     breakpoint as the rest of the theme rather than a bespoke one. */
  .glossary__list {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .glossary__group {
    padding-top: 40px;
  }
}

@media screen and (max-width: 749px) {
  .glossary__letter {
    min-width: 28px;
    height: 28px;
    font-size: var(--text-xs);
  }

  .glossary__letter-head {
    font-size: var(--text-xl);
  }

  .glossary__group {
    padding-top: 32px;
  }
}

/* ---- sections/glossary-close.liquid ---- */

.glossary-close {
  background: var(--surface-alt);
  border-top: 1px solid var(--line);
}
