.prototype {
    display: none;
}

input {
    margin: 0; /* reset for Safari */
}

html {
    font-family: "Apple Garamond", "Baskerville",
        "Times New Roman", "Droid Serif", "Times",
        "Source Serif Pro", serif;
}

h1 {
    font-weight: normal;
    font-style: normal;

    font-size: 40px;
    line-height: 54px;
}

article h1 {
    margin-top: 32px;
    margin-bottom: 0;
}

h2, h3, h4, h5, h6 {
    font-family: inherit;
    font-size: 18px;
    line-height: 32px;
    margin-top: 32px;
    margin-bottom: 0;
}

h2 {
    font-weight: bold;
    font-style: normal;
}

h3 {
    font-weight: normal;
    font-style: italic;
}

h4, h5, h6 {
    font-weight: normal;
    font-style: normal;
}

article ul, article ol {
    padding-left: 32px;
}

h1+*, h2+*, h3+*, h4+*, h5+*, h6+* {
    margin-top: 0;
}

article>hr {
    border: none;
    border-top: 6px solid var(--theme-main);
    width: 40px;
    margin: 20px auto;
}

.notice {
    background: var(--theme-main);
    color: var(--theme-text);

    padding: 1px 24px;
    font-size: 18px;
    line-height: 32px;

    box-sizing: border-box;
    max-width: 616px;
    width: 100%;
    margin: 30px auto;
}
.notice a {
    color: var(--theme-link);
}

.hero {
    background: var(--theme-main);
    color: var(--theme-text);

    /* Hack to force containing the children instead of collapsing marigins */
    border: 1px solid var(--theme-main);
}

.search-container {
    background: var(--theme-main);
    color: var(--theme-text);
}

header, article>*, .search {
    box-sizing: border-box;
    max-width: 616px;
    width: 100%;
    padding-left: 8px;
    padding-right: 8px;
    margin-left: auto;
    margin-right: auto;
}

header {
    margin: 0 auto;
}

article {
    margin: 50px auto 120px auto;

    font-size: 18px;
    line-height: 32px;
}

blockquote {
    margin-left: 0;
    padding-left: 12px;
    border: none;
    border-left: 4px solid #eee;
    max-width: 600px;
}

article>blockquote {
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 630px) {
    article>blockquote {
        margin-left: 8px;
        margin-right: 0;
        width: calc(100% - 8px);
    }
}

article>table {
    width: unset;
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
}

table {
    border-spacing: 8px 2px;
}

code, pre {
    background: #f8f8f8;
    font-family: "Inconsolata", "Fira Mono",
        "DejaVu Sans Mono",
        "Droid Sans Mono", "Source Code Pro",
        monospace;
}

pre {
    overflow: auto;
}

a {
    color: #1976D2;
    text-decoration: none;
}

a[href^="http"]::after {
    display: inline-block;
    padding: 0 0.1rem;
    font-size: 75%;
    content: "🔗";
    line-height: 0;
}

a[href^="http"]:hover::after {
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

nav {
    text-align: center;
}


/* Sticky footer */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}
body {
  display: flex;
  flex-direction: column;
}
.container {
  flex: 1;
}


footer {
    padding: 16px 8px 16px 8px;

    background: var(--theme-main);
    color: var(--theme-text);
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont,
        "Segoe UI", "Roboto", "Oxygen",
        "Ubuntu", "Cantarell", "Fira Sans",
        "Droid Sans", "Helvetica Neue", sans-serif;
}

footer a {
    color: var(--theme-link);
}

ul.dense {
    list-style: none;
    padding: 0;
}

article>ul.dense {
    padding: 0 8px;
}

ul.dense>li {
    display: inline;
}

ul.dense>li::after {
    content: "\200B\00B7\200B";
    margin: 0 12px;
}

ul.dense>li:last-child::after {
    content: "";
    margin: 0;
}

