
// Default grid ratios
%two-thirds {
	margin: 0;
	width: (200 / 3 + 0%);
}

%one-third {
	margin: 0;
	width: (100 / 3 + 0%);
}

.two-thirds {
	@extend %two-thirds;
}

.one-third {
	@extend %one-third;
}

.pull-right {
	flex: 1 1 0;
	margin-left: auto;
}

.wide-container {
	max-width: $width;

	.inside-content {
		display: flex;
		justify-content: space-between;
		margin: 0 auto;
		max-width: $column-width;

		&.three-columns {
			flex-direction: row;
			margin-top: 2em;

			.column {
				// IE11 workaround for https://github.com/philipwalton/flexbugs#flexbug-4
				flex: 1 1 100px;
				width: (100/3 + 0%);
				padding: 5px 15px;
			}
		}
	}
}

#content {
	flex-direction: row;
}

body.has-picture, .page-index #content {
	flex-direction: column;
}

#main-content-wrapper {
	flex: 1 1 0;

	#main-content {
		width: 100%;

		#sidebar, .column {
			padding: 1em;
		}
	}
}

@media screen and ($max-mobile-viewport) {
	.pull-right {
		width: 100%;
	}

	#content .wide-container .three-columns.inside-content {
		// IE11 workaround https://github.com/philipwalton/flexbugs#flexbug-14
		// avoid flex-direction: column to ignore container height to fit fit its contents
		flex-flow: wrap;
		.column {
			max-width: 100%;
			min-width: 100%;

			.cell {
				width: 100%;
			}
		}
	}
}
