.gallery-grid {
  display: block;
  margin: 1ex 0 1ex 0;
}
@media only screen and (min-width: 500px) {
  .gallery-grid {
    display: grid;
    grid-template-columns: auto auto;
  }
}
@media only screen and (min-width: 800px) {
  .gallery-grid {
    display: grid;
    grid-template-columns: auto auto auto;
  }
}
@media only screen and (min-width: 1200px) {
  .gallery-grid {
    display: grid;
    grid-template-columns: auto auto auto auto;
  }
}

/* Main gallery div, contains main image */
.gallery {
  text-align:center;
  margin-top:15px;
  margin-bottom:15px;
}
.gallery img {
  max-width:75%;
  max-height:500px;
}

/* Image strip */
.gallery > div.image_strip {
  width:100%;
  overflow:auto;
  overflow-y:hidden;
  padding-top:5px;
  padding:5px;
  white-space:nowrap;
  vertical-align:middle;
}
.gallery img.thumbnail {
  margin-left: 0.5ex;
  margin-right: 0.5ex;
  max-width: 100px;
  max-height: 56px;
}

/* Finally the fancy interactive gallery browser */

/* Each image slide is a section in the gallery div */
/* Default is hidden */
.gallery section {
	position: fixed;
	top: 0;
	left: 0;
	width: 0;
	height: 0;
	overflow: hidden;
  padding: 0;
  z-index: 25;
}
.gallery section > figure {
  margin: 0;
}
.gallery section > figure > img {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
	max-height: 100%;
	max-width: 100%;
	box-sizing: border-box;
}

/* Show the section with id matching the current local link target (#img<x>) */
.gallery section:target {
	width: 100%;
	box-sizing: border-box;
	height: 100%;
	margin: 0;
	text-align: center;
	background: rgba(0, 0, 0, .9);
}
.gallery section:target > figure > img {
  display: block;
}

.gallery section:target > figure > figcaption > h2 {
  position: absolute;
  top:100%;
  width:100%;
  font-family: Helvetica, Arial, sans-serif;
	font-size: 20px;
	font-style: italic;
  font-weight: normal;
  font-variant: normal;
  text-align: center;
	background: rgba(0, 0, 0, 0.5);
	padding-top: 10px;
  padding-bottom: 10px;
	color: #ddd;
  margin: 0;
  transform: translate(0, -50px);
}

.gallery section:target > nav > a.close {
  position: fixed;
  cursor: pointer;
  width: 45px;
  height: 45px;
  display: flex;
  justify-content: space-evenly;
  flex-direction: column;
  padding: 10px;
	right: 20px;
	top: 20px;
}
.gallery section:target > nav > a.close > span {
  height: 2.5px;
  background-color: rgba(250, 250, 250, .5);
  border-top: 0.3px solid rgba(250, 250, 250, .5);
  border-left: 0.3px solid rgba(250, 250, 250, .5);
  border-bottom: 0.3px solid rgba(250, 250, 250, .5);
  border-right: 0.3px solid rgba(250, 250, 250, .5);
  border-radius: 2px;
}
.gallery section:target > nav > a.close > span:nth-child(1) {
    transform: translateY(4.5px) rotate(45deg);
}
.gallery section:target > nav > a.close > span:nth-child(2) {
    transform: translateY(-4.5px) rotate(-45deg);
}
.gallery section:target > nav > a.close:hover > span {
  background-color: rgba(250, 250, 250, 0.9);
}

.gallery section:target > nav > a.arrow {
	position: fixed;
	top: 50%;
	width: 0;
	height: 0;
	border-top: 25px solid transparent;
	border-bottom: 25px solid transparent;
  color: rgba(255, 255, 255, 0.0);
}
.gallery section:target > nav > a.prev {
	left: 20px;
	border-right: 25px solid rgba(250, 250, 250, .5);
}
.gallery section:target > nav > a.prev:hover {
	border-right-color: rgba(250, 250, 250, .9);
}

.gallery section:target > nav > a.next {
	right: 20px;
	border-left: 25px solid rgba(250, 250, 250, .5);
}
.gallery section:target > nav > a.next:hover {
	border-left-color: rgba(250, 250, 250, .9);
}
