
/* Thank you FontSquirrel... https://www.fontsquirrel.com/fonts/manuale */
@font-face {
  font-family: 'manualeregular';
  src: url('manuale-regular-webfont.eot');
  src: url('manuale-regular-webfont.eot?#iefix') format('embedded-opentype'),
       url('manuale-regular-webfont.woff') format('woff'),
       url('manuale-regular-webfont.woff2') format('woff2'),
       url('manuale-regular-webfont.ttf') format('truetype'),
       url('manuale-regular-webfont.svg#manualeregular') format('svg');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'manualeitalic';
  src: url('manuale-italic-webfont.eot');
  src: url('manuale-italic-webfont.eot?#iefix') format('embedded-opentype'),
       url('manuale-italic-webfont.woff') format('woff'),
       url('manuale-italic-webfont.woff2') format('woff2'),
       url('manuale-italic-webfont.ttf') format('truetype'),
       url('manuale-italic-webfont.svg#manualeitalic') format('svg');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'manualemedium';
  src: url('manuale-medium-webfont.eot');
  src: url('manuale-medium-webfont.eot?#iefix') format('embedded-opentype'),
       url('manuale-medium-webfont.woff') format('woff'),
       url('manuale-medium-webfont.woff2') format('woff2'),
       url('manuale-medium-webfont.ttf') format('truetype'),
       url('manuale-medium-webfont.svg#manualemedium') format('svg');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'manualemedium_italic';
  src: url('manuale-mediumitalic-webfont.eot');
  src: url('manuale-mediumitalic-webfont.eot?#iefix') format('embedded-opentype'),
       url('manuale-mediumitalic-webfont.woff') format('woff'),
       url('manuale-mediumitalic-webfont.woff2') format('woff2'),
       url('manuale-mediumitalic-webfont.ttf') format('truetype'),
       url('manuale-mediumitalic-webfont.svg#manualemedium_italic') format('svg');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'manualesemibold';
  src: url('manuale-semibold-webfont.eot');
  src: url('manuale-semibold-webfont.eot?#iefix') format('embedded-opentype'),
       url('manuale-semibold-webfont.woff') format('woff'),
       url('manuale-semibold-webfont.woff2') format('woff2'),
       url('manuale-semibold-webfont.ttf') format('truetype'),
       url('manuale-semibold-webfont.svg#manualesemibold') format('svg');
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: 'manualesemibold_italic';
  src: url('manuale-semibolditalic-webfont.eot');
  src: url('manuale-semibolditalic-webfont.eot?#iefix') format('embedded-opentype'),
       url('manuale-semibolditalic-webfont.woff') format('woff'),
       url('manuale-semibolditalic-webfont.woff2') format('woff2'),
       url('manuale-semibolditalic-webfont.ttf') format('truetype'),
       url('manuale-semibolditalic-webfont.svg#manualesemibold_italic') format('svg');
  font-weight: normal;
  font-style: normal;
}

/* Thank you Font Squirrel... https://www.fontsquirrel.com/fonts/Kingthings-Calligraphica */
@font-face {
  font-family: 'kingthings_calligraphica_liLt';
  src: url('Kingthings_Calligraphica_Light-webfont.eot');
  src: url('Kingthings_Calligraphica_Light-webfont.eot?#iefix') format('embedded-opentype'),
       url('Kingthings_Calligraphica_Light-webfont.woff') format('woff'),
       url('Kingthings_Calligraphica_Light-webfont.woff2') format('woff2'),
       url('Kingthings_Calligraphica_Light-webfont.ttf') format('truetype'),
       url('Kingthings_Calligraphica_Light-webfont.svg#kingthings_calligraphica_liLt') format('svg');
  font-weight: normal;
  font-style: normal;
}

/* Gradient background on html, at least the min viewport height */
html {
  font-size: 100%;
  min-height: 100vh;
  /* deep red gradient */
  background: linear-gradient( 135.8deg, rgba(18,2,2,1) 27.1%, rgba(59,14,22,1) 77.5% );
}

