/************************************************************************************
MOBILE MENU ACTIVE
*************************************************************************************/
/* change max-width to trigger mobile menu active class */

/* ensure #nav and #searchform is visible on desktop version */
body:not(.mobile_menu_active) #main-nav {
	display: block !important;
}

/************************************************************************************
HEADER
*************************************************************************************/
/* reset absolute elements to static */
.mobile_menu_active #main-nav,
.mobile_menu_active .social-widget  {
	position: static;
	float: none;
	clear: both;
}

/* header */
.mobile_menu_active #header {
	height: auto;
	padding-top: 10px;
}

/* site logo */
.mobile_menu_active #site-logo {
	position: static !important;
}
.mobile_menu_active #site-logo a {
	font-size: 30px;
}

/* site description */
.mobile_menu_active #site-description {
	position: static !important;
	margin: 0 0 20px;
}

/* searchform wrap */
.mobile_menu_active #searchform-wrap {
	bottom: 8px;
	right: 0;
}
.mobile_menu_active #search-icon {
	display: none;
}
.mobile_menu_active #header #searchform:after {
	left: auto;
	right: 0;
	margin: 0;
	padding-left: 0;
}

/************************************************************************************
MOBILE NAV BUTTON
*************************************************************************************/
.mobile_menu_active .mobile-button {
	border-bottom: 2px solid;
	background-color: #fff;
	color: #333;
	cursor: pointer;
	display: block;
	text-decoration: none;
	position: absolute;
	width: 16px;
	height: 12px;
	top: 22px;
	right: 0;
	z-index: 9999;
	outline: 6px solid #fff;
}
.mobile_menu_active .mobile-button:before,
.mobile_menu_active .mobile-button:after {
	content: '';
	display: block;
	border-top: 2px solid;
	position: absolute;
	left: 0;
	width: 100%;
	transition: all .3s ease;
	transition-property: transform;
}
.mobile_menu_active .mobile-button:before {
	top: 0;
}
.mobile_menu_active .mobile-button:after {
	top: 50%;
}

/************************************************************************************
MAIN NAV (MOBILE)
*************************************************************************************/
.mobile_menu_active #main-nav-wrap {
	position: absolute;
	right: 0;
	top: 20px;
}

/* main nav */
.mobile_menu_active #main-nav {
	clear: both;
	position: absolute;
	top: 26px;
	right: 3px;
	left: auto;
	bottom: auto;
	width: 180px;
	height: auto;
	z-index: 1000;
	padding: 10px 5px 0;
	background-color: #fff;
	display: none; /* visibility will be toggled with jquery */
	margin: 10px 0;
	
}
.mobile_menu_active #main-nav li {
	clear: both;
	float: none;
	margin: 5px 0 13px 10px;
	padding: 0;
	border: none;
	background: none;
}
.mobile_menu_active #main-nav a, 
.mobile_menu_active #main-nav ul a {
	font: inherit;
	text-transform: inherit;
	background: none;
	width: auto;
	display: inline;
	padding: 0;
	color: #666;
	border: none;
}
.mobile_menu_active #main-nav a:hover, 
.mobile_menu_active #main-nav ul a:hover {
	background: none;
	color: #000;
}

/* current link */
.mobile_menu_active #main-nav .current_page_item > a,
.mobile_menu_active #main-nav .current-menu-item > a {
	background: none;
}

/* dropdown */
.mobile_menu_active #main-nav ul {
	position: static;
	display: block;
	margin: 10px 0 0;
	padding: 0;
	background: none;
}
.mobile_menu_active #main-nav ul li {
	background: none;
}

/************************************************************************************
MAIN NAV
*************************************************************************************/
.mobile_menu_active #main-nav a {
	margin: 0 10px 5px 0;
	padding: 4px 7px;
}
@media screen and (max-width: 1200px) {
	#headerwrap #site-logo a img{
		height: auto;
	}
}
@media screen and (max-width: 1020px) {

	/************************************************************************************
	STRUCTURE
	*************************************************************************************/
	#pagewrap {
		max-width: 100%;
	}

	.pagewidth,
	.full_width .themify_builder_row > .row_inner {
		max-width: 94%;
	}
	.full_width .module-layout-part .themify_builder_row.fullwidth > .row_inner,
	.full_width .themify_builder_row.fullwidth > .row_inner {
		max-width:100%;
	}

	.grid-sizer,
	.tile-post.small {
		width: calc(25% - 10px);
		padding-bottom: calc(25% - 10px);
	}
	.tile-post.medium {
		width: calc(50% - 10px);
		padding-bottom: calc(25% - 10px);
	}
	.tile-post.large {
		width: calc(50% - 10px);
		padding-bottom: calc(50% - 10px);
		overflow: auto;
		-webkit-overflow-scrolling: touch;
	}

	/* tile size in columns */
	.col4-1 .tile-post.small,
	.col3-2 .tile-post.small,
	.col3-1 .tile-post.small,
	.col2-1 .tile-post.small {
		width: calc(50% - 10px);
		padding-bottom: calc(50% - 10px);	
	}
	.col4-1 .tile-post.medium,
	.col3-2 .tile-post.medium,
	.col3-1 .tile-post.medium,
	.col2-1 .tile-post.medium {
		width: 100%;
		padding-bottom: calc(50% - 10px);	
	}
	.col4-1 .tile-post.large,
	.col3-2 .tile-post.large,
	.col3-1 .tile-post.large,
	.col2-1 .tile-post.large {
		width: 100%;
		padding-bottom: 100%;	
	}
	
}

