:root {
  --serif1: serif;
  --sans1: "Fira Sans", sans-serif;
  --text-width: 600px;
  --list-width: 800px;

  /* colors */
  /* main pallette */
  --cornsilk: hsl(45, 100%, 94%);
  --red: #c11b17;
  --old-burgundy: #46323b;
  --olive: #988F2A;
  --dark-gray: hsl(0, 0%, 15%);

  --cornsilk-transparency: rgba(255, 255, 255, 0.3);
 
  /* some additional grays */ 
  --med-gray: hsl(0, 0%, 30%);
  --light-gray: hsl(0, 0%, 45%);
  --lighter-gray: hsl(0, 0%, 85%);
  --lightest-gray: hsl(0, 0%, 95%);

  /* where colors go in main areas of site */
  --background: var(--cornsilk);
  --text: var(--dark-gray);
  --link: var(--red);
  --link-hover: var(--light-gray);
}

html {
  font-size: 20px;
  font-family: var(--sans1);
  height: 100vh;
}

body {
  margin: 0 auto;
  background-color: var(--background);
  color: var(--text);
  min-height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  grid-template-areas: "header" "main" "footer";

}

footer {
  grid-area: footer;
  padding: 8px 0 8px 0;
  text-align: center;
  border-top: 2px solid var(--med-gray);
  background-color: var(--dark-gray);
  color: var(--background);
  font-size: 0.6rem;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  color: var(--link-hover);
}

h1 {
  justify-self: end;
  font-size: 1.5rem;
  letter-spacing: 0.1rem;
  margin-top: 0;
  margin-bottom: 0;
  color: var(--background);
}

h1 a, h1 a:hover {
  color: var(--background);
  /* text-decoration: none; */
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  text-align: center;
}

h3 {
  font-size: 1.3rem;
  margin-bottom: 0.9rem;
  margin-top: 0.9rem;
}

/* site header and nav menu */

.site-header {
  top: 0;
  z-index: 100;
  padding: 0.75rem 25px 0.75rem 25px;
  border-bottom: 2px solid var(--med-gray);
  display: grid;
  grid-auto-flow: column;
  grid-gap: 25px;
  align-items: center;
  background-color: var(--text);
  color: var(--background);
}

nav button { display: none; }

nav ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
}

nav ul li {
  display: inline;
  padding-right: 7px;
}
nav ul li img {
  vertical-align: middle;
  padding-right: 5px;
}
nav a.item {
  text-decoration: none;
  color: var(--background);
}

nav a.item:hover {
  border-bottom: 2px solid var(--red);
}

nav img {
  vertical-align: bottom;
  background-color: inherit;
}

nav .search {
  display: inline;
}

nav .search input {
  padding-top: 3px;
  border-color: var(--background);
  border-width: 0 1px 1px 0;
  border-radius: 4px;
  background-color: var(--background);
}

nav .search input:focus {
  border-right: 1px dashed var(--red);
  border-bottom: 1px dashed var(--red);
  border-left: none;
  border-top: none;
}
/* end site header */

/* home page */
.home {
  font-size: 16px;
  padding-left: 35px;
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "featured about"
    "quote about";
  align-items: start;
}

.home h2 { font-size: 1.2rem; }
.home h3 { font-size: 1rem; }

#featured {
  grid-area: featured;
  margin-right: 35px;
  margin-bottom: 35px;
}

#featured h2 { color: var(--med-gray); }

#quote {
  grid-area: quote;
  color: var(--background);
  background-color: var(--light-gray);
  padding: 5px 10px 5px 10px;
  border-radius: 10px;
  text-align: center;
  margin-right: 35px;
  margin-bottom: 25px;
}

#quote a { color: var(--dark-gray); }

#quote a:hover {
  color: var(--dark-gray);
  text-decoration: underline;
}

#brief-about {
  grid-area: about;
  background-color: var(--cornsilk-transparency);
  padding: 10px 25px 0 25px;
  height: 100%;
}
/* end home page styles */

.flatpage {
  line-height: 1.5;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
  max-width: var(--text-width);
}

