@font-face {
    font-family: advocate_15_cond_med;
    font-style: normal;
    font-weight: normal;
    font-stretch: normal;
    font-display: auto;
    src: url(fonts/advocate_15_cond_med.woff2) format('woff2');
}

@font-face {
    font-family: heliotrope_4;
    font-style: normal;
    font-weight: normal;
    font-stretch: normal;
    font-display: auto;
    src: url(fonts/heliotrope_4_regular.woff2) format('woff2');
}
@font-face {
    font-family: heliotrope_4;
    font-style: italic;
    font-weight: normal;
    font-stretch: normal;
    font-display: auto;
    src: url(fonts/heliotrope_4_italic.woff2) format('woff2');
}
@font-face {
    font-family: heliotrope_4;
    font-style: normal;
    font-weight: bold;
    font-stretch: normal;
    font-display: auto;
    src: url(fonts/heliotrope_4_bold.woff2) format('woff2');
}

@font-face {
    font-family: heliotrope_4;
    font-style: italic;
    font-weight: bold;
    font-stretch: normal;
    font-display: auto;
    src: url(fonts/heliotrope_4_bold_italic.woff2) format('woff2');
}

:root {
    --text: #0b0c0c;
    --text-alt: #505a5f;

    --link: #003078;
    --link-alt: #1d70b8;

    --border: #b1b4b6;

    --highlight: #ff0000;

    --heading-underline: #730b0b;

    --bg-notice: #a5005e;
    --text-notice: #ffffff;

    --thead-fg: #ffffff;
    --thead-bg: #730b0b;
    --text-table-even: #000000;
    --bg-table-even: rgba(0,0,0,0.05);
    --border-table-inner: #dddddd;
    --border-table-outer: #730b0b;
}

* {
    box-sizing: border-box;
    max-width: 100%;
    object-fit: scale-down;
    margin: 0;
    padding: 0;
}

html {
    font-family: heliotrope_4, serif;
    font-size: 22px;
    color: var(--text);
}

body {
    max-width: 61rem;
    margin: 0 auto;
    padding: 1rem;
}

#wrapper {
    display: flex;
    flex-direction: row-reverse;
    justify-content: center;
}

main {
    /* needed to make large <pre>s not stretch the container, unfortunately */
    max-width: 45rem;
    /* needed to stretch the container if the contents are too narrow */
    width: 45rem;
}

nav {
    min-width: 15rem;
    margin-right: 1rem;
    font-size: 0.8rem;
}

footer {
    color: var(--text-alt);
    text-align: right;
    padding: 16px;
    font-size: 0.8rem;
}

p {
    line-height: 1.4;
}

.link, .markdown a {
    color: var(--link);
    text-decoration: underline;
}

.link:hover, .markdown a:hover {
    color: var(--link-alt);
    text-decoration: none;
}

.link--no-underline {
    text-decoration: none;
}

.link--notice {
    color: var(--text-notice) !important;
}

.main-heading {
    font-family: advocate_15_cond_med, sans-serif;
    font-size: 2.5rem;
    text-align: right;
    margin-bottom: 32px;
}

.memo-metadata {
    display: grid;
    grid-template-columns: auto auto;
    grid-column-gap: 16px;
}

.memo-metadata__label {
    text-align: right;
    font-weight: bold;
}

.navigation-list--index {
    padding-top: 16px;
}

.navigation-list__item {
    list-style-type: none;
}

.navigation-list__item::before {
    content: "— ";
    padding-right: 6px;
}

.navigation-list__item > .navigation-list {
    padding-left: 20px;
}

.navigation-list__division {
    margin-top: 16px;
    list-style-type: none;
    font-weight: bold;
}

.sidebar__sticky {
    position: sticky;
    top: 1em;
}

.sidebar-box + .sidebar-box {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.sidebar-box--notice {
    background: var(--bg-notice);
    color: var(--text-notice);
    padding: 30px !important;
    border: none !important;
}

span.highlight {
    color: var(--highlight);
    font-weight: bold;
}

aside.highlight {
    padding: 16px;
    margin: 16px 0;
    border: 5px solid var(--highlight);
    font-weight: bold;
}

.markdown > :first-child {
    margin-top: 0;
}

.markdown h2, .markdown h3, .markdown h4, .markdown h5, .markdown h6 {
    font-size: 1.25rem;
    font-weight: bold;
    margin-top: 16px;
    margin-bottom: 8px;
}

.markdown h2 {
    border-bottom: 5px solid var(--heading-underline);
    font-size: 1.5rem;
    counter-reset: h3counter;
}
.markdown h3:before {
    content: counter(h3counter) ".\0000a0";
}
.markdown h3 {
    counter-increment: h3counter;
    counter-reset: h4counter;
}
.markdown h4:before {
    content: counter(h3counter) "." counter(h4counter) ".\0000a0";
}
.markdown h4 {
    counter-increment: h4counter;
    counter-reset: h5counter;
}
.markdown h5:before {
    content: counter(h3counter) "." counter(h4counter) "." counter(h5counter) ".\0000a0";
}
.markdown h5 {
    counter-increment: h5counter;
    counter-reset: h6counter;
}
.markdown h6:before {
    content: counter(h3counter) "." counter(h4counter) "." counter(h5counter) "." counter(h6counter) ".\0000a0";
}
.markdown h6 {
    counter-increment: h6counter;
}

.markdown ul, .markdown ol {
    margin-top: 16px;
    padding-left: 20px;
}

.markdown blockquote, .markdown pre, .markdown table {
    margin: 16px 0;
}

.markdown blockquote {
    border-left: 5px solid var(--border);
    padding-left: 1em;
}

.markdown pre.code {
    border-left: 5px solid var(--border);
    /* full padding because the background colour looks too "tight" otherwise */
    padding: 1em;
    overflow: auto;
    font-size: 0.8rem;
}

.markdown p, .markdown li {
    margin-bottom: 16px;
}

.markdown figure {
    margin-bottom: 16px;
}

.markdown img {
    margin: 0 auto;
    display: block;
}

.markdown figcaption {
    text-align: center;
    font-style: italic;
}

.markdown hr {
    color: var(--border);
    margin: 24px;
}

.markdown pre.asciiart {
    line-height: normal;
}

.markdown table {
    width: 100%;
    border-top: 1px solid var(--border-table-outer);
    border-bottom: 1px solid var(--border-table-outer);
    border-collapse: collapse;
    border-spacing: none;
}

.markdown td, .markdown th {
    padding: 8px;
}

.markdown thead {
    background-color: var(--thead-bg);
    color: var(--thead-fg);
}

.markdown tr:nth-child(even) {
    background-color: var(--bg-table-even);
    color: var(--text-table-even);
}

.markdown .table-column-group-end {
    border-right: 1px solid var(--border-table-inner);
    padding-right: 16px;
}

.markdown .spoiler {
    color: var(--text);
    background-color: var(--text);
}

.markdown .spoiler:hover {
    color: inherit;
    background-color: transparent;
}

.markdown .footnotes {
    margin-top: 32px;
    border-top: 5px solid var(--heading-underline);
}

.markdown .footnotes hr {
    display: none;
}
