@import url("https://cdn.cubing.net/v0/css/@fontsource/ubuntu");

html,
body {
  margin: 0;
  font-family: Ubuntu, Tahoma, sans-serif;
  line-height: 1.25em;
}

body {
  background-color: #eaeaea;
  background-image:
    linear-gradient(
      45deg,
      #ddd 25%,
      transparent 25%,
      transparent 75%,
      #ddd 75%,
      #ddd
    ),
    linear-gradient(
      45deg,
      #ddd 25%,
      transparent 25%,
      transparent 75%,
      #ddd 75%,
      #ddd
    );
  background-size: 32px 32px;
  background-position:
    0 0,
    16px 16px;
}

body {
  padding: 1rem 1rem 5rem;
  box-sizing: border-box;
}

@media (max-width: 500px) {
  body {
    padding: 0;
  }
}

code {
  font-family: "Ubuntu Mono", monospace;
}

content {
  margin: auto;
  display: block;
  box-sizing: border-box;
  width: 1200px;
  max-width: 100%;
  background: white;
  box-shadow: 0 0 1rem rgba(0, 0, 0, 0.25);
}

#heading {
  padding: 0.75em;
  background: #4285f4;
  color: white;
  font-size: 2em;
}

#heading a {
  color: currentColor;
}

#heading.heading-with-player {
  padding: 0.25em 0.5em;
}

section {
  padding: 2rem 2rem;
}

section.no-header {
  padding-top: 1rem;
  padding-bottom: 1rem;
}

section:not(:first-child) {
  border-top: 1px solid #4285f466;
}

section.inline {
  margin: -0.5rem -2rem;
  padding: 0.5rem 2rem;
  border-top: none;
}

section:target,
div:target {
  background: #00448811;
}

section :is(h1) {
  margin-top: 0;
}

section :is(h1, h2, h3) a:not(.separate-page):hover::before {
  position: absolute;
  transform: translateX(-1.25em);
  font-size: 0.75em;
  content: "🔗";
}

section :is(h1, h2, h3) a:not(.separate-page) {
  color: inherit;
}

section :is(h1, h2, h3) a:not(:hover, .separate-page) {
  text-decoration: none;
}

code.sample {
  display: block;
  padding: 1em;
  margin: 0.5rem 0;
  background: #4285f422;
  line-height: 1.25em;
  overflow: hidden;
  overflow-x: auto;
}

code.output {
  display: block;
  padding: 1em;
  margin: 0.5rem 0;
  background: #4285f422;
  line-height: 1.25em;
  overflow: hidden;
  overflow-x: auto;
}

code.sample.output {
  background: #4285f4;
  color: white;
}

code.sample.output > span::before {
  content: "⇒ ";
  opacity: 0.3;
  font-size: 2em;
  vertical-align: -20%;
}

code.sample > span {
  display: block;
}

code.sample > span:not(:first-child) {
  margin-top: 0.5em;
}

twisty-player {
  max-width: 100%;
}

.code-demo {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5em;
  padding: 0.5em;
  background: #4285f411;
  overflow-x: hidden;
  box-sizing: border-box;
}

.code-demo > div:first-child {
  overflow-x: hidden;
}

.code-demo code.sample {
  margin: 0;
}

.code-demo twisty-player {
  width: 100%;
}

@media (min-width: 768px) {
  .code-demo {
    grid-template-columns: 1fr 1fr;
  }

  .code-demo twisty-player {
    height: 100%;
  }
}

code.sample span.js-object {
  background: rgba(0, 0, 0, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.25);
  padding: 0.2em;
  margin: -0.2em -0.1em;
  border-radius: 0.3em;
}

.boilerplate {
  color: #559bd4;
}
