@font-face {
    font-family: 'Floraison des Amours';
    src: url('fonts/floraison-des-amours.woff2') format('woff2');
}
@font-face {
    font-family: 'Tenor Sans';
    src: url('fonts/tenor-sans.woff2') format('woff2');
}

/* Reset */
body, h1, h2, h3, p, ul, li, table, td {
    padding: 0;
    border: 0;
    margin: 0;
}
a, a:visited {
    color: inherit;
}
h1, h2, h3, input, textarea {
    font: inherit;
}
ul {
    list-style: none;
}
table {
    border-collapse: collapse;
    border-spacing: 0;
}

/* Base */
body {
    font: 16px 'Tenor Sans';
    line-height: 1.2;
    text-align: center;
    overflow-wrap: break-word;
}

/* Headings */
header {
    padding: 24px;
    margin-bottom: 16px;
}
h1, h2 {
    font-family: 'Floraison des Amours';
    line-height: 1;
}
h1 {
    font-size: 100px;
}
h2 {
    font-size: 48px;
}
h3 {
    text-transform: uppercase;
    font-size: 18px;
    font-weight: bold;
    margin-top: 24px;
}
h2, h3 {
    margin-bottom: 16px;
}
@media (width < 1000px) {
    header {
        padding: 16px;
    }
    h1 {
        font-size: 64px;
    }
}
@media (width < 656px) {
    h1 {
        font-size: 50px;
    }
    h2 {
        font-size: 40px;
    }
    h3 {
        font-size: 16px;
    }
}

/* Paragraphs, lists */
p, ul {
    margin: 16px 0;
}
li {
    margin: 8px 0;
}

/* Tables */
table {
    text-align: left;
    margin: 16px auto;
}
td {
    padding-top: 8px;
    padding-left: 8px;
}
tr:first-child td {
    padding-top: 0;
}
td:first-child {
    padding-left: 0;
}
.timeline td:first-child {
    padding-right: 8px;
    border-right: 1px solid #333;
}

/* Forms */
textarea {
    display: block;
    box-sizing: border-box;
    width: 100%;
    height: 64px;
    margin-top: 4px;
    margin-bottom: 16px;
}
@media (width < 375px) {
    input[type=text] {
        width: 128px;
    }
}

@media screen {
    /* Base */
    body {
        color: #333;
        background: url('bg.jpg') center/cover fixed;
        /* So the background is totally uncovered when you scroll all the way to the bottom */
        margin-bottom: 100vh;
    }

    /* Headings */
    header {
        background: #f1d4d7;
    }
    h1, h2, h3 {
        color: #bf9b30;
        text-shadow: 1px 2px 1px #fff;
    }

    /* Top-level sections */
    body > section {
        max-width: 576px;
        padding: 24px 24px 8px 24px;
        border-radius: 16px;
        margin: 16px auto;
    }
    body > section:nth-child(4n) {
        background: #fff7e6ed;
    }
    body > section:nth-child(4n+1) {
        background: #e4eef5ed;
    }
    body > section:nth-child(4n+2) {
        background: #f5e1e3ed;
    }
    body > section:nth-child(4n+3) {
        background: #ffffffed;
    }

    /* Links */
    a:hover {
        color: #9c7f27;
    }

    /* ToC */
    nav {
        font-size: 18px;
        font-weight: bold;
        color: #d9bc67;
        padding: 24px;
    }
    nav ul {
        /* Cancel li margin */
        margin: -8px 0;
    }
    nav a {
        text-decoration: none;
    }
    nav a:hover {
        color: #ecdcad;
        text-decoration: underline;
    }
    @media (width < 375px) {
        nav {
            font-size: 16px;
        }
    }

    /* Responsiveness */
    @media (width >= 1232px) {
        /* Sections centered, ToC to the left */
        nav {
            right: 50%;
            margin-right: 328px;
        }
    }
    @media (width >= 944px) and (width < 1232px) {
        /* ToC fixed at the left, sections to the right */
        nav {
            left: 0;
        }
        body > section {
            margin-left: 304px;
        }
    }
    @media (width >= 944px) {
        /* ToC to the left of sections */
        nav {
            text-align: right;
            background: linear-gradient(to left, #0007 70%, #0000);
            width: 240px;
            border-radius: 0 16px 16px 0;
            position: fixed;
        }
    }
    @media (width < 944px) {
        /* ToC above sections */
        nav {
            column-count: 2;
            background: #0008;
            max-width: 576px;
            border-radius: 16px;
            margin: 16px auto;
        }
    }
    @media (width < 656px) {
        /* Full-width sections and ToC */
        body > section, nav {
            max-width: none;
            padding: 16px;
            border-radius: 0;
        }
        body > section {
            /* Avoid 0 as that would cause unwanted margin collapse */
            padding-bottom: 2px;
        }
    }
}

@media print {
    h2, h3 {
        page-break-after: avoid;
    }
    p, h2, h3 {
        orphans: 3;
        widows: 3;
    }
    body > section {
        margin-top: 24px;
    }
    nav {
        display: none;
    }
}
