/* Colors and type follow Datasette's own pages, as agent.datasette.io does */
:root {
  --ink: #111a35;
  --muted: #5b6577;
  --paper: #f8fafb;
  --card: #fff;
  --line: #dde3e8;
  --link: #276890;
  --blue: #36678e;
  --blue-light: #6090ad;
  --blue-dark: #2c5676;
  --cream: #fffff4;
  --code: #eef2f5;
  --width: 64rem;
}

* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 1rem;
}
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
}
a {
  color: var(--link);
}
img {
  max-width: 100%;
  height: auto;
}

/* The bars across the top and bottom of the page */
.hd,
.ft {
  background: linear-gradient(180deg, var(--blue-light) 0%, var(--blue) 100%);
  color: var(--cream);
}
.hd nav,
.ft p {
  max-width: var(--width);
  margin: 0 auto;
  padding: 0.6rem 1rem;
}
.hd nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  align-items: baseline;
}
.hd a,
.ft a {
  color: var(--cream);
}
.hd a {
  text-decoration: none;
  opacity: 0.85;
}
.hd a:hover,
.hd a[aria-current] {
  opacity: 1;
  text-decoration: underline;
}
.hd .site-name {
  font-weight: 700;
  opacity: 1;
  margin-right: auto;
}
.ft {
  margin-top: 3rem;
  font-size: 0.9rem;
}

/* The home page's title block */
.hero {
  background: var(--blue);
  color: var(--cream);
  border-top: 1px solid rgb(255 255 255 / 0.15);
}
.hero-inner {
  max-width: var(--width);
  margin: 0 auto;
  padding: 2.25rem 1rem 2.5rem;
}
.hero h1 {
  margin: 0;
  font-size: clamp(2.6rem, 9vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
}
.hero p {
  margin: 1rem 0 0;
  max-width: 40rem;
  font-size: 1.1rem;
}
.hero a {
  color: var(--cream);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.button {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  border: 1px solid rgb(255 255 244 / 0.55);
  border-radius: 4px;
  background: rgb(255 255 255 / 0.1);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
}
.button:hover {
  background: rgb(255 255 255 / 0.2);
}
.hero .button.primary {
  background: #fff;
  border-color: #fff;
  color: var(--ink);
}

main {
  width: 100%;
  max-width: var(--width);
  margin: 0 auto;
  padding: 1.5rem 1rem 0;
  flex: 1;
}
h1 {
  margin: 0.5rem 0 1rem;
  font-size: 2rem;
  line-height: 1.2;
}
h2 {
  margin: 2.25rem 0 0.75rem;
  font-size: 1.4rem;
  line-height: 1.25;
}
h3 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1.1rem;
  line-height: 1.3;
}
p,
ul,
ol,
pre,
table {
  margin: 0 0 1rem;
}
main > p,
main > section > p {
  max-width: 46rem;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875em;
  background: var(--code);
  padding: 0.1em 0.3em;
  border-radius: 3px;
}
pre {
  padding: 0.8rem 1rem;
  overflow-x: auto;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 5px;
  line-height: 1.45;
}
pre code {
  padding: 0;
  background: none;
  font-size: 0.85rem;
}

/* The home page's screenshot sits small on a mat, so that it reads as a
   picture of the interface and not as the interface */
.screenshot,
.shot {
  background: #e3e9ee;
  border-radius: 6px;
}
.screenshot {
  margin: 0.5rem 0 0;
  padding: 1.75rem clamp(1rem, 6vw, 4.5rem) 1.25rem;
}
.screenshot img,
.shot img {
  display: block;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgb(17 26 53 / 0.2), 0 8px 24px rgb(17 26 53 / 0.18);
}
/* The same for each chart in the gallery and on the home page's cards */
.shot {
  display: block;
  margin: 0;
  padding: 1.25rem 1.5rem 0.6rem;
}
.shot figcaption {
  display: block;
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
span.shot {
  padding-bottom: 1.25rem;
}
.shot img {
  box-shadow: 0 1px 2px rgb(17 26 53 / 0.2), 0 4px 12px rgb(17 26 53 / 0.15);
}
.screenshot figcaption {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.25rem;
  font-size: 0.9rem;
}
.demo-link {
  padding: 0.45rem 0.9rem;
  border-radius: 4px;
  background: var(--blue);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.demo-link:hover {
  background: var(--blue-dark);
}

/* Cards: chart types on the home page, charts in the gallery */
.cards {
  display: grid;
  gap: 1rem;
  padding: 0;
  list-style: none;
}
.cards.types {
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
}
.cards.charts {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 26rem), 1fr));
}
.card {
  min-width: 0;
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  scroll-margin-top: 1rem;
}
.card h3 {
  margin: 0.75rem 0 0.25rem;
}
.card p {
  margin: 0 0 0.5rem;
}
.card > :last-child {
  margin-bottom: 0;
}
.card img {
  display: block;
  width: 100%;
}
.types .card a {
  text-decoration: none;
}
.types .card a:hover h3 {
  text-decoration: underline;
}
.types .card img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: left top;
}
.types .card p {
  color: var(--muted);
  font-size: 0.95rem;
}
.card details {
  margin-top: 0.5rem;
  font-size: 0.9rem;
}
.card summary {
  cursor: pointer;
  color: var(--muted);
}
.card details pre {
  margin: 0;
  max-height: 22rem;
  overflow: auto;
  background: var(--paper);
}
.card .source {
  margin: 0.5rem 0;
  overflow-wrap: anywhere;
}

.jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin-bottom: 0.5rem;
}

/* Documentation: a table of contents beside the README */
.with-sidebar main {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}
.toc {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  padding-top: 0.75rem;
  font-size: 0.9rem;
}
.toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.toc li {
  margin: 0.35rem 0;
}
.toc ul ul {
  padding-left: 0.9rem;
}
.toc a {
  text-decoration: none;
}
.toc a:hover {
  text-decoration: underline;
}
@media (max-width: 50rem) {
  .with-sidebar main {
    display: block;
  }
  .toc {
    position: static;
    max-height: none;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 6px;
  }
}

.prose {
  max-width: 48rem;
  min-width: 0;
}
.prose li {
  margin: 0.3rem 0;
}
.prose li > ol,
.prose li > ul {
  margin: 0.3rem 0;
}
.table-scroll {
  margin-bottom: 1rem;
  overflow-x: auto;
}
table {
  margin: 0;
  border-collapse: collapse;
  font-size: 0.925rem;
}
th,
td {
  padding: 0.4rem 0.75rem 0.4rem 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.release {
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}
.release:last-child {
  border-bottom: 0;
}
.release h2 a {
  color: inherit;
  text-decoration: none;
}
.release h2 a:hover {
  text-decoration: underline;
}
.release-date {
  margin-top: -0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
}
