/*****
 * Styles for Hugo theme "Turuxi"
 * @author Petri Salmela <pesasa@iki.fi>
 *****/
:root {
    --turuxi-main: #abc837;
    --turuxi-main-light: #cdde87;
    --turuxi-main-trans: rgba(171,200,55, 0.5);
    --turuxi-main-light-trans: rgba(205,222,135, 0.9);
    --turuxi-shadow: rgba(0,0,0,0.5);
    --turuxi-beak: #f8be11;
    --turuxi-hl1: #ff4141;
    --turuxi-hl2: #0084c8;
    --turuxi-block: #cfe9f6;
    --turuxi-block: #e1eabc;
    --turuxi-dark: #111;
    --turuxi-light: #fafafa;
    --turuxi-neutral: #eee;
    --turuxi-neutral-dark: #ddd;
    --turuxi-link: #005c94;
    --turuxi-vlink: #445016;
    --turuxi-uvlink: #ba0000;
}

body {
    margin: 0;
    padding: 0;
    font-family: "Open Sans", helvetica, Arial, sans-serif;
    background: var(--turuxi-neutral);
    display: grid;
    grid-template-areas: "header header"
                         "body body"
                         "footer footer";
    grid-template-rows: auto 1fr auto;
    grid-template-columns: 0 1fr;
    height: 100vh;
}

header {
    grid-area: header;
    background-color: var(--turuxi-main);
    border-top: 1px solid var(--turuxi-main);
    box-shadow: 0 0px 10px 3px var(--turuxi-shadow);
    padding: 0.1em 2em;
    margin: 0;
    display: flex;
    flex-flow: row nowrap;
    justify-content: flex-start;
    position: relative;
    z-index: 1;
}

header .sitehead {
    flex-grow: 1;
    flex-shrink: 0;
    display: flex;
    flex-flow: column nowrap;
}

header h1.sitetitle {
    text-align: center;
    margin: 0;
    font-size: 240%;
    flex-grow: 1;
    display: flex;
    flex-flow: row nowrap;
    justify-content: center;
    align-items: center;
}

header h1.sitetitle a {
    color: var(--turuxi-dark, black);
    text-decoration: none;
}
header .sitehead .section-menu {
    display: flex;
    flex-flow: row nowrap;
    list-style: none;
    margin: 0.2em 1em;
    padding: 0;
    justify-content: center;
}
header .sitehead .section-menu li {
    margin: 0 0.5em;
}
header .sitehead .section-menu li a {
    text-decoration: none;
    display: block;
    color: var(--turuxi-dark);
    font-weight: bold;
    border: 4px solid var(--turuxi-main-light);
    padding: 0.2em 0.5em;
    border-radius: 1em;
}
header .sitehead .section-menu li.active a {
    background: var(--turuxi-main-light);
}

.main {
    grid-area: body;
    margin: 0;
    padding: 0.1em 2em;
}

nav.toc {
    width: 16em;
    margin: 0 auto;
    float: left;
}

nav.toc ul {
    padding-left: 1.4em;
}
nav.toc a {
    color: var(--turuxi-link);
}

nav.toc a:visited {
    color: var(--turuxi-vlink);
}

nav.toc h2 {
    font-size: 120%;
    color: var(--turuxi-dark);
    border-bottom: 3px double var(--turuxi-dark);
}

nav.toc h2 a {
    text-decoration: none;
    color: var(--turuxi-dark);
}

nav.toc h2 a:visited {
    color: var(--turuxi-dark);
}

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

.content {
    margin: 0;
    margin-left: 13em;
    height: 100%;
}

article {
    background-color: var(--turuxi-light, white);
    color: var(--turuxi-dark, black);
    flex-grow: 1;
    margin: 0 auto;
    padding: 0.1em 1em;
    max-width: 60em;
    border-left: 2px solid var(--turuxi-neutral-dark);
    border-right: 2px solid var(--turuxi-neutral-dark);
    height: 100%;
}

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

article h1.page-title {
    font-size: 200%;
    color: var(--turuxi-dark);
    border-bottom: 3px solid var(--turuxi-beak);
    border-bottom: 3px solid var(--turuxi-hl1);
    margin-top: 0.5em;
}

article h1 {
    color: var(--turuxi-dark);
    font-size: 150%;
    clear: right;
    margin-top: 2em;
    border-bottom: 1px solid var(--turuxi-hl2);
    border-bottom: 1px solid var(--turuxi-main);
}

article h2 {
    border-bottom: 1px solid var(--turuxi-neutral-dark);
}

article blockquote {
    background-color: var(--turuxi-block);
    padding: 0.2em 1em;
    border-left: 5px solid var(--turuxi-hl1);
    font-style: italic;
    font-family: serif;
}

article p > img:first-child:last-child {
    display: block;
    margin: 0.5em auto;
    max-width: 95%;
    height: auto;
}

article figure {
}

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

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

article figure figcaption h4 {
    margin: 0;
}

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

article figure.floatimage {
    max-width: 250px;
}

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

article .floatright {
    float: right;
}

article .floatleft {
    float: left;
}

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

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

article a {
    color: var(--turuxi-link);
}

article a:visited {
    color: var(--turuxi-vlink);
}

article em {
    color: var(--turuxi-hl1);
}

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;
    background-color: var(--turuxi-main);
    color: var(--turuxi-light);
    border: 1px solid #2d2d2d;
}

article table tr:nth-child(even) {
    background-color: var(--turuxi-block);
}

article table tr:nth-child(odd) {
    background-color: var(--turuxi-light);
}

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

article .page-classes {
    border: 1px solid var(--turuxi-main);
    padding: 0.2em 0.5em;
    display: flex;
    flex-flow: row nowrap;
}

article .page-classes ul.page-class-list {
    list-style: none;
    display: flex;
    flex-flow: row nowrap;
    margin: 0;
    padding: 0;
}

article .page-classes ul.page-class-list .page-class-item {
    border-left: 1px solid var(--turuxi-dark);
    padding: 0 0.5em;
}

article .page-classes ul.page-class-list .page-class-item:first-child {
    border: none;
}

footer {
    grid-area: footer;
    background-color: var(--turuxi-main);
    padding: 0.1em 2em;
    margin: 0;
}

footer a {
    color: var(--turuxi-vlink);
}

/**
 * Taxonomy terms
 */
.taxonomylist {
    list-style: none;
}

/**
 * Mobile
 */
@media only screen and (max-width: 800px) {
    header .sitehead {
        flex-shrink: 1;
    }
    header .sitehead .section-menu {
        flex-flow: row wrap;
    }
    header .sitehead .section-menu .section-menu-item {
        margin: 0.3em 0.5em;
        font-size: 90%;
    }
    .main {
        padding: 0.1em 0.3em;
        display: flex;
        flex-flow: column;
    }
    .content {
        order: 1;
        margin: 0;
    }
    nav.toc {
        width: auto;
        font-size: 90%;
        order: 2;
    }
}
