.cgal {
	position: fixed;
	width: 100%;
	height: 100%;
	top: 0;
	left: 0;
	box-sizing: border-box;
	padding: 4em;
	display: flex;
	justify-content: center;
	align-items: center;
	animation: 0.2s ease 0s forwards fin;
	opacity: 0;
	z-index: 1111;
	backdrop-filter: blur(2px);
}

.cgal.out {
	animation: 0.2s ease 0s forwards fout;
}

@keyframes fin {
	100% {
		opacity: 1;
	}
}

@keyframes fout {
	0% {
		opacity: 1;
	}
	100% {
		opacity: 0;
	}
}

.cgal:before {
	content: "";
	position: absolute;
	background-color: #000;
	opacity: 0.6;
	z-index: -1;
	inset: 0; 
}

.cgal * {
	box-sizing: border-box;
}

.cgal .stage,
.cgal .wrapper {
	width: 100%;
	height: 100%;
	/* background-color: red; */
	display:flex;
	justify-content: center;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	/* overflow: hidden; */
}

.cgal .wrapper{
	opacity: 0; 
	animation: 1s ease 0s forwards fin;
}
.cgal .stage iframe {
	width: 100%;
	height: 100%;
	border: none;
	border-radius: 5px;
}

.cgal .stage .imgwrapper {
	/* border: 2px solid red; */
	max-height: 100%;
	max-width: 100%;
	border-radius: 5px;
	overflow: hidden;
}
.cgal .stage .title {
	padding: 0.25em; 
	text-align: center; 
	background-color: white;
	border-radius: 0.5em; 
	font-size:smaller; 
}

.cgal .stage .imgwrapper img{
	flex-grow: 0;
	width: auto;
	max-height: 100%;
	height:  auto;
	max-height: 100%;
	max-width:  100%;
	object-fit: contain;
}

.cgal .stage video {
	max-height:100%;
	max-width: 100%;
	border-radius: 5px;
}
.cgal .next, .cgal .prev {
	position: absolute;
	right: 0;
	width: 3em;
	top: 5em;
	height: calc(100% - 10em);
	display: flex;
	justify-content: center;
	align-items: center;
	cursor: pointer;
	transition: all 0.2s ease;
	opacity: 0;
	overflow: hidden;
}
.cgal .prev {
	border-bottom-right-radius: 1em; 
	border-top-right-radius: 1em; 
}
.cgal .next {
	border-bottom-left-radius: 1em; 
	border-top-left-radius: 1em; 
}

.cgal .next.dis, .cgal .prev.dis {
	display: none; 
}

.cgal .next:hover, .cgal .prev:hover {
	opacity: 1;
}

.cgal .prev {
	right: auto;
	left: 0;
}

.cgal .next:after, .cgal .prev:after {
	content: "";
	border-left: 1em solid white;
	border-top: 1em solid transparent;
	border-bottom: 1em solid transparent;
}

.cgal .prev:after {
	border-right: 1em solid white;
	border-left: none;
}

.cgal .next:before, .cgal .prev:before {
	content: "";
	width: 100%;
	height: 100%;
	position: absolute;
	background-color: #000;
	opacity: 0.2;
}

.cgal .close {
	background-color: #0003;
	position: absolute;
	top: 0;
	right: 0;
	width: 4em;
	height: 4em;
	cursor: pointer;
	opacity: 0.5;
	transition: all 0.2s ease;
	border-bottom-left-radius: 1em;
}

.cgal .close:hover {
	opacity: 1;
}

.cgal .close:hover:after {
	transform: translateX(50%) translateY(-50%) rotateZ(135deg);
}

.cgal .close:hover:before {
	transform: translateX(50%) translateY(-50%) rotateZ(45deg);
}

.cgal .close:after, .cgal .close:before {
	content: "";
	background-color: white;
	position: absolute;
	top: 50%;
	right: 50%;
	width: 2em;
	height: 0.25em;
	border-radius: 0.1em;
	transform: translateX(50%) translateY(-50%) rotateZ(45deg);
	transition: all 0.3s ease;
}

.cgal .close:before {
	transform: translateX(50%) translateY(-50%) rotateZ(-45deg);
}

.cgal .preview{
	position: absolute; 
	width: 0px; 
	height: 0px; 
	opacity: 0; 
	left: 0;
	top: 0; 
	z-index: -10;
}
@media(max-width: 992px){
    .cgal .next, .cgal .prev {
    	opacity: 1;
    }
    .cgal {
		padding: 1em;
    }
	.cgal .close {
		width: 3em;
		height: 3em;
	}
}
@media(max-width: 992px) AND (orientation: portrait){
    .cgal {
		padding-bottom: 4em;
		padding-top: 3em;
    }
    .cgal .next, .cgal .prev {
    	opacity: 1;
    }
    .cgal .next,
    .cgal .prev {
        height: 3em; 
        left: calc(50% + 1em); 
        border-radius: 0.5em; 
        bottom: 1em;
        top: auto;
    }
    .cgal .prev {
        left: auto; 
        right: calc(50% + 1em); 
    }

}