/* EDIT SPECIALLY FOR FMA */

.gallery-item {
	display: inline-block;
	text-align: center;
	vertical-align: top;
	width: 100%;
}

.gallery-icon {height: 100%;
	display: block;}

/*
@media only screen and (min-width: 1401px) {
	div.gallery .gallery-item,
	.masonry-sizer {
		width: 16.6666%;
	}
}

@media only screen and (min-width: 1181px) and (max-width: 1400px) {
	div.gallery .gallery-item,
	.masonry-sizer {
		width: 20%;
	}
}
 */

/* Max 3-up on this site: */

/*
@media only screen and (min-width: 1181px) {
	div.gallery .gallery-item,
	.masonry-sizer {
		width: 33.3333%;
	}
}

@media only screen and (min-width: 951px) and (max-width: 1180px) {
	div.gallery .gallery-item,
	.masonry-sizer {
		width: 33.3333%;
	}
}

@media only screen and (min-width: 646px) and (max-width: 950px) {
	div.gallery .gallery-item,
	.masonry-sizer {
		width: 33.3333%;
	}
}

@media only screen and (min-width: 490px) and (max-width: 645px) {
	div.gallery .gallery-item,
	.masonry-sizer {
		width: 50%;
	}
}
@media only screen and (min-width: 200px) and (max-width: 489px) {
	div.gallery .gallery-item,
	.masonry-sizer {
		width: 50%;
		/*
		pointer-events: none;
		*/
		/* disable click when small */
	}
}
 */

div.gallery figure .gallery-icon img {
/* width: 100%;
height: auto;  */
display: block; /* ensure spacing is fully controlled */
}

/*div.gallery img*/
div.gallery figure {
box-sizing:border-box; -moz-box-sizing:border-box; -webkit-box-sizing:border-box;
padding: 0px;
margin: 0; /* override figure styling in base theme */
margin-bottom: 10px;
}

div.gallery figcaption {
/*display: none;*/
font-size: 0.7em;
height: 2.7em;
padding: 3px;
overflow: hidden;
}

/*html.no-touch div.gallery figure:hover figcaption {
background: #333;
color: white;
}*/
div.gallery figure .gallery-icon img {
	transition: opacity .5s;
	display: block; /* for other themes */
}

div.gallery figure:hover .gallery-icon {
background: black;
}

div.gallery figure:hover .gallery-icon img {
opacity: 0.8;
}

div.gallery {
/* the floated way:
margin-left: -12px;*/

/*margin-left: -6px;
margin-right: -6px;*/
margin-left: 2px;
margin-right: 2px;
text-align:center;
}

div.gallery:before, div.gallery:after { content: ""; display: table; }
div.gallery:after { clear: both; }
div.gallery { *zoom: 1; }
/* clearfix for gallery */

/*
@media only screen
and (max-width : 600px) {
div.gallery figure {
width: 33.3333%;
}
}

@media only screen
and (max-width : 480px) {
div.gallery figure {
width: 50%;
}
}
*/

/*@media only screen
and (max-width : 320px) {
div.gallery figure {
width: 100%;
}
}*/

.gallery-overlay {
	display: none;
}

body.overlaidgallery > .gallery-overlay {
	display: block;
	width: 100%;
	height: 100%;
	background: rgba(0,0,0,0.8);
	position: fixed;
	top: 0;
	left: 0;
	z-index: 999999999;

}




/*.gallery-overlay .slider {
	visibility: hidden;
}*/

/*

If centering with translate then may need to apply:

.parent-element {
  -webkit-transform-style: preserve-3d;
  -moz-transform-style: preserve-3d;
  transform-style: preserve-3d;
}

... to stop blurriness.

*/

.gallery-detail {
	/* margin: 20% 12% 25%; */ /* no - all relative to width! vh too dodgy to use too */
	background: transparent;
	position: relative;

	-webkit-box-sizing: border-box;
	-moz-box-sizing: border-box;
	box-sizing: border-box;

	padding: 15vh 0 0;


}

.gallery-detail .owl-carousel {
width: 100%;
height: 100%;
/* overflow: hidden; */ /* handled on inner div by jQuery script - remove from here to move buttons outside modal */
}



.gallery-detail .owl-carousel div.galleryimg,
.gallery-detail .owl-carousel div.galleryrest {

}

.gallery-detail .owl-carousel .owl-item .galleryrest {

	padding: 1em 1em 0;
	font-size: 1.1em;
	color: white;
	-webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  text-align: center;


}



.gallery-detail .owl-carousel .owl-item .galleryrest h2 {
	font-size: 1.25em;

}

.gallery-detail,
.owl-carousel,
.owl-wrapper-outer,
.owl-wrapper,
.owl-item,
.owl-item > div {
	height: 100%;
}


