/*
* @license Apache-2.0
*
* Copyright (c) 2019 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*    http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/*
* Layout stylesheet.
*
* 1. General rules.
* 2. Clearfix.
* 3. Positioning.
* 4. Grid.
* 5. Main.
* 6. Lists.
* 7. Definition lists.
* 8. Blockquotes.
* 9. Horizontal rules.
* 10. Tables.
* 11. Code.
* 12. Classes.
*/

/*
* General top-level rules.
*/

html {
	box-sizing: border-box;
}

html,
body {
	height: 100%;
}

*,
*:before,
*:after {
	box-sizing: inherit;
}

input {
	margin: 0;
}

img {
	box-sizing: content-box;
	max-width: 100%;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	margin-top: 1.5em;
	margin-bottom: 1em;
}

h1,
h2 {
	padding-bottom: 0.3em;
}

/*
* Clearfix.
*/

.group:before,
.group:after {
    content: "";
    display: table;
}

.group:after {
    clear: both;
}

.group {
    zoom: 1; /* for IE 6/7 (trigger hasLayout) */
}

/*
* Positioning.
*/

.left-align {
	text-align: left;
}

.right-align {
	text-align: right;
}

.center {
	text-align: center;
	margin-left: auto;
	margin-right: auto;
}

.justify {
	text-align: justify;
}

.vertical-center {
	position: absolute;
	top: 50%;
}

/*
* Grid.
*/

.row {
	display: block;
	position: relative;

	width: 100%;
	min-height: 35em; /* 560px */
	padding: 6.25em 0; /* 100px 0 */

	zoom: 1; /* for IE 6/7 (trigger hasLayout) */
}

.row [class^="col"] {
	float: left;

	min-height: 0.125em;

	/* Define gutters between columns. */
	margin: 0 2%;
}

.row::before,
.row::after {
	content: "";
	display: table;
}

.row::after {
	clear: both;
}

/*
* Mobile first column widths.
*/
.col-1,
.col-2,
.col-3,
.col-4,
.col-5,
.col-6,
.col-7,
.col-8,
.col-9,
.col-10,
.col-11,
.col-12 {
	width: 100%;
}

/*
* Provide fixed column widths for small screens.
*/
.col-1-sm {
	width: 4.33%;
}

.col-2-sm {
	width: 12.66%;
}

.col-3-sm {
	width: 21%;
}

.col-4-sm {
	width: 29.33%;
}

.col-5-sm {
	width: 37.66%;
}

.col-6-sm {
	width: 46%;
}

.col-7-sm {
	width: 54.33%;
}

.col-8-sm {
	width: 62.66%;
}

.col-9-sm {
	width: 71%;
}

.col-10-sm {
	width: 79.33%;
}

.col-11-sm {
	width: 87.66%;
}

.col-12-sm {
	width: 96%;
}

.hidden-sm {
  display: none;
}

/*
* Column widths for larger screens.
*/
@media only screen and (min-width: 45em) { /* 720px */
	.col-1 {
		width: 4.33%;
	}

	.col-2 {
		width: 12.66%;
	}

	.col-3 {
		width: 21%;
	}

	.col-4 {
		width: 29.33%;
	}

	.col-5 {
		width: 37.66%;
	}

	.col-6 {
		width: 46%;
	}

	.col-7 {
		width: 54.33%;
	}

	.col-8 {
		width: 62.66%;
	}

	.col-9 {
		width: 71%;
	}

	.col-10 {
		width: 79.33%;
	}

	.col-11 {
		width: 87.66%;
	}

	.col-12 {
		width: 96%;
	}

	.hidden-sm {
		display: block;
	}
}

/*
* Main.
*/

.main {
	width: 100%;
	/*height: 100%;*/
	margin-bottom: 6.25em; /* 100px */
}

.main p,
.main blockquote,
.main dl,
.main table,
.main pre {
	margin-top: 0;
	margin-bottom: 1em;
}

/*
* Lists.
*/

