.gg-container {
  --main-color: rgba(255,255,255,0.6);
  --secondary-color: #111;
  --txt-color: #222;
  --img-bg-color: rgba(240, 240, 240, 0.9);
  --backdrop-color: rgba(17, 17, 17, 0.9);
  --gap-length: 10px;
  --row-height: 160px;
  --column-width: 220px;
}

.gg-container *[data-theme="dark"] {
  --main-color: #ddd;
  --secondary-color: #eee;
  --txt-color: #111;
  --img-bg-color: rgba(20, 20, 20, 0.9);
  --backdrop-color: rgba(30, 30, 30, 0.9);
}

.gg-box {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--column-width), 1fr));
  grid-auto-rows: var(--row-height);
  grid-gap: var(--gap-length);
  margin: 0 0 80px;
  padding: 0 20px;
}

.gg-box img {
  object-fit: cover;
  cursor: pointer;
  width: 100%;
  height: 100%;
  /* background: var(--img-bg-color); */
  border-radius: 20px;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.gg-box img:hover {
  opacity: 0.98;
}

#gg-screen {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background: var(--backdrop-color);
  z-index: 9999;
  text-align: center;
}

#gg-screen .gg-image {
  height: 100%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

#gg-screen .gg-image img {
  max-width: 100%;
  max-height: 100%;
  margin: 0 auto;
}

.gg-btn {
  width: 50px;
  height: 50px;
  background: var(--main-color);
  color: var(--txt-color);
  text-align: center;
  line-height: 47px;
  cursor: pointer;
  -moz-transition: all 0.4s ease;
  -o-transition: all 0.4s ease;
  -webkit-transition: all 0.4s ease;
  transition: all 0.4s ease;
  font-size: 25px;
  box-sizing: border-box;
  padding-left: 2px;
  position: fixed;
  bottom: 10px;
  border: 1px solid rgba(0,0,0,0.05);
  font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif;
}

.gg-btn:hover {
  background: var(--secondary-color);
  color: var(--img-bg-color);
}

.gg-close {
  top: 10px;
}

.gg-close,
.gg-next {
  right: 10px;
}

.gg-prev {
  right: 61px;
}

.gg-prev,
.gg-next {
  bottom: 10px;
}

