@import url('https://fonts.googleapis.com/css?family=Open+Sans&display=swap');
@import url('https://fonts.googleapis.com/css?family=EB+Garamond&display=swap');


/********************************* Main *******************************/
:root {
	--line-height: 1.4em;
    --border: 0.1rem;
    --table-pad: 0.6em;
    --table-line: 1px solid black;
    --landscape-width: 1500px;
}

body {
    max-width: 810px;
	font-family: "Open sans", sans-serif;
    font-size: 1em;
    color: black;
    line-height: var(--line-height);
    background-color: lavender;
    margin: 0 auto;
    border-radius: var(--border);
}

body.distribution-landscape {
    max-width: var(--landscape-width);
}

main {
    max-width: 800px;
	background-color: white;
    margin: 0 auto;
    padding: 0 0.7rem 0.7rem;
    border-radius: var(--border);
    box-shadow: 1px 3px 20px 2px gray;
}

.distribution-landscape main {
    max-width: var(--landscape-width);
}


/********************************* Links *******************************/
nav {
    width: calc(100% + 0.7rem + 2px);
    height: 1.8rem;
	background: lightgrey;
	background: linear-gradient(
        to right, hsla(0, 0%, 80%, 100%), hsla(0, 0%, 80%, 25%));
	padding: 0.3rem 0.5ex 0;
    border-radius: 1px;
    margin-left: -0.7rem;
}

nav ul {
    width: 100%;
    display: flex;
    flex-flow: row nowrap;
    justify-content: space-between;
}

nav li {
    padding: 0 3em;
    height: 1.8rem;
}

.more-tables {
    position: fixed;
    bottom: 5%;
    right: 5%;
    z-index: 200;
}

.more-tables a {
    display: inline-block;
    font-size: 250%;
    font-weight: bold;
    color: hsla(0, 100%, 100%, 0.6);;
    text-shadow: 2px 2px 2px hsla(0, 0%, 0%, 0.2);
    border-radius: 50%;
    background: hsla(0, 0%, 0%, 0.2);
    padding: 1.5rem 1.5rem;
    cursor: pointer;
    user-select: none;
    transition: 0.6s ease;
}

.more-tables a:link, .more-tables a:hover, .more-tables a:visited {
    color: hsla(0, 100%, 100%, 0.6);;
}

.more-tables a:hover {
    background: hsla(0, 0%, 0%, 0.8);
}

a {
    text-decoration: none;
}
a:link {
    color: brown;
}
a:visited {
    color: purple;
}
a:hover {
    color: chocolate;
}


/********************************* Header *******************************/
header {
    display: grid;
    margin: 1em 2em 2em;
    grid-template-columns: 1fr 7fr 2rem 3fr 2fr;
    align-items: center;
}

hgroup {
    grid-column: 2;
    display: flex;
    flex-flow: column nowrap;
    justify-content: space-around;
}

header figure {
    grid-column: 4;
}

header svg {
    width: 100%;
    max-height: 10rem;
    font-family: "Times New Roman", Times, serif;
    font-style: italic;
    font-size: 60px;
}

header h1, header h2, header h3, header p {
    text-align: center;
}

header h1 {
    font-weight: bold;
    font-size: 150%;
    margin-bottom: 0.5em;
}

header h2 {
    font-weight: normal;
    font-size: 115%;
    margin-bottom: 1em;
}

header h3 {
    background: gainsboro;
    margin: 1em auto;
    width: 10em;
    border-radius: 1rem;
    padding: 0.5em;
}


/********************************* Footer *******************************/
footer {
    padding: 1em;
    font-size: 80%;
}

footer .license {
    display: inline-block;
}

footer .license img {
    height: 16px!important;
    margin-left: 3px;
    vertical-align: text-bottom;
}


/********************************* Tables *******************************/
table {
    clear: both;
    margin: 1em auto;
    table-layout: auto;
    border-collapse: collapse;
    padding: 1ex;
    empty-cells: hide;
    text-align: right;
}

th, td {
    padding: 0.2em 0.4em;
    max-width: 4rem;
    position: relative;
}

