/* Common setup */

@import url('https://fonts.googleapis.com/css?family=Noto+Sans');

body {
  padding: 0;
  margin: 0;
  background-color: #2a2a2a;
  color: #ccc;
}
p {
  font-family: 'Noto Sans', sans-serif;
}

a {
  color: #3d3;
}

.tile#about h1 {
  padding: 0;
  margin: 0;
  font-size: 48pt;
}
.tile#about h1 a {
  text-decoration: none;
}
.tile#about p {
  display: none;
  font-size: 14pt;
  text-align: left;
}

/* Lightbox */
.tile#about:target {
  line-height: 135%;
  background-color: #2a2a2a;
  position: fixed; top: 0; right: 0; bottom: 0; left: 0;
  overflow: auto;
}
.tile#about:target h1 {
  padding: 50px;
}
.tile#about:target p {
  display:block;
  margin: auto;
  padding: 0 5vw;
  max-width: 50rem;
}

.tile {
  padding: 0;
  margin: 0;
  text-align: center;
  font-size: 24pt;
  overflow: hidden;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.metro {
  display: grid;
  grid-gap: 0;
  padding: 0;
  margin: 0;
  min-height: 100vh;
}

/* Base layout, single column (mobile, portrait) */

@media (max-width:899px) and (orientation:portrait) {
  .tile { line-height: 30vh; }
  .metro {
    grid-template-columns: 1fr;
    grid-auto-rows: 10vh;
  }
  .tile { grid-area: span 3 / span 1; }
  .tile:nth-child(3) { grid-area: span 4 / span 1; }
  .tile:nth-child(4) { grid-area: span 8 / span 1; }
  .tile:nth-child(7) { grid-area: span 4 / span 1; }
  .tile:nth-child(8) { grid-area: 1 / 1 / span 4 / span 1; }
  .tile:nth-child(9) { grid-area: span 4 / span 1; }
  .tile:nth-child(10) { grid-area: span 7 / span 1; }
  .tile:nth-child(11) { grid-area: span 4 / span 1; }
  .tile:nth-child(12) { grid-area: span 5 / span 1; }
  .tile:nth-child(13) { grid-area: span 5 / span 1; }
}

/* Single column, less rows per screen (mobile, landscape) */
@media (max-width:899px) and (orientation:landscape) {
  .tile { line-height: 100vh; }
  .metro {
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: 10vh;
    grid-auto-flow: dense;
  }
  .tile { grid-area: span 10 / span 2; }
  .tile:nth-child(8) { grid-area: 1 / 1 / span 10 / span 2; }
  .tile:nth-child(4),
  .tile:nth-child(10) { grid-area: span 13 / span 1; }
}

/* Wide screens, 5-column 4-row metro layout */

@media (min-width:900px) and (orientation:landscape) {
  .tile { line-height: 25vh; }
  .metro {
    grid-template-columns: repeat(5, 1fr);
    grid-auto-rows: 25vh;
  }
  .tile:nth-child(1) { grid-area: 1 / 1 / span 2 / span 1; }
  .tile:nth-child(2) { grid-area: 1 / 2 / span 1 / span 2; }
  .tile:nth-child(4) { grid-area: 2 / 2 / span 2 / span 1; }
  .tile:nth-child(5) { grid-area: 2 / 3 / span 1 / span 2; }
  .tile:nth-child(6) { grid-area: 4 / 1 / span 1 / span 1; }
  .tile:nth-child(10) { grid-area: 3 / 4 / span 2 / span 1; }
}

/* Rotated wide screen */

@media (min-width:900px) and (orientation:portrait) {
  .tile { line-height: 20vh; }
  .metro {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 20vh;
    grid-auto-flow: dense;
  }
  .tile { grid-area: span 1 / span 1; }
  .tile:nth-child(4) { grid-area: 2 / 2 / span 2 / span 1; }
  .tile:nth-child(5) { grid-area: span 1 / span 2; }
  .tile:nth-child(6) { grid-area: span 1 / span 2; }
}
