:root {
  --header-height: 60px;
}

html {
    background-color: #eee3cb;
    margin: 0;
    padding: 0;
    font-family: 'CMUTypewriterTextVariableWidthMedium', Times, serif;
    font-weight: normal;
    font-style: normal;
}

header {
    position: sticky;
    top: 0;
    width: 100%;
    height: var(--header-height);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-around;
    background-color: #967e76;
    color: #eee3cb;
}

.navbar {
    display: flex;
    justify-content: space-between;
    width: 90%;
}

.site {
    font-size: 200%;
    align-self: center;
}

.site,
.site:hover {
    color: inherit;
    text-decoration: none;
}

.items {
    margin: 0;
    padding: 10px;
}

.items a {
    color: #b7c4cf;
    text-decoration: none;
    font-size: 1.2em;
    padding: 1em 1.5em;
}

.items a:hover {
    color: #eee3cb;
}

main {
    display: flex;
    align-items: flex-start;   /* sidebar keeps its own height */
    padding: 0;
}

.nav {
    position: sticky;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    flex: 0 0 20%;
    background-color: #d7c0ae;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 50;
    padding-left: 1.5em;
    padding-top: 2em;
}

.nav > ul {
    flex: 1 1 auto;     /* take the remaining height */
    min-height: 0;      /* allow it to shrink below its content */
    overflow-y: auto;   /* only the list scrolls when it overflows */
    background: inherit;
    margin: 0;
    padding: 5px 5px 1rem;
    list-style: none;
}

.nav ul,
.nav li {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Indent nested levels. More specific than the reset above, so it applies */
.nav .nav-children {
    padding-left: 1rem;
    margin-left: 0.4rem;
    border-left: 1px solid rgba(150, 126, 118, 0.6);  /* subtle guide line */
}

/* Parent sections: bold, with their own spacing */
.nav .nav-section {
    display: block;
    padding: 0.6rem 1rem 0.3rem;
    font-weight: bold;
    color: #4a3f38;
}

/* Page links: no underline, hover changes colour */
.nav .nav-item > a {
    display: block;
    padding: 0.3rem 1rem;
    color: #4a3f38;
    text-decoration: none;
    transition: color 0.15s ease;
}

.nav .nav-item > a:hover {
    color: #967e76;
}

/* Pages nested under a section get a little more left padding */
.nav .nav-children .nav-item > a {
    padding-left: 0.6rem;
}

/* Current page */
.nav .nav-item.is-active > a {
    font-weight: bold;
}

.page_content {
    flex: 1 1 auto;
    min-width: 0;       /* stops wide content from pushing the layout */
    display: flex;
    align-items: start;
    flex-direction: column;
    min-height: calc(100vh - var(--header-height));
    padding: 1em 5em;
}

/* Links in the notes, instead of the browser's default blue */
.page_content a {
    color: #967e76;
}

.turn_pages {
    align-self: stretch; /* span the full column despite align-items: center */
    margin-top: auto;    /* sticks to the bottom on short pages */
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    padding: 1.5rem 2rem;
    border-top: 1px solid rgba(150, 126, 118, 0.5);
}

.turn_prev,
.turn_next {
    flex: 1 1 0;
    min-width: 0;
}

.turn_next {
    text-align: right;
}

.turn_pages a {
    font-weight: bold;
    white-space: nowrap;
}

.headerlink {
    display: none;
}

.nav-root ~ * table,
.page_content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1rem 0;
}

.page_content th,
.page_content td {
    border: 1px solid rgba(150, 126, 118, 0.5);
    padding: 0.5rem 0.75rem;
    text-align: left;
}

.page_content th {
    background-color: rgba(183, 196, 207, 0.6);
}

.search_bar {
    align-self: center;
    color: #4a3f38; 
}

.page_content h1,
.page_content h2,
.page_content h3,
.page_content h4,
.page_content h5,
.page_content h6 {
    font-family: 'CMUTypewriterTextBold', Times, serif;
}