:root {
    --bgcol: #f0eedc;
}

/* load our fonts */

@font-face {
    font-family: 'OldStandardBold';
    src: url('/static/fonts/OldStandard-Bold.ttf') format('opentype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'OldStandardRegular';
    src: url('/static/fonts/OldStandard-Regular.ttf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'OldStandardItalic';
    src: url('/static/fonts/OldStandard-Italic.ttf') format('opentype');
    font-weight: normal;
    font-style: italic;
}

/* set up our responsive layout and typographic base */

body {
    position: relative;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box; 
    height: 100vmin;
    font-family: 'Fantasque Sans Mono', sans-serif;
    font-style: italic;
    counter-reset: pagenr;
    font-size: 1.5em; 
    line-height: 1.6;
    font-weight: 400;
    width: 341px;
    height: auto;
}

/* For devices below 380px, use the full screen */
@media (max-width: 659px) {
  body {
    padding: 0;
  }
  header h1 {
      /* font-size: smaller; */
  }
}

/* For devices larger than 650px */
@media (min-width: 660px) {
  body {
      width: 654px;
  }
}

/* For devices larger than 980px */
@media (min-width: 980px) {
  body {
      width: 961px;
  }
}

/* now do some default settings */

html {
    font-size: 62.5%; 
    background-color: var(--bgcol);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'OldStandardRegular', georgia, serif;
    font-style: normal;
}

a {
    text-decoration: none;
    color: black;
}

a:visited {
    color: black;
}

hr {
    height: 1px;
    border: 0 none;
    color: black;
    background-color: black;
}

article a {
    text-decoration: underline dotted black;
    text-underline-position: under;
}

article a:visited {
    color: #444;
}

article h1, article h2, article h3, article h4, article h5, article h6 {
    padding-left: 1rem;
}

article dl {
    padding-left: 1em;
}

header, footer, article, nav, #tocbox{
    width: 100%; 
    margin: 0 auto;
    padding: 20px 0px;
    box-sizing: border-box; 
    /* border: 1px solid green; */
}

header {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: var(--bgcol);
    border-bottom: 1px solid black;
}

header h1 a {
    color: black;
}

article img {
    max-width: 100%;
}

header h1 {
    margin: 0;
    font-weight: normal;
    font-size: 3rem;
}

header h2 {
    margin-top: 2rem;
    text-align: center;
}

figure {
    margin-left: 0;
    margin-right: 0;
    display: grid;
    place-content: center;
}

figcaption {
    font-family: "OldStandardRegular";
    font-style: normal;
    font-variant: small-caps;
    text-align: center;
}

.pubdate {
    margin-left: 0.5rem;
}

#tocbutton {
  display: none;
}

.burgerimage {
  font-size: large;
  cursor: pointer;
  width: 2em;
  margin-right: -1em;
  font-weight: bold;
  font-style: normal;
}

#sitenav {
    position: absolute;
    top: 1.8em;;
    right: 30px;
    width: 1em;
    text-align: right;
    padding: 0;
    box-sizing: border-box;
}

nav #tocbox {
    text-align: left;
    background-color: var(--bgcol);
    display: none;
    z-index: 12;
    width: 361px;
    height: calc(100vh - 5.8rem);
    left: calc(-360px + 1em + 30px);
    box-sizing: border-box;
    position: absolute;
    font-family: 'OldStandardRegular', georgia, serif;
    padding-left: 20px;
    padding-right: 20px;
}

/* For devices larger than 550px */
@media (min-width: 660px) {
  nav #tocbox {
      width: 634px;
      left: calc(-633px + 1em + 30px);
  }
}

/* For devices larger than 900px */
@media (min-width: 980px) {
  nav #tocbox {
      width: 961px;
      left: calc(-960px + 1em + 30px);
  }
}

#tocbox h5, .tocbox h5 {
    text-align: center;
    text-transform: uppercase;
    padding-top: 20px;
}

#tocsechead, .tocsechead {
    margin-left: 20px;
    float: left;
    width: 40%;
    font-family: 'OldStandardRegular', georgia, serif;
}

#tocpagehead, .tocpagehead {
    float: right;
    width: 40%;
    text-align: right;
    font-family: 'OldStandardRegular', georgia, serif;
}

#tocbox ul, .tocbox ul {
    clear: both;
    overflow-x: hidden;
    list-style: none;
    font-size: larger;
    font-style: normal;
    font-family: 'OldStandardRegular', georgia, serif;
    padding-left: 20px;
}

ul li .pagenum:after {
    content: counter(pagenr);
}

ul li .secnum:after {
    counter-increment: pagenr;
    content: counter(pagenr, upper-alpha) ". ";
}

#tocbox ul li:before, .tocbox ul li:before {
    float: left;
    width: 0;
    white-space: nowrap;
    left: 5em;
    content:
        "        . . . . . . . . . . . . . . . . "
        ". . . . . . . . . . . . . . . . . . . . "
        ". . . . . . . . . . . . . . . . . . . . "
        ". . . . . . . . . . . . . . . . . . . . "
        ". . . . . . . . . . . . . . . . . . . . "
        ". . . . . . . . . . . . . . . . . . . . ";
}

ul li .pagenum {
    float: right;
    padding-left: 0.33em;
    background-color: var(--bgcol);
}

ul li .secnum {
    padding-right: 1em;
    background-color: var(--bgcol);
}

nav ul a, .tocbox ul a {
    padding-right: 0.33em;
    background-color: var(--bgcol);
    text-decoration: none;
    color: black;
}

