$layout-width: 65rem;
$content-width: 55rem;

body {
    background: url("images/bg.gif");
    font-family: Verdana, Arial, Helvetica, sans-serif;
    color: #3e3e3e;
    margin: 0;
    border: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1, h2, h3 {
    font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
}

h1 {
    font-size: 1.375rem;
}

h3 {
    font-size: 0.875rem;
    color: #666666;
}

p {
    line-height: 1.25rem;
}

a {
    color: #365c5a;
    color: #365c5a;
}

code {
    font-size: 0.9375rem;
    color: #54870f;
}

img {
    border: 0;
    max-width: 100%;
}

dl {
    display: grid;
    grid-template-columns: max-content auto;
    grid-gap: 0.5rem;
}

dt {
    font-weight: bolder;
}

@supports (display: grid) {
    dd {
        margin-left: 0;
    }
}

.wrapper-bright, .wrapper-dark {
    padding-top: 0.625rem;
    font-size: 0.875rem;
    padding-bottom: 1.25rem;
}

.wrapper-bright {
    display: flex;
}

aside {
    margin-right: 3rem;
    width: 15rem;
    flex-grow: 0;
    flex-shrink: 0;
}

.wrapper-dark {
    background: url("images/bgdark.png");
    color: #ffffff;
}

.wrapper-dark h1 {
    color: #ffffff;
    font-weight: normal;
}

.wrapper-dark a {
    color: #bbb;
}

.homepage .main, body:not(.homepage) .wrapper-bright, .header-teaser, #screenshots {
    width: $content-width;
    margin: auto;
}

body:not(.homepage) .wrapper-bright {
    flex: 1;
    width: $layout-width;
}

nav {
    margin-top: 3rem;
}

nav h3 {
    font-variant: small-caps;
    margin-bottom: 0;
    margin-top: 0.5rem;
}

nav ul {
    margin-top: 0;
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
    list-style: none;
}

nav ul ul {
    margin: 0.1rem 0;
}

nav .active {
    font-weight: bold;
}

/************ header **************/

.header {
    display: flex;
    align-items: end;
    margin: 1rem;
}
.header-homepage {
    justify-content: space-between;
    width: $content-width;
    margin: auto;
}

.header-name {
    display: inline-block;
    background: url("images/name.png");
    background-size: contain;
    background-repeat: no-repeat;
    margin: 0;
    width: 84px;
    height: 33px;
}
.header-homepage .header-name {
    width: 253px;
    height: 100px;
}

.header-name span {
    display: none;
}

.header-name a {
    display: block;
    height: 100%;
}

.header-navigation {
    display: inline-block;
    font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
    margin: 0;
    padding-left: 0;
    font-weight: bold;
    list-style: none;
    // Match baseline of the text in the name logo.
    margin-bottom: 10px;
}

.header-homepage .header-navigation {
    // Match baseline of the text in the name logo.
    margin-bottom: 30px;
}

.header-homepage .header-navigation li {
    margin-left: 2rem;
}

.header-navigation li {
    display: inline-block;
    margin-left: 1rem;
    cursor: pointer;
}

.header-navigation a {
    text-decoration: none;
    color: #3e3e3e;
}

.header-fork {
    position: absolute;
    right: 0;
    top: 0;
}
li.nav-forge {
    display: none;
}

.intro {
    display: flex;
    margin: auto;
}

.intro-teaser {
    width: 38rem;
    margin-top: 3.125rem;
}

.intro-teaser h1 {
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
}

.intro-teaser h2 {
    margin-top: 2.4rem;
    border-bottom: 1px solid #d5d5d5;
    max-width: 18.75rem;
}

.intro-teaser ul {
    margin-top: 1.2rem;
    width: 31.25rem;
    margin-bottom: 2.4rem;
}

.intro-teaser li {
    font-family: 'DroidSans', Helvetica;
    margin-bottom: 0.6rem;
    font-size: 1rem;
    line-height: 1.2rem;
}

