@import url("https://fonts.googleapis.com/css2?family=Big+Shoulders+Display:wght@900&family=Roboto:ital,wght@0,400;0,500;0,700;1,400&display=swap");

/* Override Observable's default sans-serif with Roboto */
:root {
  --sans-serif: "Roboto", sans-serif;
}

.corner-logo {
  position: absolute;
  top: -1rem;
  right: 0rem;
  width: clamp(40px, 6vw, 100px);
  height: auto;
  z-index: 1000;
}

#observablehq-sidebar {
  font-family: "Big Shoulders Display", sans-serif;
}

/* Framework sets the sidebar to 14px with its title at 16px. Big Shoulders is a
   condensed face and reads small at those sizes, so both step up together —
   the title stays ahead of the page links so the hierarchy holds. */
#observablehq-sidebar > ol:first-child {
  font-size: 20px;
}

#observablehq-sidebar > ol:not(:first-child) a {
  font-size: 16px;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--sans-serif);
  margin: 4rem 0 4rem;
  text-wrap: balance;
  text-align: center;
}

/* Set main page title to Big Shoulders */
.hero h1 {
  margin-bottom: 1rem;
  margin-top: -0.25rem;
  padding: 0;
  max-width: none;
  font-family: "Big Shoulders Display", sans-serif;
  font-size: 90px;
  line-height: 1;
  background: linear-gradient(
    30deg,
    var(--theme-foreground-focus),
    currentColor
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero h2 {
  margin: 0;
  max-width: 36em;
  font-size: 20px;
  font-style: initial;
  font-weight: 500;
  line-height: 1.5;
  color: darkslategray;
  /* The `balance` inherited from .hero is ignored past about four lines, and
     this paragraph runs six — which left "available." stranded on its own line.
     `pretty` has no such limit and targets exactly that last-line case, so the
     orphan can't come back at some other window width. */
  text-wrap: pretty;
}

@media (min-width: 640px) {
  .hero h1 {
    font-size: 130px;
  }
}

/* Set all other dashboard titles to Roboto */
.dashboard-hero {
  display: flex;
  flex-direction: column;
  margin: 1.5rem 0 2rem;
  font-family: var(--sans-serif);
  text-wrap: balance;
}

.dashboard-hero h1 {
  max-width: none;
  font-size: 7vw;
  font-weight: 900;
  letter-spacing: -0.02em;
  font-family: "Big Shoulders Display", sans-serif;
}

.dashboard-hero h2 {
  font-size: 1rem;
  font-style: initial;
  font-weight: 400;
  color: var(--theme-foreground-muted);
}

@media (min-width: 640px) {
  .dashboard-hero h1 {
    font-size: 42px;
  }

  .dashboard-hero h2 {
    font-size: 16px;
  }
}

/* Set rest of dashboard to Roboto */
.dashboard {
  font-family: var(--sans-serif);
}

/* Set chart text, incl tooltips, axis labels, to Roboto */
svg text {
  font-family: "Roboto", sans-serif;
}

/* Remove extra space between body and footer */
#observablehq-main {
  margin-bottom: -125px !important;
}

/* Style minimized bands in detentions dashboard */
.stats-band {
  display: flex;
  align-items: stretch;
  background: #f5f2ed;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 8px;
  padding: 0.65rem 1.25rem;
  margin-top: 0.75rem;
  font-family: "Roboto", sans-serif;
}

.stats-band-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 1.25rem;
  border-right: 1px solid gainsboro;
}

.stats-band-item:first-child {
  padding-left: 0;
}
.stats-band-item:last-child {
  border-right: none;
}

.stats-band-label {
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--theme-foreground-muted);
  font-family: "Roboto", sans-serif;
}

.stats-band-value {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--theme-foreground);
  font-family: "Roboto", sans-serif;
}

.stats-band-unit {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--theme-foreground-muted);
  font-family: "Roboto", sans-serif;
}

.stats-band-compare {
  font-size: 11px;
  color: var(--theme-foreground-muted);
  font-style: italic;
  margin-top: 2px;
  font-family: "Roboto", sans-serif;
}

.filter-bar {
  margin-bottom: 1rem;
  background: #ffffff6e;
}
.filter-bar button {
  background-color: rgb(160, 159, 159);
  border: 1px solid;
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: white;
  float: right;
}
.filter-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--theme-foreground-muted);
}
.filter-inputs select {
  width: 150px;
}
.filter-inputs {
  display: flex;
  gap: 3rem;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}
.filter-inputs [class^="inputs-"] {
  --input-width: 120px;
  width: auto !important;
}
.filter-inputs [class^="inputs-"] > label {
  width: auto !important;
  white-space: nowrap;
  margin-right: 0.4rem !important;
}

.about h1 {
  max-width: none;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.02em;
  font-family: "Big Shoulders Display", sans-serif;
}

.about p {
  max-width: 700px;
  font-size: 18px;
  font-family: var(--sans-serif);
  color: rgb(95, 95, 95);
}

.source-p {
  margin-bottom: 2rem;
}

.line-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0.5rem 0 0.75rem;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.line-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  color: var(--theme-foreground-muted);
  user-select: none;
}

.line-legend-item:hover {
  color: var(--theme-foreground);
}

.line-legend-item.active {
  color: var(--theme-foreground);
  text-decoration: underline;
}

.line-legend-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

/* Stands in for Plot's ramp legend on the heatmaps and maps. */
.ramp-legend {
  display: block;
  margin: 6px 0 10px;
  overflow: visible;
}

/* Lets the footer below sit at the bottom of the card. */
.dashboard .card {
  display: flex;
  flex-direction: column;
}

/* Bottom row of a chart card: on-page caveat on the left, the control that
   downloads the chart as a branded image on the right. */
.chart-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  /* Sits as low in the card as it can without leaving it. The clearance above
     is padding rather than margin so `auto` can't collapse it, and is raised at
     runtime for charts whose axis labels spill below the plot box. */
  margin-top: auto;
  padding-top: 12px;
}

.chart-note {
  margin: 0;
  font-size: 0.85em;
  color: gray;
  /* Framework caps every paragraph at 640px, which wrapped the longer map notes
     onto three lines in a card twice that wide. These run the width of the card
     instead, with the flex gap keeping them clear of the download button. */
  max-width: none;
  flex: 1 1 auto;
  min-width: 0;
}

.chart-download-button {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--theme-foreground-faintest);
  border-radius: 4px;
  background: transparent;
  color: var(--theme-foreground-muted);
  cursor: pointer;
}

.chart-download-button:hover:not(:disabled),
.chart-download-button:focus-visible {
  color: var(--theme-foreground);
  border-color: var(--theme-foreground-muted);
}

.chart-download-button.is-busy {
  cursor: progress;
  opacity: 0.5;
}

.chart-download-button.is-error {
  color: #f75b41;
  border-color: #f75b41;
}