.main ul,
.main ol {
	margin-top: 0;
	margin-bottom: 1em;
	padding-left: 2em;
}

.main ul ul,
.main ul ol,
.main ol ol,
.main ol ul {
	margin-top: 0;
	margin-bottom: 0;
}

/*
* Set the top margin of any list item children which are paragraphs.
*/
.main li > p {
	margin-top: 1em;
}

/*
* Add space between adjacent list items.
*/
.main li + li {
	margin-top: 0.25em;
}

/*
* Definition lists.
*/

.main dl {
	padding: 0;
}

.main dl dt {
	margin-top: 1em;
	padding: 0;
}

.main dl dd {
	margin-bottom: 1em;
	padding: 0 1em;
}

.main dd {
	margin-left: 0;
}

/*
* Blockquotes.
*/

.main blockquote {
	padding: 0 1em;
}

.main blockquote > :first-child {
	margin-top: 0;
}

.main blockquote > :last-child {
	margin-bottom: 0;
}

/*
* Horizontal rules.
*/

.main hr {
	height: 0.25em;
	margin: 1.5em 0;
	padding: 0;
}

.main hr::before {
	display: table;
	content: "";
}

/*
* Tables.
*/

.main table {
	display: block;
	width: 100%;
}

.main table th,
.main table td {
	padding: 6px 13px;
}

.main td,
.main th {
	padding: 0;
}

/*
* Code.
*/

.main pre {
	padding: 1em;
}

.main pre code {
	display: inline;
	max-width: inherit;
	padding: 0;
}

.main code {
	margin: 0;
	padding: 0;
	padding-top: 0.2em;
	padding-bottom: 0.2em;
}

.main code::before,
.main code::after {
	letter-spacing: -0.2em;
	content: "\00a0";
}

.main pre code::before,
.main pre code::after {
	content: normal;
}

.main kbd {
	display: inline-block;
	padding: 3px 5px;
}

/*
* General class level rules.
*/

/*
* Mobile first top navigation.
*/
.top-nav {
	display: block;
	position: fixed;
	top: 0;
	left: 0;

	z-index: 100;

	width: 100%;
	min-height: 4em;
}

.top-nav-input {
	display: none;
}

.top-nav-label {
	display: block;
	position: fixed;

	top: 0;
	left: 0;

	z-index: 101;

	width: 100px;
	height: 4em;
}

.top-nav-items {
	display: none;
	margin-top: 3em;
}

.top-nav-item {
	height: 4em;
}

.top-nav-item a {
	display: block;
	padding: 0 1em;
}

.top-nav-input:checked ~ .top-nav .top-nav-items {
	display: block;
}

@media only screen and (min-width: 43.75em) { /* 700px */
	.top-nav {
		padding: 0 2.5em;
	}

	.top-nav-label {
		display: none;
	}

	.top-nav-items {
		display: block;
		position: relative;
		float: right;

		height: 100%;
		margin-top: 0;
	}

	.top-nav-item {
		float: left;
	}

	.top-nav-item a:hover,
	.top-nav-item a:active {
		background-color: transparent;
		text-decoration: underline;
	}
}

/*
* Hamburger menu container.
*/
.hamburger-menu-icon {
	display: block;
	position: absolute;

	top: 8px;
	left: 8px;

	width: 48px;
	height: 48px;

	padding: 12px;
}

/*
* Style each hamburger menu line.
*/
.hamburger-menu-icon span {
	display: block;
	position: absolute;

	height: 2px;
	width: 18px;

	margin-left: 3px;
}

/*
* Position the hamburger menu lines.
*/
.hamburger-menu-icon span:nth-child(1) {
	top: 18px;
}

.hamburger-menu-icon span:nth-child(2) {
	top: 23px;
}

.hamburger-menu-icon span:nth-child(3) {
	top: 23px;
}

.hamburger-menu-icon span:nth-child(4) {
	top: 28px;
}

/*
* Bottom navigation.
*/
.bottom-nav {
	width: 100%;
	min-height: 5em;
}

