/* THEMING */
:root {
    --text-color: var(--grey-6);
    --muted-text-color: var(--grey-4);
    --bg-color: black;
    --pre-color: var(--grey-1);
    --link-color: var(--color-primary-1);
    --active-color: var(--color-primary-0);
    --sidebar-width: 300px;
}

/* RESET */
*,
*:after,
*:before {
  /* Removes padding behavior on widths */
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

body {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    background-image: url('./images/bg.jpg');

    /* BASE STYLES */
    font-family: var(--font-serif);
    font-size: 20px;
    line-height: 1.4;
    color: var(--text-color);
    background-color: var(--bg-color);
    min-height: 100vh;
}

/* FRAME */

#container {
    display: flex;
    min-height: 100vh;
    padding: 1em;
}

/* SIDEBAR */

nav {
    font-size: 20px;
    min-width: 0;    
    font-family: var(--font-sans);
    text-transform: uppercase;
}

nav a {
    text-decoration: none;
    font-weight: 400;
    color: var(--muted-text-color);
}

nav a:hover {
    font-weight: 700;
}

nav ul {
    list-style: none;
    padding: 0;
}

/* yeah, I'm using hr to reset markdown lists, because
   by commonmark spec otherwise putting a space between lists
   just turns them all into paragraphs
*/
nav hr {
    height: 0!important;
    margin: 0!important;
    width: 0!important;
}

#nav {
    width: 100%;
    max-width: var(--sidebar-width);
    flex: 1;
    align-self: flex-start;
    padding-top: 2rem;
    padding-left: 4rem;
    padding-right: 1rem;
}

#nav img {
    max-width: 24px;
}

/* MAIN */

main {
    flex: 3;
    min-width: 0;
    max-width: 800px;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

article img {
    max-width: 100%;
    position: relative;
    border: 2px solid;
    border-image-source: linear-gradient(45deg, var(--blue-1), var(--green-2));
    border-image-slice: 1;
}

article {
    flex-grow: 1;
}

/* FOOTER */

footer {
    padding-top: 1em;
}

footer p {
    font-family: var(--font-sans);
    margin: 0;
    font-size: 0.6em;
}

footer #footer-nav {
    display: flex;
}

footer #footer-links {
    display: flex;
    align-items: center;
    flex-shrink: 1;
    padding-bottom: 4px;
}

footer #footer-pager {
    font-family: var(--font-sans);
    margin-top: 0.5em;
    margin-bottom: 1em;
    display: flex;
    justify-content: space-between;
}

footer #footer-pager a {
    font-size: 0.8em;
    text-transform: uppercase;
}

footer #footer-pager #next {
    text-align: right;
}

footer #top-link {
    font-family: var(--font-sans);
    text-transform: uppercase;
    padding-right: 2em;
    margin-right: 1em;
    border-right: 1px solid var(--grey-3);
}

footer a:hover {
    font-weight: 700;
}

footer nav {
    display: flex;
}

footer nav div {
    flex-basis: 0;
    position: relative;
    margin-right: 24px;
}

footer nav div:after {
    position: absolute;
    right: -16px;
    top: 0;
    bottom: 0;
    color: var(--grey-3);
    content: '›';
    display: flex;
}

footer nav div:last-child {
    flex-basis: 100%;
}

footer nav div:last-child:after {
    padding: 0;
    content: '';
}

footer nav ul {
    margin: 0;
    font-size: 0.8em;
    padding-right: 20px;
}

footer nav ul li {
    display: inline-block;
}

footer nav ul li:after {
    padding: 4px;
    color: var(--grey-3);
    content: '/';
}

footer nav ul li:last-child:after {
    content: '';
}

@media (max-width: 720px) {
    body {
        font-size: 20px;
    }

    #container {
        display: block;
    }

    #nav {
        max-width: unset;
        padding-left: 1rem;
        text-align: center;
    }

    #nav ul {
        column-count: 2;
        column-gap: 24px;
        column-width: 150px;
    }
}

/* TYPOGRAPHY */

p {
    margin-bottom: 1em;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Barlow', sans-serif;
    font-weight: 700;
    margin-top: 1.5em;
    margin-bottom: 1em;
}

h1 {
    font-size: 28px;
    text-transform: uppercase;
}

h2 {
    font-size: 24px;
}

h3 {
    font-size: 20px;
    padding-left: 2em;
    text-transform: uppercase;
}

pre, code {
    font-family: var(--font-monospace);
    font-size: 16px;
}

pre {
    padding: 12px;
    max-width: 100%;
    overflow: auto;
    background-color: var(--pre-color);
    border: 2px solid;
    border-image-source: linear-gradient(45deg, var(--blue-1), var(--green-2));
    border-image-slice: 1;
}

code {
    background-color: var(--pre-color);
    border-radius: 2px;
    padding: 2px;
}

pre code {
    /* negate all of the code styles in multi-line code blocks */
    background: none;
    border-radius: 0;
    padding: 0;
}

hr {
    border: 0;
    height: 24px;
    background-image: url('./images/divider.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin: 2em auto;
    width: 100%;
}

blockquote {
    font-family: var(--font-sans);
    border-left: 4px solid;
    border-image-source: linear-gradient(0deg, var(--blue-1), var(--green-2));
    border-image-slice: 1;
    margin-left: 0;
    padding-left: 2em;
    font-size: 0.9em;
    font-style: italic;
}

/* LINKS */

a {
    color: var(--link-color);
    text-decoration: none;
    background-color: rgba(0, 0, 0, 0.6);
}

a:hover {
    color: var(--active-color);
}

article a {
    font-weight: 700;
}

/* SECTIONS */

#main-header {
    position: relative;
    height: 3em;
}

#main-header img {
    max-width: 100%;
    position: absolute;
    left: 0;
    top: 0;
    z-index: -1;
    opacity: 0.5;
}

#gallery img {
    border: none!important;
    max-height: 720px;
}

.bg img {
    border: none!important;
}

figure {
    margin-left: 0;
    margin-right: 0;
}

figure p {
    margin: 0;
}

figure figcaption p {
    margin-bottom: 2em;
}

/* cards */

.cards ul {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
    grid-column-gap: 1.5rem;
    grid-row-gap: 2rem;
    padding: 0;
    list-style: none;
}

.card {
    display: flex;
    flex-direction: column;
    position: relative;
}

.card .text {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

.card h2 {
    margin: 0;
    font-size: 24px;
}

.card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    overflow: hidden;
}

.card p {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 18px;
}

.card a {
    text-decoration: none;
}


.iframe {
    border: none;
    overflow: hidden;
}