/* Body sets font size and minimum height, plus margin around content. */
body {
  min-height: 100vh;
  font: 1.3rem/1.9rem 'manualeregular', serif;
  color: rgba(18,2,2,0.9);
}

/* Background with padding to contain the grid, includes a faint diagonal texture. */
#background-vessel {
  display: flex;
  flex-direction: row;
  justify-content: center;
  background-position-x: 0%;
  background-position-y: 0%;
  background-origin: padding-box;
  margin-top: 100px;
  margin-bottom: 50px;
  background: repeating-linear-gradient(45deg, rgba(111,34,50,0.3) 0, rgba(111,34,50,0.4) 5%, transparent 0, transparent 50%) 0 / 10px 10px;
  transition: margin 0.2s linear 0.3s, background 0.2s linear 0.3s; 
}

/* 
  Main grid container. Has shadowed background with noise texture.
  see: https://stackoverflow.com/questions/4011113/can-you-add-noise-to-a-css3-gradient
*/
#grid-vessel {
  margin: 0 0 2rem 0;
  padding: 50px 70px;
  border: 0;
  border-radius: 7px;
  box-shadow: 
    inset 0 0 35px 35px rgba(26,26,29,0.09),
    inset 0 0 30px 15px rgba(111,34,50,0.1),
    0 0 2px 4px rgba(249,238,221,0.1),
    0 0 35px 35px rgba(26,26,29,0.2),
    0 0 30px 15px rgba(111,34,50,0.2);
  background: #f9eedd;

  display: grid;
  grid-template-columns: 600px 200px;
  grid-template-rows: 120px auto auto 50px;
  grid-template-areas:
    "header header"
    "content sidebar"
    "article-footer article-footer"
    "footer footer";
  align-content: stretch;
  min-width: 800px;
  transition: 
    padding 0.2s linear 0.3s, 
    border-radius 0.2s linear 0.3s, 
    grid-template-columns 0.2s linear 0.3s, 
    grid-template-rows 0.2s linear 0.3s, 
    grid-template-areas 0.2s linear 0.3s, 
    min-width 0.2s linear 0.3s;
}

/* Header spans width of grid container */
#page-header {
  grid-area: header;
}

/* page title and subtitle */
#page-header h1 {
  font: 4rem/4rem 'kingthings_calligraphica_liLt', serif;
  margin-block-start: 4px;
  margin-block-end: 0;
  margin-left: 0.5rem;
}
#page-header h2 {
  font: 1.5rem/1.5rem 'manualemedium', serif;
  margin-block-start: 0;
  margin-block-end: 4px;
  margin-left: 0.5rem;
}
#page-header h2 em {
  font: 1.5rem/1.5rem 'manualemedium_italic', serif;
}

/* splash image styling */
figure.block-figure {
  display: block;
  margin-bottom: 3rem;
}
figure.block-figure img {
  max-width: 90%;
  height: auto;
  border: 1px solid rgba(26,26,29,0.5);
  padding: 7px;
  background-color: rgba(26,26,29,0.1);
}
figcaption {
  font: 1.1rem/1.3rem 'manualeitalic', serif;
  padding-left: 10px;
}

/* don't show top nav for wide viewports */
#top-nav {
  display: flex;
  justify-content: center;
  height: 0;
  opacity: 0;
  transition: height 0.5s linear 0.3s, opacity 0.5s linear 0.3s;
}

/* navigation sidebar visible at wider viewport sizes */
#page-sidebar {
  display: block;
  grid-area: sidebar;
  transition: height 0.5s linear 0.3s, width 0.5s linear 0.3s, opacity 0.5s linear 0.3s;
}

/* fuzzy background around sidebar links */
#sidebar-bkgd {
  background-color: rgba(111,34,50,0.1);
  box-shadow: 0 0 15px rgba(111,34,50,0.2);
  padding: 20px;
  border-radius: 15px;
  margin-top: 30px;
}

