/* ── References page: the Handbook's parts of web-base's citation cards ────
   references_format.py rebuilds each entry from the raw .bib fields as
   web-base's citation card (its README's "Citation cards": mg-citation-*,
   data-type), which web-base.css styles, type colours included. What is
   left here is what the card leaves to its host: the text of an entry not
   rebuilt from the .bib, and the repaired state. */

/* ── Search layout ────────────────────────────────────────────────────────
   references_search.py puts web-base's search layout round the list and
   search-list.js drives it, so all that belongs here is fitting the layout
   to the article column: it is already inside the theme's own padding, and
   the page has no secondary sidebar to centre it against. */

.handbook-references {
  /* web-base's own width, less the 2rem side padding this page does not
     need: the article column is already inside the theme's, and the
     handbook's does not cap itself, so without this the cards would run
     the width of the window -- 1914px on a 2560px screen. At this width a
     card measures the 756px it does on magma-maths.org's /citations/.
     Left, not centred, so the layout starts where the page's title does. */
  --mg-search-layout-max: calc(1120px - 2 * 2rem);
  --mg-search-layout-pad: 1rem 0 0;
  --mg-search-layout-pad-narrow: 1rem 0 0;
  margin-inline: 0;
}

/* ── A chapter's own Bibliography page (#3210) ────────────────────────────
   It has no search layout round its list, so its cards would take the whole
   article column (1254px at a 1600px viewport) where a References card
   measures 756px. .mg-citation is an inline-size container query, so the
   width is what drives the card's internal layout: matching it here is what
   makes a chapter's cards the same cards, not merely similar ones.
   Left, not centred, so the list starts where the page's title does.
   756px is the width the rule above works out to, and the one the printed
   measurement in web-base's own /citations/ page reports; the two are kept
   the same by hand, so change them together.
   The list itself, not a wrapper: a `:list: bullet` bibliography replaces
   the directive's node outright, so the `.docutils container` the default
   list type wraps it in is not there to hang a width on. */
#bibliography > .citation-list {
  max-width: 756px;
  margin-inline: 0;
}

/* The list and each card are flex containers, which outranks the plain
   [hidden] rules search-list.js relies on: say it where the display is set. */
.citation-list[hidden],
.citation-list .citation[hidden] {
  display: none;
}

/* The entry's label ("[AHU74]"): the key its in-text citations show. */
.citation-list .citation > .label {
  flex: none;
  margin-inline-end: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--pst-color-text-muted, #68635f);
}

/* pybtex's own text, for an entry not rebuilt from the .bib */
.citation-list .citation-text {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--pst-color-text-base, #212529);
}

/* Repaired entries (legacy pybtex-text fallback): an amber strip and a help
   cursor, to hint at the tooltip carrying the original bibtex error. The
   card reads the strip's colour from --mg-citation-accent. */
.mg-citation.citation-repaired {
  --mg-citation-accent: #f59e0b;
  --mg-citation-accent-text: var(--mg-amber-text);
  cursor: help;
}
