* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  height: 100vh;
  width: 100vw;
  padding: 20px;
  /*background-color: #121212;*/
  position: relative;
  overflow: hidden;
}

section {
  	margin: 0 auto 20px auto;
  	max-width: 1000px;
  	padding: 10px 10px;
  	display: block;
	background-color: #2b2b2a;
}

section.header {
  padding: 10px 20px;
  margin: 20px auto 20px auto;
  text-align: center;
  background-color: #705e0c;
  color: #cab470;
  line-height: 1.4em;
  max-width: 1000px;
}

 h1 {
      margin: 0;
      font-size: 1.4em;
    }

#grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  grid-auto-rows: 350px;
  gap: 5px;
  height: 100vh;
  overflow-y: scroll;
  padding-right: 10px;
  grid-auto-flow: dense;
}

#grid::-webkit-scrollbar {
  background-color: #dedede;
  width: 10px;
}

#grid::-webkit-scrollbar-thumb {
  background-color: #757575;
}

.grid-item {
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
}

#nature-2,
#nature-7,
#nature-16 {
  grid-column: span 2;
}

#nature-4,
#nature-5,
#nature-10 {
  grid-row: span 2;
}

#nature-13 {
  grid-column: span 2;
  grid-row: span 2;
}

.grid-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}

.grid-item:hover {
  transform: scale(1.05);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
  z-index: 2; /*bug correction */
}

.grid-img:hover {
  transform: scale(1.2);
}

#popup-bg {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 3;
  justify-content: center;
  align-items: center;
}

#popup-bg.active {
  display: flex;
}

#popup-content {
  max-width: 80%;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

#popup-img {
  width: 80%;
  height: auto;
  z-index: 1001;
}

#popup-close {
  position: absolute;
  top: 0;
  right: 0;
  transform: translate(50%, -50%);
  height: 40px;
  width: 40px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 40px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  z-index: 1002;
}

#popup-close:hover {
  background-color: orange;
}