li.missing, ul.dense>li.missing {
    display: none;
}

input:focus, textarea:focus {
    outline: none;
}

textarea {
    border: none;
    background: none;
    margin: 0 auto;
    padding: 0;
    font-family: "SF Mono", "Monaco",
        "Inconsolata", "Fira Mono",
        "Droid Sans Mono", "Source Code Pro",
        monospace;

    width: 100%;
    resize: none;
    overflow: hidden;
}

h1>input {
    font: inherit;
    border: none;
    background: none;
    padding: 0;

    width: 100%;
}

.hero input {
    background: var(--theme-input);
    color: var(--theme-text);
}

.shadow-control {
    visibility: hidden;
    position: fixed;
    height: auto;
    min-height: 100px;
}

.editor {
    display: none;
}

.editor textarea[name="body"] {
    height: 600px;
}

.edit .editor {
    display: block;
}

.edit .rendered {
    display: none;
}

.editor-controls {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;

    box-sizing: border-box;

    text-align: right;

    box-shadow: 0px 5px 20px rgba(0,0,0, 0.2);

    background: white;
    color: var(--theme-text);
    padding: 10px 10px;

    transform: translate(0, 65px);
    transition: transform 100ms;
    transition-timing-function: linear;
}

.edit .editor-controls {
    transform: translate(0, 0);
    transition-timing-function: cubic-bezier(.17,.84,.44,1);
}

.button {
    border-radius: 2px;

    display: inline-block;
    width: 120px;
    text-align: center;
    border: none;

    cursor: pointer;

    font-family: -apple-system, BlinkMacSystemFont,
        "Segoe UI", "Roboto", "Oxygen",
        "Ubuntu", "Cantarell", "Fira Sans",
        "Droid Sans", "Helvetica Neue", sans-serif;
    font-size: 16px;
    line-height: 20px;

    padding: 10px 0px;
    margin-left: 10px;
}
.button[disabled] {
    opacity: 0.5;
    cursor: default;
}
.button:hover {
    text-decoration: none;
}
.button:not([disabled]):hover, .button:not([disabled]):active {
    background: var(--button-alt);
}

.button-cancel {
    background: white;
    color: var(--theme-main);
    --button-alt: #f0f0f0;
}
.button-default {
    background: var(--theme-main);
    color: var(--theme-text);
    --button-alt: var(--theme-input);
}

@media (min-width: 960px) {
    /* min-width is calculated like this:

    body-width = width of the main text column
    controls-width = width of .editor-controls element, including drop-shadow

    min-width = body-width + 2*controls-width = 600 + 2 * 180 = 960

    */

    .editor-controls {
        border-radius: 2px;

        position: fixed;
        left: calc(50% + 320px);
        width: 140px;
        top: calc(50% - 55px);
        height: 110px;
        padding: 10px;

        transform: translate(20px, 0);
        opacity: 0;

        transition: transform 100ms, opacity 100ms;
        transition-timing-function: linear;
    }

    .edit .editor-controls {
        transform: translate(0, 0);
        transition-timing-function: cubic-bezier(.17,.84,.44,1);
        opacity: 1;
    }

    .button {
        margin: 0;
        margin-bottom: 10px;
    }
}

article ul.search-results {
    padding-left: 8px;
}
.search-results {
    list-style: none;
}
.search-result {
    padding: 0;
    margin-bottom: 8px;
}
.search-result .title {
    font-weight: bold;
}
.search-result p {
    margin: 0;
}

.search-result a {
    display: block;
    color: inherit;
    text-decoration: none;
    padding: 8px 16px;
    background: white;
    color: black;
}
.search-result a:hover, .search-result a:focus {
    background: var(--theme-main);
    color: var(--theme-text);
}

.search {
    text-align: center;
    margin-top: 45px;
    position: relative;
}

input[type="search"]::-webkit-search-decoration {
    -webkit-appearance: none;
}

