/*****
 * Styles for Hugo theme "Schoolbook"
 * cssstyle = "bluebook"
 * @author Petri Salmela <pesasa@iki.fi>
 *****/

@font-face {
    font-family: 'Josefin Sans';
    font-style: normal;
    font-weight: normal;
    src: url('fonts/JosefinSans-Regular.ttf') format('truetype');
}

@font-face {
    font-family: 'Josefin Sans';
    font-style: normal;
    font-weight: bold;
    src: url('fonts/JosefinSans-Bold.ttf') format('truetype');
}

@font-face {
    font-family: 'Josefin Sans';
    font-style: italic;
    font-weight: normal;
    src: url('fonts/JosefinSans-Italic.ttf') format('truetype');
}

@font-face {
    font-family: 'Josefin Sans';
    font-style: italic;
    font-weight: bold;
    src: url('fonts/JosefinSans-BoldItalic.ttf') format('truetype');
}

@font-face {
    font-family: 'HankenBook';
    src: url('fonts/Hanken-Book.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'HankenLight';
    src: url('fonts/Hanken-Light.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'AveriaSans';
    src: url('fonts/AveriaSans-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'AveriaSans';
    src: url('fonts/AveriaSans-BoldItalic.ttf') format('truetype');
    font-weight: bold;
    font-style: italic;
}

@font-face {
    font-family: 'AveriaSans';
    src: url('fonts/AveriaSans-Italic.ttf') format('truetype');
    font-weight: normal;
    font-style: italic;
}

@font-face {
    font-family: 'AveriaSansLight';
    src: url('fonts/AveriaSans-Light.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'AveriaSansLight';
    src: url('fonts/AveriaSans-LightItalic.ttf') format('truetype');
    font-weight: normal;
    font-style: italic;
}

@font-face {
    font-family: 'AveriaSans';
    src: url('fonts/AveriaSans-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}


html {
    height: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: helvetica, Arial, sans-serif;
    background-color: #eee;
    overflow-y: scroll;
    min-height: 100%;
    position: relative;
    font-family: "Josefin Sans", "AveriaSans", "HankenBook", sans-serif;
    font-family: Helvetica, Arial, sans-serif;
}

header {
    background-color: #0084c8;
    border-top: 1px solid #0084c8;
    box-shadow: 0 0px 10px 3px rgba(0,0,0,0.5);
    padding: 0 2em;
    margin: 0;
    position: fixed;
    z-index: 2;
    top: 0;
    left: 0;
    right: 0;
    /*height: 50px;*/
}

header h1.sitetitle {
    margin: 0 auto;
    padding-left: 120px;
    font-size: 200%;
    max-width: 27em;
    font-family: AveriaSans, helvetica, Arial, sans-serif;
}

header h1.sitetitle a {
    color: white;
    text-decoration: none;
}

header .section-menu {
    margin: 0 auto 0.3em auto;
    padding: 0px;
    padding-left: 120px;
    max-width: 54em;
    list-style: outside none none;
    display: flex;
    flex-flow: row nowrap;
}

header .section-menu .section-menu-item {
    padding: 0 0.5em;
    /*border-top: 1px solid rgba(255,255,255,0.5);*/
}

header .section-menu-item a {
    color: #eee;
    text-decoration: none;
}

header .section-menu-item.active a {
    /*font-weight: bold;*/
    text-decoration: underline;
}

header .section-menu-item a:hover {
    color: white;
}

header .sitelogo {
    background-color: #0084c8;
    position: absolute;
    bottom: -50px;
    left: 40px;
    padding: 5px 15px;
    border-radius: 0 0 10px 10px;
    /*border: 1px solid red;*/
    /*border-top: none;*/
    box-shadow: 0 5px 5px rgba(0,0,0,0.5);
    border-radius: 0 0 60px 60px;
}

header .sitelogo img {
    width: 80px;
    padding: 3px;
    border-radius: 50%;
    background-color: white;
    height: auto;
    margin-top: -45px;
}

.main {
    max-width: 1200px;
    min-height: 100%;
    margin: 0 auto;
    padding: 0.1em 2em;
    padding-bottom: 7em;
}

nav#TableOfContents {
    float: right;
    background-color: white;
    border: 1px solid #0084c8;
    padding: 0.5em;
    max-width: 230px;
    margin-right: -240px;
    background-color: rgba(230,250,256,0.5);
    background-color: #f2fcff;
}

nav#TableOfContents > ul {
    margin: 0;
    padding: 0 1em;
}

nav.toc {
    width: 13em;
    margin: 0 auto;
    margin-top: 120px;
    margin-bottom: 120px;
    float: left;
    position: fixed;
    top: 0;
    bottom: 0;
    overflow-y: auto;
    font-size: 90%;
    color: #0084C8;
}

nav.toc h2.toc-section {
    text-transform: capitalize;
    font-size: 120%;
    /*color: #2d2d2d;*/
    border-bottom: 3px solid #0084C8;
    font-family: AveriaSans, helvetica, Arial, sans-serif;
}

nav.toc h2.toc-section a {
    text-decoration: none;
}

nav.toc .toc-section-list {
    padding-left: 1.5em;
}

nav.toc a {
    color: #2d2d2d;
    color: #0084C8;
}

nav.toc a:visited {
    color: #555;
    color: #0084C8;
}

nav.toc .active a {
    color: #FF4141;
    color: black;
    text-decoration: none;
}

nav.toc h3.toc-section-name {
    font-size: 100%;
    color: #2d2d2d;
    border-bottom: 1px solid #2d2d2d;
    text-transform: capitalize;
}

.content {
    margin: 0;
    margin-left: 14em;
    min-width: 50em;
    min-height: 100%;
}

article {
    background-color: white;
    min-height: 30em;
    color: #111;
    /*flex-grow: 1;*/
    margin: 0 auto;
    padding: 6em 260px 3em 1em;
    max-width: 45em;
    border-left: 2px solid #ddd;
    border-right: 2px solid #ddd;
}

article::after {
    display: block;
    content: " ";
    clear: both;
}

article h1.page-title {
    font-size: 200%;
    color: #2d2d2d;
    border-bottom: 3px solid #ff4141;
    margin-top: 0.5em;
    font-family: AveriaSans, helvetica, Arial, sans-serif;
}

article h1, article h2, article h3, article h4, article h5, article h6 {
    color: #2d2d2d;
    font-family: AveriaSans, helvetica, Arial, sans-serif;
}

article h1 {
    font-size: 150%;
    /*clear: right;*/
    margin-top: -60px;
    padding-top: 80px;
    border-bottom: 1px solid #0084c8;
}

article h2 {
    font-size: 130%;
}

article h1.page-title {
    font-size: 200%;
    color: #2d2d2d;
    border-bottom: 3px solid #ff4141;
    margin-top: 0.5em;
    padding: 0;
}

article .page-prevnext {
    display: flex;
    flex-flow: row nowrap;
    justify-content: space-between;
}

article blockquote {
    background-color: #CFE9F6;
    padding: 0.2em 1em;
    border-left: 5px solid #ff4141;
    font-style: italic;
    font-family: serif;
}

article code {
    background-color: #f7f7f7;
    color: #004;
}

article pre code {
    overflow-x: auto;
}

article dl dt {
    font-weight: bold;
}

article figure {
}

article figure img {
    max-width: 100%;
    height: auto;
}

article figure figcaption {
    font-size: 80%;
    text-align: left;
}

article figure figcaption h4 {
    margin: 0;
}

article figure figcaption p {
    margin: 0.2em 0;
}

article figure.nonfloatimage {
    max-width: 400px;
    clear: both;
    background-color: #eee;
    padding: 0.5em;
    margin: 1em auto;
}

article figure.floatimage {
    max-width: 250px;
    clear: both;
    background-color: #eee;
    padding: 0.5em;
}

article figure.floatimage img[src$=".svg"] {
    width: 250px;
    height: auto;
}

article figure.mediumimage img {
    width: auto;
    height: 200px;
}

article .floatright {
    float: right;
    margin-right: -240px;
}

article .floatleft {
    float: left;
}

article .centerimage {
    margin: 0.1em auto;
    text-align: center;
}

article .centerimage figcaption {
    text-align: left;
}

article a {
    color: #005c94;
}

article a:visited {
    color: #0084c8;
}

article em {
    color: #ff4141;
}

article table {
    border-collapse: collapse;
    border: 1px solid #2d2d2d;
}

article table td,
article table th {
    padding: 0.1em 0.3em;
}

article table th {
    background-color: #0084c8;
    color: white;
    border: 1px solid #2d2d2d;
}

article table tr:nth-child(even) {
    background-color: #cfe9f6;
}

article table tr:nth-child(odd) {
    background-color: white;
}

article table td {
    border-right: 1px solid #999;
    border-left: 1px solid #999;
    vertical-align: top;
}

article .exercises {
    margin: 3em 3em 1em 0;
    border: 1px solid #92C7FF;
    background-color: #ecf7fd;
    box-shadow: 3px 3px 5px rgba(150,150,150,0.5);
}

article .exercises h1 {
    font-size: 130%;
    border-bottom: 1px solid #999;
    background-color: rgba(150,150,150,0.5);
    background-color: #6dcbfc;
    border-bottom: 1px solid #ecf7fd;
    margin: 0;
    padding: 0.2em;
}

article .exercises h2:first-child {
    background-color: #6dcbfc;
    margin: 0;
    padding: 0.3em 0.5em 0.1em;
}

article .exercises h1,
article .exercises h2,
article .exercises h3,
article .exercises h4,
article .exercises h5,
article .exercises h6 {
    padding-left: 0.5em;
    padding-right: 0.5em;
}

article .exercises p {
    margin: 0.5em 0.5em;
}

article .exercises pre {
    margin: 1em;
}

article .exercises a[href$="svg"]::before {
    content: "";
    display: inline-block;
    width: 3em;
    height: 3em;
    margin-right: 0.5em;
    background: transparent url(../images/SVG-icon.svg) center center no-repeat;
    background-size: contain;
}

article .examplebox {
    margin: 3em 3em 1em 0;
    border: 1px solid #92C7FF;
    background-color: #ecf7fd;
    box-shadow: 3px 3px 5px rgba(150,150,150,0.5);
}

article .examplebox h1 {
    font-size: 120%;
    border-bottom: 1px solid #999;
    background-color: rgba(150,150,150,0.5);
    background-color: #1b4e6e;
    border-bottom: 1px solid #ecf7fd;
    margin: 0;
    padding: 0.2em;
    color: #eee;
}

article .examplebox h2:first-child {
    background-color: #1b4e6e;
    margin: 0;
    padding: 0.3em 0.5em 0.1em;
}

article .examplebox h1,
article .examplebox h2,
article .examplebox h3,
article .examplebox h4,
article .examplebox h5,
article .examplebox h6 {
    padding-left: 0.5em;
    padding-right: 0.5em;
}

article .examplebox p {
    margin: 0.5em 0.5em;
}

article .examplebox pre {
    margin: 1em;
}

article .examplebox pre:hover {
    margin-right: -250px;
    margin-bottom: 2.35em;
}

article .theorybox {
    margin: 3em 3em 1em 0;
    border: 1px solid #92C7FF;
    border-left: 6px solid #c34a07;;
    border-radius: 6px 0 0 6px;
    background-color: #ecf7fd;
    box-shadow: 3px 3px 5px rgba(150,150,150,0.5);
}

article .theorybox h1 {
    font-size: 130%;
    border-bottom: 1px solid #999;
    background-color: rgba(150,150,150,0.5);
    background-color: #6dcbfc;
    border-bottom: 1px solid #ecf7fd;
    margin: 0;
    padding: 0.5em;
}

article .theorybox h2:first-child {
    background-color: #6dcbfc;
    margin: 0;
    padding: 0.3em 0.5em 0.1em;
}

article .theorybox h1,
article .theorybox h2,
article .theorybox h3,
article .theorybox h4,
article .theorybox h5,
article .theorybox h6 {
    padding-left: 0.5em;
    padding-right: 0.5em;
}

article .theorybox p {
    margin: 0.5em 0.5em;
}

article .theorybox pre {
    margin: 1em;
}

article .topicsbox {
    margin: 3em 3em 1em 0;
    border: 1px solid #92C7FF;
    background-color: #ecf7fd;
    box-shadow: 3px 3px 5px rgba(150,150,150,0.5);
}

article .topicsbox h1 {
    font-size: 120%;
    border-bottom: none;
    margin: 0;
    padding: 0.2em;
}

article .topicsbox h2:first-child {
    margin: 0;
    padding: 0.3em 0.5em 0.1em;
}

article .topicsbox h1,
article .topicsbox h2,
article .topicsbox h3,
article .topicsbox h4,
article .topicsbox h5,
article .topicsbox h6 {
    padding-left: 0.5em;
    padding-right: 0.5em;
}

article .topicsbox p {
    margin: 0.5em 0.5em;
}

article .topicsbox ul {
    list-style: none;
}

article .topicsbox ul li::before {
    content: "– ";
}


article .butterflybox1 {
    background-image: url(../images/butterfly-wireframe-transparent.svg);
    background-size: 150px;
    background-repeat: no-repeat;
    background-position: right 20px center;
}

article .butterflybox2 {
    background-image: url(../images/butterfly-wireframe2-transparent.svg);
    background-size: 180px;
    background-repeat: no-repeat;
    background-position: right 20px center;
}

article .butterflybox3 {
    background-image: url(../images/butterfly-wireframe3-transparent.svg);
    background-size: 200px;
    background-repeat: no-repeat;
    background-position: right 20px center;
}

footer {
    background-color: #0084c8;
    padding: 0.1em 2em;
    margin: 0;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

footer a {
    color: #eee;
}



/*******************************************
 * Mobile devices
 *******************************************/
/* #### Mobile Phones Portrait #### */

@media screen and (max-device-width:480px) and (orientation:portrait){
}

/* #### Mobile Phones Landscape #### */
@media screen and (max-device-width:640px) and (orientation:landscape){

}

/* #### Mobile Phones Portrait or Landscape #### */
@media screen and (max-width:1024px){
    header {
        position: relative;
        padding: 0 0.5em;
    }

    header h1.sitetitle {
        font-size: 180%;
        max-width: none;
    }

    header .section-menu {
        flex-flow: row wrap;
    }

    header .section-menu .section-menu-item {
        padding: 0.2em 0.5em;
    }

    header .sitelogo {
        left: 5px;
    }

    .main {
        padding: 0.1em 0.2em;
    }

    nav.toc {
        position: relative;
        float: none;
        width: auto;
        margin: 0 0 0 120px;
    }

    nav#TableOfContents {
        float: none;
        max-width: none;
        margin: 0;
        margin-top: 0.8em;
        padding: 0.2em;
        background-color: rgba(230,250,256,0.5);
        background-color: #f2fcff;
    }

    nav#TableOfContents ul {
        margin: 0.2em;
        padding: 0;
        padding-left: 2em;
    }

    .content {
        margin: 0;
        min-width: 0;
    }

    article {
        padding: 0 0.5em;
    }

    article h1 {
        margin-top: 0;
        padding-top: 20px;
    }

    article .floatright,
    article .floatleft {
        float: none;
        margin: 0.1em auto;
        text-align: center;
    }

    article .exercises,
    article .examplebox,
    article .theorybox {
        margin: 3em 0 1em 0;
    }

    article .floatright figcaption,
    article .floatleft figcaption {
        text-align: left;
    }

    footer {
        position: relative;
    }
}
