html {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
}
body {
    /* color: #aba99f; */
    color: #4c4742;
    margin: 0;
    padding: 0;
    background: #fff;
    font-family: "sans-serif";
    height: 100%;
    width: 100%;
}

h1 {
    margin-top: 0;
}

a {
    color: inherit;
}
a:hover {
    color: #aba99f;
}

emph {
    font-style: italic;
}

details {
    list-style: none;
    border-top: 4px solid #aba99f;
    border-bottom: 4px solid #aba99f;
    position: relative;
    margin-top: 10px;
}

details+details {
    margin-top: -4px;
}

details p {
    padding: 10px;
    margin: 0;
}

summary {
    cursor: pointer;
    padding: 10px;
}

summary + p {
    border-top: 1px solid #aba99f;
}

nav, section {
    max-width: 1060px;
    margin: 0 auto;
    background: #ffffff;
}

nav {
    text-align: right;
    margin-top: 20px;
}
nav > a {
    padding: 5px;
    margin: 15px;
    font-size: 2em;
}

button {
    font-size: 1em;
    color: #fff;
    background: #f88b00;
    border-radius: 20px;
    border: 0;
    padding: 20px 30px;
    text-decoration: none;
    font-family: "sans-serif";
    font-weight: bold;
    filter: drop-shadow(0 0 15px #405d88);
}
button:hover {
    background: #f8981d;
}

.button-container {
    text-align: center;
}

@media screen and (min-width : 737px) {
    button {
        margin: 20px auto;
        font-size: 1.5em;
        cursor: pointer;
    }
}

section.info {
    margin-top: 20px;
    border-radius: 10px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    background: #fff;
    align-items: center;
}
section.info > div.content {
    padding: 10px;
    width: 100%;
    font-size: 1.5em;
    flex: 1;
}
section.info > div.sidebar {
    max-width: 300px;
}
div.sidebar {
    margin-bottom: 10px;
}
div.sidebar img {
    max-width: 100%;
}

img {
    border-radius: 50px;
}
img.logo {
    border-radius: 0;
    margin: 20px 0;
    max-height: 200px;
}

section.info h2 {
    font-size: 1.5em;
    margin-top: 0;
}
section.info dl {
    margin-bottom: 0;
}
section.info dl dt {
    margin-top: 5px;
    font-weight: bold;
}
section.info dl dt:after {
    content: ":";
}

section.links {
    display: block;
    text-align: center;
}
section.links p {
    margin-top: 0;
}
section.links div {
    width: auto;
}
section.links img {
    max-height: 100px;
    max-width: 100%;
}

section:last-child {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

div.fader {
    position: relative;
    padding-top: 100%; /* Somehow this makes it 1:1 aspect ratio even though the contents are position absolute. */
    overflow: hidden;
}
div.fader > img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}

/*
 * n = number of images
 * a = presentation time for one image
 * b = duration for cross fading
 * Total animation duration t = (a+b)*n
 *
 * Percentage for keyframes:
 *   0%              => 100% opacity
 *   a/t*100%        => 100% opacity
 *   1/n*100%        => 0% opacity
 *   100%-(b/t*100%) => 0% opacity
 *   100%            => 100% opacity
 *
 * In our case:
 *   n = 2
 *   a = 6s
 *   b = 1s
 *   t = (6s + 1s) * 2 = 14s
 *
 * Then each animation needs to be staggered by t/n (or a+b) = 7s.
 *
 * The height trick just makes it so that when you click on an image
 * during the animation, it's the one that you're actually looking at
 * rather than the "top" one in the DOM.
 */
@keyframes image-fader {
    0% {
        opacity: 1;
    }
    42% {
        opacity: 1;
    }
    50% {
        opacity: 0;
        height: initial;
    }
    50.1% {
        height: 0;
    }
    92.9% {
        height: 0;
    }
    93% {
        opacity: 0;
        height: initial;
    }
    100% {
        opacity: 1;
    }
}
div.fader > img {
    animation-name: image-fader;
    animation-timing-function: ease-in-out;
    animation-iteration-count: infinite;
    animation-duration: 14s;
}
div.fader > img:nth-of-type(1) {
    animation-delay: 0s;
}
div.fader > img:nth-of-type(2) {
    animation-delay: -7s;
}

@media screen and (min-width : 737px) {
    section.info {
        padding: 30px;
    }
    section.info > img, section.info > div.fader {
        width: 300px;
        height: 300px;
    }
    div.sidebar {
        float: right;
        text-align: center;
        width: 300px;
        height: 300px;
    }

    section.info:nth-child(even) {
        flex-direction: row-reverse;
    }
    section.info:nth-child(even) > div.content + div.sidebar {
        margin-right: 50px;
    }
    section.info:nth-child(odd) {
        flex-direction: row;
    }
    section.info:nth-child(odd) > div.content + div.sidebar {
        margin-left: 50px;
    }

    div.fader {
        padding-top: 0; /* on desktop we don't need the weird padding trick, because we use explicit sizes */
    }

    /*
     * These sections have some expandable stuff, which changes the
     * height of the box and moves around the image. To avoid that,
     * just pin the image to the top. It looks good enough. We only do
     * this for desktops, though, because on mobile the images follow
     * the text, so we still want to center them.
     */
    section.info {
        align-items: flex-start;
    }
}

footer {
    text-align: center;
}