@media (min-width: 478px) {
  .gg-box img:nth-child(2n):not(:last-of-type) {
    grid-row-end: span 2;
  }
   .gg-box img:nth-child(168):not(:last-of-type) {
    grid-row-end: span 1;	
  }
  .gg-box img:nth-child(170):not(:last-of-type) {
    grid-row-end: span 1;	
  }
  .gg-box img:nth-child(172):not(:last-of-type) {
    grid-row-end: span 1;	
  }
  /*.gg-box img:nth-child(74n):not(:last-of-type) {
    grid-row-end: span 1;
  }
  .gg-box img:nth-child(76n):not(:last-of-type) {
    grid-row-end: span 1;
  }
  .gg-box img:nth-child(78n):not(:last-of-type) {
    grid-row-end: span 1;
  } */
  .gg-box-2 img:nth-child(116):not(:last-of-type) {
    grid-row-end: span 1;
  }
  .gg-box-2 img:nth-child(114):not(:last-of-type) {
    grid-row-end: span 1;
  } 
  .gg-box-2 img:nth-child(3):not(:last-of-type){
	object-position: center -60px;
  }
  .gg-box-2 img:nth-child(51):not(:last-of-type),
  .gg-box-2 img:nth-child(53):not(:last-of-type),
  .gg-box-2 img:nth-child(113):not(:last-of-type) {
	object-position: center -20px;
  }
  
  .gg-box-2 img:nth-child(15):not(:last-of-type),
  .gg-box-2 img:nth-child(23):not(:last-of-type),
  .gg-box-2 img:nth-child(29):not(:last-of-type),
  .gg-box-2 img:nth-child(31):not(:last-of-type),
  .gg-box-2 img:nth-child(33):not(:last-of-type),
	.gg-box-2 img:nth-child(63):not(:last-of-type),
	.gg-box-2 img:nth-child(69):not(:last-of-type), 
	
	.gg-box-2 img:nth-child(75):not(:last-of-type) { 
		object-position: center -45px;
	}	
	.gg-box-2 img:nth-child(101):not(:last-of-type),
	.gg-box-2 img:nth-child(117):not(:last-of-type),
	.gg-box-2 img:nth-child(118) {
		object-position: center 0px;
	}
	/* .gg-box-2 img:nth-child(71n):not(:last-of-type) { 
		object-position: center -45px;
	}	
  .gg-box-2 img:nth-child(72n):not(:last-of-type) {
    grid-row-end: span 1;
	object-position: center -45px;
  } 
  .gg-box-2 img:nth-child(76n):not(:last-of-type) {
    grid-row-end: span 1;
	object-position: center -25px;
  }
  .gg-box-2 img:nth-child(77n) {
	object-position: center -25px;	
  }
   */
   .gg-box-3 img:nth-child(68):not(:last-of-type),
   .gg-box-3 img:nth-child(70):not(:last-of-type) {
    grid-row-end: span 1;
  }
  .gg-box-3 img:nth-child(3):not(:last-of-type),
  .gg-box-3 img:nth-child(7):not(:last-of-type),
  .gg-box-3 img:nth-child(41):not(:last-of-type),
  .gg-box-3 img:nth-child(57):not(:last-of-type) {
	object-position: center -25px;	
  }
  /* .gg-box-3 img:nth-child(11):not(:last-of-type),
  .gg-box-3 img:nth-child(17):not(:last-of-type),
  .gg-box-3 img:nth-child(27):not(:last-of-type) {
	object-position: center -25px;	
  }
  
  .gg-box-3 img:nth-child(58):not(:last-of-type) {
    grid-row-end: span 1;
	object-position: center -10px;
  } */
   .gg-box-4 img:nth-child(80):not(:last-of-type),
  .gg-box-4 img:nth-child(82):not(:last-of-type) {
    grid-row-end: span 1;
  } 
  .gg-box-4 img:nth-child(3):not(:last-of-type),
  .gg-box-4 img:nth-child(15):not(:last-of-type),
  .gg-box-4 img:nth-child(45):not(:last-of-type),
  .gg-box-3 img:nth-child(57):not(:last-of-type) {
	object-position: center -25px;	
  }
  /* .gg-box-5 img:nth-child(3n):not(:last-of-type) {
    grid-row-end: span 2;
  }
  .gg-box-5 img:nth-child(14):not(:last-of-type),
  .gg-box-5 img:nth-child(16):not(:last-of-type) {
	grid-row-end: span 1;
  } */
  /* .gg-box-6 img:nth-child(2n):not(:last-of-type) {
	grid-row-end: span 1;
  }
  .gg-box-6 img:nth-child(3n):not(:last-of-type) {
	grid-row-end: span 2;
  } */
  .gg-box-6 img:nth-child(26):not(:last-of-type),
  .gg-box-6 img:nth-child(28):not(:last-of-type) {
	grid-row-end: span 1;
  }
  
  .gg-box-6 img:nth-child(27):not(:last-of-type) {
	object-position: center -25px;
  }

  .gg-box-7 img:nth-child(36):not(:last-of-type),
  .gg-box-7 img:nth-child(38):not(:last-of-type) {
	grid-row-end: span 1;
  }
  .gg-box-8 img:nth-child(40):not(:last-of-type),
  .gg-box-8 img:nth-child(46):not(:last-of-type),
  .gg-box-8 img:nth-child(58):not(:last-of-type),
  .gg-box-8 img:nth-child(60):not(:last-of-type) {
	grid-row-end: span 1;
  }
  /* .gg-box-8 img:nth-child(1):not(:last-of-type),
  .gg-box-8 img:nth-child(4):not(:last-of-type) {
	grid-row-end: span 2;
  	grid-column-end: span 2;
  } */

  .gg-box-9 img:nth-child(70):not(:last-of-type),
  .gg-box-9 img:nth-child(72):not(:last-of-type) {
	grid-row-end: span 1;
  }

  /* [data-layout="horizontal"] img:nth-child(2n):not(:last-of-type) {
    grid-column-end: span 2;
    grid-row-end: span 1;
  }

  [data-layout="square"] img:nth-child(2n):not(:last-of-type) {
    grid-row-end: span 1;
    grid-column-end: span 1;
  } */
}

@media (max-width: 768px) {
  .gg-box {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    grid-auto-rows: calc(var(--row-height) - 5vh);
    margin: 10px 0;
  }
}

@media (max-width: 450px) {
  .gg-box {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  }
}
