/************************************************************************************
PREVENT PAGE WIDTH OVER EXTENDING
*************************************************************************************/
#pagewrap
#headerwrap,
#header,
#middlewrap,
#middle,
#content,
#sidebar,
#footerwrap,
#footer,
.pagewidth,
.themify_builder_row .row_inner, /* for themify builder plugin */
.tf_row_inner {
	max-width: 100%;
}

/************************************************************************************
INITIAL BREAKPOINT
*************************************************************************************/
@media screen and (max-width: 1200px) {

	.themify_builder_row .row_inner, /* for themify builder plugin */
	#header .tf_row_inner,
	#footer .tf_row_inner,
	#middle.pagewidth,
	.sidebar_none .tf_content .tf_row_inner {
		padding-left: 3%;
		padding-right: 3%;
	}
	.themify_builder_row.fullwidth .row_inner, /* for themify builder plugin */
	#header .tf_row_full_width .tf_row_wrapper > .tf_row_inner,
	#footer .tf_row_full_width .tf_row_wrapper > .tf_row_inner,
	.sidebar_none #middle.pagewidth,
	.sidebar_none .tf_content .tf_row_inner .tf_row_inner, /* prevent padding apply to nested rows */
	.sidebar_none .tf_content .tf_row_full_width > .tf_row_inner {
		padding-left: 0;
		padding-right: 0;
	}
	.themify_builder_row.fullwidth .row_inner, 
	.sidebar_none .tf_content .tf_row_full_width > .tf_row_wrapper > .tf_row_inner {
		padding-left: 0;
		padding-right: 0;
	}
	 		
}

/************************************************************************************
RESPONSIVE POST MODULE
*************************************************************************************/
@media screen and (max-width: 880px) {
	/*
	MODULE POST
	================================================ */
	.tf_loops_wrapper.grid4 .tf_post {
		width: 48.4%; /* change grid4 to 2 columns */
	}
	.tf_loops_wrapper.grid4 .tf_post:nth-of-type(2n+1) {
		margin-left: 0;
		clear: left;
	}
}

/************************************************************************************
TABLET BREAKPOINT (#pagewrap parent selector is added for overriding purpose)
*************************************************************************************/
@media screen and (max-width: 760px) {

	/*
	STRUCTURE
	================================================ */
	#pagewrap #content {
		width: 100%;
		max-width: 100%;
		float: none;
		clear: both;	
	}
		
	/* sidebar */
	#pagewrap #sidebar {	
		width: 100%;
		max-width: 100%;
		float: none;
		clear: both;
	}

}

/************************************************************************************
RESPONSIVE COLUMNS
*************************************************************************************/
@media (min-width: 600px) and (max-width: 959px) {
	.tf_col.tf_col4-1 {
		width: 48.4%;
	}
	.tf_col.tf_col4-1:nth-child(2n+1) {
		margin-left: 0 !important;
	}
	
	/* Fix non even width grids */
	.tf_sub_row .tf_col4-3 + .tf_col4-1,
	.grid_1-4_3-4 .tf_col4-1  {
		width: 22.6%;
	}
	.grid_2-4_1-4_1-4 .tf_col4-1,
	.grid_1-4_2-4_1-4 .tf_col4-1,
	.grid_1-4_1-4_2-4 .tf_col4-1  {
		width: 22.6%;
	}
	.tf_sub_row .tf_col4-2 + .tf_col4-1 + .tf_col4-1,
	.tf_sub_row .tf_col4-1 + .tf_col4-2 + .tf_col4-1  {
		margin-left: 3.2% !important;
	}
	
	.tf_col.tf_col6-1 {
		width: 31.2%;
	}
	.tf_col.tf_col6-1:nth-child(3n+1) {
		margin-left: 0 !important;
	}
	
	.tf_gutter_narrow.tf_sub_row  > .tf_col.tf_col4-1,
	.tf_gutter_narrow .tf_row_inner  > .tf_col.tf_col4-1 {
		width: 49.2%;
	}
	.tf_gutter_narrow.tf_sub_row  > .tf_col.tf_col6-1,
	.tf_gutter_narrow .tf_row_inner  > .tf_col.tf_col6-1 {
		width: 32.266%;
	}

	.tf_gutter_none.tf_sub_row  > .tf_col.tf_col4-1,
	.tf_gutter_none .tf_row_inner  > .tf_col.tf_col4-1 {
		width: 50%;
	}
	.tf_gutter_none.tf_sub_row  > .tf_col.tf_col6-1,
	.tf_gutter_none .tf_row_inner  > .tf_col.tf_col6-1 {
		width: 33.333%;
	}
	
	/* Fix non even width grids narrow */
	.tf_gutter_narrow.tf_sub_row  > .tf_col.tf_col4-3 +.tf_col.tf_col4-1,
	.tf_gutter_narrow .tf_row_inner  > .tf_col.tf_col4-3 +.tf_col.tf_col4-1,
	.tf_gutter_narrow.grid_1-4_3-4  > .tf_col.tf_col4-1,
	.tf_gutter_narrow.grid_1-4_3-4  > .tf_col.tf_col4-1,
	.tf_gutter_narrow.tf_sub_row.grid_2-4_1-4_1-4 .tf_col4-1,
	.tf_gutter_narrow.tf_sub_row.grid_1-4_2-4_1-4 .tf_col4-1,
	.tf_gutter_narrow.tf_sub_row.grid_1-4_1-4_2-4 .tf_col4-1  {
		width: 23.8%;
	}
	.tf_gutter_narrow.tf_sub_row .tf_col4-2 + .tf_col4-1 + .tf_col4-1,
	.tf_gutter_narrow.tf_sub_row .tf_col4-1 + .tf_col4-2 + .tf_col4-1  {
		margin-left: 1.6% !important;
	}
	
}

