img{
    max-width: 100%;
    height: auto;
}
.gallery{
    width: 100%;
    padding: 0 0 5px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin: 0;
}
.gallery-item {
  width: 32%;
  margin: 0 0 20px;
  overflow: hidden;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-item a {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 450px;
    background-color: #fff;
    display: flex;
    align-items: center;
}
.gallery-item a img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
p.insta-cap {
  font-size: 12px;
  margin: 5px 0 0;
  color: black;
  height: calc(1.4em * 3); /* 制限したい行数が2の場合 */
  line-height: 1.5em; /* 本当は、heightと同じ値にする。今回は微調整 */
  overflow: hidden;
  position: relative;
  word-wrap: break-word;
}
p.insta-cap span {
  margin-right: 1em;
}
p.insta-cap::before {
  background: linear-gradient(
    to right,
    rgba(246, 246, 246, 0) 0%,
    rgba(246, 246, 246, 1) 30% /* 背景色 */
  );
  bottom: 0;
  content: "…";
  padding-left: 1em;
  position: absolute;
  right: 0;
}
p.insta-cap::after {
  background: #fff; /* 背景色 */
  content: "";
  height: 100%;
  position: absolute;
  width: 100%;
}

.fancybox-slide--iframe .fancybox-content {
    width  : 800px;
    height : 800px;
    max-width  : 80%;
    max-height : 80%;
    margin: 0;
}

.instagram-link a img {
  width: 30px;
  margin-right: 5px;
  vertical-align: middle;
}


/*=================================
中間設定（641px〜839px）
=================================*/
@media only screen and (max-width: 839px) {

  .gallery-item a {
    height: 340px;
  }

}


/*=================================
スマホ設定（〜640px）
=================================*/
@media only screen and (max-width: 640px) {

    .fancybox-slide--iframe .fancybox-content {
        max-width  : 97%;
        max-height : 97%;
    }

    .gallery-item {
      width: 48.5%;
    }
    .gallery-item a {
      width: 100%;
      height: 200px;
      display: flex;
      align-items: center;
    }

}