.gallery-detail .owl-carousel .owl-item > div {
	display: -webkit-box;      /* OLD - iOS 6-, Safari 3.1-6 */
  display: -moz-box;         /* OLD - Firefox 19- (buggy but mostly works) */
  display: -ms-flexbox;      /* TWEENER - IE 10 */
  display: -webkit-flex;     /* NEW - Chrome */
  display: flex;             /* NEW, Spec - Opera 12.1, Firefox 20+ */



	-webkit-box-orient: vertical;
  -moz-box-orient: vertical;
  -webkit-box-direction: normal;
  -moz-box-direction: normal;

  -webkit-flex-direction: column;
  -ms-flex-direction: column;
  flex-direction: column;
}
.gallery-detail .owl-carousel .owl-item > div .galleryimg {
	-webkit-box-flex: 1;      /* OLD - iOS 6-, Safari 3.1-6 */
  -moz-box-flex: 1;         /* OLD - Firefox 19- */
  width: 100%;               /* For old syntax, otherwise collapses. */
  -webkit-flex: 1;          /* Chrome */
  -ms-flex: 1;              /* IE 10 */
  flex: 1;                  /* NEW, Spec - Opera 12.1, Firefox 20+ */

	position: relative;
}

.gallery-detail .owl-carousel .owl-item > div .galleryimg img {
	width: 100%;
	height: 100%;
	position: absolute; /* needed to make 100% child of flex item work */
	object-fit: cover;
	font-family: 'object-fit: cover;' /* IE fix */
}


.gallery-detail .owl-carousel div.owl-prev:hover, .gallery-detail .owl-carousel div.owl-next:hover {
  color: white;
}

.gallery-detail .owl-carousel .owl-pagination {
/*	position: absolute;
height: auto;
top: 0;
left: 0;*/

margin-top: 2em;
}

.owl-page {
	display: inline-block;
	padding: 0 6px;
	color: #f7f7f7;
	text-align: center;
}

.owl-page.active,
.owl-page:hover {
	color: white;
	background: #555;
}

div.gallery figure {
	cursor: pointer;
}




.gallery-overlay .cross {

  cursor: pointer;
  font-family: FontAwesome;
  font-size: 21px;
  display: block;
  position: absolute;
  z-index: 10000;
  top: 80px;
right: 54px;
  text-align: right;
  margin-right: 5px;

  color: #7b7b7b;
}
@media only screen and (min-width: 671px) { /* on touch button doesn't work reliably when set */
.gallery-overlay .cross:hover {
  color: white;
}
}


.owl-pagination {
	/*display: none;*/
}



.owl-prev {

  margin-right: 20px;
  padding-right: 3px;
  left: 20px;
  left: -100px;
}


.owl-next {

  margin-left: 20px;
  padding-left: 3px;
  right: 20px;
  right: -100px;
}


.gallery-detail .owl-carousel div.owl-prev, .gallery-detail .owl-carousel div.owl-next {
  position: absolute;
  z-index: 10000;
  top: 50%;
  display: block;
  color: #888;
  width: 100px;
  height: 100px;
  margin-top: calc( -30px - 7.5vh ); /* allow for .gallery-detail 20px top pad */
  font-size: 60px;
  font-family: FontAwesome;
  font-weight: normal;
  font-style: normal;
  -webkit-font-smoothing: antialiased;
  cursor: pointer;

  /* line-height: 40px; */ /* for chevron */
  line-height: 100px; /* for angle */
  text-align: center;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;

}

div#pag {
text-align: center;
color: white;
padding: 1em 0;

}


.gallery-detail .owl-carousel {

		-webkit-box-flex: 1;      /* OLD - iOS 6-, Safari 3.1-6 */
  -moz-box-flex: 1;         /* OLD - Firefox 19- */
  width: 100%;               /* For old syntax, otherwise collapses. */
  -webkit-flex: 1;          /* Chrome */
  -ms-flex: 1;              /* IE 10 */
  flex: 1;                  /* NEW, Spec - Opera 12.1, Firefox 20+ */

	position: relative;

	/*padding: 0 120px;*/
	margin: 0 120px;
	width: calc( 100% - 240px );
box-sizing: border-box;
}

.owl-carousel .owl-wrapper-outer {
	position: absolute;
}

div.gallery-detail {

		display: -webkit-box;      /* OLD - iOS 6-, Safari 3.1-6 */
  display: -moz-box;         /* OLD - Firefox 19- (buggy but mostly works) */
  display: -ms-flexbox;      /* TWEENER - IE 10 */
  display: -webkit-flex;     /* NEW - Chrome */
  display: flex;             /* NEW, Spec - Opera 12.1, Firefox 20+ */



	-webkit-box-orient: vertical;
  -moz-box-orient: vertical;
  -webkit-box-direction: normal;
  -moz-box-direction: normal;

  -webkit-flex-direction: column;
  -ms-flex-direction: column;
  flex-direction: column;
}


