:root {
  --gallery-gap: 1.5em;
  --gallery-items-per-row: 1;
  --width: 80vw;

  /**
    // generated at http://www.patternify.com/
    // http://bit.ly/2mg6Qlc
  */
  --background-pattern: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAALklEQVQoU2NkIAIwEqGGgZAiYwYGhrOEFIEtIlsR2Apkt5JtEoaHYSZhWIGsEgB+QQMKUesOpwAAAABJRU5ErkJggg==)
}

body {
  font-size: 0.9rem;
  font-family: 'Courier New', Courier, monospace;
  margin: 0;
  background-color: #fffafa;
}

main {
  padding-left: 1.0em;
  padding-right: 1.0em;
  min-height: 85vh;
  margin-bottom: 3.0em;

  ul {
    padding-left: 1.0em;
  }
  h1, h2, h3  {
    margin-top: 2.5rem;
    margin-bottom: 0.25rem;
  }
  h1 + p, h2 + p {
    margin-top: 0px;
  }
}

main p {
  max-width: var(--width);
  line-height: 1.25em;
  padding-left: 0px;
}

.full-bleed, main p .full-bleed {
  position: relative;
  width: 96vw !important;
  max-width: 96vw;
}

ul {
  max-width: 75vw;
}

body.full-bleed main, body.full-bleed main ul {
  max-width: 1000em;
}

article h1 {
  font-size: 100%;
}

.header, .footer {
  width: 100vw;
  background: var(--background-pattern) repeat;
}

.footer footer {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 3.0em;
  text-align: center;
  align-items: center;
  
  p {
    background: white;
    padding: 1.0em;
  }
}


nav {
  padding-top: 1.0em;
  padding-left: 1.0em;
  
  h1 {
    margin-top: 0px;
    font-size: 1.0em;
  }
  
  h1, a {
    color: black;
  }
  
  a {
    background: white;
    text-decoration: none;
  }
  a:hover {
    color: red;
  }
  ul {
    display: flex;
    list-style: none;
    padding-left: 0px;
    margin-top: 0px;
  }
  li {
    list-style-type: none;
    margin-right: 0.5em;
  }
}

img {
  max-width: 100%;
}

div.list {
  img {
    max-width: 32em;
  }
  p {
    margin-top: 0px;
    margin-bottom: 0px;
  }
  article {
    margin-bottom: 1.2em;
  }
}

@media print {
  body {
    font-size: 11px;
  }
  main p {
    max-width: 65em;
    line-height: 1.1em;
    padding-left: 0px;
  }
  .not-in-print {
    display: none;
  }
  
  .address {
    list-style-type: none;
  }
  
  body > div.header, body > div.footer {
    display: none;
  }
  
  a {
    text-decoration: none;
    color: inherit;
  }
}

body.sketch #sketch {
  width: 100%;
  min-height: 85vh;
}

body.sketch #controls {
  display: flex;
  > * {
    margin-bottom: 5px;
  }
  input[type=range] {
    margin-right: 20px;
  }
  label + input {
    margin-left: 10px;
  }
}

/* https://blog.logrocket.com/responsive-image-gallery-css-flexbox/ */
body.sketches {
  ul.sketches {
    display: flex;
    flex-wrap: wrap;
    gap: var(--gallery-gap);
    list-style-type: none;
  }
  
  ul.sketches figcaption h1, 
  ul.sketches figcaption time {
    font-size: 0.9rem;
    display: inline;
  }
  
  ul.sketches > li {
    flex: 0 0
    calc(
      100% / var(--gallery-items-per-row) - var(--gallery-gap) *
      (var(--gallery-items-per-row) - 1) / var(--gallery-items-per-row)
    );
  }

  ul.sketches img {
    max-width: 400px;
    max-height: 400px;
    aspect-ratio: 1 / 1;
    object-fit: cover;
  }
  
  figure { 
    margin: 0 
  }
  
  figcaption {
    margin-top: .5rem;
    font-weight: bold;
  }

  @media only screen and (width >= 1024px) {  
    ul.sketches {
      --gallery-items-per-row: 4;
    }
  }
  @media only screen and (768px < width < 1024px) {
    & ul.sketches img {
      max-width: 200px;
      max-height: 200px;
    }
  
    ul.sketches {
      --gallery-items-per-row: 3;
    }
  }
  @media only screen and (width < 768px) {
    & ul.sketches img {
      max-width: 100%;
    }

    ul.sketches {
      --gallery-items-per-row: 1;
    }
  }
}
