body {
    color: $black;
    font-family: Arial, sans-serif;
    font-size: $medium;
    line-height: 1.5;
}

h1, h2, h3, h4, h5, h6, legend {
    color: $primary-color;
    font-family: 'ColaborateRegular', Arial, sans-serif;
    line-height: 1.2;
    text-transform: none;
    margin: 0.8em 0;
    text-rendering: optimizelegibility; // Fix the character spacing for headings
}
h1 { font-size: 260%; margin: 0.8em 0; font-weight: normal; }
h2 { font-size: 230%; margin-bottom: 0.3em; font-weight: normal; }
h3 { font-size: 190%; margin-bottom: 0.4em; font-weight: normal; }
h4, legend { font-size: 140%; margin-bottom: 0.5em; font-weight: normal; }
h5 { font-size: 120%; margin-bottom: 0.3em; font-weight: normal; }
h6 { font-size: 110%; font-weight: normal; color: $fg1; }

// increase spacing between blocks
// looks better in /badges and does not break anything else
h2:not(:first-of-type) {
    margin-top: 1.5em;
}

/* don't allow headings in user generated content to be as big
 * as our own */
blockquote,
.text,
.comment .body {
    h1, h2, h3, h4, h5, h6 {
        font-size: 100%;
        margin: 0.8em 0;
    }
    h1 {
        font-size: 120%;
    }
    h2 {
        font-size: 110%;
    }
}
.category_body,
.instance_description,
.paper_text,
.proposal .body {
    h1, h2, h3, h4, h5, h6 {
        font-size: 100%;
        margin: 0.8em 0;
    }
    h1 {
        font-size: 140%;
    }
    h2 {
        font-size: 120%;
    }
    h3 {
        font-size: 110%;
    }
}
section.subpage {
    h1, h2, h3, h4, h5, h6 {
        font-size: 120%;
        margin: 0.8em 0;
    }
    h1 {
        font-size: 180%;
    }
    h2 {
        font-size: 150%;
    }
}

p {
    margin-bottom: 1.5em;
    word-wrap: break-word;

    &:last-child {
        margin-bottom: 0;
    }
}

ul, ol, dl {
    margin: 0 0 1.5em 1.5em;
}
li {
    line-height: 1.5;
    margin-left: 0;
}

hr {
    margin: 1.5em 0;
    border: 0;
    border-top: 1px dotted $border;
}

/* table */
table {
    margin-bottom: 1.5em;

    td, th {
        text-align: left;
        padding: 0.5em;
        border-top: 1px solid $border;
    }
    thead, tfoot {
        th {
            text-align: center;
        }
    }

    caption {
        font-size: $small;
    }

    &.line_based {
        td {
            border: none;
            padding: initial;

            &.line_number {
                width: 1.5em;
                padding-right: 0.8em;
                text-align: right;
                color: $fg1;
                line-height: 1.5em;
            }
            &.line_text {
                color: $black;
                font-family: Menlo, Monaco, 'Courier New', monospace;
            }
        }
    }
}

/* links */
a {
    text-decoration: none;
    color: $primary-color;
    &:hover, &:focus {
        text-decoration: underline;
    }

    &.icon_link {
        height: 1.4em;
        line-height: 1.4;
        background-repeat: no-repeat;
    }
    &.follow {
        background-position: right -254px;
        padding-right: 23px;
        &:hover, &:focus {
            background-position: right -304px;
            text-decoration: underline !important;
        }
    }
}

// blockqoute
blockquote {
    position: relative;
    font-style: italic;
    border-left: 0.4em solid $primary-color;
    padding-left: 0.5em;
    margin: 1.5em;
    cite {
        float: right;
    }
}

// code
code {
    font-size: $smaller;
    background-color: $bg2;
}
pre {
    margin: 1em 0;
    display: block;
    padding: 0.7em;
    font-size: $smaller;
    background-color: $bg2;
    border: 1px solid $border;
    max-height: 18em;
    overflow: auto;

    code {
        background-color: transparent;
    }
}

// figure
figure {
    margin: 1em 0;
}
figcaption {
    font-size: $small;
}

.pro, .con { font-size: $medium; }
.pro, ins { color: $green; }
.con, del, .countdown.highlight { color: $red; }

.meta, .utility {
    color: $fg1;
    font-size: $small;
    font-family: Arial, sans-serif;
}
h1, h2, h3, h4, h5, h6 {
    .utility {
        display: inline-block;
        margin-left: 0.8em;
        margin-bottom: 0;
    }
}
