@font-face {
  font-family: "StoryFont";
  src: url("../fonts/OldstyHPLHS.otf");
}

@font-face {
  font-family: "Roboto";
  src: url("../fonts/Roboto-Regular.ttf");
}

:root {
    --main-bg-color: #eff0f1;
    --alt-bg-color: #fcfcfc;
    --alt-bg-color2: #e0dfde;
    --input-bg-color: #fcfcfc;
    --button-bg-color: #e0dfde;
    --readonly-bg-color: #ddd;
    --disabled-bg-color: #888786;
    --link-color: #0066cc;
    --heading-color: #31363b;
    --border-color: #3e8acc;
    --soft-border-color: #3daee9;
    --input-border-color: #8ecbe9;
    --text-color: #31363b;
    --readonly-color: #31363b;
    --disabled-color: #afb0b3;
}

body {
    margin: 0;
    background-color: var(--main-bg-color);
    font-family: Roboto;
    color: var(--text-color);
}

button {
    font-family: Roboto;
}

h1, h2 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: var(--heading-color);
}
h3 {
    margin-top: 5px;
    margin-bottom: 5px;
    color: var(--heading-color);
}

a, a:visited {
    color: var(--link-color);
    text-decoration: none;
}

nav.top-bar {
    display: flex;
    justify-content: space-between;

    margin: 0;
    padding: 10px;

    border-bottom: 2px solid #aaa;
}

nav.breadcrumbs {
    margin-top: 10px;
    margin-bottom: 10px;
}

input[type="file"] {
    color: var(--input-bg-color);
    background-color: buttonface;
}

ul li {
    padding-top: 3px;
}

.app-container {
    padding: 60px;
    padding-top: 10px;
}
.app-container-simple {
    max-width: 50em;
}
@media (max-width: 1024px) {
    .app-container {
        padding: 40px;
        padding-top: 10px;
    }
}
@media (max-width: 800px) {
    .app-container {
        padding: 20px;
        padding-top: 10px;
    }
}
@media (max-width: 600px) {
    .app-container {
        padding: 10px;
    }
}

.login-page {
    margin-top: 30vh;
    text-align: center;
}
.site-title {
    margin-bottom: 20px;
    font-size: 24px;
}
.login-form {
    width: 100%;
}
.login-form .form-line label {
    display: inline-block;
    min-width: 100px;
    text-align: right;
    margin-right: 10px;
}
.login-form .form-actions {
    margin-top: 5px;
}
.narrow-form {
    max-width: 500px;
}
.vertical-form {
    display: flex;
    flex-direction: column;
}
.inline-form {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.single-field-form {
    display: flex;
    justify-content: space-between;
}

.vertical-form .form-line {
    margin-bottom: 18px;
}
.vertical-form label {
    font-size: 18px;
}
.inline-form label {
    font-weight: bold;
}
.inline-form label.checkbox {
    font-weight: normal;
}
.vertical-form input, .inline-form input {
    border: 1px solid black;
    background-color: #eee;
}
.vertical-form input[type="text"],
.vertical-form input[type="password"],
.vertical-form input[type="email"],
.vertical-form textarea {
    width: 100%;
}
.vertical-form input[type="color"] {
    display: block;
}
.vertical-form input[type="color"]:disabled {
    opacity: 15%;
}
.vertical-form input[type="text"],
.vertical-form input[type="password"],
.vertical-form input[type="email"],
.vertical-form textarea,
.inline-form input[type="text"],
.inline-form input[type="password"],
.inline-form input[type="email"] {
    padding: 4px;
    border: 1px solid var(--input-border-color);
    background-color: var(--input-bg-color);
}
.vertical-form input[type="text"],
.vertical-form input[type="password"],
.vertical-form input[type="email"] {
    font-size: 22px;
}
.inline-form input[type="text"],
.inline-form input[type="password"],
.inline-form input[type="email"],
.single-field-form input[type="text"],
.single-field-form input[type="password"],
.single-field-form input[type="email"] {
    font-size: 16px;
}

.vertical-form input[type="text"][readonly],
.vertical-form input[type="email"][readonly],
.inline-form input[type="text"][readonly],
.inline-form input[type="email"][readonly],
.single-field-form input[type="text"][readonly],
.single-field-form input[type="email"][readonly],
.single-field-form textarea[readonly]{
    background-color: var(--readonly-bg-color);
    color: var(--readonly-color);
}
.vertical-form button[disabled],
.inline-form button[disabled],
.single-field-form button[disabled],
.vertical-form input[type="button"][disabled],
.inline-form input[type="button"][disabled],
.single-field-form input[type="button"][disabled],
.single-field-form textarea[disabled] {
    background-color: var(--disabled-bg-color);
    color: var(--disabled-color);
}
.single-field-form input[type="text"],
.single-field-form input[type="password"],
.single-field-form input[type="email"] {
    width: 100%;
}
.vertical-form input[type="file"] {
    border: none;
}

.secondary-form {
    margin-top: 18px;
    margin-bottom: 18px;
    padding: 15px;
    background-color: var(--alt-bg-color2);
}
.secondary-form input[type="text"], .secondary-form ul {
    font-size: 80%;
}

#loader {
    width: 100%;
    height: 100%;

    text-align: center;
}
#loader-contents {
    padding-top: 40vh;
}
#loader-contents .banner {
    font-family: "Roboto";
}
#loader, #loader button {
    font-size: 36px;
}
#loader button {
    padding: 15px;
}