nav ul a:visited, .tocbox ul a:visited {
    color: black;
}

#tocbutton:checked ~ .burgerimage {
    color: var(--bgcol);
    background-color: black;
}

#tocbutton:checked ~ #tocbox {
    display: block;
}

article {
    clear: both;
    position: relative;
    border: 1px solid black;
    border-top: none;
    padding-top: 0;
}

article.list_grid {
    border: none;
}

article h1 {
    font-size: x-large;
    text-align: center;
    text-transform: uppercase;
    padding: 0.2em 0;
    border-bottom: 1px solid black;
    position: -webkit-sticky;
    position: sticky;
    top: calc(41px + 3.6rem);
    background-color: var(--bgcol);
}

article p {
    padding: 0 1em;
}

article details {
    padding: 0 1em;
    margin-bottom: 1em;
    background-color: rgba(127, 127, 127, 20%);
}

article details > summary {
    display: list-item;
    cursor: pointer;
    list-style-type: "\21E8";
}

article details[open] > summary {
    list-style-type: "\21E9";
}

.titlepage {
    border: none;
    counter-reset: pagenr;
}

.titlepage img {
    max-height: 40vh;
}

.cover-img {
    text-align: center;
}

#projects {
    display: grid;
    grid-template-columns: repeat(auto-fit, 307px);
}

.proj_header {
    position: -webkit-sticky;
    position: sticky;
    top: calc(41px + 3.6rem);
    background-color: var(--bgcol);
    z-index: 2;
    border: 1px solid black;
    border-top: none;
    text-align: center;
    margin-bottom: 0;
}

.proj_detail_head {
    text-align: left;
    border-right: none;
    border-left: none;
    margin-bottom: 2rem;
    border-bottom: 1px solid black;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    padding-left: 0;
}


.proj_detail_head a, .proj_detail_head a:visited {
    border-right: 1px solid black;
    text-decoration: none;
    padding-right: 1rem;
    padding-left: 1rem;
    margin-right: 1rem;
    margin-top: -1px;
    color: black;
}

.proj_detail_head div {
    border-top: 1px solid black;
    padding-top: 1px;
    padding-left: 1rem;
    margin-top: -1px;
    flex: auto;
}

.proj_short {
    width: 307px;
    height: 307px;
    padding: 6px;
    box-sizing: border-box;
    border-left: 1px solid black;
    border-bottom: 1px solid black; 
    position: relative;
}

.proj_short:nth-of-type(1) {
 /*   border-top: 1px solid black; */
}
    
.proj_short:nth-last-of-type(1){
    border-right: 1px solid black;
    width: 308px;
}

.proj_short h5 {
    padding-left: 0;
}

@media (max-width: 659px){
    #projects {
        grid-template-columns: repeat(auto-fit, 341px);
    }
    .proj_short {
        border-right: 1px solid black;
        width: 341px;
        height: 341px;
    }
    .proj_short:nth-last-of-type(1){
        width: 341px;
        height: 341px;
    }       
}


/* For devices larger than 550px */
@media (min-width: 660px) and (max-width: 979px) {
    .proj_short:nth-of-type(2n){
        border-right: 1px solid black;
        width: 307px;
    }
}

/* For devices larger than 900px */
@media (min-width: 980px) {
    .proj_short:nth-of-type(3n){
        border-right: 1px solid black;
        width: 307px;
    }
}


.proj_short .proj_thumb2 {
    z-index: -1;
    position: absolute;
    padding-right: 12px;
    box-sizing: border-box;
}

.proj_short:hover .proj_thumb2 {
    z-index: 1;
}

.proj_short:hover .proj_thumb1 {
    /* display: none; */
}

a.proj_short, a.proj_short:visited {
    color: black;
    text-decoration: none;
}

.proj_backlink, .footer_backlink {
    font-family: OldStandardRegular;
    margin: unset;
    text-align: right;
    font-weight: bold;
    font-style: normal;
    font-size: large;
    padding-right: 0.8em;
}

.proj_backlink {
    position: absolute;
    top: -30px;
    right: 0px;
    width: 120px;
}

.footer_backlink {
    padding-bottom: 0;
}

.proj_backlink  a, .proj_backlink a:visited, .footer_backlink a, .footer_backlink a:visited {
    color: black;
    text-decoration: none;
}



footer {
    text-align: right;
}

/* Typography
–––––––––––––––––––––––––––––––––––––––––––––––––– */
h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  margin-bottom: 2rem;
  font-weight: 300; }
h1 { font-size: 4.0rem; line-height: 1.2;  letter-spacing: -.1rem;}
h2 { font-size: 3.6rem; line-height: 1.25; letter-spacing: -.1rem; }
h3 { font-size: 3.0rem; line-height: 1.3;  letter-spacing: -.1rem; }
h4 { font-size: 2.4rem; line-height: 1.35; letter-spacing: -.08rem; }
h5 { font-size: 1.8rem; line-height: 1.5;  letter-spacing: -.05rem; }
h6 { font-size: 1.5rem; line-height: 1.6;  letter-spacing: 0; }

/* Larger than phablet */
@media (min-width: 550px) {
  h1 { font-size: 5.0rem; }
  h2 { font-size: 4.2rem; }
  h3 { font-size: 3.6rem; }
  h4 { font-size: 3.0rem; }
  h5 { font-size: 2.4rem; }
  h6 { font-size: 1.5rem; }
}

p {
  margin-top: 0; }
