/* Copyright 2024 Observable, Inc. */
@import url("https://fonts.googleapis.com/css2?family=Source+Serif+Pro:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&display=swap");

:root {
  --syntax-normal: #1b1e23;
  --syntax-comment: #828282;
  --syntax-diff: #24292e;
  --syntax-diff-bg: #ffffff;
  --syntax-number: #20a5ba;
  --syntax-keyword: #c30771;
  --syntax-atom: #10a778;
  --syntax-string: #008ec4;
  --syntax-error: #ffbedc;
  --syntax-unknown-variable: #838383;
  --syntax-known-variable: #005f87;
  --syntax-matchbracket: #20bbfc;
  --syntax-key: #6636b4;
  --hr: rgba(0, 0, 0, 0.05);
  --monospace: Menlo, Consolas, monospace;
  --monospace-font: 14px/1.5 var(--monospace);
  --serif: "Source Serif Pro", "Iowan Old Style", "Apple Garamond",
    "Palatino Linotype", "Times New Roman", "Droid Serif", Times, serif,
    "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  --sans-serif: -apple-system, BlinkMacSystemFont, "avenir next", avenir,
    helvetica, "helvetica neue", ubuntu, roboto, noto, "segoe ui", arial,
    sans-serif;
}

html {
  font: 17px/1.5 var(--serif);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #1b1e23;
}

body {
  margin: 0 14px;
}

body.fullscreen {
  margin: 0;
}

@media print {
  html {
    font-size: 12pt;
  }
  body {
    margin: 0;
  }
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: #333;
  font-weight: 700;
  line-height: 1.15;
  margin-top: 0;
  margin-bottom: 0.25rem;
}

h2 ~ p,
h3 ~ p,
h4 ~ p,
h2 ~ table,
h3 ~ table,
h4 ~ table {
  margin-top: 0;
}

.observablehq:first-of-type h1 + h2 {
  font-size: 20px;
  font-style: italic;
  font-weight: normal;
  margin-bottom: 1rem; /* see h2 ~ p */
}

a[href] {
  text-decoration: none;
}

a[href]:hover {
  text-decoration: underline;
}

h1 code,
h2 code,
h3 code,
h4 code,
h5 code,
h6 code {
  font-size: 90%;
}

pre, code, tt {
  font-family: var(--monospace);
  font-size: 14px;
  line-height: 1.5;
}

img {
  max-width: calc(100vw - 28px);
}

p,
table,
figure,
figcaption,
h1,
h2,
h3,
h4,
h5,
h6,
.katex-display {
  max-width: 640px;
}

blockquote,
ol,
ul {
  max-width: 600px;
}

blockquote {
  margin: 1rem 1.5rem;
}

ul,
ol {
  padding-left: 28px;
}

hr {
  height: 1px;
  margin: 1rem 0;
  padding: 1rem 0;
  border: none;
  background: no-repeat center/100% 1px
    linear-gradient(to right, var(--hr), var(--hr));
}

pre {
  padding: 2px 0;
}

.observablehq--md-pre {
  overflow-x: auto;
}

input:not([type]),
input[type="email"],
input[type="number"],
input[type="password"],
input[type="range"],
input[type="search"],
input[type="tel"],
input[type="text"],
input[type="url"] {
  width: 240px;
}

input,
canvas,
button {
  vertical-align: middle;
}

button,
input,
textarea {
  accent-color: #3b5fc0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font: 13px/1.2 var(--sans-serif);
}

table pre,
table code,
table tt {
  font-size: inherit;
  line-height: inherit;
}

th > pre:only-child,
td > pre:only-child {
  margin: 0;
  padding: 0;
}

th {
  color: #111;
  text-align: left;
  vertical-align: bottom;
}

td {
  color: #444;
  vertical-align: top;
}

th,
td {
  padding: 3px 6.5px 3px 0;
}

th:last-child, td:last-child {
  padding-right: 0;
}

tr:not(:last-child) {
  border-bottom: solid 1px #eee;
}

thead tr {
  border-bottom: solid 1px #ccc;
}

figure,
table {
  margin: 1rem 0;
}

figure img {
  max-width: 100%;
}

figure > h2,
figure > h3 {
  font-family: var(--sans-serif);
}

figure > h2 {
  font-size: 20px;
}

figure > h3 {
  font-size: 16px;
  font-weight: normal;
}

