
/* DEFAULT PARAMETERS */

:root
{
    --background: #000a12;
    --surface: #102027;
    --primary: #ffab40;
    --secondary: #c77c02;
    --text: #eceff1;
    --font-default: "Marcellus";
    --font-allcaps: "Marcellus SC";
    --font-fallback: sans-serif;
}

/* GENERAL FORMATTING */

h1, dt, h3, h4, figcaption, nav a
{
    font-family: var(--font-allcaps), var(--font-fallback);
}

h2, dd, p, a, li, figcaption > strong
{
    font-family: var(--font-default), var(--font-fallback);
}

a
{
    text-decoration: underline;
    color: var(--text);
}

a[href]:hover
{
    color: var(--primary);
}

a[href]:active
{
    color: var(--surface);
}

strong
{
    font-weight: bold;
}

h1
{
    font-size: 48px;
    font-weight: lighter;
    color: var(--secondary);
    /* spacing: */
    margin-top: 16px;
    margin-bottom: 16px;
}

h2, figcaption > strong
{
    font-size: 28px;
    color: var(--secondary);
    margin: 12px 0;
    font-weight: bold;
}

h3
{
    font-size: 20px;
    font-weight: bold;
    color: var(--secondary);
    margin: 8px 0;
}

dt, h4, figcaption
{
    font-size: 16px;
    font-weight: lighter;
    color: var(--secondary);
    margin: 4px 0;
}

dd, p
{
    font-size: 18px;
    line-height: 24px;
    color: var(--text);
    /* text-indent: 16px; */
    text-indent: 0;
    text-align: justify;
    /* spacing */
    margin-top: 12px;
    margin-bottom: 12px;
}

dl > *
{
    display: inline;
}

hr
{
    background-color: var(--secondary);
    border: none;
    height: 2px;
    margin: 16px 0;
}

img
{
    border-radius: 8px;
    max-width: 100%; /* never overflow the container */
}

/* SECTIONS */

/* BODY */

body
{
    margin: 0;
    background-color: var(--background);
}

/* NAVIGATION */

nav
{
    display: flex;
    justify-content: center;
    background-color: var(--surface);
}

nav > ul
{
    display: inline-block;
    padding-left: 0;
    list-style: none;
    font-size: 0;
}

nav > ul > li
{
    display: contents;
}

nav > ul > li > a
{
    background-color: initial;
    color: initial;
    display: inline-block;
    box-sizing: border-box;
    text-align: center;
    text-decoration: none;
    font-size: 24px;
    font-weight: bold;
    padding: 16px;
}

nav > ul > li > a[href]
{
    background-color: var(--surface);
    color: var(--secondary);
    transition: 0.2s;
}

nav > ul > li > a[href]:active
{
    color: var(--surface);
    background-color: var(--secondary);
}

/* NAVIGATION - MOBILE */

@media screen and (max-width: 640px)
{
    nav > ul
    {
        width: 100%;
    }
    nav > ul > li:not(:last-child)::after
    {
        content: "";
        display: block;
        background-color: var(--secondary);
        border: none;
        height: 2px;
    }
    nav > ul > li > *
    {
        width: 100%;
    }
}

/* FOOTER */

footer
{
    display: block;
    width: 100%;
    padding: 16px;
    box-sizing: border-box;
    background-color: var(--surface);
}

footer > *
{
    text-align: center;
}

/* HEADER */

header
{
    display: flex;
    padding: 16px;
    background-color: var(--surface);
    align-items: center;
}

header > img
{
    width: 192px;
}

header > h1
{
    text-align: center;
    width: auto;
}

/* HEADER - DESKTOP */

@media screen and (min-width: 640px)
{

    header > *
    {
        display: inline-block;
        margin-left: 32px;
        margin-right: 32px;
    }

    header > *:first-child
    {
        margin-left: auto;
    }

    header > *:last-child
    {
        margin-right: auto;
    }

}

/* HEADER - MOBILE */

@media screen and (max-width: 640px)
{

    header
    {
        display: block;
        padding: 16px;
    }

    header > *
    {
        display: block;
        width: 100%;
    }

    header > img
    {
        max-width: 256px;
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 16px;
    }

    header > h1
    {
        font-size: 36px;
    }

}

/* FIGURE */

figure
{
    display: block;
    margin: 16px 0;
    box-sizing: border-box;
    width: 100%;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 0 4px black;
    background-color: var(--surface);
}

figure > img
{
    display: block;
    width: 100%;
}

figure > :first-child
{
    margin-top: 0;
}

figure > :last-child
{
    margin-bottom: 0;
}

/* MAIN */

main
{
    display: block;
    font-size: 0;
    background-color: var(--background);
    max-width: 1024px;
    padding: 0 16px;
    margin: 16px auto;
}

main > article, main > ul > li, main > ol > li
{
    font-size: initial;
}

/* ARTICLE */

article
{
    max-width: 768px;
    margin: auto;
}

article:not(:only-child) > :first-child
{
    margin-top: 0;
}

article:not(:only-child) > :last-child
{
    margin-bottom: 0;
}

/* ASIDE */

aside
{
    display: none;
}

aside > :first-child
{
    margin-top: 0;
}

aside > :first-child
{
    margin-bottom: 0;
}

@media screen and (min-width: 768px)
{
    main > article:not(:only-child)
    {
        display: inline-block;
        vertical-align: top;
        width: 66%;
    }
    main > article ~ aside
    {
        display: inline-block;
        vertical-align: top;
        margin-left: 16px;
        width: calc(34% - 16px);
    }
}

/* GALLERY COMPONENT */
/* ================= */

.gallery
{
    display: flex;
    width: 100%;
    gap: 16px;
    justify-content: space-between;
}

.gallery img
{
    display: block;
    width: 100%;
}

/* for all non-first gallery items, add top gap for proper distance: */
ul.gallery > li > ul > li + li, ul.gallery > li > ul:not(:empty)
{
    margin-top: 16px;
}

/* for unordered lists treated as gallery containers/columns,
 * negate the padding default for unordered lists: */
ul.gallery, ul.gallery > li > ul
{
    padding-left: 0;
}

/* for all gallery rows/columns: */
ul.gallery > li, ul.gallery > li > ul > li
{
    /* negate the bullet symbol default for list items: */
    list-style-type: none;
}

/* for gallery rows

/* on smaller screens, gallery shall collapse to one column: */
@media screen and (max-width: 640px)
{
    .gallery
    {
        display: block;
    }

    ul.gallery > li + li
    {
        margin-top: 16px;
    }
}

/* Card Subcomponent */
/* ----------------- */

ul.gallery > li > ul > li > blockquote
{
    margin: 0;
    padding: 0 16px;
    border: solid 4px var(--surface);
    background: var(--surface);
    border-radius: 8px;
    box-sizing: border-box;
}

/* ensure children won't cling to the top/bottom of the card: */

ul.gallery > li > ul > li > blockquote:first-child
{
    margin-top: 16px;
}

ul.gallery > li > ul > li > blockquote:last-child
{
    margin-bottom: 16px;
}
