/* ===================================================================*/
/*    Principal                                                       */
/*=================================================================== */
  

/* Grid Categories 
===================================================================== */

.xpg-categories {
	margin: 0;
	padding: 0 0.625rem 0.375rem;
}

.xpg-categories-item {
	display: inline-block;
	list-style: none;
	margin: 0.25rem 0.125rem 0;
	padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    color: #313131;
    text-align: center;
    background-color: #e5e5e5;
    cursor: pointer;
}

.xpg-categories-item:hover {
	opacity: 0.6;
}

.xpg-categories-item.active {
	background-color: #007e6d;
	color: white;
}


/* Grid
===================================================================== */

.xpg-grid {
	list-style: none;
	padding-bottom: 10px;
	margin: 0 auto;
	text-align: center;
	width: 100%;
	position: relative;

	display: flex;
	flex-wrap: wrap;
}


/* Grid Item (Preview + Container)
===================================================================== */

.xpg-item {
	display: inline-block;
	vertical-align: top;
	flex: 0 0 25%;
    max-width: 25%;
    height:auto;
	padding: 1.25rem 0.625rem 0;
}

.xpg-item:before {
    content:'';
    float:left;
    padding-top:100%;
}

/* Hidden Item (Children) */ 

.xpg-item.hidden { 
	display: none; 
}

/* Parent Item */ 

.xpg-item-parent { 
	color: white; 
}


.xpg-item-parent:hover { 
	opacity: 0.6; 
	cursor: pointer; 
}

.xpg-item-parent > .xpg-item-preview--title { 
	min-height: auto; 
}

/* Parent : Openend */

.xpg-item-parent.opened { 
	border-color: #008875; 
}

/* Child Item */

.xpg-item-child { 
	border-color: #007e6d; 
}

.xpg-item-child > .xpg-item-preview--title { 
	background-color: #eeeeee; 
}


/* Grid Item Preview
===================================================================== */

.xpg-item-preview { 
	display: flex; 
	flex-direction: column; 
	border: 1px solid #9c9e9f; 

	width: 100%;
	height: 100%;
}

.xpg-item-preview--img { 
	flex: 1; 
	background: no-repeat center center; 
	background-size: cover; 

}
.xpg-item-preview--title { 
	min-height: 3.75rem; 
	padding: 0.625rem 0.875rem; 
	color: #313131; 
	line-height: 1.25rem; 
	text-align: left; 
	background-color: white; 
}

.xpg-item-preview--more { 
	padding: 0.125rem 0.875rem; 
	text-align: left; 
	font-size: 0.875rem; 
	background-color: #007e6d; 
}

.xpg-item-preview:hover { 
	z-index: 110; 
}


/* Parent Opened */ 

.xpg-item-preview.opened { 
	border-color: #008875; 
}

/* Other Items blurred bc Parent Opened */

.xpg-item-preview.blurred-opended { 
	filter: grayscale(100%) brightness(0.8); 
	overflow: hidden; 
	background: grey; 
}
@media all and (-ms-high-contrast:none) {
    .xpg-item-preview.blurred-opended > .xpg-item-preview--img  { opacity: 0.3; } /* IE10 */
    *::-ms-backdrop, .xpg-item-preview.blurred-opended > .xpg-item-preview--img  { opacity: 0.3; } /* IE11 */
}

.xpg-item-preview.blurred-opended > .xpg-item-preview--img { 
	filter: blur(4px); 
}
@media all and (-ms-high-contrast:none) {
    .xpg-item-preview.blurred-opended { opacity: 0.3; } /* IE10 */
    *::-ms-backdrop, .xpg-item-preview.blurred-opended { opacity: 0.3; } /* IE11 */
}

/* Item Expanded */

.xpg-item.xpg-item-expanded > .xpg-item-preview {
	position: relative;
	border-width: 3px;
	border-color: rgba(0,136,117,1); /* $color-primary */
}

.xpg-item.xpg-item-expanded > .xpg-item-preview:hover {
	opacity: 1;
	z-index: 110;
}

.xpg-item.xpg-item-expanded > .xpg-item-preview:hover > * {
	opacity: 0.6;
}

.xpg-item.xpg-item-expanded > .xpg-item-preview::after,
.xpg-item.xpg-item-expanded > .xpg-item-preview::before {
	border: solid transparent;
	content: " ";
	height: 0;
	width: 0;
	position: absolute;
	bottom: -25px;
	pointer-events: none;
	border-bottom-color: rgba(244,244,244,1);
	border-width: 14px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 110;
}

