@import url("/cgj/font-loader.css");

:root {
  --title-bg: #fcfcfc;
  --title-fg: #333;
  --title-crumb: #555;
  --title-crumb-mark: #888;
  --title-size: 1rem;


  --head-bg: #01579b;
  --head-fg: rgba(255, 255, 255, 0.96);
  --head-a: rgba(179, 229, 252, 0.96);
  --head-aa: rgba(255, 183, 77, 0.96);
  --line: #eee;

  --active-bg: #01579b;

  --input-bg: #1e1e1e;
  --output-bg: #fff;
}

* {
  box-sizing: inherit;
}

html {
  font-family: mcdUi, sans-serif;
  font-size: 16px;
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  color: var(--head-fg);
  background: var(--head-bg);
  width: 100vw;
  height: 100vh;
}

#spine {
  display: flex;
  flex-direction: column;
}

img {
  box-sizing: content-box;
}

#header-group {
  width: 100vw;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.35);
  z-index: 1;
  height: 8rem;
  display: flex;
  flex-direction: column;
}

#header-group * {
  user-select: none;
}

#header-group p {
  margin: 0;
  padding: 0 0 0 inherit;
}

header {
  width: 100vw;
  height: 3.5rem;
  padding: 1rem 0;
  color: var(--title-fg);
  background: var(--title-bg);
  display: flex;
  align-items: center;
  font-size: 1rem;
}

header>* {
  display: block;
  overflow: hidden;
}

header>img {
  width: calc(1.5 * var(--title-size));
  height: calc(1.5 * var(--title-size));
  margin-right: 0.5rem;
}

header>a:first-of-type {
  color: var(--title);
  font-weight: bold;
}

header>a {
  color: var(--title-crumb);
  text-decoration: none !important;
}

header>a:after {
  content: ">";
  opacity: 0.67;
  padding: 0 0.5rem;
  color: var(--title-crumb-mark);
}

header>a:last-of-type:after {
  display: none;
}

header>h1 {
  font-size: calc(var(--title-size) * 0.83);
  font-weight: bold;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

header a {
  color: #333;
}

#header-group>* {
  padding-left: 4vw;
}


/* Editor and output panels */
#playground {
  flex: 1 0 8rem;
  display: flex;
  flex-direction: row;
  background: var(--head-bg);
  height: calc(100vh - 8rem);
}

#input,
#output {
  border: none;
  width: 50%;
  min-width: 100px;
  height: inherit;
}

.gutter {
  cursor: ew-resize;
  width: 16px;
  background: var(--head-bg);
  z-index: 1;
  /* border-width: 0 1px;
  border-color: #eee;
  border-style: solid; */
}

/* inner container for the editor */
#editor {
  width: 100%;
  height: 100%;
  background: var(--input-bg);
}

#output {
  background: var(--output-bg);
}


/* UI controls */

#demo-controls {
  padding-top: 0.5rem;
  padding-bottom: 1rem;
  display: flex;
  flex-wrap: nowrap;
}

button {
  color: var(--head-fg);
  background: var(--head-bg);
  border: 1px solid var(--title-bg);
  min-width: 10rem;
  transition-duration: 0.16s;
  cursor: pointer;
  overflow: hidden;
  height: 2rem;
  margin: 1rem 1rem 0 0;

  font-size: 0.8125rem;
  font-weight: 400;
  text-transform: uppercase;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;

  -ms-touch-action: manipulation;
  touch-action: manipulation;

  cursor: pointer;

  transition: all 0.2s;
  background-image: none;
  background-position: 50%;
  background-size: 0 0;
  background-repeat: no-repeat;
}

@media (max-width: 650px) {
  button {
    min-width: auto;
  }
}

button:focus,
button:hover {
  background-color: rgba(255, 255, 255, 0.2);
  outline: none;
}

button:active {
  box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
  background-color: var(--active-bg);
}

button>div {
  flex: 1;
}

button>svg {
  width: 1.5rem;
  height: 1.5rem;
}

/* Popup example list */

button.popped {
  border-bottom-color: var(--active-bg);
  background-color: var(--active-bg);
  z-index: 11;
}

#example-popup {
  position: fixed;
  width: 42rem;
  max-width: calc(100% - 2rem);
  background: var(--active-bg);
  border: 1px solid #fff;
  z-index: 10;
  opacity: 0;
  display: none;
  transition: opacity 0.3s;
}

#example-popup.popped {
  opacity: 1;
  display: block;
}

.popup-join {
  position: absolute;
  top: -1px;
  left: 0;
  height: 2px;
  background: var(--active-bg);
}

#example-list {
  margin: 1rem 1rem 1rem 1rem;
  padding-top: 1rem;
  width: calc(100% - 2rem);
  max-height: calc(100vh - 10rem);
  background: var(--active-bg);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  overflow-y: auto;
}

.example-group {
  flex: 0 0 18rem;
  white-space: nowrap;
  display: flex;
  flex-direction: column;
}

.example-group>h2 {
  font-size: 1.2rem;
  font-weight: bold;
  margin: 1rem 0 4px 0;
  padding: 0;
}

.example-group a {
  color: var(--head-a);
}

.example-group a:hover,
.example-group a:active,
.example-group a:focus {
  color: var(--head-aa);
  outline: none;
}

.info-box {
  width: calc(100% - 1rem);
  padding: 0.5rem;
  margin: 3rem 0 1rem 0;
  border: 1px solid var(--head-fg);
  background: var(--head-bg);
  white-space: normal;
  font-size: 90%;
}

#click-catcher {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: none;
}

#click-catcher.popped {
  display: block;
}


input,
select {
  display: none
}

input[type=text],
select {
  border: none;
  border-bottom: 2px solid rgba(0, 0, 0, 0.125);
  border-radius: 0;
  background-color: #f7f7f7;
  padding: 3px 0 0 0;
  line-height: 1.5;
  font-size: 1rem;
  font-family: system-ui, sans-serif;
  transition: border-color 0.2s;
}

select {
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border-radius: 3px;
  border-color: #f7f7f7;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20width%3D'13'%20height%3D'13'%20viewBox%3D'0%200%2013%2013'%3E%3Cpath%20d%3D'M3%205l4%204%204-4z'%20fill%3D'rgba(0%2C0%2C0%2C0.749)'%2F%3E%3C%2Fsvg%3E");
  background-size: 0.8125rem;
  background-repeat: no-repeat;
  background-position: right 0.25rem center;
  padding: 2px 0.5rem;
}

select::-ms-expand {
  display: none;
}

input[type=text]:focus,
select:focus {
  outline: none;
  border-bottom-color: #027abb;
}

a {
  color: #027abb;
  transition: color 0.25s;
  text-decoration: none;
}

a:hover,
a:active,
a:focus {
  color: #bf360c;
  text-decoration: underline;
}

.simple-editor {
  width: 100%;
  height: 100%;
  resize: none;
  font-size: 1rem;
  border: none;
}