/* main navigation items visible in the sidebar at wider viewport sizes */
#page-sidebar .main-nav {
  margin-bottom: 30px;
}

/* Active main navigation section */
.activeNav {
  font-family: 'manualesemibold', serif;
  background: none;
}

/* article header and links in the sidebar */
#sidebar-articles h4 {
  font: 1.1rem/1.3rem 'manualeitalic', serif;
  margin-bottom: 0.5rem;
}

#sidebar-articles li {
  text-indent : -0.5rem;
  margin-left :  0.5rem;
  margin-bottom: 0.35rem;
  font-size: 1.2rem;
}

/* content below header, should be at least 50% of viewport high */
#page-content {
  grid-area: content;
  min-height: 50vh;
  padding-right: 2rem;
}

#page-content p,
#page-content ul {
  margin-left: 0.5rem;
  margin-bottom: 1rem;
}

#page-content h3{
  margin: 2.5rem 0 1rem 0.5rem;
  font: 1.5rem/1.89rem 'manualemedium_italic', serif;
}

#page-content p em {
  font-family: 'manualeitalic', serif;
}
#page-content p strong {
  font-family: 'manualesemibold', serif;
}

#page-content p.soundcloud {
  margin-top: 2rem;
}

/* Versal in first paragraph of article content */
#page-content p:first-of-type::first-letter {
  font: 6rem/4.5rem 'kingthings_calligraphica_liLt', serif;
  float: left;
  padding: -0.5rem 0 0 0;
  letter-spacing: 0.5rem;
  color: rgba(111,34,50,1);
  text-shadow: 2px 2px 3px rgba(26,26,29,0.5);
}

/* indent other paragraphs in the page content */
#page-content p:not(:first-of-type) {
  text-indent: 1em;
}

/* pull-quotes in page content when needed */
blockquote {
  margin: 1.5rem 0 1rem 1rem;
  padding: 0.5rem 1rem;
  border-left: 5px solid rgba(158, 87, 102, 0.6);
  font: 1.4rem/2rem 'manualeitalic', serif;
}
blockquote strong {
  /* the one place we use this font */
  font-family: 'manualesemibold_italic', serif;
}
blockquote footer {
  margin-top: .5em;
  padding: 0;
  color: rgba(18,2,2,0.7);
  font: 1.2rem/1.6rem 'manualeregular', serif;
}
blockquote footer:before {
  content: '— ';
}

/* ordered lists in the page content */
#page-content ol {
  counter-reset: li;
  margin: 0 0 1rem 2rem;
  padding-left: 0;
}
#page-content ol > li {
  position: relative;
  margin: 0 0 0.25rem 1rem;
  padding: 0.25rem 0 0 0.5rem;
  list-style: none;
}
#page-content ol > li:before {
  content: counter(li);
  counter-increment: li;
  position: absolute;
  left: -1.5rem;
  top: -0.25rem;
  width: 3em;
  font: 3rem/3rem 'kingthings_calligraphica_liLt', serif;
  color: rgba(111,34,50,1);
  text-shadow: 1px 1px 2px rgba(26,26,29,0.25);
}
#page-content ol > li em {
  font-family: 'manualeitalic', serif;
}
#page-content ol > li strong,
#page-content ul > li strong {
  font-family: 'manualesemibold', serif;
}


/* Articles listed on the articles and the home page */
#articles-list li {
  margin-bottom: 0.75rem;
}

#articles-list li .article-title {
  font: 1.5rem/2rem 'manualemedium', serif;
}

#articles-list li .article-date {
  font: 1.3rem/1.5rem 'manualeitalic', serif;
}

.article-summary {
  text-indent: 0.5rem;
}

/* optional grid row below article content */
#article-footer,
#page-footer {
  grid-area: article-footer;
  display: flex;
  margin: 1rem 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* prev, next, top links below article content */
#article-footer span.af-link,
#page-footer span.pf-link {
  flex: 1;
}

/* footer at bottom of page aligned to bottom */
#page-footer {
  grid-area: footer;
  height: 50px;
}