#start-ui button {
    padding: 20px 30px;
    background-color: buttonface; /* Needed for Firefox for some reason */
}
#start-ui label {
    font-size: 14px;
}

.invisible {
    display: none;
}

.transparent {
    opacity: 0;
}

.fade-in {
    transition: opacity 7s;
}

.banner {
    /* For some reason, this seems needed for the character claiming error
       messages in the narration intro pages */
    position: relative;
    max-width: 50em;

    margin: 20px auto;
    padding: 10px 20px;

    color: #ddd;
}
.banner-success {
    background-color: #151;
}
.banner-error {
    background-color: #511;
}

.btn-bar {
    text-align: right;
}
.btn-bar-extra {
    margin-top: 10px;
}
.btn-bar-status {
    display: flex;
    justify-content: space-between;
}
.btn-bar-status .banner {
    margin: inherit;
    padding: 7px 10px;
    flex-grow: 1;
}
.btn-bar-status .btn-bar {
    margin-left: auto;
}

.btn {
    border: 1px solid var(--button-bg-color);
    margin: 0 3px;
    padding: 5px 10px;

    font-size: 18px;
    font-weight: normal;
    color: var(--text-color);
    background-color: var(--input-bg-color);
    white-space: nowrap;
}
a.btn {
    display: inline-block;
    text-decoration: none;
    color: var(--text-color);
}

.btn-default {
    background-color: #113;
    color: #eee;
}

.btn-small {
    font-size: 12px;
}

.btn-inline {
    display: inline-block;
    padding: 0;
    font-size: 10px;
    vertical-align: middle;
}

.btn-add {
    padding-left: 30px;
    background-image: url("/img/add.png");
    background-repeat: no-repeat;
    background-position: 8px 50%;
}

.btn-edit {
    padding-left: 30px;
    background-image: url("/img/edit.png");
    background-repeat: no-repeat;
    background-position: 8px 50%;
}

.btn-remove {
    padding-left: 30px;
    background-image: url("/img/remove.png");
    background-repeat: no-repeat;
    background-position: 8px 50%;

    background-color: #bf2424;
    color: #eee;
}

.btn-inline.btn-add {
    min-width: 18px;
    min-height: 18px;
    padding-left: 0;

    background-position: 0 50%;
}

ul.thread-list {
    display: block;
    padding-left: 0;
    margin-top: 0;
}
ul.thread-list li {
    display: block;
    margin-bottom: 15px;
    padding: 10px;
}
ul.thread-list li span.narrator {
    font-style: italic;
}
ul.thread-list .message {
    padding: 5px;
    white-space: pre-wrap;
}
ul.thread-list li .btn-bar {
    padding: 10px 5px 10px 0;
}

.thread-participants {
    display: flex;
    align-items: center;

    font-weight: bold;
    font-size: 18px;
}
.thread-participants * {
    margin-top: 5px;
    margin-bottom: 5px;
    margin-left: 5px;
}

.new-message {
    display: block;
    margin: 10px auto 20px auto;
}