/*@media only screen and (min-width: 646px) {*/
/*@media only screen and (min-width: 601px) {*/
	div.gallery figure {margin-bottom: 0;}
	div.gallery .gallery-item {position:relative; overflow:hidden;}
	div.gallery .gallery-item img {object-fit:cover; font-family: 'object-fit: cover;' /* IE fix */ max-width: none; max-height: none; width: 100%;  min-width: 100%; min-height: 100%;}
/*}*/




/* multiple galleries */

body.overlaidgallery > .gallery-overlay {
    display: none;
}

body.overlaidgallery > .gallery-overlay.active {
    display: block;
}




/* bigger mage space on small screens */

@media only screen and (max-width: 670px) {
	.gallery-detail .owl-carousel .owl-item .galleryrest {
		display: none;
	}
	.gallery-detail {
		padding: 0;

	}
	.gallery-detail .owl-carousel {
		margin: 0;
		width: 100%;
		/*z-index: -1;*/ /* portrait phone close button event trapped */ /* but then couldn't work the swipe or anything */
		z-index: 1;
	}
	.gallery-overlay .cross {
		top: 8px;
		right: 8px;
		font-size: 21px;
		width: 80px;
		height: 80px;

	}
	.gallery-detail .owl-carousel div.owl-prev,
	.gallery-detail .owl-carousel div.owl-next {
		margin-top: -16px;
		width: 20px;
		height: 32px;
		background: black;
		line-height: 30px;
		font-size: 30px;
	}
	.gallery-detail .owl-carousel div.owl-prev {
		left: 0;
	}
	.gallery-detail .owl-carousel div.owl-next {
		right: 0;
	}
}
/*
@media all and (orientation:portrait) {
  /* Styles for Portrait screen * /
  .gallery-detail .owl-carousel .owl-item > div .galleryimg img {
  	max-width: 100%;
  }
}
@media all and (orientation:landscape) {
  /* Styles for Landscape screen * /
  .gallery-detail .owl-carousel .owl-item > div .galleryimg img {
  	max-width: 90%;
  }
}
attempt to cause fresh layout when rotated but just made image smaller
*/




div.gallery {margin-top: 90px; margin-bottom: 90px; box-sizing: border-box; }
div.gallery.style-windowwidth {margin-top: 90px; margin-bottom: 30px; padding: 0 30px; box-sizing: border-box; }
div.gallery.style-windowwidth figure {padding: 0 30px 0 30px !important; margin-bottom: 60px !important; }
.alignleft {margin: 5px 60px 60px 0; }
.alignright {margin: 5px 0 60px 60px; }

.gallery-icon {position:relative;}
.gallery-icon::after {content: ''; background:url('img/zoom.svg')no-repeat; background-size: contain; position: absolute; top: calc(50% - 25px); left: 50%; transform: translate(-50%); display: none; width: 50px; height: 50px;}
html.no-touch figure:hover .gallery-icon::after {display: inline-block;}



