// Color
$base-hue: 45;
$key-hue: 166;
$key-color: hsl($key-hue, 41%, 49%);

$outer-background-color: hsl($base-hue, 3%, 80%);
$background-color: hsl($base-hue, 3%, 95%);
$color: #444;

$a-color: $key-color;
$a-hover-background-color: adjust-color($a-color, $saturation: -15%, $lightness: +38%);
$body-border-color: darken($background-color, 20%);
$code-background-color: darken($background-color, 2%);
$code-border-color: darken($background-color, 9%);
$heading-color: #444;
$heading-border-color: darken($background-color, 9%);
$pre-background-color: darken($background-color, 2%);
$pre-border-color: darken($background-color, 9%);
$table-border-color: darken($background-color, 9%);
$th-background-color: darken($background-color, 2%);

$button-background-color: $key-color;
$button-color: lighten($button-background-color, 40%);
$button-hover-background-color: adjust-color($button-background-color, $saturation: +15%, $lightness: +5%);
$button-hover-color: lighten($button-color, 30%);
$config-row-disabled-background-color: darken($background-color, 2%);
$config-row-disabled-color: darken($config-row-disabled-background-color, 35%);
$copyright-color: darken($background-color, 20%);
$logger-color: lighten($color, 30%);
$nav-key-color: hsl($base-hue, 3%, 53%);
$nav-border-color: $nav-key-color;
$nav-item-background-color: $background-color;
$nav-item-color: $nav-key-color;
$nav-active-item-background-color: $nav-key-color;
$nav-active-item-color: $background-color;
$nav-item-hover-background-color: darken($nav-item-background-color, 5%);
$nav-item-hover-color: $nav-item-color;
$pre-strong-background-color: mix($key-color, $pre-background-color, 15%);
$pre-title-background-color: $pre-border-color;
$pre-title-color: darken($pre-border-color, 40%);

// Font
$font-family-sans-serif: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
$font-family-serif: 'Georgia', 'Times New Roman', serif;
$font-family-monospace: 'Source Code Pro', 'Menlo', 'Courier New', monospace;

$font-family: $font-family-serif;
$button-font-family: $font-family-sans-serif;
$code-font-family: $font-family-monospace;
$heading-font-family: $font-family-sans-serif;
$nav-font-family: $font-family-sans-serif;
$pre-title-font-family: $font-family-sans-serif;

$font-size: 1.0em;
$font-size-monospace: 80%;
$h1-font-size: 150%;
$h2-font-size: 120%;
$line-height: 150%;
$pre-line-height: 150%;
$pre-title-line-height: 175%;
$nav-font-size: 90%;

$desc-cell-font-size: 90%;
$copyright-font-size: 90%;
$pre-title-font-size: 70%;
$theme-form-label-font-size: 80%;

// Geometry
$def-vert-margin: 0.75em;

$body-margin: 32px auto;
$body-padding: 32px;
$body-width: 800px;
$code-border-radius: 3px;
$code-padding: 2px 4px;
$h1-margin: 0;
$h1-padding: 0;
$h2-margin: 2.0em 0 $def-vert-margin;
$h2-padding: 4px 0;
$ul-margin: 0 0 $def-vert-margin;
$ul-padding: 0 0 0 1.5em;
$li-spacing: 0.5em;
$p-margin: 0 0 $def-vert-margin;
$pre-margin: 0 0 $def-vert-margin;
$pre-padding: 8px;
$pre-title-padding: 0 0.75em;
$table-margin: 0 0 $def-vert-margin;
$table-cell-padding: 8px 1.0em;
$toolbar-margin: 1.0em;

$button-border-radius: 3px;
$button-padding: 4px 1.0em;
$copyright-spacing: 2.0em;
$double-column-column1-width: 40%;
$double-column-column2-width: 60%;
$event-logger-height: 8.0em;
$github-height: 24px;
$github-padding: 2px 0;
$link-li-spacing: 0;
$nav-height: 30px;
$nav-margin: 2.0em 0;
$nav-border-radius: 3px;
$nav-border-width: 1px;
$nav-item-height: $nav-height - $nav-border-width * 2;
$nav-item-width: 20%;
$theme-form-height: 28px;


* {
	box-sizing: border-box;
	-moz-box-sizing: border-box;
}
html {
	background-color: $outer-background-color;
	margin: 0;
	padding: 0;
}
body {
	background-color: $background-color;
	border: $body-border-color solid 1px;
	color: $color;
	font-family: $font-family;
	font-size: $font-size;
	line-height: $line-height;
	margin: $body-margin;
	padding: $body-padding;
	-webkit-text-size-adjust: 100%;
	width: $body-width;
}

h1, h2 {
	clear: both;
	color: $heading-color;
	font-family: $heading-font-family;
}
h1 {
	font-size: $h1-font-size;
	margin: $h1-margin;
}
h2 {
	border-bottom: $heading-border-color solid 1px;
	font-size: $h2-font-size;
	margin: $h2-margin;
	padding: $h2-padding;
}

