@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,500;1,500&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap");

:root {
  --accent: #b3122a;
  --accent-dark: #7d0c1d;
  --accent2: #035096;
}

body {
  font-family: "Roboto", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #1a1a1a;
}
h1, h2, h3, h4 {
  font-family: "Poppins", Georgia, serif;
  font-weight: 500;
}

/* navigation */
nav#menu { font-size: 14px; }
nav#menu .nav-link { color: #81c3fc; }
nav#menu .nav-link:hover { color: #d9edf7; }

/* source-link favicons, attached automatically by URL (or by class for the
   internal reference links). The icon stays glued to the link text (nowrap). */
a[href*="arxiv.org"]::before,        a.ref-arxiv::before {
  background-image: url("/icons/arxiv.ico");
}
a[href*="mathscinet.ams.org"]::before, a.ref-mr::before {
  background-image: url("/icons/mathscinet.png");
}
a[href*="doi.org"]::before  { background-image: url("/icons/doi.svg"); }
a[href*="github.com"]::before { background-image: url("/icons/github.svg"); }
a[href*="arxiv.org"]::before, a.ref-arxiv::before,
a[href*="mathscinet.ams.org"]::before, a.ref-mr::before,
a[href*="doi.org"]::before, a[href*="github.com"]::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 3px;
  vertical-align: -2px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
a[href*="arxiv.org"], a.ref-arxiv,
a[href*="mathscinet.ams.org"], a.ref-mr,
a[href*="doi.org"], a[href*="github.com"] { white-space: nowrap; }

/* title block */
#title { background-color: #eee; }
#title h1 { font-size: 2.4rem; }
#title h1 a { color: #000; text-decoration: none; }
#title h1 a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
#title h1 .d { font-style: italic; color: var(--accent2); }
#title h1 .as { color: var(--accent); }
#title #slogan { font-style: italic; font-size: 0.95rem; color: #444; }

main { max-width: 900px; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

/* tables */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { border: 1px solid #dee2e6; padding: 0.35rem 0.5rem; }
thead th { background: #f6f6f6; }
th, td { text-align: center; }
table.sortable th:first-child, table.sortable td:first-child { text-align: left; }
tbody tr:hover { background: #fafafa; }

/* narrow viewport: show only family, defined, parameters, dim point scheme */
@media (max-width: 720px) {
  table.sortable .wide { display: none; }
}

/* family detail */
.lead { font-size: 1.05rem; color: #333; }
dl.family-data {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.5rem 1.25rem;
  align-items: baseline;
  margin-top: 1.25rem;
}
dl.family-data dt {
  font-family: "Poppins", Georgia, serif;
  font-weight: 500;
  color: var(--accent);
  text-align: right;
}
dl.family-data dd { margin: 0; }
dl.family-data ul.relations,
dl.family-data ul.params { list-style: none; margin: 0; padding: 0; }
dl.family-data ul.relations li { padding: 0.05rem 0; }
@media (max-width: 560px) {
  dl.family-data { grid-template-columns: 1fr; gap: 0.15rem; }
  dl.family-data dt { text-align: left; margin-top: 0.6rem; }
}

/* families list page */
table.family-table td { text-align: left; vertical-align: baseline; }
table.family-table td:first-child { white-space: nowrap; font-family: "Poppins", Georgia, serif; }
table.family-table td:last-child { color: #444; }
table.overview td { text-align: left; }
table.overview td:nth-child(2) { text-align: center; }

/* code tabs */
.nav-tabs { margin-top: 0.75rem; }
.tab-content pre {
  margin: 0;
  padding: 0.75rem;
  background: #f7f7f7;
  border: 1px solid #dee2e6;
  border-top: none;
  overflow-x: auto;
  font-size: 13px;
}
.tab-content code { color: inherit; background: none; white-space: pre; }

/* bibliography */
.bibliography .reference { margin-bottom: 0.6rem; padding-left: 1.6rem; text-indent: -1.6rem; }
.bibliography .csl-bib-body, .bibliography .csl-entry { display: inline; }
.bibliography .reference:target { background: #fffbcc; }

/* table controls */
.table-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin: 0.75rem 0;
}
.table-controls input[type="search"] {
  padding: 0.3rem 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  min-width: 14rem;
}
.table-controls label { user-select: none; }

/* sortable headers */
table.sortable th[data-col] { cursor: pointer; user-select: none; }
table.sortable th[data-col]:hover { background: #ededed; }
table.sortable th.sorted-asc::after { content: " \25B2"; font-size: 0.7em; }
table.sortable th.sorted-desc::after { content: " \25BC"; font-size: 0.7em; }