/*@media only screen and (min-width: 600px) {*/
	div.gallery.layout-masonry { display:-ms-grid; display: grid; -ms-grid-columns: 1fr 1fr 1fr; grid-template-columns: 1fr 1fr 1fr; grid-template-rows:1fr 1fr; }

	/* div.gallery.style-content {width: calc(94vw + 8px);} */
	div.gallery .gallery-item {
		padding: 4px; 
		width: 50%;
		display: inline-block;
	/*display: block;*/
	}
	div.gallery.layout-masonry .gallery-item {
		display: block;
		width: auto;
	}

	

	/* standard grid 1 - 40 */
	div.gallery.layout-masonry .gallery-item:nth-of-type(1) { grid-area: 1 / 1 / 3 / 3; -ms-grid-row: 1; -ms-grid-column: 1; -ms-grid-row-span:2; -ms-grid-column-span: 2;  }
	div.gallery.layout-masonry .gallery-item:nth-of-type(2) { grid-area: 1 / 3 / 2 / 4; -ms-grid-row: 1; -ms-grid-column: 3; }
	div.gallery.layout-masonry .gallery-item:nth-of-type(3) { grid-area: 2 / 3 / 3 / 4; -ms-grid-row: 2; -ms-grid-column: 3; }
	div.gallery.layout-masonry .gallery-item:nth-of-type(4) { grid-area: 3 / 1 / 5 / 2; -ms-grid-row: 3; -ms-grid-column: 1; -ms-grid-row-span:2; }
	div.gallery.layout-masonry .gallery-item:nth-of-type(5) { grid-area: 3 / 2 / 5 / 4; -ms-grid-row: 3; -ms-grid-column: 2; -ms-grid-row-span:2; -ms-grid-column-span: 2;  }
	div.gallery.layout-masonry .gallery-item:nth-of-type(6) { grid-area: 5 / 1 / 7 / 3; -ms-grid-row: 5; -ms-grid-column: 1; -ms-grid-row-span:2; -ms-grid-column-span: 2;  }
	div.gallery.layout-masonry .gallery-item:nth-of-type(7) { grid-area: 5 / 3 / 7 / 4; -ms-grid-row: 5; -ms-grid-column: 3; -ms-grid-row-span:2;}
	div.gallery.layout-masonry .gallery-item:nth-of-type(8) { grid-area: 7 / 1 / 8 / 2; -ms-grid-row: 7; -ms-grid-column: 1; }
	div.gallery.layout-masonry .gallery-item:nth-of-type(9) { grid-area: 8 / 1 / 9 / 2; -ms-grid-row: 8; -ms-grid-column: 1; }
	div.gallery.layout-masonry .gallery-item:nth-of-type(10) { grid-area: 7 / 2 / 9 / 4; -ms-grid-row: 7; -ms-grid-column: 2; -ms-grid-row-span:2; -ms-grid-column-span: 2;  }

	div.gallery.layout-masonry .gallery-item:nth-of-type(11) { grid-area: 9 / 1 / 11 / 3; -ms-grid-row: 9; -ms-grid-column: 1; -ms-grid-row-span:2; -ms-grid-column-span: 2;  }
	div.gallery.layout-masonry .gallery-item:nth-of-type(12) { grid-area: 9 / 3 / 10 / 4; -ms-grid-row: 9; -ms-grid-column: 3; }
	div.gallery.layout-masonry .gallery-item:nth-of-type(13) { grid-area: 10 / 3 / 11 / 4; -ms-grid-row: 10; -ms-grid-column: 3; }
	div.gallery.layout-masonry .gallery-item:nth-of-type(14) { grid-area: 11 / 1 / 13 / 2;  -ms-grid-row: 11; -ms-grid-column: 1; -ms-grid-row-span:2;}
	div.gallery.layout-masonry .gallery-item:nth-of-type(15) { grid-area: 11 / 2 / 13 / 4; -ms-grid-row: 11; -ms-grid-column: 2; -ms-grid-row-span:2; -ms-grid-column-span: 2;}
	div.gallery.layout-masonry .gallery-item:nth-of-type(16) { grid-area: 13 / 1 / 15 / 3; -ms-grid-row: 13; -ms-grid-column: 1; -ms-grid-row-span:2; -ms-grid-column-span: 2;}
	div.gallery.layout-masonry .gallery-item:nth-of-type(17) { grid-area: 13 / 3 / 15 / 4; -ms-grid-row: 13; -ms-grid-column: 3; -ms-grid-row-span:2;}
	div.gallery.layout-masonry .gallery-item:nth-of-type(18) { grid-area: 15 / 1 / 16 / 2; -ms-grid-row: 15; -ms-grid-column: 1;}
	div.gallery.layout-masonry .gallery-item:nth-of-type(19) { grid-area: 16 / 1 / 17 / 2; -ms-grid-row: 16; -ms-grid-column: 1; }
	div.gallery.layout-masonry .gallery-item:nth-of-type(20) { grid-area: 15 / 2 / 17 / 4; -ms-grid-row: 15; -ms-grid-column: 2; -ms-grid-row-span:2; -ms-grid-column-span: 2; }

	div.gallery.layout-masonry .gallery-item:nth-of-type(21) { grid-area: 17 / 1 / 19 / 3; -ms-grid-row: 17; -ms-grid-column: 1; -ms-grid-row-span:2; -ms-grid-column-span: 2;  }
	div.gallery.layout-masonry .gallery-item:nth-of-type(22) { grid-area: 17 / 3 / 18 / 4;  -ms-grid-row: 17; -ms-grid-column: 3;}
	div.gallery.layout-masonry .gallery-item:nth-of-type(23) { grid-area: 18 / 3 / 19 / 4; -ms-grid-row: 18; -ms-grid-column: 3;}
	div.gallery.layout-masonry .gallery-item:nth-of-type(24) { grid-area: 19 / 1 / 21 / 2;  -ms-grid-row: 19; -ms-grid-column: 1; -ms-grid-row-span:2;}
	div.gallery.layout-masonry .gallery-item:nth-of-type(25) { grid-area: 19 / 2 / 21 / 4; -ms-grid-row: 19; -ms-grid-column: 2; -ms-grid-row-span:2; -ms-grid-column-span: 2;}
	div.gallery.layout-masonry .gallery-item:nth-of-type(26) { grid-area: 21/ 1 / 23 / 3; -ms-grid-row: 21; -ms-grid-column: 1; -ms-grid-row-span:2; -ms-grid-column-span: 2;}
	div.gallery.layout-masonry .gallery-item:nth-of-type(27) { grid-area: 21 / 3 / 23 / 4; -ms-grid-row: 21; -ms-grid-column: 3; -ms-grid-row-span:2;}
	div.gallery.layout-masonry .gallery-item:nth-of-type(28) { grid-area: 23/ 1 / 24 / 2; -ms-grid-row: 23; -ms-grid-column: 1;}
	div.gallery.layout-masonry .gallery-item:nth-of-type(29) { grid-area: 24 / 1 / 25 / 2; -ms-grid-row: 24; -ms-grid-column: 1; }
	div.gallery.layout-masonry .gallery-item:nth-of-type(30) { grid-area: 23 / 2 / 25 / 4; -ms-grid-row: 23; -ms-grid-column: 2; -ms-grid-row-span:2; -ms-grid-column-span: 2; }

	div.gallery.layout-masonry .gallery-item:nth-of-type(31) { grid-area: 25 / 1 / 27 / 3; -ms-grid-row: 25; -ms-grid-column: 1; -ms-grid-row-span:2; -ms-grid-column-span: 2;  }
	div.gallery.layout-masonry .gallery-item:nth-of-type(32) { grid-area: 25 / 3 / 26 / 4;  -ms-grid-row: 25; -ms-grid-column: 3;}
	div.gallery.layout-masonry .gallery-item:nth-of-type(33) { grid-area: 26 / 3 / 27 / 4; -ms-grid-row: 26; -ms-grid-column: 3;}
	div.gallery.layout-masonry .gallery-item:nth-of-type(34) { grid-area: 27 / 1 /29 / 2;  -ms-grid-row: 27; -ms-grid-column: 1; -ms-grid-row-span:2;}
	div.gallery.layout-masonry .gallery-item:nth-of-type(35) { grid-area: 27 / 2 / 29 / 4; -ms-grid-row: 27; -ms-grid-column: 2; -ms-grid-row-span:2; -ms-grid-column-span: 2;}
	div.gallery.layout-masonry .gallery-item:nth-of-type(36) { grid-area: 29 / 1 / 31 / 3; -ms-grid-row: 29; -ms-grid-column: 1; -ms-grid-row-span:2; -ms-grid-column-span: 2;}
	div.gallery.layout-masonry .gallery-item:nth-of-type(37) { grid-area: 29 / 3 / 31 / 4; -ms-grid-row: 29; -ms-grid-column: 3; -ms-grid-row-span:2;}
	div.gallery.layout-masonry .gallery-item:nth-of-type(38) { grid-area: 31 / 1 / 32 / 2; -ms-grid-row: 31; -ms-grid-column: 1;}
	div.gallery.layout-masonry .gallery-item:nth-of-type(39) { grid-area: 32 / 1 / 33 / 2; -ms-grid-row: 32; -ms-grid-column: 1; }
	div.gallery.layout-masonry .gallery-item:nth-of-type(40) { grid-area: 31 / 2 / 33 / 4; -ms-grid-row: 31; -ms-grid-column: 2; -ms-grid-row-span:2; -ms-grid-column-span: 2; }

	div.gallery.layout-masonry .gallery-item:nth-of-type(41) { grid-area: 33 / 1 / 35 / 3; -ms-grid-row: 33; -ms-grid-column: 1; -ms-grid-row-span:2; -ms-grid-column-span: 2;  }
	div.gallery.layout-masonry .gallery-item:nth-of-type(42) { grid-area: 33 / 3 / 34 / 4;  -ms-grid-row: 33; -ms-grid-column: 3;}
	div.gallery.layout-masonry .gallery-item:nth-of-type(43) { grid-area: 34 / 3 / 35 / 4; -ms-grid-row: 34; -ms-grid-column: 3;}
	div.gallery.layout-masonry .gallery-item:nth-of-type(44) { grid-area: 35 / 1 /37 / 2;  -ms-grid-row: 35; -ms-grid-column: 1; -ms-grid-row-span:2;}
	div.gallery.layout-masonry .gallery-item:nth-of-type(45) { grid-area: 35 / 2 / 37 / 4; -ms-grid-row: 35; -ms-grid-column: 2; -ms-grid-row-span:2; -ms-grid-column-span: 2;}
	div.gallery.layout-masonry .gallery-item:nth-of-type(46) { grid-area: 37 / 1 / 39 / 3; -ms-grid-row: 37; -ms-grid-column: 1; -ms-grid-row-span:2; -ms-grid-column-span: 2;}
	div.gallery.layout-masonry .gallery-item:nth-of-type(47) { grid-area: 37 / 3 / 39 / 4; -ms-grid-row: 37; -ms-grid-column: 3; -ms-grid-row-span:2;}
	div.gallery.layout-masonry .gallery-item:nth-of-type(48) { grid-area: 39 / 1 / 41 / 2; -ms-grid-row: 39; -ms-grid-column: 1;}
	div.gallery.layout-masonry .gallery-item:nth-of-type(49) { grid-area: 41 / 1 / 43 / 2; -ms-grid-row: 41; -ms-grid-column: 1; }
	div.gallery.layout-masonry .gallery-item:nth-of-type(50) { grid-area: 39 / 2 / 43 / 4; -ms-grid-row: 39; -ms-grid-column: 2; -ms-grid-row-span:2; -ms-grid-column-span: 2; }

	div.gallery.layout-masonry .gallery-item:nth-child(1):nth-last-child(1)  { grid-area: 1 / 1 / 3 / 4; }
	/* 2 */
	div.gallery.layout-masonry .gallery-item:nth-child(1):nth-last-child(2)  { grid-area: 1 / 1 / 3 / 3; }
	div.gallery.layout-masonry .gallery-item:nth-child(2):nth-last-child(1)  { grid-area: 1 / 3 / 3 / 4; }
	/* 4 */
	div.gallery.layout-masonry .gallery-item:nth-child(2):nth-last-child(3)  { grid-area: 1 / 3 / 3 / 4; }
	div.gallery.layout-masonry .gallery-item:nth-child(3):nth-last-child(2)  { grid-area: 3 / 1 / 5 / 2; }
	div.gallery.layout-masonry .gallery-item:nth-child(4):nth-last-child(1)  { grid-area: 3 / 2 / 5 / 4; }
	/* 6 */
	div.gallery.layout-masonry .gallery-item:nth-child(4):nth-last-child(3)  { grid-area: 3 / 1 / 4 / 2; }
	div.gallery.layout-masonry .gallery-item:nth-child(5):nth-last-child(2)  { grid-area: 4 / 1 / 5 / 2; }
	div.gallery.layout-masonry .gallery-item:nth-child(6):nth-last-child(1)  { grid-area: 3 / 2 / 5 / 4; }
	/* 8 */
	div.gallery.layout-masonry .gallery-item:nth-child(7):nth-last-child(2)  { grid-area: 5 / 3 / 6 / 4; }
	div.gallery.layout-masonry .gallery-item:nth-child(8):nth-last-child(1)  { grid-area: 6 / 3 / 7 / 4; }
	/* 9 */
	div.gallery.layout-masonry .gallery-item:nth-child(8):nth-last-child(2)  { grid-area: 7 / 1 / 9 / 2; }
	div.gallery.layout-masonry .gallery-item:nth-child(9):nth-last-child(1)  { grid-area: 7 / 2 / 9 / 4; }
	/* 11 */
	div.gallery.layout-masonry .gallery-item:nth-child(8):nth-last-child(4)  { grid-area: 7/1/9/2; }
	div.gallery.layout-masonry .gallery-item:nth-child(9):nth-last-child(3)  { grid-area: 9/3/11/4; }
	/* 12 */
	div.gallery.layout-masonry .gallery-item:nth-child(12):nth-last-child(1)  { grid-area: 9/3/11/4; }
	/* 14 */
	div.gallery.layout-masonry .gallery-item:nth-child(12):nth-last-child(3)  { grid-area: 9/3/11/4; }
	div.gallery.layout-masonry .gallery-item:nth-child(13):nth-last-child(2)  { grid-area: 11/1/13/2; }
	div.gallery.layout-masonry .gallery-item:nth-child(14):nth-last-child(1)  { grid-area: 11/2/13/4; }