.xpg-item.xpg-item-expanded > .xpg-item-preview::before {
	bottom: -23px;
	border-width: 13px;
	border-bottom-color: rgba(0,136,117,1); /* $color-primary */
}

/* Other Items blurred bc Item Expanded */

.xpg-item-preview.blurred-expanded { filter: grayscale(100%) brightness(0.3); }
@media all and (-ms-high-contrast:none) {
    .xpg-item-preview.blurred-expanded { position: relative; } /* IE10 */
    ::-ms-backdrop, .xpg-item-preview.blurred-expanded  {position: relative; } /* IE11 */
    .xpg-item-preview.blurred-expanded:after {
    	content: '';
    	position: absolute;
    	top:0;
    	left:0;
    	width:100%;
    	height:100%; 
    	display: block; 
    	background: rgba(40,40,40,0.6);
    } /* IE10 */
    ::-ms-backdrop, .xpg-item-preview.blurred-expanded:after {
    	position: absolute;
    	top:0:left:0;
    	width:100%;
    	height:100%; 
    	display: block; 
    	background: rgba(40,40,40,0.6);
    } /* IE11 */
}


/* Grid Item Container
===================================================================== */

.xpg-item-container {
	position: absolute;
	top: auto;
	/*left: 50%;*/
	left: 0;
	width: calc(100% - 1.25rem);
	height: 0;
	margin: 1.25rem 0.625rem 0;	
	text-align: left;
	background: rgba(244,244,244,1);
	overflow: hidden;
	z-index: 100;
}

.xpg-item-container--fullimg,
.xpg-item-container--details {
	width: 50%;
	float: left;
	height: 100%;
	overflow: hidden;
	position: relative;
	padding: 1.125rem 1.25rem;
}


/* Container Close Button */

.xpg-item-container--close {
	position: absolute;
	width: 1.5rem;
	height: 1.5rem;
	top: 20px;
	right: 20px;
	cursor: pointer;
	z-index: 110;
}

.xpg-item-container--close::before,
.xpg-item-container--close::after {
	content: '';
	position: absolute;
	width: 100%;
	top: 50%;
	height: 1px;
	background: rgba(98,98,98,1);
	-webkit-transform: rotate(45deg);
	-moz-transform: rotate(45deg);
	transform: rotate(45deg);
}

.xpg-item-container--close::after {
	-webkit-transform: rotate(-45deg);
	-moz-transform: rotate(-45deg);
	transform: rotate(-45deg);
}

.xpg-item-container--close:hover::before,
.xpg-item-container--close:hover::after {
	background: #333;
}


/* Details */

.xpg-item-container--details {
	font-family: 'opensans', Helvetica, sans-serif;
	min-width: 62.5%;
	padding: 1.125rem 1.25rem 1.125rem  1.75rem;
}

.xpg-item-container--title {
	padding-right: 1.5rem;
	font-weight: 300;
	font-size: 1.75rem;
	line-height: 1.25;
	margin: 0.25rem 0 0.5rem;
	font-family: 'opensans', Helvetica, sans-serif;
	color: rgba(49,49,49,1); /* $color-black */
}

.xpg-item-container--cat {
	margin-bottom: 0.5rem;
	line-height: 1.25;
	text-transform: uppercase;
	font-size: 0.875rem;
	color: rgba(22,166,141,1); /* $color-primary-light */
}

.xpg-item-container--text {
	line-height: 1.5;
	font-size: 0.875rem;
	color: rgba(49,49,49,1);
}

.xpg-item-container--contact {
	float: right;
	display: inline-block;
	padding: 0.875rem 1.625rem;
	line-height: 1;
	color: white;
	border-radius: 0.25rem;
	outline: none;
	background-color: rgba(0,126,109,1); /* $color-primary-dark */
}

.xpg-item-container--contact:hover {
	color: white;
}


/* Image (& Gallery) */

.xpg-item-container--fullimg {
	display: flex;
	flex-direction:row;
	height: 100%;
	padding-right: 0;
	justify-content: center;
	align-items: center;
	text-align: center;
	width: 37.5%;
}

/* Image Loader */

.xpg-item-container--loading {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #ddd;
	box-shadow: 0 0 1px #ccc, 15px 30px 1px #ccc, -15px 30px 1px #ccc;
	position: absolute;
	top: 50%;
	left: 50%;
	margin: -25px 0 0 -25px;
	-webkit-animation: loader 0.5s infinite ease-in-out both;
	-moz-animation: loader 0.5s infinite ease-in-out both;
	animation: loader 0.5s infinite ease-in-out both;
}

