@import "common.css";

html {
    padding: 5%;
    color: white;
    line-height: 1.5;
    background-color: hsl(210, 80%, 40%);
}

a {
    color: inherit;
    text-decoration: none;
}

a[href] {
    font-family: "Lato Black", sans-serif;
    color: hsl(60, 100%, 50%);
    text-decoration: underline;
}

.code a[href] {
    font-family: monospace;
    font-weight: bold;
}

a code {
    font-weight: bold;
}

a.secondary[href] {
    font-weight: normal;
    color: white;
    font-family: "Lato", sans-serif;
    text-decoration: none;
    border-bottom: 1px dashed hsla(0, 0%, 100%, 0.5);
}

code {
    padding-left: 0.25em;
    padding-right: 0.25em;
    padding-top: 0.125em;
    padding-bottom: 0.125em;
    border-radius: 0.25em;
    font-style: normal;
    background-color: hsla(0, 0%, 0%, 0.25);
}

header, section {
    max-width: 50rem;
    margin-left: auto;
    margin-right: auto;
}

section + section {
    margin-top: 2rem;
}

header {
    position: relative;
}

header .previous, header .next {
    position: absolute;
    top: 0;
}

header .previous {
    left: 0;
}

header .previous::before {
    content: "« ";
}

header .next {
    right: 0;
}

header .next::after {
    content: " »";
}

h1, h2, h3 {
    line-height: 1;
}

h1 {
    margin-bottom: 1em;
    text-align: center;
    font-size: 3rem;
}

.synopsis {
    margin-top: -1.75rem;
    margin-bottom: 2rem;
    text-align: center;
    font-size: 1.5rem;
    font-style: italic;
}

h2 {
    margin-top: 2rem;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

h3 {
    margin-top: 1.5rem;
    margin-bottom: 1em;
    font-size: 1rem;
    font-family: "Lato Black", sans-serif;
}

p:not(:last-child), blockquote:not(:last-child), ul:not(:last-child), ol:not(:last-child) {
    margin-bottom: 1rem;
}

ul, ol {
    padding-left: 2rem;
}

ul {
    list-style-type: square;
}

ol.large ul, ol.large ol {
    margin-top: 0.25rem;
}

ol.large {
    counter-reset: list;
}

ol.large > li {
    position: relative;
    display: block;
    counter-increment: list;
}

ol.large > li:not(:last-child) {
    margin-bottom: 0.25rem;
}

ol.large > li::before {
    content: counter(list);
    position: absolute;
    right: 100%;
    top: 0;
    margin-right: 1rem;
    font-size: 3rem;
    line-height: 1;
}

ol.large > li:not(:last-child) {
    margin-bottom: 2rem;
}

ol.large ul, ol.large ol {
    margin-top: 1rem;
}

ol.large ul > li:not(:last-child), ol.large ol:not(.code) > li:not(:last-child) {
    margin-bottom: 0.5rem;
}

figure {
    text-align: center;
    margin-top: 1rem;
}

ol.code {
    counter-reset: code;
    margin-bottom: 1rem;
    padding: 1em;
    padding-left: 5em;
    line-height: 1.5;
    font-family: monospace;
    background-color: hsla(0, 0%, 0%, 0.25);
}

ol.code li {
    counter-increment: code;
    position: relative;
    list-style-type: none;
    white-space: pre-wrap;
    min-height: 1.5em;
}

ol.code .comment {
    color: hsla(0, 0%, 100%, 0.75);
}

ol.code li::before {
    content: counter(code);
    position: absolute;
    right: 100%;
    height: 100%;
    margin-right: 1em;
    padding-right: 1em;
    border-right: 2px solid hsla(0, 0%, 100%, 0.25);
    color: hsla(0, 0%, 100%, 0.75);
}

@media print {
    ol.code li::before {
        border-right-color: hsl(0, 0%, 50%);
        color: black;
    }
}

ol.code li::after {
    /* Ensure "strut". */
    content: " ";
}

ol.code.text {
    padding-left: 1em;
}

ol.code.text li::before {
    display: none;
}

img.math {
    display: inline-block;
    vertical-align: middle;
}

.alert {
    padding: 0.5em;
    text-align: center;
    font-family: "Lato Black", sans-serif;
    background-color: hsl(210, 80%, 30%);
}

.alert strong {
    font-style: italic;
}

blockquote {
    font-style: italic;
    padding: 0.5em;
    background-color: hsl(210, 80%, 30%);
}

img {
    max-width: 100%;
}

ul.spaced li:not(:last-child) {
    margin-bottom: 1rem;
}

@media not print {
    img.math {
        filter: invert(100%);
    }
}

@media print {
    @page {
        margin: 2.5cm;
    }

    html {
        padding: 0;
    }

    * {
        color: black !important;
        background-color: white !important;
    }
}

table.sql {
    font-family: monospace;
    border-collapse: collapse;
}

table.sql th, table.sql td {
    padding: 0.375em;
    border: 1px solid hsla(0, 0%, 100%, 0.5);
}

table.sql th {
    border-left-color: transparent;
    border-right-color: transparent;
    border-top-color: transparent;
    font-weight: bold;
    color: white;
    background-color: hsl(210, 80%, 30%);
}
