@import url('https://fonts.googleapis.com/css?family=Roboto+Mono|Roboto:400,700&display=swap');
@import url('reset.css');

:root {
  /* Colors */
  --c-primary: #ff7c83;
  --c-primary-transparent: #fff2f2;
  --c-bg: #eeeff6;
  --c-text-primary: #3d3f4e;
  --c-text-secondary: #8e91a6;
  --c-postmark: #ffde00;

  /* Fonts */
  --f-primary: 'Roboto', Helvetica, Arial, sans-serif;
  --f-code: 'Roboto Mono', monospace;
}

body {
  background-color: #fff;
  font-family: var(--f-primary);
  font-size: 1rem;
  color: var(--c-text-primary);
  background-color: var(--c-bg);
}

p,
li {
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: var(--c-text-primary);
}

/* *************************** */
/** Toolbars **/
/* *************************** */

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  background-color: #fff;
  height: 56px;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  box-sizing: border-box;
  padding: 10px 15px;
}

.toolbar_meta {
  display: flex;
  align-items: stretch;
}

.toolbar_title {
  display: flex;
  font-size: 14px;
  color: var(--c-text-main);
  margin: 0;
  align-items: center;
}

.toolbar_title--index {
  font-size: 16px;
}

.toolbar_alias {
  margin-top: 4px;
}

.toolbar_text {
  margin: 0 0 0 10px;
}

.toolbar_back {
  display: none;
  text-decoration: none;
  border: 1px solid #dbdaeb;
  margin: 2px 0;
  padding: 6px 6px 0;
  border-radius: 3px;
  color: var(--c-text-secondary);
  transition: 100ms all ease-in-out;
}

.toolbar_back:hover {
  color: var(--c-primary);
  background-color: var(--c-primary-transparent);
  border-color: var(--c-primary);
}

@media only screen and (min-width: 610px) {
  .toolbar_back {
    display: inline-block;
  }
}

.toolbar_path {
  display: none;
}

@media only screen and (min-width: 610px) {
  .toolbar_path {
    display: flex;
    font-size: 12px;
    color: var(--c-text-secondary);
    align-self: center;
  }
  .toolbar_path::before {
    display: inline-block;
    content: '';
    background-image: url('../images/folder.svg');
    background-repeat: no-repeat;
    background-size: 100%;
    width: 15px;
    height: 12px;
    margin-right: 5px;
  }
}

.toolbar_icon {
  margin-right: 8px;
}

.toolbar_layout {
  align-self: center;
  margin-right: 5px;
}

.sub-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #fff;
  height: 40px;
  box-sizing: border-box;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  box-sizing: border-box;
  padding: 0 15px;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
}

/* *************************** */
/* Toggle button */
/* *************************** */

.toggle {
  display: flex;
  justify-content: space-between;
  border: 1px solid #dbdaeb;
  border-radius: 3px;
  margin-left: 10px;
  align-items: stretch;
}

.toggle_item {
  display: flex;
  box-sizing: border-box;
  text-decoration: none;
  color: var(--c-text-secondary);
  background-color: transparent;
  padding: 0 12px;
  font-size: 13px;
  margin: 3px;
  border-radius: 2px;
  font-weight: bold;
  transition: 100ms all ease-in-out;
  align-items: center;
  outline: none;
  cursor: pointer;
  border: none;
}

.toggle_item:last-child {
  margin-left: 0;
}

.toggle_item:hover {
  color: var(--c-primary);
}

.toggle_item.is-active,
.toggle_item.is-active:hover {
  background-color: var(--c-primary);
  color: #fff;
  border-radius: 2px;
  cursor: default;
}

/* *************************** */
/* Template listing */
/* *************************** */

.template-list {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  width: 80%;
}

.template-link {
  display: flex;
  justify-content: space-between;
  background-color: #fff;
  padding: 10px 15px;
  border: 1px solid transparent;
  margin-bottom: 5px;
  text-decoration: none;
  color: var(--c-text-primary);
  border-radius: 4px;
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.08);
  transition: 100ms all ease-in-out;
  align-items: center;
}

.template-link:hover {
  border: 1px solid var(--c-primary);
  background-color: var(--c-primary-transparent);
  color: var(--c-primary);
}

.template-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
}

.template-layout,
.template-layout a {
  display: none;
  color: var(--c-text-secondary);
  font-size: 12px;
}
@media only screen and (min-width: 610px) {
  .template-layout,
  .template-layout a {
    display: inline-block;
  }
}

/* *************************** */
/* Previews */
/* *************************** */

.preview-iframe {
  display: block;
  position: absolute;
  top: 56px;
  height: calc(100vh - 96px);
  width: 100%;
  z-index: 1;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
  transition: 200ms width ease-in-out;
}

.preview-iframe--layout {
  height: calc(100vh - 56px);
}

.preview-iframe--text {
  max-width: 650px;
  transform: translateX(-50%);
  left: 50%;
  background-color: #fff;
}

.preview-iframe--mobile {
  width: 360px;
}

.preview-iframe.is-loaded {
  background-color: #fff;
}

.preview-text {
  padding: 50px;
  background-color: #fff;
}

.preview-text pre {
  margin: 0;
  font-family: var(--f-primary);
  word-wrap: break-word;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.5;
  color: #000;
}

/* *************************** */
/* Misc */
/* *************************** */

.container {
  margin: 0 auto;
  padding: 56px 0;
  max-width: 800px;
}

.section-title {
  text-align: center;
  color: var(--c-text-secondary);
  font-size: 13px;
  text-transform: uppercase;
  font-weight: normal;
  letter-spacing: 1px;
  margin: 40px 0 20px;
}

.subject {
  font-size: 13px;
  font-weight: normal;
}

.subject_label {
  color: var(--c-text-secondary);
  margin-right: 8px;
}

