@import url('https://fonts.googleapis.com/css?family=Roboto:100,400,700&display=swap');

/*----- Global Variable Declaration -----*/
:root {
    --primary: hsl(140, 55%, 30%);
    --secondary: hsl(140, 55%, 50%);
}

/*----- HTML Default Changes -----*/
html {
    box-sizing: border-box;
}

*, *:before, *::after {
    box-sizing: inherit;
    padding: 0;
    margin: 0;
    border: 0;
}

body {
    font-family: 'Roboto', sans-serif;
    font-size: .7em;
    color: white;
    text-align: center;
    user-select: none;
}

h1, h2, h3 {
    font-weight: 700;
}

img {
	width: 100%;
    height: auto;
}

button {
    font-family: inherit;
    color: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

/*----- Header & Footer -----*/
.header {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-content: center;
    position: fixed;
    top: 0%;
    width: 100%;
    min-height: 5.5em;
    text-transform: uppercase;
    line-height: 1;
    background: var(--primary);
    z-index: 2;
}

.header h2 {
    font-weight: 100;
}

.footer {
    color: darkgrey;
    padding: 1em;
}

/*----- Modal Menu -----*/
.burger {
    position: absolute;
    right: .5em;
    opacity: .6;
    transition: ease .5s;
    background: hsla(0, 0%, 0%, .7);
    z-index: 3;
}

.burger * {
    width: 1.5em;
    height: .3em;
    margin: .3em;
    background: white;
}

.menu img {
    width: 7em;
    height: auto;
}

.menu a {
    margin: 2em;
}

.menu, .viewer {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background: hsla(0, 0%, 0%, .9);
}

/*----- Gallery Mode -----*/
.gallery {
    display: grid;
    padding-top: 5.5em;
}

.gallery figure{
    display: grid;
}

.gallery figure * {
    grid-row: 1;
    grid-column: 1;
}

.gallery figcaption {
    align-self: center;
    border-radius: .5em;
    font-size: 2em;
    padding: 1em;
    margin: 2em;
    opacity: 0;
    transition: ease .5s;
    background: hsla(0, 0%, 0%, .9);
}

.gallery p {
    display: none;
}

/*----- Modal Gallery Viewer -----*/
.viewer {
    z-index: 4;
}

.card {
    position: relative;
    margin: auto;
    width: 100%;
    height: auto;
}

.card figure{
    display: flex;
    flex-direction: column;
}

.card figcaption {
    display: inherit;
    flex-direction: inherit;
    align-items: center;
    text-align: left;
    padding: 1em 2em;
    background: var(--primary);
}

.card h3 {
    font-size: 2em;
    margin-bottom: .25em;
}

.card p {
    margin-bottom: .5em;
}

.close {
    position: absolute;
    top: .25em;
    right: .25em;
    width: 1.25em;
    height: 1.25em;
    border-radius: 50%;
    font-size: 2em;
    opacity: .7;
    transition: ease .5s;
    background: hsla(0, 0%, 0%, .7);
}

/*----- Combined Link Transitions -----*/
.burger:hover,
.burger:focus,
.close:hover,
.close:focus,
.gallery a:hover figcaption,
.gallery a:focus figcaption {
    opacity: 1;
}

/*----- Query for Grid Compatibility -----*/
@supports (grid-area:auto) {

    @media screen and (min-width: 768px) {
        body {
            font-size: 1em;
        }

        .footer{
            font-size: .75em;
        }

        .gallery {
            grid-template-columns: repeat(2, 1fr);
        }
        
        .card {
            width: 70%;
        }

        .close {
            font-size: 1.5em;
        }
    }

    @media screen and (min-width: 1025px) {
        .gallery {
            grid-template-columns: repeat(3, 1fr);
        }

        .card {
            width: 40%;
        }
    }
}