/* Copyright 2026 Brian Duke */

body:has(.lightbox.active) {
	overflow: hidden;
}

body:has(.lightbox) main img {
	cursor: pointer;
}

.lightbox {
	visibility: hidden;
	position: fixed;
	z-index: 998;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.0);
	transition: background-color 0.3s ease, visibility 0.3s;
}

.view-container {
	width: 100%;
	height: 100%;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.lightbox.active {
	visibility: visible;
	background-color: rgba(0, 0, 0, 1);
}

.lightbox.active .view-container {
	opacity: 1;
}

.lightbox.active img {
	cursor: grab;
}

.lightbox.active img:active {
	cursor: grabbing;
}

.lightbox .image-container {
	width: 100%;
	height: 100%;
	display: flex;
	justify-content: center;
	align-items: center;
}

.lightbox .image-container img {
	object-fit: contain;
	width: auto;
	max-width: 100%;
	max-height: 90%;
	-webkit-user-drag: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
	transform-origin: center center;
	transition: transform 0.1s ease-out;
}

.lightbox.active button {
	position: absolute;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background-color: black;
	color: white;
	cursor: pointer;
}

.lightbox button#back {
	top: 50%;
	left: 0;
	margin-left: 1rem;
}

.lightbox button#back::after {
	content: "<";
}

.lightbox button#next {
	top: 50%;
	right: 0;
	margin-right: 1rem;
}

.lightbox button#next::after {
	content: ">";
}

.lightbox button#exit {
	top: 0;
	right: 0;
	margin: 1rem;
}

.lightbox button#exit::after {
	content: "X";
}

.lightbox.active .info {
	position: absolute;
	top: 0;
	left: 0;
	padding: 1rem;
	color: white;
	font-weight: bold;
}