
.gallery{
	margin: 3em 0 1em; 
}
.gal-grid{
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	/* grid-auto-rows: 1fr; */
	grid-auto-flow: row dense;
	gap: 7px;
	width: 100%;
}
.gal-grid.gal-grid-3{
	grid-template-columns: repeat(3, 1fr);
}
.gal-grid .height2{
	grid-row: span 2;
}
.gal-grid .width2{
	grid-column: span 2;
}
.gal-grid img{
	display: none;
}
.gal-item{
	background-size: cover;
	background-position: center center;
	position: relative;
	overflow: hidden;
	display: flex;
	justify-content: center;
	align-items: center;
	padding-top: 100%;
	transition: none;
}

.gal-item.ver{
	grid-column: span 1;
	padding-top: 133.333%;
}
.gal-item.hor{
	grid-column: span 2;
	padding-top: 66.666%;
}
.gal-item.ver img,
.gal-item.hor img{
	object-fit: cover; 
	height: 100%; 
	width: 100%; 
}

.gal-item:after{
	content: ""; 
	position: absolute;
	height: 30px; 
	width: 30px; 
	background: linear-gradient(transparent 13px, #fff 13px, #fff 17px, transparent 17px),
				linear-gradient(90deg, transparent 13px, #fff 13px, #fff 17px, transparent 17px);
	top: calc(50% - 15px);
	left: calc(50% - 15px);
	opacity: 0; 
	transform: translateY(100%);
	transition: all 0.3s ease;
}
.gal-item.video:after{
	background: none;
	border-left: 25px solid white;
	border-top: 15px solid transparent;
	border-bottom: 15px solid transparent;
	width: 25px;
	left: calc(50% - 12px);
}
.gal-item:hover:after{
	opacity: 1; 
	transform: translateY(0);
}
.gal-item:before{
	content: ""; 
	position: absolute;
	width: 100%; 
	height: 100%; 
	top: 0; 
	left: 0; 
	background-color: var(--agriox-primary);
	opacity:0; 
	transition: all 0.3s ease;
}
.gal-item:hover:before{
	opacity: 0.4; 
}
.gal-item>div{
	height: 100%;
	width: 100%;
	position: absolute;
	top: 0;
	left: 0;
	background-size: cover;
	transition: all 0.3s ease;
	background-position: center center;
}
.gal-item:hover>div{
	transform: scale(1.1);
}
.gal-item.height1.width2{
	padding-top: 50%;
}

body:has(>.cgal){
	overflow: hidden; 
}

.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: 100000;
	backdrop-filter: blur(6px);
}

.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;
	width: 100%;
	height: 100%;
	background-color: #000;
	opacity: 0.6;
	z-index: -1;
}

.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.1s 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.1s 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.15s 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 .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); 
    }

}