th {
    box-sizing: border-box;
    height: 0.7rem;
    border-top: var(--table-line);
    border-bottom: var(--table-line);
    position: sticky;
    top: 0;
    background: Gainsboro;
    background-clip: padding-box;
    z-index: 100;
}

tr:first-child {
    border-bottom: var(--table-line);
}

tr:last-child {
    border-top: var(--table-line);
}

tr:nth-child(even) {
    background: white;
}

tr:nth-child(odd) {
    background: oldlace;
}

tr:nth-child(5n+1) > td {
    padding-bottom: var(--table-pad);
}

.infinity td {
	padding-top: var(--table-pad);
}

th, td:first-child {
    font-weight: bold;
    text-align: center;
}

th:first-child, td:first-child {
    padding: 0;
    border-right: var(--table-line);
    min-width: 2rem;
}

tr:not(:first-child):not(:last-child):hover, th.highlight, td.highlight {
    background: lavender;
}

th svg {
    display: inline;
    vertical-align: middle;
    height: 1.8rem;
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    font-size: 36px;
    font-family: "Open sans", sans-serif;
    font-style: italic;
}


@media print {
/*****************************************************/
    @page {
        margin: 1cm 1.5cm;
        size: A4 portrait;
    }

    body {
        width: 100%;
        height: 100%;
        font-size: 12pt;
        background: white;
        border-radius: 0;
        font-family: "EB Garamond", times, serif;
    }

    main {
        box-shadow: none;
        padding: 0;
    }
    
    header p:nth-of-type(2) {
        background: white;
    }

    footer {
        display: none;
    }

    table {
        width: auto;
        line-height: 1.1em;
        table-layout: fixed;
        margin-top: 1em;
    }

    tr:first-child {
        border-bottom: 2px solid black;
        z-index: 200;
    }

    tr:nth-child(odd) {
        background: white;
    }

    tr:last-child {
        display: none;
    }

    th {
        position: relative;
        background: white;
        box-shadow: none;
        background-clip: none;
        height: 0.4rem;
    }

    nav, .more-tables {
        display: none;
    }

    /* Normal distribution */
    #normal table {
        text-align: center;
        margin-top: 3em;
    }

    /* t-Student distribution */
    #t-student {
        font-size: 10pt;
    }
    
    /* landscape distributions */
    body.distribution-landscape {
        max-width: 297mm;
    }
    
    .distribution-landscape table {
        line-height: 1em;
        font-size: 9pt;
    }
    
    .distribution-landscape th, .distribution-landscape td {
        padding: 0 1em;
    }
    
    .distribution-landscape .wider th, .distribution-landscape .wider td {
        padding: 0 0.4em;
    }
    
    .distribution-landscape th:first-child, 
    .distribution-landscape td:first-child {
        padding: 0;
    }
    
    .distribution-landscape header {
        margin-top: 0;
        max-width: 40em;
    }
    
    .distribution-landscape header > h2 {
        font-size: 9pt;
        line-height: 1;
    }
    
    .distribution-landscape header > p {
        display: none;
    }
    
    .distribution-landscape header > svg {
        width: 20%;
    }
}


@media screen and (max-width: 780px) {
	body {
		font-size: 75%;
	    background-color: white;
	    border-radius: 0;
	}

	main {
	    padding: 0 0.3em 0.3em;
	    border-radius: 0;
	    box-shadow: none;
	}

    nav {
        font-size: 1rem;
    }
}

@media screen and (max-width: 1450px) {
	body.distribution-landscape {
		font-size: 75%;
	    background-color: white;
	    border-radius: 0;
	}

	.distribution-landscape main {
	    padding: 0 0.3em 0.3em;
	    border-radius: 0;
	    box-shadow: none;
	}

    nav {
        height: 1.4rem;
        font-size: 1rem;
    }
}

@media screen and (max-width: 1200px) {
	body.distribution-landscape {
		font-size: 60%;
	}

    nav {
        height: 1.4rem;
        font-size: 1rem;
    }
}