@-webkit-keyframes loader {
	0% { background: #ddd; }
	33% { background: #ccc; box-shadow: 0 0 1px #ccc, 15px 30px 1px #ccc, -15px 30px 1px #ddd; }
	66% { background: #ccc; box-shadow: 0 0 1px #ccc, 15px 30px 1px #ddd, -15px 30px 1px #ccc; }
}

@-moz-keyframes loader {
	0% { background: #ddd; }
	33% { background: #ccc; box-shadow: 0 0 1px #ccc, 15px 30px 1px #ccc, -15px 30px 1px #ddd; }
	66% { background: #ccc; box-shadow: 0 0 1px #ccc, 15px 30px 1px #ddd, -15px 30px 1px #ccc; }
}

@keyframes loader {
	0% { background: #ddd; }
	33% { background: #ccc; box-shadow: 0 0 1px #ccc, 15px 30px 1px #ccc, -15px 30px 1px #ddd; }
	66% { background: #ccc; box-shadow: 0 0 1px #ccc, 15px 30px 1px #ddd, -15px 30px 1px #ccc; }
}

/* Gallery: Prev & Next Buttons */

.xpg-item-container--gallery-prev {
	flex-shrink: 0;
	flex-grow: 0;
	max-width: 1.75rem;
	padding-right: 0.75rem;
}
.xpg-item-container--gallery-next {
	flex-shrink: 0;
	flex-grow: 0;
	max-width: 1.75rem;
	padding-left: 0.75rem;
}

.xpg-item-container--gallery-prev img{
	margin-right: 0.75rem;
	height: 1.75rem;
	cursor: pointer;
}
.xpg-item-container--gallery-next img {
	margin-right: 0.75rem;
	height: 1.75rem;
}

.xpg-item-container--gallery-prev img:hover,
.xpg-item-container--gallery-next img:hover {
	opacity: 0.6;
	cursor: pointer;
}

/* Gallery: Images */

.xpg-item-container--gallery-img {
	display: none;
	max-height: 14.375rem;
}

.xpg-item-container--gallery-img.active {
	display: inline-block;
}

.xpg-item-container--fullimg > img {
	display: inline-block;
	max-height: 100%;
	max-width: 100%;
	width: 100%;
}

/* Gallery: Points */

.xpg-item-container--gallery-content {
	flex: 1;
}

.xpg-item-container--gallery-content-points {
	padding-top: 0.5rem;
	line-height: 1;
}

.xpg-item-container--gallery-point {
	display: inline-block;
	height: 0.75rem;
	width: 0.75rem;
	margin: 0.375rem;
	border-radius: 50%;
	background-color: rgba(184,217,213,1);
}

.xpg-item-container--gallery-point.active,
.xpg-item-container--gallery-point:hover {
	cursor: pointer;
	background-color: rgba(0,136,117,1);
}


/* Redirectionners Linl item 
===================================================================== */

.xpg-item-redirection > .xpg-item-preview { 
	border: none; 
	background-color: #007e6d; 
}
.xpg-item-redirection > a { 
	justify-content: center; 
	padding: 1.375rem; text-align: left; 
	color: white; 
	font-size: 1.375rem; 
}

.xpg-item-redirection > .xpg-item-preview:hover { 
	background-color: rgba(0, 126, 109, 0.6); 
}
.xpg-item-redirection > a:hover { 
	opacity: 1; 
	color: white;
}


/* ===================================================================*/
/*    Media Queries                                                   */
/*=================================================================== */

@media screen and (max-width: 1100px) {
	.xpg-item {
		flex: 0 0 33.33332%;
    	max-width: 33.33332%;
	}
}

@media screen and (max-width: 830px) {
	.xpg-item-container h3 { font-size: 32px; }
	.xpg-item-container p { font-size: 13px; }
	.xpg-item-container a { font-size: 12px; }

	.xpg-item {
		flex: 0 0 50%;
    	max-width: 50%;
	}
}

@media screen and (max-width: 650px) {
	.xpg-item-container--fullimg { display: none; }
	.xpg-item-container--details { float: none; width: 100%; }	
}

@media screen and (max-width: 550px) {
	.xpg-item {
		flex: 0 0 100%;
    	max-width: 100%;
	}
}