* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: sans-serif;
}

html {
    width: 100%;
    height: 100%;
}

body {
    width: 100%;
    height: 100%;
}

#page-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    position: relative;
    flex-flow: column nowrap;
    align-items: stretch;
    overflow: hidden;
}

#background {
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    background-color: #242424;
    z-index: -1;
}

header {
    flex: 0 0 auto;
    width: 100%;
    height: 48px;
    display: flex;
    position: relative;
    flex-flow: row nowrap;
    justify-content: space-between;
    align-items: stretch;
    color: #242424;
    background-color: #f4f4f4;
    z-index: 10;
}

#header-bar {
    flex: 1 0 auto;
    display: flex;
    position: relative;
    flex-flow: row nowrap;
    justify-content: space-between;
    background-color: inherit;
    box-shadow: 0 0 15px 2px #000000;
    z-index: 11;
}

#heading {
    flex: 0 0 auto;
    height: 100%;
    display: flex;
    position: relative;
    flex-flow: row nowrap;
    align-items: center;
    font-size: 30px;
}

#heading img {
    flex: 0 0 auto;
    height: 90%;
}

#heading a {
    flex: 0 0 auto;
    color: inherit;
    font-weight: 600;
    text-decoration: none;
}

#menu-button {
    flex: 0 0 auto;
    height: 48px;
    width: 48px;
    display: block;
    background-color: transparent;
    border: none;
}

.menu-icon-bar {
    width: 36px;
    height: 5px;
    margin: 6px auto;
    background-color: #242424;
    border-radius: 2px;
}

#navigation {
    width: 100%;
    padding-top: 48px;
    margin-top: -100%;
    position: absolute;
    top: 0;
    left: 0;
    background-color: inherit;
    box-shadow: 0 0 15px 2px #000000;
    z-index: 10;
    transition: margin-top 400ms ease;
}

#navigation.show {
    margin-top: 10px;
}

#navigation ul {
    width: 100%;
    display: flex;
    position: relative;
    flex-flow: column nowrap;
    align-items: center;
}

#navigation ul li {
    flex: 0 0 auto;
    padding: 10px;
    list-style-type: none;
}

#navigation ul li a {
    color: inherit;
    font-weight: 600;
    text-decoration: none;
}

#page-content-wrapper {
    flex: 1 0 auto;
    height: 0;
    overflow: auto;
    scroll-behavior: smooth;
    position: relative;
}

#splash {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* 
    Typewriter effect:
    https://css-tricks.com/snippets/css/typewriter-effect/
*/

#splash h1 {
    color: #f4f4f4;
    font-size: 4.5rem;
    overflow: hidden;
    margin: 0 auto;
    animation: typing 1s steps(10, end);
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

#splash p {
    color: #009fae;
    font-size: 1.5rem;
    opacity: 0;
    animation: reveal 0.8s 1s ease forwards;
}

@keyframes reveal {
    from { opacity: 0 }
    to { opacity: 1 }
}

#splash-arrow {
    width: 24px;
    height: 24px;
    position: absolute;
    bottom: 20px;
    border-bottom: #f4f4f4 solid 5px;
    border-right: #f4f4f4 solid 5px;
    border-bottom-right-radius: 5px;
    transform: rotateZ(45deg);
    opacity: 0;
    animation:
        reveal 0.8s 1s ease forwards,
        floating 1.2s infinite ease;
}

@keyframes floating {
    0% { bottom: 20px }
    50% { bottom: 30px }
    100% { bottom: 20px }
}

main {
    max-width: 1300px;
    margin: 0 auto;
    padding-bottom: 10px;
}

.content {
    padding: 10px 10px 35px 10px;
    counter-increment: section-counter;
}

.content h2 {
    padding: 5px 0 5px 10px;
    color: #f4f4f4;
    font-size: 2rem;
    background-color: #128691;
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
}

.content h2::before {
    content: counter(section-counter) ". ";
}

.content .text-wrapper {
    padding: 10px;
    font-size: 1.2rem;
    background-color: #f4f4f4;
    border-bottom-left-radius: 3px;
    border-bottom-right-radius: 3px;
}

