body {
  font-family: "Oswald", sans-serif;
}

/* skubber teksten ned */
.wrapper {
  padding-top: 170px;
}

/* teksten på mobil visning */
h1 {
  text-align: center;
  color: #fff;
  font-weight: 200;
  display: none;
  font-size: 2.2em;
  margin-top: 30px;
}

/* ---------- grid og captions ---------- */

/* laver griddet (responsive) */
.images {
  padding: 0 2%;
  padding-bottom: 200px;
  margin: 0 auto;
  max-width: 1010px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

/* endnu et grid til tekst over billede */
figure {
  display: grid;
  max-width: 320px;
}

figure:nth-child(odd) {
  justify-self: right;
}

/* fortæller grid til tekst at billede og tekst skal være samme sted */
figure img {
  grid-area: 1/1/-1/2;
  margin: 0 auto;
}

figure figcaption {
  max-width: 320px;
  width: 100%;
  margin: 0 auto;
  display: none;
  grid-area: 1/1/-1/2;
  align-self: end;
  background-color: #00000080;
  color: #fff;
  text-align: center;
  font-family: "Oswald", sans-serif;
  padding: 0.3em 0;
  font-size: 0.75em;
}

/* viser text når man hover */
figure:hover > figcaption {
  display: block;
  cursor: pointer;
}

figure img:hover {
  cursor: pointer;
}

/* ---------- lightbox ---------- */

#lightbox_mask {
  background-color: rgba(0, 0, 0, 1);
  position: fixed;
  background-size: cover;
  width: 100%;
  height: 100vh;
  z-index: 2;
  display: none;
}
#lightbox {
  max-width: 900px;
  width: 70%;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 2em auto;
  line-height: 1;
  z-index: 3;
  display: none;
  grid-template-columns: auto;
  grid-template-rows: auto;
  align-items: center;
}

#lightbox img:nth-child(n + 2) {
  width: 50px;
  border: none;
}

#lightbox img:nth-child(2) {
  border: none;
  transform: rotate(180deg);
  margin-left: 10px;
  cursor: pointer;
}

#lightbox img:nth-child(3) {
  justify-self: end;
  margin-right: 10px;
  cursor: pointer;
}

#lightbox img {
  grid-area: 1/1;
}

#lightbox img:active:nth-child(n + 2) {
  opacity: 0.6;
}

#light img:first-of-type {
  width: 10px;
}

#lightbox p {
  grid-area: 2/1;
  justify-self: center;
  color: #fff;
}

/* ---------- media queries ---------- */

/* til tablet */
@media only screen and (max-width: 850px) {
  figure figcaption {
    display: block;
  }
  figure figcaption {
    grid-area: 2/1;
    background-color: #00000000;
    font-size: 1em;
    padding: 0.5em 0;
  }
  .images {
    padding-bottom: 40px;
  }
}

/* for at løse et problem */
@media only screen and (max-width: 687px) {
  figure:nth-child(odd),
  figure:nth-child(even) {
    justify-self: center;
  }
}

/* til smartphone */
@media only screen and (max-width: 500px) {
  h1 {
    display: block;
    margin-bottom: 1em;
  }
  .wrapper {
    padding-top: 0;
  }
  .images {
    padding: 0;
    padding-bottom: 100px;
  }
}
