/*********************************************************************************/
/* Set all elements to default value                                             */
/*********************************************************************************/

html, body {
	height: 100%;
}

body {
	margin: 0px;
	padding: 0px;
	font-family: Helvetica, Arial, sans-serif;
	font-size: 13pt;
	font-weight: 400;
	color: #363636;
}

@media screen and (max-width:780px) {
	body {
		font-size: 16px;
		line-height: 1.55rem;
		font-weight: 400;
	}
}
  
h1, h2, h3 {
	margin: 0;
	padding: 0;
}

p, ol, ul {
	margin-top: 0px;
}

@media screen and (max-width:780px) {
	ul { padding-left: 18px; }
}

@media screen and (min-width: 780px) {
	p  { line-height: 160%; }
}

a {
	color: #171717;
}

strong a {
	color: #363636;
}

a:hover {
	text-decoration: none;
}

a img {
	border: none;
}

sup {
    font-size: 0.83em;
    vertical-align: super;
    line-height: 0;
}


/*********************************************************************************/
/* Wrappers                                                                      */
/*********************************************************************************/

.container {
	margin: 0px auto;
}

#header-wrapper
{
	overflow: hidden;
	background-size: 100%;
	background: #f4f4f4;
}

#footer-wrapper
{
	overflow: hidden;
	padding: 4em 1em;
	background: #1E1B1A;
}

/*********************************************************************************/
/* Header and text-based logo                                                    */
/*********************************************************************************/

#header  {
	position: relative;
	overflow: hidden;
	text-align: center;

	margin: 0 auto;
	padding: 5px 0px 5px 0px;

	font-size: 13pt;
	font-weight: 400;
	color: #363636;
	line-height: normal;
}

#logo {
	display: inline-block;
	width: 250px;
}

#header h3 {
	margin-top: 10px;
	margin-bottom: 15px;
	
	font-size: 0.875em;
	font-weight: normal;
	font-style: italic;
	color: #909090;
}

#header a  {
	/*text-decoration: none;*/
	color: #909090;
}

@media screen and (max-width:560px) {
	#header h3 {
		margin-top: 20px;
		margin-bottom: 15px
	}
	#header {
		font-size: 0.8em;
		padding: 10px 0px 5px 0px;
	}
	#logo {
		width: 210px;
	}
}

/*********************************************************************************/
/* Main menu                                                                     */
/*********************************************************************************/

#menu-wrapper {
	background: #f4f4f4;
	
	line-height: normal;
	font-size: 13pt;
	font-weight: 400;
	color: #363636;

	border-top: 1px solid transparent;
	border-bottom: 1px solid transparent;
	border-color: #ff57229c;

	position:relative;
}

#main-nav {
	overflow: hidden;
	margin: 0px auto;
}

#main-nav ul {
	margin: 0;
	padding: 0px;
	list-style: none;
	text-align: center;
}

#main-nav li {
	display: inline-block;
	background: #f4f4f4;
}

#main-nav a, #main-nav #menu_title {
	display: block;
	letter-spacing: 1px;
	padding: 20px 35px;
	text-decoration: none;
	text-align: center;
	text-transform: uppercase;
	font-size: 0.80em;
	font-weight: 600;
	border: none;
}
#main-nav #menu_title {
	display: none;
	padding: 15px 20px;
}


#main-nav a:hover, #main-nav .current_page_item a {
	text-decoration: none;
}

#main-nav #menu_button {
	display: none;

	margin-left: 60px;
	background: transparent url("../images/down.png") no-repeat scroll 15px 18px;
	cursor: pointer;
	position: absolute;
	left: 50%;
	height: 8px;
	width: 12px;
	top: 0px;
	/** prevent touch highlight on mobile devices */
	-webkit-tap-highlight-color: rgba(0,0,0,0);
}

@media screen and (min-width:560px) and (max-width:780px) {
	#main-nav a { padding: 15px 18px; }
}

@media screen and (max-width:560px) {
	#main-nav a { padding: 12px 20px; }
	#main-nav li { float: none; width: 100%; }
	.js #main-nav ul { position: absolute; z-index:9999; }
	
	.js #main-nav .menu {
		display: none;
	}
	.js #main-nav #menu_button, .js #main-nav #menu_title {
		display: block;
	}
	.js .responsive-toggle-open {
		display: block;
	}
}

/*********************************************************************************/
/* Main page and content                                                         */
/*********************************************************************************/


#page {
	position: relative;
	overflow: hidden;
	padding: 3em 1em 0em 1em;
}

#content {
    margin: 0px auto 50px auto;
	max-width: 920px;
}

#content li {
    padding-bottom: 5px;
    line-height: 150%;
}


