*,
*:before,
*:after {
	list-style: none;
	text-decoration: none;
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

body {
	width: 100vw;
	height: 100vh;
	background-color: #eee;
	padding: 10px;
	overflow: hidden;
	position: relative;
}
.navbar {
	display: flex;
	flex-direction: column;
	width: 100%;
	text-align: center;
	height: max-content;
	margin: 0 0 5px;
}

.navbar h1 {
	padding: 0;
	margin-bottom: 0;
}

.navbar-item {
	display: inline;
	padding: 0 25px;
}

.navbar-links {
	color: #000;
	position: relative;
	font-size: 1.2rem;
}

.navbar-links:after {
	content: "";
	position: absolute;
	background-color: rgb(0, 255, 0);
	height: 2.5px;
	width: 0;
	left: 0;
	bottom: -5px;
	transition: 0.25s;
}

.navbar-links:hover {
	text-transform: uppercase;
	color: dodgerblue;
	text-decoration: bold;
}

.navbar-links:hover:after {
	width: 100%;
}

@media screen and (max-width: 500px) {
	.navbar {
		height: 200px;
	}
	.navbar-item {
		padding: 5px 0;
		display: block;
	}
}

.hamburger {
	display: none;
	cursor: pointer;
}

.bar {
	display: block;
	width: 25px;
	height: 3px;
	margin: 5px auto;
	-webkit-transition: all 0.3s ease-in-out;
	background-color: #000;
}

@media screen and (max-width: 424px) {
	.bar {
		display: block;
		width: 25px;
		height: 3px;
		margin: 5px auto;
		-webkit-transition: all 0.3s ease-in-out;
		background-color: #000;
	}

	.navbar {
		height: 35px;
		display: flex;
		justify-content: space-between;
	}

	.navbar h1 {
		position: absolute;
	}

	.hamburger {
		display: block;
		position: absolute;
		right: 20px;
	}

	.hamburger.active .bar:nth-child(2) {
		opacity: 0;
	}
	.hamburger.active .bar:nth-child(1) {
		transform: translateY(8px) rotate(45deg);
	}
	.hamburger.active .bar:nth-child(3) {
		transform: translateY(-8px) rotate(-45deg);
	}

	.navbar-menu {
		display: flex;
		position: fixed;
		left: -100%;
		top: 0;
		gap: 50px;
		flex-direction: column;
		background: rgba(225, 255, 225, 0.8);
		backdrop-filter: blur(0px);
		width: 100%;
		text-align: center;
		transition: 0.3s;
		height: 100%;
		padding-top: 48.5px;
	}

	.navbar-item {
		margin: 16px 0;
	}

	.navbar-menu.active {
		left: 0;
	}
}

@media screen and (max-height: 500px) {
	.navbar-menu {
		gap: 0;
	}

	.navbar {
		height: 35px;
		display: flex;
		justify-content: space-between;
	}

	.navbar h1 {
		position: absolute;
	}

	.hamburger {
		display: block;
		position: absolute;
		right: 20px;
	}

	.hamburger.active .bar:nth-child(2) {
		opacity: 0;
	}
	.hamburger.active .bar:nth-child(1) {
		transform: translateY(8px) rotate(45deg);
	}
	.hamburger.active .bar:nth-child(3) {
		transform: translateY(-8px) rotate(-45deg);
	}

	.navbar-menu {
		display: flex;
		position: fixed;
		left: -100%;
		top: 0;
		gap: 0;
		flex-direction: column;
		background: rgba(225, 255, 225, 0.8);
		backdrop-filter: blur(50px);
		width: 100%;
		text-align: center;
		transition: 0.3s;
		height: 100%;
		padding-top: 48.5px;
	}

	.navbar-item {
		margin: 16px 0;
	}

	.navbar-menu.active {
		left: 0;
	}
}

@media screen and (max-height: 480px) {
	#popup-content {
		max-width: 50%;
		display: flex;
		justify-content: center;
		align-items: center;
		position: relative;
	}

	#popup-img {
		width: 123px;
		height: 200px;
		border-radius: 8px;
	}
}

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

#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;
	border-radius: 10px;
	box-shadow: 0 0 13px #333;
}

.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: 100%;
	height: auto;
	border-radius: 8px;
}

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

#popup-close:hover {
	background-color: rgb(0, 119, 255);
}