/*}*/

div.gallery {clear:both;}



@media only screen and (min-width: 1100px) {
	div.gallery.style-content {width: 100%; margin: 3em -8px 3em -8px; max-width: 1355px;}
	div.gallery .gallery-item {padding: 8px;}
}

.size-windowwidth {width: 100vw; position: relative; /* left: 50%; */ transform: translateX(-50vw); max-width: none; margin:5em 0;}
.entry-content :nth-child(1).size-windowwidth {margin-top: 0;}


/* GALLERY 2.0 */
.gallery {margin: 50px 0; }

div.gallery.style-window {transform: translateX(-50%); position: relative; left: 50%; width: calc(100vw + 18px); margin: 3em 0 !important;}
div.gallery.style-standard {	width: 100%; }
div.gallery.style-content {}

.gallery-icon {position:relative;}
.gallery-icon:after {content: ""; position:absolute; top: calc(50% - 20px); left:50%; transform: translate(-50%); display:none; background:url('img/iconZoom.svg')no-repeat; background-size: 40px; background-position: center; width: 40px; height: 40px;}
html.no-touch figure:hover .gallery-icon:after {display:block; }
html.no-touch div.gallery figure:hover .gallery-icon {background: #000;}

@media only screen and (min-width: 600px) {
	div.gallery.layout-three-column figure {
		width: 33.3333%;
		display: inline-block;
	}
	/* AFTER THAT if the third(n) is the last, full width */
	div.gallery.layout-three-column figure:nth-child(3n-2):nth-last-child(1)  {width: 100%;}
	/* if the third(n) is the 2nd last, and forth(n) is last, 50% */
	div.gallery.layout-three-column figure:nth-child(3n-2):nth-last-child(2),
	div.gallery.layout-three-column figure:nth-child(3n+2):nth-last-child(1)  {width: 50%;}

	/* CSS to keep  3col gallery neat */
	div.gallery.layout-three-column figure:nth-child(3n-2):nth-last-child(1)  {width: 100%;}
	/* 2 */
	div.gallery.layout-three-column figure:nth-child(1):nth-last-child(2),
	div.gallery.layout-three-column figure:nth-child(2):nth-last-child(1)  {width: 50%;}
	/* 4 */
	div.gallery.layout-three-column figure:nth-child(1):nth-last-child(4),
	div.gallery.layout-three-column figure:nth-child(2):nth-last-child(3),
	div.gallery.layout-three-column figure:nth-child(3):nth-last-child(2),
	div.gallery.layout-three-column figure:nth-child(4):nth-last-child(1) {width: 50%;}
	/* 7 */
	div.gallery.layout-three-column figure:nth-child(1):nth-last-child(7),
	div.gallery.layout-three-column figure:nth-child(2):nth-last-child(6),
	div.gallery.layout-three-column figure:nth-child(6):nth-last-child(2),
	div.gallery.layout-three-column figure:nth-child(7):nth-last-child(1) {width: 50%;}
	/* 8 */
	div.gallery.layout-three-column figure:nth-child(4):nth-last-child(5),
	div.gallery.layout-three-column figure:nth-child(5):nth-last-child(4){width: 50%;}
	div.gallery.layout-three-column figure:nth-child(6):nth-last-child(3),
	div.gallery.layout-three-column figure:nth-child(7):nth-last-child(2),
	div.gallery.layout-three-column figure:nth-child(8):nth-last-child(1){width: 33.333%;}
	/*10 */
	div.gallery.layout-three-column figure:nth-child(4):nth-last-child(7),
	div.gallery.layout-three-column figure:nth-child(5):nth-last-child(6),
	div.gallery.layout-three-column figure:nth-child(9):nth-last-child(2),
	div.gallery.layout-three-column figure:nth-child(10):nth-last-child(1) {width: 50%;}

}

div.gallery.style-scrollingstrip {
margin:3.5em 0;-webkit-transform:translateX(-50%);-moz-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%);position:relative;left:50%;width:calc(100vw + 6px); height: 480px; /* amb */
}
div.gallery.style-scrollingstrip figure > div img,
div.gallery.style-scrollingstrip figure > span img{
max-width:none; width: auto; height: 100%;
}
div.gallery.style-scrollingstrip figure {
width: auto; height: 480px; padding:0 2px;overflow:hidden;
}
div.gallery.style-scrollingstrip figure>div,
div.gallery.style-scrollingstrip figure>span{height: 480px;overflow:hidden}

