:root {
    --highlight-color:  var(--theme-highlight-color, #721818);
    --color:            var(--theme-color, #020202);
    --background-color: var(--theme-background-color, #f5f5f5);
    --card-background:  var(--theme-card-background, rgba(200,200,200,.3));
}

html, body {
    border: 0;
    margin: 0;
    padding: 0;

    background-color: var(--background-color);
    color: var(--color);

    font-size: 1.015em;
}

h, .highlight {
    color: var(--highlight-color);
}

body {
    display: grid;
    grid-template-areas: 
            ".    hl   ."
            ".    .    ."
            ". content ."
            ". footer  ."; 

    grid-template-columns: 1fr minmax(85%, auto) 1fr;
    grid-template-rows:  9.5em 3em 1fr 5em;
    height: 100vh;
}

body > header {
    grid-area: hl;
    
    position: relative;
    padding-top: 3em;
    padding-bottom: 3em;
    text-align: center;

    overflow: hidden;
}

body > header > h1 {
    margin: auto;
    position: relative;
    padding: 0;
    font-size: 3.5em;
}

body > content {
    grid-area: content;

    display: grid;

    grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));

    grid-auto-flow: dense;

    grid-gap: 1rem;

    height: min-content;
}

body > footer {
    grid-area: footer;

    padding-top: 1.5em;
    padding-bottom: 1.5em;

    display: flex;
    justify-content: center;
}

article {
    position: relative;
    min-width: 100%;
    width: 100%;

    background-color: var(--card-background);
    border-radius: .2em;

    padding-bottom: 100%;
    height: 0;

    transition: background .1s;
}

@media only screen and (min-width: 50em) {
    article.a2x2 {
        grid-column: span 2; 
        grid-row: span 2;
    }

    article.a2x1 {
        grid-column: span 2;
        padding-bottom: 49%;
    }
}

article > header > h2 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: .5em;
    margin: 0;

    cursor: pointer;
}

article > content {
    position: absolute;
    display: block;
    
    overflow: hidden;

    top: 3.1em;
    bottom: 0;
    left: 0;
    right: 0;

    padding: .5em;
}

article > content > section {
    margin-bottom: 1em;
}
article > content > section > p {
    padding-left: 1em;
}
article > content > section > h2 ~ p,
article > content > section > h3 ~ p,
article > content > section > h4 ~ p,
article > content > section > h5 ~ p,
article > content > section > h6 ~ p {
    margin-top: 0em;
}

article.full {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;

    z-index: 400;

    background-color: var(--background-color);

    border-radius: 0;

    padding-bottom: 0;
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
}

article.full > header {
    margin: 2em;
    margin-bottom: 0;
}

article.full > header:after {
    display: block;
    content: '✖';
    position: absolute;
    right: 0;
    top: 0;
    padding: 1em;
    font-size: 1.5em;
    text-align: center;
    width: 1.5em;
    height: 1.5em;
    cursor: pointer;
    color: var(--color);
}

article.full > content {
    position: relative;
    display: block;

    top: auto;
    bottom: auto;
    left: auto;
    right: auto;
    margin: 2em;
    padding: .5em;
}

a {
    text-decoration: none;
    color: var(--highlight-color);
    transition: all .2s;
    border-bottom: transparent solid 1px;
}

a:hover {
    border-bottom-color: var(--highlight-color);
}