/* Raleway, the site font (set as mainfont in _quarto.yml) */
@import url('https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,400;0,600;0,700;1,400&display=swap');

/* The comparison page (webapp/index.qmd): a row of models to pick from, and two panes of code */

.model-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 1rem 0 2rem;
}

.model-picker .framework { /* One framework's name, then a link for each of its models */
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.model-picker .framework span {
  font-weight: 600;
  margin-right: 0.2rem;
}

.model-picker a {
  padding: 0.15rem 0.7rem;
  font-size: 0.9em;
  border: 1px solid var(--bs-border-color);
  border-radius: 2rem;
  text-decoration: none;
  color: var(--bs-body-color);
}

.model-picker a:hover {
  border-color: #2780e3;
}

.model-picker a.chosen {
  border-color: #2780e3;
  background: #2780e3;
  color: #fff;
  font-weight: 600;
}

/* The same links down the left side, staying in view while the page scrolls */
.compare-layout {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 2rem;
}

.model-nav {
  position: sticky;
  top: 5rem; /* Below the navbar */
  align-self: start;
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
  font-size: 0.9em;
}

.model-nav .framework {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.6rem;
}

.model-nav .framework span {
  font-weight: 600;
}

.model-nav a {
  padding: 0.05rem 0.6rem;
  border-left: 2px solid var(--bs-border-color);
  text-decoration: none;
  color: var(--bs-body-color);
}

.model-nav a:hover, .model-nav a.chosen {
  border-left-color: #2780e3;
  color: #2780e3;
}

.model-nav a.chosen {
  font-weight: 600;
}

@media (max-width: 992px) {
  .compare-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .model-nav {
    display: none; /* The buttons at the top are enough on a narrow screen */
  }
}

/* A CSV file, shown as the sheet it is */
.sheet {
  overflow: auto;
  max-height: 75vh; /* As for code, below */
  font-size: 0.8em;
}

.sheet td {
  height: 1.8em;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--bs-border-color);
  white-space: nowrap;
}

.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.compare .pane {
  min-width: 0; /* So long lines scroll inside the pane, not widen it */
}

.compare pre {
  font-size: 0.8em;
  max-height: 75vh; /* A long file scrolls inside its pane, so both panes fit on the screen together */
  overflow-y: auto;
}

@media (max-width: 992px) {
  .compare {
    grid-template-columns: 1fr;
  }
}

/* The benchmark table has long notes in its last column */
.benchmark table {
  font-size: 0.9em;
}

.benchmark td:nth-child(3), .benchmark td:nth-child(4) { /* Lines and time: the original's above Starsim's, kept from wrapping inside a number */
  min-width: 10rem;
}

.benchmark td:first-child {
  white-space: nowrap;
}

/* Starsim's lines and time: green if no more than the original's, red if more (translucent, so they work in the dark theme too) */
.benchmark td:has(.pass) {
  background-color: rgba(25, 135, 84, 0.18);
}

.benchmark td:has(.fail) {
  background-color: rgba(220, 53, 69, 0.18);
}

/* The influences page (approaches/influences.qmd): blue for frameworks, gray for "Other" and "New" (translucent, so they work in the dark theme too) */
.influence-bars {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.25rem 0.75rem;
  align-items: center;
  margin: 1rem 0 2rem;
  font-size: 0.9em;
}

.influence-bars .name {
  text-align: right;
}

.influence-bars .track {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.influence-bars .bar {
  height: 1rem;
  background: #2780e3;
  border-radius: 0 4px 4px 0;
}

.influence-bars .bar.extra {
  background: rgba(128, 128, 128, 0.6);
}

.influence-map {
  overflow-x: auto;
  margin: 1rem 0 2rem;
}

.influence-map table {
  border-collapse: separate;
  border-spacing: 2px;
  font-size: 0.8em;
}

.influence-map thead th {
  vertical-align: bottom;
  padding-bottom: 0.3rem;
  font-weight: normal;
}

.influence-map thead a {
  text-decoration: none; /* An underline on rotated text draws as a vertical rule */
}

.influence-map thead th div {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  white-space: nowrap;
}

.influence-map tbody th {
  text-align: right;
  white-space: nowrap;
  font-weight: normal;
  padding-right: 0.5rem;
}

.influence-map table, .influence-map thead, .influence-map tbody, .influence-map tr, .influence-map th, .influence-map td {
  border: none;
  padding: 0;
}

.influence-map td {
  min-width: 2rem;
  height: 1.9rem;
  text-align: center;
  border-radius: 3px;
  cursor: default;
}

.influence-map td.source {
  background: rgba(39, 128, 227, calc(0.08 + 0.92 * var(--share)));
}

.influence-map td.extra {
  background: rgba(128, 128, 128, calc(0.08 + 0.72 * var(--share)));
}

.influence-map tr.overall th, .influence-map tr.overall td {
  font-weight: 600;
  border-top: 2px solid var(--bs-border-color);
}

.influence-map td.dark {
  color: #fff;
}