/*********************************************************************************/
/* Titles for sections (and subtitles)                                           */
/*********************************************************************************/

#content h2
{
	text-transform: uppercase;
	letter-spacing: 0.20em;
	font-weight: 700;
	font-size: 2em;
	margin: 1.6em 0em 1.0em 0em;
}

#content h2 a:any-link, #content h3 a:any-link
{
	text-decoration: none;
	color: #8e0000;
}

@media screen and (max-width:780px) {
	#content h2 {
		letter-spacing: normal;
	}
}

#content h3
{
	font-size: 1.20em;
	font-weight: bold;
	margin-top: 15px;
	margin-bottom: 15px;
	margin-top: 30px;

	text-decoration: none;
}

#content h4, h4 a
{
	font-size: 1.05em;
	font-weight: bold;
	margin-top: 15px;
	margin-bottom: 15px;
	margin-top: 30px;

	text-decoration: none;
}

#content .firsttitle {
	margin-top: 0px;
}

/*********************************************************************************/
/* Bibtex entry                                                                  */
/*********************************************************************************/

.indent {
	padding-left: 40px;
}

@media screen and (max-width:780px) {
	.indent { padding-left: 18px; }
}

pre {
    display: block;
    padding: 9.5px;
    margin: 0 0 10px;
    font-size: 13px;
    line-height: 1.42857143;
    word-break: break-all;
    word-wrap: break-word;
    background-color: #f5f5f5;
    border: 1px solid #cccccc;
    border-radius: 4px;
}

/*********************************************************************************/
/* Images                                                                        */
/*********************************************************************************/

.diagram {
    margin: 0px auto;
    margin-bottom: 25px;
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;  
}

#aggregated {
    background-image: url(../images/aggregated.png);
    height: 130px;
}

#mixedkey {
    background-image: url(../images/mixedkey.png);
    height: 250px;
}

#fragmentcache {
    background-image: url(../images/fragmentcache.png);
    height: 250px;
}

/**
 * Scaling background image according to a given image ratio:
 *
 *    http://stackoverflow.com/questions/600743/how-to-get-div-height-to-auto-adjust-to-background-size
 *
 * This is only works properly if the image covers the complete width of the div, otherwise there is
 * too much top-padding. Hence we only start doing this once the screen is smaller than image width.
 * Additionally this is done depending on the specific image to get the correct ratios.
 */
@media screen and (max-width:750px) {
    #aggregated {
        height: 0;
        padding-top: 18.6%; /* (img-height / img-width * widthpercentage) */
                             /* (      186  /      1000 *             100) */
    }
    #mixedkey, #fragmentcache {
        height: 0;
        padding-top: 37.7%; /* (img-height / img-width * widthpercentage) */
                             /* (      377  /      1000 *             100) */
    }
}
@media screen and (max-width:560px) {
    #aggregated {
        background-image: url(../images/aggregatedsmall.png);
        height: 0;
        padding-top: 27.45%; /* (img-height / img-width * widthpercentage) */
                             /* (       193 /       703 *             100) */
    }
    #mixedkey {
        background-image: url(../images/mixedkeysmall.png);
        height: 0;
        padding-top: 92.74%; /* (img-height / img-width * widthpercentage) */
                             /* (       575 /       620 *             100) */
    }
    #fragmentcache {
        background-image: url(../images/fragmentcachesmall.png);
        height: 0;
        padding-top: 101.66%; /* (img-height / img-width * widthpercentage) */
                             /* (       610 /       600 *             100) */
    }
}

/*********************************************************************************/
/* YouTube                                                                       */
/*********************************************************************************/

.demo-video {
	text-align: center;
	padding: 10px 0px 40px 0px;
	width: 100%;
	margin: 0px auto;
}

@media screen and (min-width:820px), screen and (max-height:350px) {
	.demo-video {
		width: 75%;
	}
}

.demo-video-container {
	position: relative;
	padding-bottom: 51.9%;
	padding-top: 30px; height: 0; overflow: hidden;
}
 
.demo-video-container iframe,
.demo-video-container object,
.demo-video-container embed {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}


/*********************************************************************************/
/* Copyright                                                                     */
/*********************************************************************************/

#copyright
{
	overflow: hidden;
	padding: 3em 0em 2em 0em;
	text-align: center;
	background: #f4f4f4;
}

#copyright p
{
	letter-spacing: 0.20em;
	text-transform: uppercase;
	font-size: 0.80em;
	color: #6F6F6F;
}

#copyright a
{
	text-decoration: none;
	color: #8C8C8C;
}

/*********************************************************************************/
/* Browser-specific fixes                                                        */
/*********************************************************************************/

/** So click events are properly handled on iPhone */
.clickable { cursor: pointer; }

