:root {
    --menu-background: #f0f0f0;
    --menu-border: 1px solid #ccc;
}

html {
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 16px;
    font-family: 'Open Sans', sans-serif;
    margin: 0;
    padding: 0;
}

.page-wrapper {
    display: flex;
    flex-direction: row;
    position: relative;
    padding: 0.5em;
    box-sizing: border-box;
    max-width: 100%;
}

textarea,
pre,
code {
    font-family: 'Anonymous Pro', monospace;
}

code {
    background-color: #ddd;
    padding: 0.1em 0.3em;
}

show-sample + show-sample {
    padding-top: 0.2em;
}

li + li {
    padding-top: 0.2em;
}

/* Hide all custom elements until they get defined */
*:not(:defined) {
    display: none;
}

/* Styles for sidebar */
.sidebar {
    width: 25%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.content {
    width: 100%;
    flex-shrink: 1;
    overflow: hidden;
}

.limit-width {
    width: 100%;
    max-width: 1024px;
}

.sidebar-link {
    display: block;
    padding: 0.5em;
}

/* Styles for the flyout menu */
.menu {
    display: none;
    position: fixed;
    top: 0;
    background: var(--menu-background);
    left: calc(-80% + 60px);
    padding: 8px;
    transition: left 0.5s ease-in-out;
    width: calc(80% - 60px);
    border-right: var(--menu-border);
    border-bottom: var(--menu-border);
    box-sizing: border-box;
}

.menu.open {
    left: 0;
}

menu-handle {
    position: absolute;
    top: 0;
    left: 100%;
    background: var(--menu-background);
    border-right: var(--menu-border);
    border-bottom: var(--menu-border);
}

.menu-links {
    overflow-y: auto;
    max-height: 100vh;
    direction: rtl;
}

.flyout-link {
    display: block;
    padding: 0.5em;
}

@media (max-width: 768px) {
    .sidebar {
        display: none
    }

    .menu {
        display: block;
    }
}

/* Tables from markdown have no styling */
table {
    border-collapse: collapse;
    margin-bottom: 1em;
    margin: 0 auto;
}

thead {
    border-bottom: 1px solid black;
}

th, td {
    padding: 0 0.25em;
}
