body {
    margin: 0 0;
    font-family: "Roboto", sans-serif;
}

header, main, footer {
    box-sizing: border-box;
    width: 100%;
    max-width: 640px;
    margin: 1em auto;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
}

header {
    background-color: purple;
    max-width: 100%;
    margin: 0;
}

h1 {
    margin: 0;
}

h2 {
    color: black;
    margin: 0;
    margin-bottom: .5em;
}

nav, .nav-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: column;
    color: white;
    width: 100%;
    max-width: 640px;
    margin: 10px;
}

.hide {
    display: none;
}

.menu {
    background-color: transparent;
    color: white;
    border: none;
    font-size: 1.2em;
}

a {
    color: white;
}

footer {
    background-color: purple;
    max-width: 100%;
    margin-bottom: 0;
}

.gallery {
    display: grid;
    grid-template-columns: 1fr;
    max-width: 640px;
    padding: 0;
    gap: 1em;
}

img {
    width: 100%;
    max-width: 100%;
    margin: 0;
    border: 10px solid whitesmoke;
    box-shadow: 5px 5px 5px darkgray;
    box-sizing: border-box;
}

figure {
    margin: 0;
    width: 100%;
    max-width: 100%;
}

dialog {
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, .6);
    margin: 0 auto;
}

dialog img {
    max-width: 90vw;
    max-height: 80vh;
    width: auto;
    height: auto;
    display: block;
    margin: 0 auto;
    object-fit: contain;
  }

.close-viewer {
    position: absolute;
}

@media screen and (min-width: 700px) {
    .gallery {
        grid-template-columns: 1fr 1fr;
    }
    .hide a {
        display: none;
    }
}

@media screen and (min-width: 1000px) {
    .gallery {
        grid-template-columns: 1fr 1fr 1fr;
    }
    .hide a {
        display: flex;
    }
    .nav-links {
        flex-direction: row;
    }
}