/************************************************************************************
MOBILE BREAKPOINT
*************************************************************************************/
@media screen and (max-width: 600px) {
	
	/*
	HEADING
	================================================ */
	h1 {
		font-size: 1.65em;
	}
	h2 {
		font-size: 1.5em;
	}
	h3 {
		font-size: 1.3em;
	}
	h4 {
		font-size: 1.25em;
	}

	/*
	ROW & COLUMN
	================================================ */
	.tf_col.tf_col6-1,
	.tf_col.tf_col5-1,
	.tf_col.tf_col4-1,
	.tf_col.tf_col4-2, 
	.tf_col.tf_col2-1,
	.tf_col.tf_col4-3,
	.tf_col.tf_col3-1,
	.tf_col.tf_col3-2 {
		margin-left: 0 !important;
		width: 100% !important;
		max-width: 100% !important;
	}

	/*
	PAGE WIDTH CONTAINERS
	================================================ */
	.themify_builder_row .row_inner, /* for themify builder plugin */
	#header .tf_row_inner,
	#footer .tf_row_inner,
	#middle.pagewidth,
	.sidebar_none .tf_content .tf_row_inner {
		padding-left: 5%;
		padding-right: 5%;
	}
	.themify_builder_row.fullwidth .row_inner,
	#header .tf_row_full_width .tf_row_wrapper > .tf_row_inner,
	#footer .tf_row_full_width .tf_row_wrapper > .tf_row_inner,	
	.sidebar_none .tf_content .tf_row_full_width .tf_row_wrapper > .tf_row_inner {
		padding-left: 0;
		padding-right: 0;
	}

	/*
	SITE LOGO
	================================================ */
	#pagewrap .tf_site_logo {
		font-size: 1.6em;
	}
	#pagewrap .tf_site_logo a {
		font-size: inherit;
	}
	
	/*
	MODULE POST
	================================================ */
	.tf_loops_wrapper.list-post .tf_post,
	.tf_loops_wrapper.grid4 .tf_post,
	.tf_loops_wrapper.grid3 .tf_post,
	.tf_loops_wrapper.grid2 .tf_post {
		width: 100%;
		max-width: 100%;
		margin-left: 0;
		float: none;
	}

	/*
	COMMENTS
	================================================ */
	.commentlist {
		padding-left: 0;
	}
	.commentlist .commententry {
		clear: left;
	}
	.commentlist .avatar {
		float: left;
		width: 40px;
		height: 40px;
		margin: 0 1em 1em 0;
	}

	/*
	NEXT/PREV POST LINK
	================================================ */
	.tf_post_nav .prev,
	.tf_post_nav .next {
		width: 100%;	
		margin: 0 0 1.5em;
		float: none;
		clear: both;
		display: block;
	}

}