/*
* Specify the "splash" section layout.
*/
.splash {
	height: 100%;
	min-height: 100vh; /* IE9+ */
	padding: 0;
}

.splash .background {
	display: block;
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;

	height: 100%;
}

.splash .logo {
	margin: 0;
	margin-top: -90px; /* roughly the height */
}

.splash .subtitle {
	margin-top: 0.5em;
	margin-bottom: 2em;
}

.splash .downarrow {
	display: block;
	position: absolute;
	top: 95%;
	left: 0;

	width: 100%;
}

.splash .downarrow svg {
	z-index: 0;
}

.splash .downarrow p {
	z-index: 1;
	opacity: 0;
	margin-top: -30px;
}

.splash .downarrow:hover svg {
	opacity: 0;
}

.splash .downarrow:hover p {
	opacity: 1;
}

@media only screen and (min-width: 45em) { /* 720px */
	/*
	* For medium screens, we need to tweak the logo position to appear centered.
	*/
	.splash .logo {
		margin-left: 40px;
	}
}

@media only screen and (min-width: 60em) { /* 960px */
	/*
	* For bigger screens, we need to tweak the logo position to appear centered.
	*/
	.splash .logo {
		margin-left: 50px;
	}
}

/*
* Mobile-first row column positioning.
*
* By floating columns within a row, we are able to dynamically update row order. When floating `left`, columns visually appear in the same order as in markup. When floating `right`, columns visually appear in reverse order.
*
* As an example, in wider viewports, we can alternate row column order, creating a zig-zag pattern (two-column).
*/
.floating-columns .col {
	float: left;
}

/*
* General asset positioning.
*/
.asset {
	display: block;
	position: relative;
	width: 96%;
	margin: 0;
}

/*
* Specify equation asset layout.
*/
.asset .equation {
	display: block;
	position: relative;
	min-height: 6.25em; /* 100px */
}

.asset .equation img {
	position: absolute;
	top: 40%; /* vertical alignment */
}

/*
* Specify code asset layout.
*/
.asset .code {
	margin-bottom: 4em;
}

/*
* General blurb positioning.
*/
.blurb {
	display: block;
	position: relative;
	width: 96%;
	margin: 0 auto;
	margin-bottom: 4em;
}

.blurb .text {
	margin-bottom: 1.5em;
}

@media only screen and (min-width: 45em) { /* 720px */
	.blurb {
		width: 80%;
	}

	/* Rules for floating columns. */
	.main > .floating-columns:nth-child(odd) > .col {
		float: right;
	}

	.main > .floating-columns:nth-child(even) > .col {
		float: left;
	}

	/* Rules for explicit asset positioning and assets within floating-columns. */
	.main > .floating-columns:nth-child(odd) > .col > .asset,
	.asset-left {
		margin-left: 0;
		margin-right: 4%;
	}

	.main > .floating-columns:nth-child(even) > .col > .asset,
	.asset-right {
		margin-left: 4%;
		margin-right: 0;
	}

	/* Rules for explicit blurb positioning and blurbs within floating-columns. */
	.main > .floating-columns:nth-child(even) > .col > .blurb,
	.blurb-left {
		margin-left: 2%;
		margin-right: 18%;
	}

	.main > .floating-columns:nth-child(odd) > .col > .blurb,
	.blurb-right {
		margin-left: 18%;
		margin-right: 2%;
	}
}

@media only screen and (min-width: 60em) { /* 960px */
	.blurb {
		width: 70%;
	}

	/* Rules for explicit blurb positioning and blurbs within floating-columns. */
	.main > .floating-columns:nth-child(even) > .col > .blurb,
	.blurb-left {
		margin-left: 2%;
		margin-right: 28%;
	}

	.main > .floating-columns:nth-child(odd) > .col > .blurb,
	.blurb-right {
		margin-left: 28%;
		margin-right: 2%;
	}
}

/*
* Pseudo-button positioning.
*/
.button {
	display: block;
	width: 180px;
	padding-top: 1em;
	padding-bottom: 1em;

	text-align: center;
}
