html, body, .container {
  height: 100%;
}
.js .boxgallery, .js .boxgallery div {
  position: absolute;
}
.js .boxgallery, .bg-tile, .bg-img {
  overflow: hidden;
}
.js .boxgallery, .js .panel {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.panel {
  z-index: 0;
  -webkit-perspective: 1200px;
  perspective: 1200px;
}
.bg-tile {
  width: 50%;
  height: 50%;
}
.bg-tile:nth-child(2), .bg-tile:nth-child(4) {
  left: 50%;
}
.bg-tile:nth-child(3), .bg-tile:nth-child(4) {
  top: 50%;
}
.bg-img {
  width: 100%;
  height: 100%;
  background: #999;
}
.bg-img img{
  position: absolute;
  display: block;
  height: 200%;
}
/*.bg-img img.sp{
  display: none;
}*/
/*@media (max-width: 767px) {
.bg-img img.pc{
  display: none;
}
.bg-img img.sp{
  position: absolute;
  display: block;
  height: 200%;
}
}*/


@media screen and (min-aspect-ratio: 1280/850) {
  .bg-img img {
    width: 200%;
    height: auto;
  }
}
.bg-tile:nth-child(2) .bg-img img, .bg-tile:nth-child(4) .bg-img img {
  left: -100%;
}
.bg-tile:nth-child(3) .bg-img img, .bg-tile:nth-child(4) .bg-img img {
  top: -100%;
}



@media (max-width: 767px) {

.bg-tile:nth-child(2), .bg-tile:nth-child(4) {
  left: calc(50% - 1px);
  width: calc(50% + 2px);
}
.bg-tile:nth-child(3), .bg-tile:nth-child(4) {
  top: calc(50% - 1px);
  height: calc(50%);
}


.panel:nth-child(1) .bg-img img.pc{
  position: absolute;
  height: 200%;
  left: -150%;
}
.panel:nth-child(1) .bg-tile:nth-child(2) .bg-img img,
.panel:nth-child(1) .bg-tile:nth-child(4) .bg-img img {
  left: calc(-250% + 6px);
}

.panel:nth-child(2) .bg-img img.pc{
  position: absolute;
  height: 200%;
  left: -200%;
}
.panel:nth-child(2) .bg-tile:nth-child(2) .bg-img img,
.panel:nth-child(2) .bg-tile:nth-child(4) .bg-img img {
  left:calc(-300% + 6px);
}

.panel:nth-child(3) .bg-img img.pc{
  position: absolute;
  height: 200%;
  left:-225%;
}
.panel:nth-child(3) .bg-tile:nth-child(2) .bg-img img,
.panel:nth-child(3) .bg-tile:nth-child(4) .bg-img img {
  left:calc(-325% + 6px);
}

.panel:nth-child(4) .bg-img img.pc{
  position: absolute;
  height: 200%;
  left:-200%;
}
.panel:nth-child(4) .bg-tile:nth-child(2) .bg-img img,
.panel:nth-child(4) .bg-tile:nth-child(4) .bg-img img {
  left:calc(-300% + 6px);
}


}
/* Navigation Arrow */
/*.boxgallery > nav span {
	position: absolute;
	top: 50%;
	z-index: 1000;
	display: block;
	width: 100px;
	height: 100px;
	outline: none;
	text-align: left;
	cursor: pointer;
	-webkit-transform: translateY(-50%);
	transform: translateY(-50%);
}

.boxgallery > nav span.prev {
	left: 0;
}

.boxgallery > nav span.next {
	right: 0;
}

.boxgallery > nav i {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
}*/
.boxgallery > nav {
  position: absolute;
  top: 44%;
  right: 34px;
  z-index: 1000;
  display: block;
  outline: none;
  text-align: left;
  cursor: pointer;
}
.boxgallery > nav div.prev {
  position: relative;
  display: block;
  width: 7px;
  height: 7px;
  margin-bottom: 20px;
  outline: none;
  text-align: left;
  cursor: pointer;
}
.boxgallery > nav div.next1 {
  position: relative;
  display: block;
  width: 7px;
  height: 7px;
  margin-bottom: 20px;
  outline: none;
  text-align: left;
  cursor: pointer;
}
.boxgallery > nav div.next2 {
  position: relative;
  display: block;
  width: 7px;
  height: 7px;
  margin-bottom: 20px;
  outline: none;
  text-align: left;
  cursor: pointer;
}
.boxgallery > nav div.next3 {
  position: relative;
  display: block;
  width: 7px;
  height: 7px;
  margin-bottom: 20px;
  outline: none;
  text-align: left;
  cursor: pointer;
}
.boxgallery > nav i {
  position: relative;
  display: block;
  width: 7px;
  height: 7px;
  background: #fff;
  border-radius: 50%;
}
.boxgallery > nav i:hover {
  position: relative;
  display: block;
  width: 7px;
  height: 7px;
  background: #ffd500;
  border-radius: 50%;
}
@media (max-width: 767px) {
  .boxgallery > nav {
    position: absolute;
    top: auto;
    right: auto;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    display: block;
    outline: none;
    text-align: left;
    cursor: pointer;
  }
  .boxgallery > nav div.prev {
    position: relative;
    display: block;
    float: left;
    width: 7px;
    height: 7px;
    margin-right: 15px;
    outline: none;
    text-align: left;
    cursor: pointer;
  }
  .boxgallery > nav div.next1 {
    position: relative;
    display: block;
    float: left;
    width: 7px;
    height: 7px;
    margin-right: 15px;
    outline: none;
    text-align: left;
    cursor: pointer;
  }
  .boxgallery > nav div.next2 {
    position: relative;
    display: block;
    float: left;
    width: 7px;
    height: 7px;
    margin-right: 15px;
    outline: none;
    text-align: left;
    cursor: pointer;
  }
  .boxgallery > nav div.next3 {
    position: relative;
    display: block;
    float: left;
    width: 7px;
    height: 7px;
    margin-right: 15px;
    outline: none;
    text-align: left;
    cursor: pointer;
  }
  .boxgallery > nav i {
    position: relative;
    display: block;
    width: 7px;
    height: 7px;
    background: #fff;
    border-radius: 50%;
  }
  .boxgallery > nav i:hover {
    position: relative;
    display: block;
    width: 7px;
    height: 7px;
    background: #ffd500;
    border-radius: 50%;
  }
}
/* Transitions and individual delays/effects */
/* The "active" class is given to the panel that is coming */
.panel.current {
  z-index: 2;
}
.panel.active {
  z-index: 1;
}
.panel.current .bg-img {
  -webkit-transition: -webkit-transform 1.1s ease-in-out;
  transition: transform 1.1s ease-in-out;
}
.boxgallery[data-effect="effect-1"] .panel.active .bg-tile, .boxgallery[data-effect="effect-2"] .panel.active .bg-tile {
  -webkit-animation: scaleDown 1.1s ease-in-out;
  animation: scaleDown 1.1s ease-in-out;
}
@-webkit-keyframes scaleDown {
  from {
    -webkit-transform: translate3d(0, 0, 380px);
    transform: translate3d(0, 0, 380px);
  }
  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
@keyframes scaleDown {
  from {
    -webkit-transform: translate3d(0, 0, 380px);
    transform: translate3d(0, 0, 380px);
  }
  to {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}
/* Variation 2 */
.boxgallery[data-effect="effect-2"] .panel.current .bg-img {
  -webkit-transition: -webkit-transform 0.9s cubic-bezier(0.7, 0, 0.3, 1);
  transition: transform 0.9s cubic-bezier(0.7, 0, 0.3, 1);
}
.boxgallery[data-effect="effect-2"] .panel.current .bg-tile:nth-child(2) .bg-img {
  -webkit-transition-delay: 0.15s;
  transition-delay: 0.15s;
}
.boxgallery[data-effect="effect-2"] .panel.current .bg-tile:nth-child(3) .bg-img {
  -webkit-transition-delay: 0.3s;
  transition-delay: 0.3s;
}
.boxgallery[data-effect="effect-2"] .panel.current .bg-tile:nth-child(4) .bg-img {
  -webkit-transition-delay: 0.45s;
  transition-delay: 0.45s;
}
/* Variation 3 */
.boxgallery[data-effect="effect-3"] .panel::after {
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  content: '';
  -webkit-transition: opacity 1.1s ease-in-out;
  transition: opacity 1.1s ease-in-out;
}
.boxgallery[data-effect="effect-3"] .panel.current::after, .boxgallery[data-effect="effect-3"] .panel.active::after {
  opacity: 0;
}
.boxgallery[data-effect="effect-3"] .panel.current::after {
  -webkit-transition: none;
  transition: none;
}
.boxgallery[data-effect="effect-3"] .panel.current .bg-img {
  -webkit-transition: -webkit-transform 1.1s cubic-bezier(0.7, 0, 0.3, 1);
  transition: transform 1.1s cubic-bezier(0.7, 0, 0.3, 1);
}
.boxgallery[data-effect="effect-3"] .panel.current .bg-tile:nth-child(2) .bg-img {
  -webkit-transition-delay: 0.15s;
  transition-delay: 0.15s;
}
.boxgallery[data-effect="effect-3"] .panel.current .bg-tile:nth-child(3) .bg-img {
  -webkit-transition-delay: 0.3s;
  transition-delay: 0.3s;
}
.boxgallery[data-effect="effect-3"] .panel.current .bg-tile:nth-child(4) .bg-img {
  -webkit-transition-delay: 0.45s;
  transition-delay: 0.45s;
}
@media screen and (max-width: 767px) {
  .boxgallery > nav span {
    width: 30px;
    height: 30px;
  }
}