/* natUIve – Grid */

@import 'natuive-setup';

/* For proper fallback, use .col* for all columns. Automatic column width (no .col*) works for Flexbox only. */

.row {

	width: 100%;
	display: block;
	display: -webkit-flex;
	display: -ms-flexbox;
	display: flex;
	 -webkit-justify-content: center;
	-webkit-flex-wrap: wrap;
	-ms-flex-wrap: wrap;
	flex-wrap: wrap;
	text-align: center;

}

	.row > * {
	
		vertical-align: top;
		position: relative;
		word-wrap: break-word;
		display: inline-block;
		-webkit-flex: 1 0 auto;
		-ms-flex: 1 0 auto;
		flex: 1 0 auto;
		width: 20%; /* Minimum col width */
		width: calc(20% - #{$line-height-em});
		text-align: left;
		text-align: start;
		padding: $line-height-em/2;
		margin: $line-height-em/2;

	}
	
	.row:before, .row:after { // Clear margins before/after a row
		
		content: '';
		display: table;
		width: 100%;

	}
	
	.row > *, .row > * > * {
		
		max-width: 100%; /* instead of overflow-x:hidden, which would also activate overflow-y:hidden and clip the tooltip */
		
	}

	.no-flex .row { // Fallback
		
		font-size: 0;
	
	}

	.no-flex .row > * {
		
		font-size: $font-size;
		font-size: 1rem;
		margin: $line-height-em/2 0;

	}

/* colXY where the column takes up X/Y of space; colY means 1/Y */

	.row > .col23 { // body used for rules override

		width: 66.667%;
		flex: 0 0 calc(66.667% - #{$line-height-em});

	}
	
	.row > .col34 {

		width: 75%;
		flex: 0 0 calc(75% - #{$line-height-em});

	}

	.row > .col4 {

		width: 25%;
		flex: 0 0 calc(25% - #{$line-height-em});

	}

	.row > .col5 {

		width: 20%;
		flex: 0 0 calc(20% - #{$line-height-em});

	}

	.row > .col25 {

		width: 40%;
		flex: 0 0 calc(40% - #{$line-height-em});

	}

	.row > .col35 {

		width: 60%;
		flex: 0 0 calc(60% - #{$line-height-em});

	}

	.row > .col45 {

		width: 80%;
		flex: 0 0 calc(80% - #{$line-height-em});

	}

	.row > .col3 {

		width: 33.333%;
		flex: 0 0 calc(33.333% - #{$line-height-em});

	}

	.row > .col2 {

		width: 50%;
		flex: 0 0 calc(50% - #{$line-height-em});

	}
	
	.row > .col1, .row > *:only-child:not([class^=col]) {

		width: 100%;
		flex: 0 0 calc(100% - #{$line-height-em});

	}
	
	.row.no-spacing > .col23 { // body used for rules override
	
		flex: 0 0 66.667%;
	
	}
	
	.row.no-spacing > .col34 {
	
		flex: 0 0 75%;
	
	}
	
	.row.no-spacing > .col4 {
	
		flex: 0 0 25%;
	
	}
	
	.row.no-spacing > .col5 {
	
		flex: 0 0 20%;
	
	}
	
	.row.no-spacing > .col25 {
	
		flex: 0 0 40%;
	
	}
	
	.row.no-spacing > .col35 {
	
		flex: 0 0 60%;
	
	}
	
	.row.no-spacing > .col45 {
	
		flex: 0 0 80%;
	
	}
	
	.row.no-spacing > .col3 {
	
		flex: 0 0 33.333%;
	
	}
	
	.row.no-spacing > .col2 {
	
		flex: 0 0 50%;
	
	}
	
	.row.no-spacing > .col1 {
	
		flex: 0 0 100%;
	
	}

	.row > * > img {
		
		display: block;
		margin: 0 auto;
		
	}

	@media screen and (max-width: 1024px) {
	
		.row > * {
			
			width: 25%;
		
		}
	
	}
	
	@media screen and (max-width: 768px) {
	
		.row > * {
			
			width: 33.333%;
		
		}
	
	}
	
	.row.no-padding, .row.no-padding > * {
		
		padding: 0;
	
	}
	
.align-left, .align-left *, .row > .align-left {
	
	text-align: left;
	text-align: start;

}

.align-right, .align-right *, .row > .align-right {
	
	text-align: right;	
	text-align: end;

}

.align-center, .align-center *, .row > .align-center {
	
	text-align: center;

}

.row > .align-top, .row > .align-middle, .row > .align-bottom {
	
	display: inline-block;
	display: flex;
	
}

.align-top, .row > .align-top, .align-top .row > * {
	
	vertical-align: top;
	justify-content: flex-start;
	flex-direction: column;
	display: flex;
	
}

.align-middle, .row > .align-middle, .align-middle .row > * {
	
	vertical-align: middle;
	justify-content: center;
	flex-direction: column;
	display: flex;
	
}

.align-bottom, .row > .align-bottom, .align-bottom .row > * {
	
	vertical-align: bottom;
	justify-content: flex-end;
	flex-direction: column;
	display: flex;

}

.align-children *, .row.align-children > * {
	
	text-align: inherit;
	
}

section {
	
	position: relative;

}

section:before, section:after { // Prevent inner edge margins from creating blank space between sections
	
	content: '';
	display: table;
	width: 100%;

}

/* Masonry in CSS only */

.masonry {

    -moz-column-count: 3;
    -moz-column-gap: 0;
    -webkit-column-count: 3;
    -webkit-column-gap: 0;
    column-count: 3;
    column-gap: 0;
    margin: $line-height-em 0;

}

    .masonry > * {

        display: inline-block;
		margin: 0 $line-height-em $line-height-em $line-height-em;
        width: calc(100% - #{$line-height-em}*2);
        -webkit-column-break-inside: avoid;
		page-break-inside: avoid;           /* FF 20+ */
		break-inside: avoid-column;

    }
    
    .masonry.col2 {

	    -moz-column-count: 2;
	    -webkit-column-count: 2;
	    column-count: 2;
	    
    }

.pad {
	
	padding: $line-height-em;

}

	.pad-half {
		
		padding: $line-height-em/2;
	
	}

	.unpad {
		
		margin: -$line-height-em;
		width: calc(100% + #{$line-height-em}*2);
	
	}
	
	.unpad-vertical {
		
		margin: -$line-height-em 0;

	}

.row.border {

	border: 1px solid #e6e6e6;
	padding: 0;

}
		
	.row.border > * {
		
		border-left: 1px solid #e6e6e6;
		
	}

	.row.border > *:first-child {
		
		border-left: none;
		
	}
	
	.row * .box { /* Boxes inside grid cells */
		
		background: #fff;
		border: 1px solid #e6e6e6;
		
	}
	
	.row.border-all {
		
		border: 1px solid;
		padding: 0;
		margin: 0;
		width: 100%;
		margin: 0 auto;

	}
	
	.row.border-all > *, .row.border-all .row > * {
		
		padding: $line-height-em/2;
		
	}
	
	.row.border-all > *, .row.border-all .row > * {
		
		margin: 0;

	}
	
	.row.border-all > *:only-child {
		
		flex: 0 0 100%;
		
	}
	
	.row.border-all > *:not(:first-child), .row.border-all .row > *:not(:first-child) {
		
		border-left: 1px solid;
		
	}
	
	.row.border-all .row {
		
		border-top: 1px solid;
		padding-top: 0;
		margin-top: -$line-height-em/2;
		max-width: none;
		margin-left: -$line-height-em/2;
		width: calc(100% + #{$line-height-em});
		
	}
	
	@-moz-document url-prefix() {

		.row.border-all .row .row {  
			
			margin-left: -$line-height-em/2;
			
		}

	}
	

	.row.border-all * .row:not(:first-child) {
		
		margin-top: 0;
		margin-bottom: 0
		
	}

	.row.border-all .row:first-child {
		
		border-top: none;
		
	}

	.row.border-all .row:last-child {
		
		margin-bottom: -$line-height-em/2;

	}
	
	.row.border-all .row .row:last-child {
		
		margin-bottom: -$line-height-em/2;
		
	}
	
	.row.border-all .row.border-off > * {
		
		border: none;

	}
	
	.row.border-all .row > .col1, .row.border-all .row > *:only-child:not([class^=col]) {

		width: 100%;
		flex: 0 0 calc(100%);

	}

	.row.no-spacing {
		
		padding: 0;
		margin: 0;

	}
	
	.row.no-spacing > * {
		
		padding: 0;
		margin: 0;

	}
	
	.row.spacing-horizontal > * {
		
		margin: 0 $line-height-em/2;

	}
	
	.row.spacing-vertical > * {
		
		margin: $line-height-em/2 0;

	}

@media screen and (max-width: $screen-narrow) {

/*
	.row * .row {
		
		margin: 0;
		width: 100%;

	}
*/

	.row > *, .row > [class^=col] {

		padding: .3em;
		width: 100% !important; // Important because of Android Browser
		border: none;
		flex: 0 0 100% !important;
		margin: $line-height-em/2 0;

	}

	.no-mobile-gutter.row > * {
		
		padding: 0;

	}
	
	.row > *, .row.border, .row.border > * {

		border: none;

	}

	.row.half > * {
		
		width: 50% !important;
		flex: 0 0 50%;

	}
	
	.row.border-all > *:not(:first-child), .row.border-all .row>*:not(:first-child) {
		
		border-left: none;

	}

	.masonry {
		
	    -moz-column-count: 2;
	    -webkit-column-count: 2;
	    column-count: 2;
		
	}

}