/* container for the lists of texts/tocs or authors */
#list_container {
  max-width: var(--text-width);
  margin: auto;
  margin-top: 1rem;
}

/* text_container is for the individual texts within the lists */
.text_container {
  padding: 10px;
  margin-bottom: 20px;
  /* text-align: center; */
  /* border: 1px solid var(--med-gray); */
  /* border-radius: 3px; */
  /* transition: all 900ms linear; */
  /* background-color: var(--light-gray); */
  /* color: var(--cornsilk); */
}

.text_container h3 {
  display: inline;
}

/* author_container is for the individual authors within the lists */
.author_container {
  display: grid;
  grid-gap: 25px;
  grid-template-columns: minmax(100px, 25%) 1fr;
  /* background-color: var(--light-gray); */
  /* color: var(--cornsilk); */
  padding: 10px;
  margin-bottom: 20px;
  /* border: 1px solid var(--med-gray); */
  /* transition: all 900ms linear; */
  /* border-radius: 3px; */
}

/* .text_container:hover, .author_container:hover { */
/*   color: var(--dark-gray); */
/*   background-color: var(--cornsilk-transparency); */
/* } */

.author_container img {
  width: 100%;
  justify-self: end;
}

.author_container, .author_intro {
  font-size: 0.8rem;
}

.text_container h3, .author_container h3 { margin-top: 0; }

/* meta is used for the meta info for both texts (article) and .toc, and each is adjusted below */
#meta {
  max-width: var(--text-width);
  margin: 0 auto;
  width: auto;
  padding: 0 20px 0 20px;
  text-align: center;
}

/* content is used for the main text for both texts (article) and .toc, each adjusted below */
#content {
  margin: 0 auto;
  max-width: var(--text-width);
  width: auto;
  padding: 20px;
  font-family: var(--sans1);
  line-height: 1.5;
}

#content::before {
  content: "★";
  text-align: center;
  font-size: 1.5rem;
  display: block;
}

#content::after {
  content: "⚙";
  font-size: 1.5rem;
  height: 1.5rem;
  text-align: center;
  display: block;
  color: var(--red);
}

#content p { padding-bottom: 0.75rem; }
#content > p:first-of-type { padding-top: 0; }

#content > p:not(.ignore):first-of-type::first-letter {
  font-size: 4.6rem;
  float: left;
  padding: 0.5rem 0.5rem 0 0;
  color: var(--red);
}

#content p:last-of-type { padding-bottom: 0; }

#content blockquote {
  border-left: 3px solid var(--lighter-gray);
  padding-left: 10px;
}

#content sup { font-size: .8rem; line-height: .8rem;}

#content p img {
  max-width: var(--text-width);
  max-width: 100%;
  height: auto;
}

#content h4 {font-weight: bold;}

/* headers for Texts (article) and TableOfContents (.toc) */
article header, .toc header {
  height: calc(100vh - 3.5rem - 2px);
  position: relative;
}

article header img, .toc header img {
  height: 100%;
  width: 100%;
  object-fit: cover;
}

/* styles related to the Text objects */
article {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas: "header header header"
    ". meta right-sidebar"
    ". content right-sidebar";
}

article header {
  grid-area: header;
}

article #meta {
  grid-area: meta;
  justify-self: center;
}

article #content {
  grid-area: content;
  justify-self: center;
}

article #content img {
  object-fit: contain;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

#right-sidebar {
  grid-area: right-sidebar;
  max-width: 350px;
}

.notes {
  font-size: 0.8rem;
  border-left: 2px solid var(--red);
  padding: 10px 10px 10px 15px;
  background-color: var(--background);
  background-image:
    url("/static/main/paper-fibers.png"),
    linear-gradient(to right, var(--lighter-gray), 5%, var(--background));
}

.subtitle {
  font-size: 0.7em;
  font-style: italic;
  line-height: 1;
  margin-top: 1rem;
  display: block;
}

/* end styles related to Text/TOC objects */

#author_intro {
  font-family: var(--sans1);
  line-height: 1.5;
}

#author_intro,
#topic_header {
  margin: auto;
  margin-top: 1rem;
  padding: 0 10px 0 10px;
  max-width: var(--text-width);
}