figcaption {
  font: small var(--sans-serif);
  color: var(--syntax-unknown-variable);
}

.observablehq--expanded,
.observablehq--collapsed,
.observablehq--function,
.observablehq--import,
.observablehq--string:before,
.observablehq--string:after,
.observablehq--gray {
  color: var(--syntax-normal);
}

.observablehq--collapsed,
.observablehq--expanded.observablehq--inspect a {
  cursor: pointer;
}

.observablehq--caret {
  margin-right: 4px;
  vertical-align: baseline;
}

.observablehq--field {
  text-indent: -1rem;
  margin-left: 1rem;
}

.observablehq--prototype-key,
.observablehq--empty,
.hljs-comment {
  color: var(--syntax-comment);
}

.hljs-built_in {
  color: var(--syntax-known-variable);
}

.observablehq--unknown {
  color: var(--syntax-unknown-variable);
}

/* NOTE: please keep hljs-* styles up to date in src/syntax.css */
.hljs-keyword,
.hljs-selector-tag,
.hljs-section,
.hljs-doctag,
.hljs-type,
.hljs-tag,
.hljs-name,
.hljs-selector-id,
.hljs-selector-class,
.hljs-strong {
  color: var(--syntax-keyword);
}

a[href],
.observablehq--keyword,
.observablehq--blue {
  color: #3182bd;
}

.hljs-deletion,
.hljs-variable,
.observablehq--forbidden,
.observablehq--pink {
  color: #e377c2;
}

.observablehq--orange {
  color: #e6550d;
}

.observablehq--null,
.observablehq--undefined,
.observablehq--boolean,
.hljs-literal {
  color: var(--syntax-atom);
}

.hljs-number,
.hljs-regexp,
.hljs-bullet,
.hljs-link,
.observablehq--bigint,
.observablehq--number,
.observablehq--date,
.observablehq--regexp,
.observablehq--symbol,
.observablehq--green {
  color: var(--syntax-number);
}

.observablehq--index,
.observablehq--key {
  color: var(--syntax-key);
}

.observablehq--empty {
  font-style: oblique;
}

.hljs-string,
.hljs-meta,
.hljs-symbol,
.hljs-template-tag,
.hljs-template-variable,
.hljs-addition,
.observablehq--string,
.observablehq--purple {
  color: var(--syntax-string);
}

/* Note: Tachyons' dark-red */
.observablehq--error,
.observablehq--red {
  color: #e7040f;
}

.observablehq {
  position: relative;
  margin: 17px 0;
  min-height: 1.5rem; /* the standard line-height */
}

.observablehq:before {
  content: "";
  position: absolute;
  left: -14px;
  top: 0;
  bottom: 1px;
  width: 4px;
  transition: background-color 250ms linear;
}

.observablehq--running.observablehq--worker:before,
.observablehq--changed.observablehq--worker:before {
  background-color: hsl(217, 13%, 70%);
  transition: none;
}

.observablehq--error:before {
  background-color: #e7040f;
}

.observablehq:empty:after,
.observablehq > link:only-child,
.observablehq > style:only-child,
.observablehq--inspect {
  font: var(--monospace-font);
  overflow-x: auto;
  display: block;
  padding: 4px 0; /* matches a one-line editor */
  white-space: pre;
}

.observablehq--worker:not(.observablehq--running):empty:after {
  content: "<detached>";
  color: var(--syntax-comment);
  font-style: oblique;
}

.observablehq > link:only-child,
.observablehq > style:only-child {
  visibility: hidden;
  white-space: nowrap;
  color: var(--syntax-keyword);
}

.observablehq > link:only-child:before {
  content: "<link>";
  visibility: visible;
  text-decoration: none;
  pointer-events: none;
}

.observablehq > style:only-child:before {
  content: "<style>";
  visibility: visible;
}

.observablehq--inspect.observablehq--import {
  white-space: normal;
}

.observablehq--inspect::-webkit-scrollbar {
  display: none;
}

.observablehq--error .observablehq--inspect {
  word-break: break-all;
  white-space: pre-wrap;
}

.observablehq--string-expand {
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 2px;
  font-size: 80%;
  background: #eee;
  color: var(--syntax-normal);
  cursor: pointer;
  vertical-align: middle;
  position: sticky;
  right: 0;
}

.observablehq--string-expand:hover {
  background: #ddd;
}

.observablehq--string-expand:active {
  background: #ddd;
}
