* {
  margin: 0;
  padding: 0;
}

.flex-layout {
  margin: 3rem auto;
  display: flex;
  flex-flow: column;
  gap: 2rem 0;
}

.flex-layout li {
  list-style: none;
}

.flex-layout img {
  width: auto;
  max-width: 90%;
  max-height: 640px;
  margin: auto;
}

.lightbox {
  visibility: hidden;
  opacity: 0;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all .5s;
}

.lightbox picture {
  position: relative;
}

.lightbox:target {
  visibility: visible;
  opacity: 1;
}

.lightbox figure {
  position: relative;
  width: 80%;
  max-width: 900px;
}

.lightbox figcaption {
  position: relative;
  padding: 0.6rem 2.4rem 0.6rem 0.6rem;
  color: #fff;
}

.lightbox figure img {
  object-fit: contain;
  position: relative;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 640px;
  margin: auto;
}

.lightbox .close {
  display: block;
  position: absolute;
  right: 0;
  bottom: 0.4rem;
  text-decoration: none;
}

.lightbox .close::after {
  content: "\00d7";
  position: relative;
  width: 2rem;
  height: 2rem;
  font-size: 1.5rem;
  padding: 0 0 0.15rem;
  color: #fff;
  cursor: pointer;
  background-color: rgba(0,0,0,.5);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1;
}

.lightbox .close::before {
  content: "";
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  position: fixed;
  background-color: rgba(0,0,0,.8);
  cursor: default;
}

.center_ {
  justify-content: center;
  text-align: center;
}

/*------------------------------------------------------
 Tablet ~
------------------------------------------------------*/
@media screen and (min-width:768px) {

  /* contents
  ================================================ */
  .flex-layout {
    background-color: #fff3eb;
    max-width: 1000px;
    padding: 2%;
    display: flex;
    flex-flow:row wrap;
    justify-content: center;
    gap: 0;
  }

  .flex-layout li {
    width: calc(100% / 3);
    padding: 2%;
  }

  .flex-layout img {
    width: 100%;
    max-width: none;
    height: 250px;
    object-fit: cover;
  }

  .lightbox figure {
    width: auto;
  }

  .lightbox img {
    max-width: 900px;
  }

}