input[type="search"] {
    -webkit-appearance: none;
    border-radius: 0;

    box-sizing: border-box;
    width: 100%;
    max-width: 300px;

    padding: 0 16px;
    margin: 0;
    border: none;
    background: var(--theme-input);
    color: var(--theme-text);

    font: inherit;
    font-size: 18px;

    line-height: 32px;
    height: 34px;

    text-overflow: ellipsis;
}

input[type="search"]::placeholder {
    color: var(--theme-text);
    opacity: 0.8;
}

.search .live-results {
    text-align: left;

    box-sizing: border-box;
    width: 100%;
    max-width: 300px;

    padding: 0;
    margin: 0 auto;

    overflow: hidden;

    transition: max-height 200ms;
    max-height: 0px;
}

.search-widget-container {
    border-radius: 2px;
    overflow: hidden;

    width: 100%;
    max-width: 300px;
    display: inline-block;
}

.live-results.show {
    max-height: 500px;
}

.live-results .search-result {
    margin: 0;
}

.live-results .search-result.error {
    padding: 8px;
    color: #888;
}

@media (min-width: 630px) {
    .search {
        text-align: right;
        height: 38px;
        position: relative;
    }

    .search-widget-container {
        position: absolute;
        right: 8px;
        width: 300px;
        box-shadow: 0 0 0 rgba(0,0,0,0.2);
        transition: all 0.2s ease-in-out;
    }

    .focus .search-widget-container {
        box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    }

    .search .live-results {
        width: 100%;
        max-height: 0px;
    }

    .search.focus .live-results {
        max-height: 500px;
    }
}

.diff {
    background: none;
    white-space: pre-wrap;
}
.removed {
    color: #866;
    background: #fdd;
    text-decoration: line-through;
}
.added {
    background: #ceb;
}

.modal-block {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);

    display: flex;
    align-items: center;
    justify-content: center;
}

.popup {
    display: flex;
    flex-direction: column;

    text-align: center;
    background: #eee;
    box-shadow: 0px 5px 20px rgba(0,0,0, 0.2);
}

.popup>.message {
    margin: 16px 32px;
    max-width: 600px;
}

.popup>.btn-row {
    display: flex;
    flex-direction: row;

    font-family: -apple-system, BlinkMacSystemFont,
        "Segoe UI", "Roboto", "Oxygen",
        "Ubuntu", "Cantarell", "Fira Sans",
        "Droid Sans", "Helvetica Neue", sans-serif;
}

.btn-row>* {
    padding: 8px 16px;
    margin: 0;
    background: white;
    color: black;
    border: none;
    border-radius: 0;
    flex: 1;

    font-family: inherit;
    cursor: pointer;
}
.btn-row>*:hover {
    text-decoration: underline;
}

.primary {
    background: #337ab7;
    color: white;
}

@media print {
    @page {
        margin: 25mm;
    }

    html, body {
        height: unset;
    }

    body {
        display: block;
    }

    .hero {
        background: none;
        color: initial;

        /* Disable hack to force containing the children instead of collapsing marigins */
        border: none;
    }

    h1, h2, h3, h4, h5, h6 {
        /* This doesn't work at all, but it might start to! */
        break-after: avoid;
        page-break-after: avoid;
    }

    a, a:visited, a:hover, a:visited:hover {
		text-decoration: none;
		color: black !important;
		font-weight: normal !important;
	}

    a[href^="http"]::after {
        display: none;
    }

    article {
        margin: 0 auto;
    }

    article>hr {
        border-color: black;
    }

    h1 {
        font-size: 22pt;
        line-height: 33pt;
    }

    article, h2, h3, h4, h5, h6, .notice {
        font-size: 12pt;
        line-height: 18pt;
    }

    article p {
        text-align: justify;
    }

    pre {
        overflow: visible;
        white-space: pre-wrap;
    }

    .search {
        display: none;
    }
    footer {
        display: none;
    }
}