div.gallery.style-scrollingstrip {
    margin: 3.5em 0;     -webkit-transform: translateX(-50%);     -moz-transform: translateX(-50%);     -ms-transform: translateX(-50%);     transform: translateX(-50%);     position: relative;     left: 50%;     width: calc(100vw + 6px); height: 480px; padding-top: 0; }

div.gallery.style-scrollingstrip figure > div img,
div.gallery.style-scrollingstrip figure > span img {
    max-width: none;     width: auto;     /*width: 42vw*/
	height: 480px; }
div.gallery.style-scrollingstrip figure {
    /*width: 42vw;*/
	width: auto; height: 480px;     padding: 0 2px;     overflow: hidden;
	font-size: 0.9em;
	line-height: 2;
}

div.gallery.style-scrollingstrip figure > div,
div.gallery.style-scrollingstrip figure > span {
    overflow: hidden
}


div.gallery.style-scrollingstrip .flickity-prev-next-button{width:50px; height:55px; padding: 1em; background: rgba(0,0,0,.2); border-radius: 0;}
.no-touch div.gallery.style-scrollingstrip .flickity-prev-next-button:hover{background: rgba(0,0,0,.7);}
div.gallery.style-scrollingstrip .flickity-prev-next-button svg{position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; padding: 14px;}
div.gallery.style-scrollingstrip .flickity-prev-next-button .arrow{fill:#fff}


@media screen and (max-width:1220px){
	div.gallery.style-scrollingstrip .flickity-prev-next-button.previous{left:10px}
	div.gallery.style-scrollingstrip .flickity-prev-next-button.next{right:0px}
}

div.gallery.style-scrollingstrip .flickity-prev-next-button.previous{left:30px}
div.gallery.style-scrollingstrip .flickity-prev-next-button.next{right:30px}


body.overlaidgallery>.gallery-overlay.active{display:block;width:100%;height:100%;background:rgba(0,0,0,.85);position:fixed;top:0;left:0;z-index:999999999}
.gallery-detail{background:0 0;position:relative;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:15vh 0 0}
.gallery-detail .owl-carousel{height:100%}
.gallery-detail .owl-carousel .owl-item .galleryrest {font-size: 0; color: transparent;}
.gallery-detail .owl-carousel .owl-item .galleryrest h2{font-size:20px; margin: 1em auto; color: #fff;}
.gallery-detail {height:90%}
.owl-carousel,.owl-item,.owl-item>div,.owl-wrapper,.owl-wrapper-outer{height:100%}
.gallery-detail .owl-carousel .owl-item>div{display:-webkit-box; display:-moz-box; display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column}
.gallery-detail .owl-carousel .owl-item>div .galleryimg{-webkit-box-flex:1;-moz-box-flex:1;width:100%;-webkit-flex:1;-ms-flex:1;flex:1;position:relative; height: 100%; /* amb - don't mess with the object-fit property */
}
.gallery-detail .owl-carousel .owl-item>div .galleryimg img{width:100%; height: 100%; /* amb - don't mess with the object-fit property */ object-fit:contain;}

.gallery-detail .owl-carousel .owl-pagination{margin-top:2em}
.owl-page{display:inline-block;padding:0 6px;color:#f7f7f7}
.owl-page.active,html.no-touch .owl-page:hover{color:#fff;background:#555}
html.no-touch .gallery-overlay .cross:hover{opacity:1}
.owl-prev{margin-right:20px;padding-right:3px;left:20px;left:-100px}
.owl-next{margin-left:20px;padding-left:3px;right:20px;right:-100px}
.gallery-detail .owl-carousel div.owl-next,.gallery-detail .owl-carousel div.owl-prev
{position:absolute;z-index:10000;top:50%;display:block;width:100px;height:100px;cursor:pointer;line-height:30px;text-align:center; padding: .4em; text-indent: 9999px; opacity:.8}
.gallery-overlay .cross{cursor:pointer;display:block;position:absolute;z-index:10000;top:30px;right:30px;text-align:right;margin-right:5px;width: 2em; height: 2em;background: url('img/iconX.svg')no-repeat; background-size: 60px; background-position: center; text-indent: 999px;  opacity:.8;}
.gallery-detail .owl-carousel div.owl-next {background: url('img/iconChevronRight.svg')no-repeat; background-size: 60px; background-position: center;}
.gallery-detail .owl-carousel div.owl-prev {background: url('img/iconChevronLeft.svg')no-repeat; background-size: 60px; background-position: center;}
.gallery-detail .owl-carousel div.owl-next:hover, .gallery-detail .owl-carousel div.owl-prev:hover {opacity:1}

div#pag{text-align:center;color:#fff;padding:1em 0}
.owl-pagination{display:none}
.gallery-detail .owl-carousel{-webkit-box-flex:1;-moz-box-flex:1;-webkit-flex:1;-ms-flex:1;flex:1;position:relative;margin:0 120px;width:calc(100% - 240px);box-sizing:border-box}
.owl-carousel .owl-wrapper-outer{position:absolute}
div.gallery-detail{display:-webkit-box;display:-moz-box;display:-ms-flexbox;display:-webkit-flex;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column}

html.no-touch div.gallery figure:hover {cursor: pointer; }


div.gallery figcaption {font-size: 1em; height:auto; position: absolute; width: calc(100% - 48px); bottom: 8px; padding: 16px; margin: 0; color: white;
background: -moz-linear-gradient(top, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 1%, rgba(0,0,0,0.5) 100%);
background: -webkit-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,0) 1%,rgba(0,0,0,0.5) 100%);
background: linear-gradient(to bottom, rgba(0,0,0,0) 0%,rgba(0,0,0,0) 1%,rgba(0,0,0,0.5) 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00000000', endColorstr='#80000000',GradientType=0 );}

div.gallery.style-scrollingstrip figcaption { width: calc(100% - 36px);bottom: 0; }

@media only screen and (max-width: 1099px) {
	div.gallery figcaption {width: calc(100% - 40px); bottom: 4px;}
	div.gallery.style-scrollingstrip figcaption { bottom: 0; }
}

@media only screen and (max-width: 645px) {
	div.gallery figure {position:relative;}
}

@media only screen and (max-width:599px) {
	/*div.gallery.layout-masonry figcaption {width: calc(100% - 32px);bottom: 0px;}*/
	/*div.gallery figcaption {width: calc(100% - 32px);bottom: 0px;}*/
	/* was only needed for one-up, not for the change to 2-up */
}



div.gallery.style-standard .gallery-icon {position:relative; width: 100%; height: 0; padding-bottom: 66.6666%; /* amb - force aspect ratio on overview images */}
div.gallery.style-standard .gallery-item img {width: 100%; height: 100%; /* position: absolute; */ object-fit: cover; font-family: 'object-fit: cover; object-position: bottom;'; position: absolute; left: 0; top: 0; }


.gallery-item img {pointer-events: none;}

@media only screen and (max-width: 650px) {
.gallery-item {pointer-events: none;}
}


@media only screen and (max-width: 599px) {
	div.gallery.style-scrollingstrip {
		height: 80vw;
	}
	
	div.gallery.style-scrollingstrip figure {
		width: 80vw;
		height: 80vw;
	}
	
	div.gallery.style-scrollingstrip figure > div, 
	div.gallery.style-scrollingstrip figure > span {
		width: 80vw;
		height: 80vw;
	}
	
	div.gallery.style-scrollingstrip figure > div img, 
	div.gallery.style-scrollingstrip figure > span img {
		width: 80vw;
		height: 80vw;
	}
}

@media only screen and (max-width: 599px) {
	div.gallery figcaption {

		font-size: 0.7em;
	}
}