/* Copyright Ion Fusion contributors. All rights reserved. */
/* SPDX-License-Identifier: Apache-2.0 */


/* Outermost page layout uses flexbox so the site nav shifts above the main
 * content on narrow viewports.
 */
body {
    height: 100vh;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    align-items: stretch;

    header {
        flex-basis: 100%;
    }

    nav {
        /* TODO perhaps use intrinsic width? */
        flex-basis: 15rem; /* Width when on the side */
        flex-grow: 1;
    }

    main {
        flex-basis: 0;
        flex-grow: 999;
        min-inline-size: 70%; /* Threshold for flowing inline (right) */
    }

    footer {
        flex-basis: 100%;
    }
}


body > header {
    padding: 1rem;
    background-color: lightsteelblue;

    .logotype {
        margin: 0;
        line-height: 1;
        font-weight: bold;
        font-size: 2rem;
        color: black;
        text-decoration: none;
    }
}

body > footer {
    padding: 1rem;
    background-color: lightsteelblue;
    line-height: 1;
    text-align: center;

    p {
        margin: 0;
    }
}


/* Formatting of the site navigation. */

body > nav {
    padding: 0 1rem 1rem; /* No padding on top; the header provides it. */
    overflow-y: scroll;
    background-color: lightsteelblue;

    > section + section { /* Space _between_ sections */
        margin-block-start: 1rem;
    }

    h1 {
        margin: 0;
        font-size: 1.25rem;
    }

    nav {
        margin-left: 1rem;
    }

    a {
        display: block;
        color: black;
        text-decoration: none;
    }

    a:hover {
        text-decoration: underline;
    }
}


/* Formatting of the main content area. */

main {
    padding: 1rem;
    overflow: scroll;

    * + * {
        margin-block-start: 1em;
    }
    h1 + p, h2 + p, h3 + p {
        margin-block-start: .25em;
    }
    li {
        margin-block-start: 0;
    }
}

blockquote {
    padding-inline-start: 1em;
}
pre {
    padding-inline-start: 1em;
    overflow-x: auto;
}

/* When a link is targeted, ensure some visible room around it. */
:target {
    scroll-margin: 2rlh;
}