#author_intro img { width: 200px; }

#pagination {
  font-size: 0.7rem;
  text-align: center;
  margin-bottom: 1rem;
}

.bold { font-weight: bold; }
.italic { font-style: italic; }
.center { text-align: center; }
.left { text-align: left; }
.right { text-align: right; }
.small { font-size: 0.9rem; }
.smaller { font-size: 0.8rem; }
.smallest { font-size: 0.7rem; }
.bigger { font-szie: 1.2rem; }
.light_gray { color: var(--light-gray); }
.med_gray { color: var(--med-gray); }
.red { color: var(--red); }

/* styles for the labels of the texts in the public queue */
.queue-tag { 
  color: white;
  margin-right: 2px;
}
.red-back { background-color: var(--red); padding: 2px 4px 2px 4px; border-radius: 3px;}
.gray-back { background-color: var(--dark-gray); padding: 2px 4px 2px 4px; border-radius: 3px; }
.old-burgundy-back { background-color: var(--old-burgundy); padding: 2px 4px 2px 4px; border-radius: 3px; }
.olive-back { background-color: var(--olive); padding: 2px 4px 2px 4px; border-radius: 3px; }
.cornsilk-back { background-color: var(--cornsilk); padding: 2px 4px 2px 4px; border-radius: 3px; color: var(--dark-gray); }

/* this intends to only change link color on hover, otherwise same as surrounding text */
.link_color_hover_only a {
  color: inherit;
  text-decoration: none;
}

.link_color_hover_only a:hover { color: var(--link); }

/* Responsive layout */
@media (max-width: 900px) {
  .site-header nav { font-size: .9rem }
}

@media (max-width: 768px) {
  h1 { justify-self: center;}

  .site-header {
    grid-template-columns: 1fr 10px;
    padding-right: 5px;
    padding-left: 10px;
  }

  nav { 
    justify-self: end; 
    font-size: 2rem;
  }

  nav button {
    display: block;
    border: none;
    font-size: 1.5rem;
    color: var(--background);
    background: transparent;
    margin-right: 0;
    padding-right: 0;
  }

  nav button::after {
    content: "\2630";
  }

  nav button.show::after {
    content: "\00D7";
  }

  nav ul {
    font-size: 1.5rem;
    display: grid;
    justify-items: end;
    align-items: center;
    position: absolute;
    right: 0;
    top: 0;
    width: 0;
    height: calc(100vh - 3.5rem - 3px);
    margin-top: calc(3.5rem + 3px);
    overflow-x: hidden;
    transition: all 500ms;
    white-space: nowrap;
    background-color: var(--light-gray);
  }

  nav ul.show {
    width: 100vw;
    padding-right: 10px;
  }

  nav ul li {
    margin-right: 5px;
    margin-left: 5px;
  }

  main {
    padding: 0;
    margin: 0;
  }

  .home {
    padding: 0;
    grid-gap: 0;
    grid-template-columns: 1fr;
    grid-template-areas: "about" "quote" "featured"
  }

  #brief-about {
    background-color: transparent;
    padding: 20px 20px 10px 20px;
  }

  #featured {
    padding: 10px 20px 0 20px;
    margin: 0;
  }

  #quote {
    padding: 10px 20px 10px 20px;
    margin:0;
    border-radius: 0;
  }

  article {
    grid-template-columns: 1fr;
    grid-template-areas: "header" "meta" "content" "right-sidebar";
    justify-items: center;
  }

  article header, .toc header {
    height: calc(100vh - 1.5rem - 6vw - 2px);
    width: 100%;
  }

  #meta {
    max-width: none;
    padding: 0 20px 0 20px;
  }

  #content {
    max-width: none;
    padding: 10px 20px 20px 20px;
  }

  #right-sidebar {
    grid-area: right-sidebar;
    max-width: none;
    width: 100%;
  }

  .notes {
    border-left: none;
    border-top: 2px solid var(--red);
    padding: 0 20px 0 20px;
    background-image:
      url("/static/main/paper-fibers.png"),
      linear-gradient(to bottom, var(--lighter-gray), 5%, var(--background));
  }
}