table {
	border-collapse: collapse;
	border: $table-border-color solid 1px;
	margin: $table-margin;
	width: 100%;
}
th, td {
	border: $table-border-color solid 1px;
	padding: $table-cell-padding;
}
th {
	background-color: $th-background-color;
	font-weight: normal;
}

ul {
	margin: $ul-margin;
	padding: $ul-padding;
}
li + li {
	margin-top: $li-spacing;
}

p {
	margin: $p-margin;
}

pre {
	background-color: $pre-background-color;
	border: $pre-border-color solid 1px;
	font-family: $code-font-family;
	font-size: $font-size-monospace;
	line-height: $pre-line-height;
	margin: $pre-margin;
	overflow: scroll;
	padding: $pre-padding;

	strong {
		background-color: $pre-strong-background-color;
		font-style: normal;
		font-weight: normal;
	}
}

code {
	background-color: $code-background-color;
	border: $code-border-color solid 1px;
	border-radius: $code-border-radius;
	padding: $code-padding;
}

strong {
	font-style: italic;
	font-weight: normal;
}

a {
	color: $a-color;
}
a:hover {
	background-color: $a-hover-background-color;
	text-decoration: none;
}

.pre-container {
	margin: $pre-margin;
	position: relative;

	pre {
		margin: 0;
		padding-top: 2.0em;
	}
	.title {
		background-color: $pre-title-background-color;
		color: $pre-title-color;
		font-family: $pre-title-font-family;
		font-size: $pre-title-font-size;
		left: 0;
		line-height: $pre-title-line-height;
		padding: $pre-title-padding;
		position: absolute;
		top: 0;
	}
}

ul.nav {
	background-color: $nav-item-background-color;
	border: $nav-border-color solid $nav-border-width;
	border-radius: $nav-border-radius;
	font-family: $nav-font-family;
	font-size: $nav-font-size;
	height: $nav-height;
	margin: $nav-margin;
	padding: 0;
	width: 100%;

	li {
		border-right: $nav-border-color solid $nav-border-width;
		color: $nav-active-item-color;
		display: block;
		float: left;
		height: $nav-item-height;
		line-height: $nav-item-height;
		list-style-type: none;
		text-align: center;
		width: $nav-item-width;

		&.active {
			background-color: $nav-active-item-background-color;
		}
		& > a {
			color: $nav-item-color;
			display: block;
			height: 100%;
			text-decoration: none;
			width: 100%;

			&:active,
			&:hover {
				background-color: $nav-item-hover-background-color;
				color: $nav-item-hover-color;
			}
		}
	}
	li + li {
		margin-top: 0;
	}
}

.copyright {
	color: $copyright-color;
	font-size: $copyright-font-size;
	margin-top: $copyright-spacing;
	text-align: center;
}


// Index
.github {
	float: right;
	height: $github-height;
	padding: $github-padding;
	position: relative;
	text-align: right;
	top: -$github-height;
}


// Demo
#theme-form {
	float: right;
	height: $theme-form-height;
	line-height: $theme-form-height;
	margin: 0;
	position: relative;
	text-align: right;
	top: -$theme-form-height;
}
#theme-form label {
	font-size: $theme-form-label-font-size;
	vertical-align: middle;
}
#theme-form select {
	vertical-align: middle;
}

.link-list {
	li + li {
		margin-top: $link-li-spacing;
	}
}

.logger {
	color: $logger-color;
}

.double-column {
	position: relative;
	width: 100%;
}
.column1 {
	float: left;
	width: $double-column-column1-width;
}
.column2 {
	float: right;
	width: $double-column-column2-width;
}
.term {
	clear: both;
	height: 0;
	width: 0;
}

.config-row-disabled {
	background-color: $config-row-disabled-background-color;
	color: $config-row-disabled-color;
}
.config-enabled-cell {
	text-align: center;
}
.config-name-cell {
	font-family: $code-font-family;
	font-size: $font-size-monospace;
}
.config-desc-cell {
	font-size: $desc-cell-font-size;
}
.config-field-cell {
	input, select {
		width: 100%;
	}
}

// Events
#event-image-list {
	display: none;
}
.event-name-cell {
	font-family: $code-font-family;
	font-size: $font-size-monospace;
	text-align: center;
}
.event-args-cell {
	font-family: $code-font-family;
	font-size: $font-size-monospace;
}
.event-desc-cell {
	font-size: $desc-cell-font-size;
}
#event-logger {
	height: $event-logger-height;
	overflow: auto;
}

.toolbar {
	margin: $toolbar-margin;
	text-align: center;
}
.button {
	background-color: $button-background-color;
	border-radius: $button-border-radius;
	color: $button-color;
	cursor: pointer;
	display: inline-block;
	font-family: $button-font-family;
	padding: $button-padding;
	text-align: center;

	&:hover {
		background-color: $button-hover-background-color;
		color: $button-hover-color;
	}
}

#interactive-image-list,
#interactive-page-list {
	display: none;
}