/* little icons */
#page-footer span.icon {
  font-size: 1.5rem;
  position: relative;
  top: 0.2rem;
  letter-spacing: 0.25rem;
}

/* links underlined, with underline thickening when you hover */
a {
  background:
     linear-gradient(
       to bottom, rgba(111,34,50,0.7) 0%,
       rgba(26,26,29,0.09) 100%
     );
	background-position: 0 100%;
	background-repeat: repeat-x;
  color: rgba(18,2,2,0.9);
  text-decoration: none;
  transition: background-size .4s;
	background-size: 1px 1px;
}

a:hover {
  background:
     linear-gradient(
       to bottom, rgba(111,34,50,0.9) 0%,
       rgba(26,26,29,0.09) 100%
     );
	background-position: 0 100%;
	background-repeat: repeat-x;
  color: rgba(18,2,2,0.9);
  text-decoration: none;
  transition: background-size .4s;
  background-size: 1px 3px;
}

/* Reduce external margin and size of layout components below 1000px */
@media only screen and (max-width: 1000px) {
  #background-vessel {
    margin-top: 50px;
  }
  
  #grid-vessel {
    padding: 30px;
    border: 0;
    min-width: 600px;
  }
  
}

/* layout shifts to a single column with top nav below 800px */
@media only screen and (max-width: 850px) {
  html {
    padding: 0;
    background: #f9eedd;
    width: 100vw;
  }

  #background-vessel {
    display: block;
    margin: 0;
    padding: 0;
    background: none;
    justify-content: left;
  }

  /* let poor dendranthropology hyphenate on mobile */
  #page-header h1 {
    word-wrap: break-word;
    overflow-wrap: break-word;
  
  -webkit-hyphens: auto;
     -moz-hyphens: auto;
          hyphens: auto;
  }

  /* hide the page sidebar */
  #page-sidebar {
    display: none;
  }

  /* 
    The grid becomes a one-column layout with the top sidebar above.
    Remove the padding here and add a bit of margin to the inner components.
  */
  #grid-vessel {
    border-radius: 0;
    min-width: unset;
    margin: 0;
    padding: 0;
    box-shadow: 
    inset 0 0 35px 35px rgba(26,26,29,0.09),
    inset 0 0 30px 15px rgba(111,34,50,0.1);
    grid-template-columns: auto;
    grid-template-rows: auto auto auto auto auto;
    grid-template-areas:
      "top-nav"
      "header"
      "content"
      "article-footer"
      "footer";
  }

  /* Add a bit of margin around top-level children of the grid vessel */
  #grid-vessel > * {
    margin: 1rem;
  }

  #top-nav {
    grid-area: top-nav;
    white-space: nowrap;
    overflow: hidden;
    height: auto;
    opacity: 1;
  }

  #top-nav-bkgd {
    background-color: rgba(111,34,50,0.1);
    box-shadow: 0 0 15px rgba(111,34,50,0.2);
    padding: 0 1rem;
    border-radius: 1rem;
    display: inline-block;
  }

  #top-nav ul {
    display: flex;
    justify-content: center;
  }

  #top-nav li {
    display: inline-block;
    padding: 0.2rem 0.3rem;
  }

  #page-header h1 {
    hyphens: auto;
  }

  #page-content {
    padding-right: 1rem;
  }

  /* reformat the articles lists at reduced viewport widths */
  .article-date {
    display: block;
    margin-left: 0.5rem;
  }

  .article-summary {
    text-indent: unset;
    margin-left: 0.5rem;
  }

  .dot {
    display: none;
  }

  #page-footer {
    height: auto;
    padding-bottom: 1rem;
  }

}

/* stack footer links on narrowest screens */
@media only screen and (max-width: 600px) {
  #article-footer,
  #page-footer {
    white-space: unset;
    overflow: unset;
    text-overflow: unset;
    flex-direction: column;
  }

  #article-footer span.af-link,
  #page-footer span.pf-link {
    display: block;
  }
}