.ProseMirror {
    padding: 5px;
    color: #113;
    background-color: var(--input-bg-color);
    outline: -webkit-focus-ring-color auto 5px;
}
.ProseMirror p:first-child {
    margin-top: 0;
}
.ProseMirror p:last-child {
    margin-bottom: 0;
}
.ProseMirror img, .chapter img {
    width: 100%;
}
span.mention img {
    /* This is so that the mentioned images get the color in the border */
    box-sizing: border-box;
    padding: 10px;
}
.chapter span.mention img {
    /* This is specifically for images with a single mention: otherwise the
       gradient will fade to the wrong colour */
    background-color: #e5e5e5;
}

.ProseMirror .separator, .chapter .separator {
    height: 20px;
    border: none;
    margin: 0 auto;
    padding: 10px 20px;

    background: url(/img/separator.png) no-repeat center;
}
.chapter .separator {
    font-size: 18px;
    max-width: 40em;
    background-color: #e5e5e5;
}

div.ProseMirror-menubar {
    background-color: var(--input-bg-color);
}

.dialog-overlay {
    position: fixed;
    left: 0px;
    top: 0px;
    width: 100%;
    height: 100%;
    z-index: 100;

    text-align: center;
    background-color: rgba(64, 64, 64, 0.6);
}

.dialog {
    width: 300px;

    margin-top: 40vh;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid #000;
    padding: 15px;

    text-align: center;
    color: var(--text-color);
    background-color: var(--alt-bg-color);
}

.dialog-text {
    margin: 2em;
    font-size: 18px;
}

.editor-container {
    width: 100%;
    margin: 0;
    border: 1px solid var(--input-border-color);

    background-color: var(--input-bg-color);
}

.editor-container .ProseMirror {
    min-height: 200px;
}

.help {
    cursor: help;
}

.dramatis-personae {
    display: block;
    padding-left: 0;
}
.dramatis-personae > li {
    display: flex;
    margin: 20px 0;
}
.dramatis-personae.compact > li {
    align-items: center;
    font-size: 20px;
}
.dramatis-personae > li .avatar {
    margin-right: 10px;
}

.avatar {
    width: 100px;
    height: 100px;
    /* This is needed because otherwise Flexbox will shrink this avatar to
       make room for the character description besides it. */
    flex-shrink: 0;
}
.avatar.small {
    width: 50px;
    height: 50px;
}

.avatar.placeholder {
    text-align: center;
    color: #fff;
    background: #000;
    user-select: none;

    line-height: 100px;
    border-radius: 50px;
    font-size: 50px;
}

.avatar.placeholder.small {
    border-radius: 25px;
    font-size: 25px;
    line-height: 50px;
}

.floating-tip {
    margin: 5px 20px;
    border: 2px solid var(--border-color);
    padding: 10px;

    font-size: 16px;
    background-color: var(--alt-bg-color2);
}
.floating-tip h3 {
    margin: 0;
    font-size: 18px;
}
.floating-tip p {
    font-weight: normal;
    margin-bottom: 0;
}
.floating-tip blockquote {
    font-style: italic;
    font-weight: normal;
}

.peekaboo-container .peekaboo-item {
    visibility: hidden;
}
.peekaboo-container:hover .peekaboo-item {
    visibility: visible;
}

.alt-background {
    background-color: var(--alt-bg-color2);
    padding: 20px;
}
.alt-background > h2 {
    margin-top: 0;
}

/* CSS Spinner rules (from http://tobiasahlin.com/spinkit/) */
.spinner {
  display: inline-block;
  width: 70px;
  text-align: center;
}
.spinner > div {
  display: inline-block;
  width: 14px;
  height: 14px;

  background-color: #333;
  border-radius: 100%;
  -webkit-animation: sk-bouncedelay 1.4s infinite ease-in-out both;
  animation: sk-bouncedelay 1.4s infinite ease-in-out both;
}
.spinner .bounce1 {
  -webkit-animation-delay: -0.32s;
  animation-delay: -0.32s;
}
.spinner .bounce2 {
  -webkit-animation-delay: -0.16s;
  animation-delay: -0.16s;
}
@-webkit-keyframes sk-bouncedelay {
  0%, 80%, 100% { -webkit-transform: scale(0) }
  40% { -webkit-transform: scale(1.0) }
}
@keyframes sk-bouncedelay {
  0%, 80%, 100% {
    -webkit-transform: scale(0);
    transform: scale(0);
  } 40% {
    -webkit-transform: scale(1.0);
    transform: scale(1.0);
  }
}
/* End of the CSS spinner rules */

/* Print CSS */
@media print {
    nav.top-bar {
        display: none;
    }
}