.intro-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.intro-logo {
    display: block;
}

.intro-download {
    display: block;
    background: #84b025;
    border-radius: 0.5rem;
    width: 12.1875rem;
    height: 2.625rem;
    text-decoration: none;
    vertical-align: middle;
}

.intro-download, .intro-appstores {
    margin-top: 0.5rem;
}

.intro-download span {
    display: block;
    font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
    color: #ffffff;
    font-size: 1rem;
    margin-top: 0.625rem;
    text-align: center;
    width: 100%;
}

/************ Screenshots **************/

#screenshots ul {
    margin-left: 0;
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    justify-content: center;
}

#screenshots li:not(:last-child) {
    margin-bottom: 1.125rem;
    margin-right: 2.25rem;
}

/************ documentation **************/

.main {
    font-size: 0.875rem;
}

.main h2 {
    font-size: 1.125rem;
    margin-left: 1.25rem;
    margin-top: 2.4rem;
}

.main div {
    margin-left: 1.25rem;
}

.main th {
    text-align: left;
}

.main table {
    margin-left: 1.25rem;
}

.main table, .main td, .main th, .main tr {
    border: 0;
    vertical-align: top;
}

.main td {
    font-size: 0.75rem;
    padding: 0.3125rem;
}

kbd {
    border: 1px solid #353535;
    border-radius: 0.25rem;
    padding: 0.1875rem 0.3125rem;
    margin: 0.125rem;
    color: #353535;
    text-decoration: none;
}

/************ footer **************/

.footer {
    background: #333;
    border-top: 3px solid #365c5a;
    height: 8rem;
}

.footer, .footer a {
    color: white;
    font-size: 11px;
}

.footer a {
    text-decoration: underline;
}

.footer p {
    width: $content-width;
    margin: auto;
    margin-top: 1rem;
}

@media (max-width: $layout-width) {
    .header-homepage {
        width: 100%;
        flex-direction: column;
        align-items: center;
        margin: auto;
    }

    body:not(.homepage) .wrapper-bright {
        width: auto;
        margin: 0 1rem;
    }

    .footer p {
        margin: 1rem;
        position: static;
    }
}

@media (max-width: $content-width) {
    .header {
        width: 100%;
        flex-direction: column;
        align-items: center;
        margin: auto;
    }

    .intro {
        flex-direction: column;
        width: 100%;
    }

    .intro-teaser, .intro-side {
        width: 100%;
    }

    .homepage .main, body:not(.homepage) .wrapper-bright, .header-teaser, #screenshots {
        width: 100%;
    }
}

@media (max-width: 37.5rem) {
    body:not(.homepage) .wrapper-bright {
        flex-direction: column;
    }

    .header-fork {
        display: none;
    }

    li.nav-forge {
        display: inline-block;
    }

    nav {
        margin-top: 0;
    }
}

.doc-block-container {
    display: flex;
    flex-wrap: wrap;
}

.doc-block {
    background: #d4d4d244;
    padding: 1rem;
    border-radius: 0.3rem;
    width: 5em;
    flex-grow: 1;
}

.doc-block h2 {
    margin: 0;
}

.nav-link a {
    display: inline-block;
    padding: 0.5rem;
    background: #d4d4d244;
    border-radius: 0.3rem;
}

.nav-link.next {
    text-align: right;
}

// Footnotes from pulldown-cmark
.footnote-definition {
    display: flex;
    font-size: 0.95rem;
}

.footnote-definition p {
    margin: 0;
}

.footnote-definition-label {
    margin-right: 0.95rem;
}

// Admonitions
.admonition {
    background: #d4d4d244;
    border-left: 0.3rem solid #d4d4d2;
    padding: 1rem;
    border-radius: 0.3rem;
}

.admonition h2 {
    margin: 0;
}

.admonition.warning {
    background: #d9770644;
    border-left-color: #d97706;
}

.admonition.warning h2 {
    color: #d97706;
}