@media screen and (max-width: 760px) {
	
	/************************************************************************************
	CUSTOM POST TYPE SHORTCODE STYLES
	*************************************************************************************/
	/* portfolio details */
	.single .portfolio .post-inner {
		padding: 3%;
	}

}

@media screen and (max-width: 700px) {
	
	/************************************************************************************
	STRUCTURE
	*************************************************************************************/
	#content {
		width: 100%;
		max-width: 100%;
		float: none;
		clear: both;
	}
	
	/* sidebar */
	#sidebar {
		width: 100%;
		max-width: 100%;
		float: none;
		clear: both;
	}
	#sidebar .secondary {
		width: 49%;
	}
	
	/************************************************************************************
	SIDEBAR
	*************************************************************************************/
	.widget {
		margin-bottom: 1.5%;
	}
	#sidebar .secondary .widget {
		margin-bottom: 3.5%;
	}
	
}

@media screen and (max-width: 680px) {
	
	/************************************************************************************
	LAYOUTS
	*************************************************************************************/
	/* loops-wrapper */
	.loops-wrapper {
		width: 100% !important;
	}

	/* portfolio-wrapper */
	.portfolio-wrapper {
		margin-left: 0 !important;
	}

	/* grid3 */
	.loops-wrapper.grid4 .post,
	.loops-wrapper.grid3 .post {
		width: 100%;
		float: none;
	}
	
	/************************************************************************************
	POST VIDEO (css for fluid video)
	*************************************************************************************/
	.post-video {
		clear: both;
	}

	/* disable webkit text size adjust (for iPhone) */
	html {
		-webkit-text-size-adjust: none;
	}
	
	/************************************************************************************
	STRUCTURE
	*************************************************************************************/
	#body {
		padding: 34px 0;
	}
	#content {
		overflow: hidden;
	}

	/************************************************************************************
	GRID
	*************************************************************************************/
	.col4-1,
	.col4-2, .col2-1,
	.col4-3,
	.col3-1,
	.col3-2	 {
		margin-left: 0;
		width: 100%;
		max-width: 100%;
	}
	
	/************************************************************************************
	POST
	*************************************************************************************/
	/* post */
	.post {
		max-width: 100% !important;
		margin-left: 0 !important;
		float: none !important;
	}
	.post:not(.portfolio-post) {
		width: auto !important;
	}
	.portfolio-post {
		width: 100% !important;
	}
	
	/* reset grid margin */
	.loops-wrapper.grid2 .post,
	.loops-wrapper.grid3 .post,
	.loops-wrapper.grid2.sidebar-none .post,
	.loops-wrapper.grid3.sidebar-none .post,
	.shortcode.portfolio .post,
	.sidebar-none .shortcode.portfolio .post,
	.portfolio.loops-wrapper.grid3 .post,
	.sidebar-none .portfolio.loops-wrapper.grid3 .post,
	.portfolio.loops-wrapper.grid2 .post,
	.sidebar-none .portfolio.loops-wrapper.grid2 .post {
		margin-bottom: 10px;
	}
	
	/************************************************************************************
	POST NAV
	*************************************************************************************/
	.post-nav .prev, .post-nav .next {
		display: block;
		width: 100%;
		clear: both;
		margin-bottom: 10px;
	}

	.single-portfolio .post-nav .prev, .post-nav .next {
		display: inline-block;
		width: auto;
		clear: none;
		margin-bottom: 5px;
	}
	
	/************************************************************************************
	COMMENTS
	*************************************************************************************/
	.commentlist {
		padding-left: 0;
	}
	.commentlist .commententry {
		clear: left;
	}
	.commentlist .avatar {
		float: left;
		width: 40px;
		height: 40px;
		margin: 0 10px 10px 0;
	}

	/************************************************************************************
	TILE
	*************************************************************************************/
	#pagewrap .grid-sizer,
	.tile-post.small {
		width: calc(50% - 10px);
		padding-bottom: calc(50% - 10px);
	}
	.tile-post.medium {
		width: calc(100% - 10px);
		padding-bottom: calc(50% - 10px);
	}
	.tile-post.large {
		width: calc(100% - 10px);
		padding-bottom: calc(100% - 10px);
		overflow: auto;
		-webkit-overflow-scrolling: touch;
	}
	.tile-post.image .tile-flip,
	.tile-post.map .tile-flip {
		height: 100%;
		width: 100%; /* tile large and medium */
	}
	.tile-post.small .tile-flip {
		width: 100%;
	}
	.tile-post.large .tile-flip {
		height: 100%;
	}
	
	/************************************************************************************
	WOOCOMMERCE SUPPORT
	*************************************************************************************/
	.woocommerce #content div.product div.images,
	.woocommerce #content div.product div.summary {
		float: none !important;
		width: 100% !important;
	}
	
}