.subject_line {
  color: var(--c-text-primary);
}

.icon {
  display: inline-block;
  background-image: url('../images/icon.png');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 75%;
  width: 22px;
  height: 22px;
  border-radius: 3px;
  background-color: var(--c-postmark);
}

.u-alias {
  display: block;
  font-size: 12px;
  color: var(--c-text-secondary);
  font-weight: normal;
}

/* *************************** */
/* Blank */
/* *************************** */

.blank {
  margin: 60px auto;
  padding: 0 15px;
}
@media only screen and (min-width: 610px) {
  .blank {
    max-width: 600px;
    padding: 0;
  }
}

.blank p {
  margin-bottom: 0;
}
.blank h4 {
  margin-top: 2em;
  margin-bottom: 1.5em;
}
.blank ol li {
  margin-bottom: 1.5em;
}
.blank ul li {
  margin-bottom: 0.5em;
}
.blank ul {
  margin-top: 0.5em;
}

/* *************************** */
/* Missing template */
/* *************************** */

.template-error-body {
  background-color: #fff;
}

.template-error {
  margin: 0;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translateX(-50%) translateY(-50%);
  width: 90%;
}
@media only screen and (min-width: 610px) {
  .template-error {
    width: 500px;
  }
}
.template-error h1,
.template-error h2 {
  color: var(--c-text-secondary);
  font-size: 16px;
  text-align: center;
}
.template-error h2 {
  font-weight: normal;
}
.template-error_list {
  text-align: left;
}
.template-error_list li {
  color: var(--c-text-secondary);
  font-size: 14px;
  margin-bottom: 0.5em;
}

/* *************************** */
/* Utilities */
/* *************************** */

.is-hidden {
  display: none;
}

.f-code,
pre,
code {
  font-family: var(--f-code);
}

code {
  padding: 2px 4px 3px;
  color: var(--c-primary);
  background-color: #fff;
  border-radius: 4px;
  font-size: 13px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  white-space: nowrap;
}

.snippet {
  margin-top: 10px;
  padding: 10px;
  color: var(--c-primary);
  background-color: #fff;
  border-radius: 4px;
  font-size: 13px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  line-height: 1.4;
}
.snippet pre {
  margin: 0;
  word-break: break-all;
  white-space: pre-wrap;
}
.snippet--fit {
  display: inline-block;
}

.center {
  text-align: center;
}

/* *************************** */
/* Viewport icons */
/* *************************** */

.icon-view {
  width: 40px;
  padding: 0;
}
.icon-view::before {
  display: inline-block;
  content: '';
  background-image: url('../images/responsive.svg');
  margin: 0 auto;
}

/* Mobile icon */
.icon-view--mobile::before {
  width: 11px;
  height: 16px;
}

.icon-view--mobile.is-active::before,
.icon-view--mobile.is-active:hover::before {
  background-position: 0 -16px;
}

.icon-view--mobile:hover::before {
  background-position: 0 -32px;
}

/* Desktop icon */
.icon-view--desktop::before {
  width: 18px;
  height: 13px;
  background-position: 18px 0;
}

.icon-view--desktop:hover::before {
  background-position: 18px -32px;
}

.icon-view--desktop.is-active::before,
.icon-view--desktop.is-active:hover::before {
  background-position: 18px -16px;
}

/* *************************** */
/* Reloaded message */
/* *************************** */

.reloaded {
  display: flex;
  align-items: center;
  font-size: 13px;
  transition: 200ms all ease-in-out;
  transform: translateY(4px);
  opacity: 0;
  font-weight: bold;
  color: var(--c-primary);
}

.reloaded::before {
  content: '';
  display: inline-block;
  background-image: url('../images/check.svg');
  background-size: 100%;
  width: 15px;
  height: 15px;
  margin-right: 4px;
}

.reloaded.is-active {
  transform: translateY(0);
  opacity: 1;
}

.reloaded.is-active::before {
  animation: 280ms 500ms 1 linear spinzoom;
}

/* *************************** */
/* Loading indicator */
/* *************************** */

.loader {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translateX(-50%) translateY(-50%);
  text-align: center;
  z-index: 2;
}
.loader_spinner {
  display: inline-block;
  position: relative;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: linear-gradient(
    var(--c-text-secondary),
    var(--c-primary),
    var(--c-postmark)
  );
  animation: spin 600ms linear infinite;
}
.loader_spinner span {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  left: 0;
  background: linear-gradient(
    var(--c-text-secondary),
    var(--c-primary),
    var(--c-postmark)
  );
}
.loader_spinner span:nth-child(1) {
  filter: blur(5px);
}
.loader_spinner::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  right: 3px;
  bottom: 3px;
  background: #f1f1f1;
  border: solid rgba(255, 255, 255, 0.4) 3px;
  border-radius: 50%;
}
.loader_text {
  color: var(--c-text-secondary);
  font-weight: bold;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 1em 0 0;
}

.has-error {
  color: #f95400;
}

.syntax-error {
  display: inline-block;
  margin-left: 4px;
  background-color: #f95400;
  border-radius: 2px;
  color: white;
  font-weight: bold;
  padding: 2px 4px;
  font-size: 11px;
}

.subject-error-tooltip p {
  margin: 0;
  display: list-item;
  list-style-type: disc;
  list-style-position: inside;
  font-size: 13px;
}

.tooltip {
  background-color: #333;
  color: white;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 13px;
  display: none;
}
.tooltip[data-show] {
  display: block;
  z-index: 5;
}

/* *************************** */
/* Animations */
/* *************************** */

@keyframes spinzoom {
  0% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(220deg) scale(1.6);
    filter: blur(0.5px);
  }
  100% {
    transform: rotate(359deg) scale(1);
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