.content-with-subsections {
    counter-reset: subsection-counter;
}

.content-subsection {
    counter-increment: subsection-counter;
}

.content-subsection:not(:last-child) {
    margin-bottom: 5px;
}

.content .text-wrapper h3 {
    padding-top: 5px;
    margin-bottom: 10px;
    color: #128691;
    font-size: 1.5rem;
}

.content-subsection h3::before {
    content: counter(section-counter) "." counter(subsection-counter) " ";
}

.content .text-wrapper p {
    text-indent: 2em;
    text-align: justify;
    margin-bottom: 10px;
}

.content .text-wrapper p:not(:last-child) {
    margin-bottom: 15px;
}

.content .text-wrapper p a {
    color: #128691;
    text-decoration: none;
}

.content .text-wrapper figure {
    padding-top: 5px;
    margin-bottom: 10px;
    text-align: center;
    font-style: italic;
    counter-increment: fig-counter;
}

.content .text-wrapper figure div {
    max-width: 100%;
    overflow-x: auto;
}

.content .text-wrapper figure:not(:last-child) {
    margin-bottom: 15px;
}

.content .text-wrapper figure img {
    max-width: 200%;
}

#fig-2 img {
    max-width: 100%;
}

.content .text-wrapper figure figcaption {
    margin-top: 10px;
}

.content .text-wrapper figure figcaption::before {
    font-style: normal;
    content: "Obr. " counter(fig-counter) ": ";
}

.content code {
    font-family: monospace;
}

.note {
    font-style: italic;
    font-size: 0.9em;
    text-indent: 0 !important;
}

.note::before {
    content: "Poznámka: ";
}

.diary-wrapper {
    padding-left: 11px;
}

.diary-milestone {
    padding: 10px 0 10px 19px;
    border-left: 4px solid #128691;
}

.diary-milestone p {
    text-indent: 0 !important;
}

.diary-milestone .milestone-time {
    position: relative;
    color: #128691;
    font-size: 1.6rem;
    font-weight: bold;
}

.diary-milestone .milestone-time::before {
    content: '';
    width: 26px;
    height: 26px;
    position: absolute;
    top: 0;
    left: -34px;
    background-color: #128691;
    border-radius: 50%;
}

.diary-milestone .milestone-time::after {
    content: '';
    width: 18px;
    height: 18px;
    position: absolute;
    top: 4px;
    left: -30px;
    background-color: #f4f4f4;
    border-radius: 50%;
}

.diary-milestone h3 {
    padding-top: 0 !important;
    font-size: 1.4rem !important;
    color: #000000 !important;
}

footer {
    padding: 10px 7px;
    color: #f4f4f4;
    font-size: 1.3rem;
    text-align: center;
    background-color: #171717;
}

@media only screen and (min-width: 560px) {
    .content .text-wrapper figure img {
        max-width: 150%;
    }
}

@media only screen and (min-width: 800px) {
    #menu-button {
        display: none;
    }

    header {
        box-shadow: 0 0 15px 2px #000000;
    }

    #header-bar {
        background-color: none;
        box-shadow: none;
    }
    
    #navigation {
        transition: none;
        flex: 0 0 auto;
        width: auto;
        height: auto;
        padding-top: 0;
        position: relative;
        margin-top: 0;
        background-color: none;
        box-shadow: none;
    }
    
    #navigation ul {
        height: 100%;
        flex-direction: row;
    }

    #navigation ul li a {
        transition: color 100ms ease;
    }

    #navigation ul li a:hover {
        color: #128691;
    }

    .content .text-wrapper figure img {
        max-width: 100%;
    }
}

@media only screen and (min-width: 1100px) {
    html {
        font-size: 0.9em;
    }
    
    .content .text-wrapper figure img {
        max-width: 80%;
    }
}

@media only screen and (min-width: 1300px) {
    .content .text-wrapper figure img {
        max-width: 65%;
    }
}

@media only screen and (min-width: 1800px) {
    .content .text-wrapper figure img {
        max-width: 50%;
    }
}