/* Responsive Gallery items */
@media screen and (max-width: 1024px) {
	.gallery-columns-5 .gallery-item:nth-of-type(5n),
	.gallery-columns-6 .gallery-item:nth-of-type(6n),
	.gallery-columns-7 .gallery-item:nth-of-type(7n),
	.gallery-columns-8 .gallery-item:nth-of-type(8n),
	.gallery-columns-9 .gallery-item:nth-of-type(9n) {
		margin-right: 1.5%;
	}
	.gallery-columns-5 .gallery-item:nth-of-type(4n+1),
	.gallery-columns-6 .gallery-item:nth-of-type(4n+1),
	.gallery-columns-7 .gallery-item:nth-of-type(4n+1),
	.gallery-columns-8 .gallery-item:nth-of-type(4n+1),
	.gallery-columns-9 .gallery-item:nth-of-type(4n+1) {
		clear: left;
	}
	.gallery-columns-5 .gallery-item:nth-of-type(4n),
	.gallery-columns-6 .gallery-item:nth-of-type(4n),
	.gallery-columns-7 .gallery-item:nth-of-type(4n),
	.gallery-columns-8 .gallery-item:nth-of-type(4n),
	.gallery-columns-9 .gallery-item:nth-of-type(4n) {
		margin-right: 0;
	}
	.gallery-columns-5 .gallery-item + br,
	.gallery-columns-6 .gallery-item + br,
	.gallery-columns-7 .gallery-item + br,
	.gallery-columns-8 .gallery-item + br,
	.gallery-columns-9 .gallery-item + br {
		display: none;
	}
	
	/* clear none gallery item different sizes */
	.gallery-columns-5 .gallery-item:nth-of-type(5n + 1),
	.gallery-columns-6 .gallery-item:nth-of-type(6n + 1),
	.gallery-columns-7 .gallery-item:nth-of-type(7n + 1),
	.gallery-columns-8 .gallery-item:nth-of-type(8n + 1),
	.gallery-columns-9 .gallery-item:nth-of-type(9n + 1) {
		clear: none;
	}

	/* gallery column 5,6,7,8 and 9 */
	.gallery-columns-5 .gallery-item,
	.gallery-columns-6 .gallery-item,
	.gallery-columns-7 .gallery-item,
	.gallery-columns-8 .gallery-item,
	.gallery-columns-9 .gallery-item {
		width: 23.8%;
	}
}
@media screen and (max-width: 680px) {
	.gallery-columns-3 .gallery-item + br {
		display: none;
	}
	.gallery-columns-3 .gallery-item:nth-of-type(3n) {
		margin-right: 1.5%;
	}

	.gallery-columns-3 .gallery-item,
	.gallery-columns-4 .gallery-item,
	.gallery-columns-5 .gallery-item,
	.gallery-columns-6 .gallery-item,
	.gallery-columns-7 .gallery-item,
	.gallery-columns-8 .gallery-item,
	.gallery-columns-9 .gallery-item {
		width: 49.2%;
	}
	.gallery-columns-3 .gallery-item:nth-of-type(2n),
	.gallery-columns-4 .gallery-item:nth-of-type(2n),
	.gallery-columns-5 .gallery-item:nth-of-type(2n),
	.gallery-columns-6 .gallery-item:nth-of-type(2n),
	.gallery-columns-7 .gallery-item:nth-of-type(2n),
	.gallery-columns-8 .gallery-item:nth-of-type(2n),
	.gallery-columns-9 .gallery-item:nth-of-type(2n) {
		margin-right: 0;
	}
	
	/* clear none gallery item different sizes */
	.gallery-columns-4 .gallery-item:nth-of-type(4n + 1),
	.gallery-columns-3 .gallery-item:nth-of-type(3n + 1),
	.gallery-columns-2 .gallery-item:nth-of-type(2n + 1) {
		clear: none;
	}
}