/* TODO
/Move media rules to single blocks
/Move rules governing microfilm index tables to 500px max width media rule
/Add bottom margin to each row
  table {border: 0}
  tr {margin-bottom: .5em;}
/Make microfilm index table header row sticky
  table {border: solid thin #000; border-collapse: separate;}
  thead {position: sticky; top: 0;}
  th {background-clip: padding-box;}
*/

html {
  font-size: 20px
}

body {
  background: #eee;
}

p {
  padding-bottom: .5em;
}

label {
  font-family: 'Arbutus Slab', serif;
}

.mobileOnly {
  display: none;
}

.screenReaderOnly {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.topHeader {
  background: #fff;
  border-bottom: solid thick black;
  padding: 0 .5em;
}

.topHeader h1 {
  font-family: 'Gravitas One', serif;
  font-size: 2.75em;
  text-transform: uppercase;
}

.topHeaderContent {
  margin: 0 auto;
  padding: 1rem 0;
  text-align: center;
}

.logo img {
  width: 150px;
}

.siteTitle {
  /*display: inline-table;*/
  text-align: center;
}

.siteSearch {
  /*display: inline-table;*/
  margin-top: 1rem;
  text-align: center;
}

.siteSearch .border {
  border: solid thin #000;
  display: inline;
}

.siteSearch input[type=text] {
  border: 0;
}

.siteSearch input[type=submit] {
  background: 0;
  border: 0;
  font-family: FontAwesome;
  font-size: 1em;
}

.topHeader nav {
  font-family: Arial, Helvetica, sans-serif;
  font-size: .875em;
  margin: .5rem auto .5rem auto;
  width: 40rem;
}

.topHeader nav>ul {
  overflow: hidden;
}

.topHeader nav>ul:hover {
  overflow: visible;
  /*white-space: nowrap;*/
}
.topHeader nav>ul>li.volume_nav:hover,
.topHeader nav>ul>li.issueNumber_nav:hover {
  white-space: nowrap;
}

.topHeader nav a {
  text-decoration: none;
}

.topHeader nav a:visited {
  color: blue;
}

.topHeader nav ul li,
.topHeader nav ol li {
  background: #fff;
  /* Adding a background makes the dropdown work properly in IE7+. Make this as close to your page's background as possible (i.e. white page == white background). */
  /*background:rgba(255,255,255,0); /* But! Let's make the background fully transparent where we can, we don't actually want to see it if we can help it... */
}

.topHeader nav>ul>li {
  display: inline-table;
  position: relative;
  margin-right: .5em;
}

.topHeader nav>ul>li.open {
  z-index: 10;
}

.topHeader nav>ul>li>img {
  height: 1em;
  vertical-align: text-top;
  margin-right: .5em
}

.topHeader nav>ul>li.open>img {
  transform: rotate(90deg);
}

.topHeader nav>ul>li ol {
  background: #fff;
  /* Adding a background makes the dropdown work properly in IE7+. Make this as close to your page's background as possible (i.e. white page == white background). */
  background: rgba(255, 255, 255, 0);
  /* But! Let's make the background fully transparent where we can, we don't actually want to see it if we can help it... */
  border-top: 1px solid #ddd;
  border-right: 1px solid #aaa;
  border-bottom: 1px solid #aaa;
  border-left: 1px solid #aaa;
  margin-top: .1em;
  max-height: 20em;
  overflow-y: scroll;
  position: absolute;
  left: -9999px;
  /* Hide off-screen when not needed (this is more accessible than display:none;) */
}

.topHeader nav>ul>li:hover ol,
.topHeader nav>ul>li.open ol {
  left: 0;
  /* Bring back on-screen when needed */
}

.topHeader nav>ul>li ol li {
  border-right: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
  border-left: 1px solid #ddd;
  float: none;
}

.topHeader nav>ul>li ol li.current a {
  color: #000;
}

.topHeader nav>ul>li:hover>a,
.topHeader nav>ul>li:hover ol li:hover a {
  /* These create persistent hover states, meaning the top-most link stays 'hovered' even when your cursor has moved down the list. */
  text-decoration: underline;
}

.topHeader nav>ul>li ol li,
.topHeader nav>ul>li ol li a {
  /* Introducing a padding between the li and the a give the illusion spaced items */
  padding: .5em 1em;
  /* Un-indent padded text */
  text-indent: -1em;
  /* Stop text wrapping and creating multi-line dropdown items */
  /*white-space: nowrap;*/
}

.topHeader nav>ul>li:hover ol a,
.topHeader nav>ul>li.open ol a,
.topHeader nav>ul>li.open ol li a {
  /* The persistent hover state does however create a global style for links even before they're hovered. Here we undo these effects. */
  text-decoration: none;
}

.topHeader nav>ul>li:hover ol li:hover {
  background: #eee;
}

main {
  background: #fff;
  width: 100%;
}

main section,
main article {
  background: #fff;
  margin: 0 auto;
  padding: 1em .5em;
  width: 40rem;
}


section header,
article header {
  border-bottom: solid medium black;
  padding-bottom: .25em;
  margin-bottom: 1em;
}

section header h1,
article header h1 {
  font-family: 'Arbutus Slab', serif;
  font-size: 2em;
}

section header .subtitle,
article header .subtitle {
  margin-top: 1rem;
  text-align: right;
}

section header h2,
article header h2 {
  font-family: serif;
}

section header h3,
article header h3 {
  font-family: serif;
}

section>h2,
article>h2 {
  font-size: 1.5em;
  margin: 1em 0 .5em 0;
}

main p {
  font-family: 'Arbutus Slab', serif;
  line-height: 1.2em;
}

main a:visited {
  color: darkblue;
}

.index {
  list-style: none inside;
}

.index li {
  font-family: sans-serif;
  line-height: 1.25em;
  padding-left: 2em;
  text-indent: -2em;
}

.volume .index {
  display: inline-block;
  list-style: decimal inside;
}

.volume .index li {
  float: left;
  white-space: nowrap;
  width: 10em;
}

.microfilmIndex table {
  border: solid thin #000;
  border-collapse: separate;
  margin-top: 1em;
}
.microfilmIndex thead {
  position: sticky;
  top: 0;
}

.microfilmIndex th {
  background-clip: padding-box;
  border-left: solid 2px #000;
  border-bottom: solid 2px #000;
  border-top: solid thin #000;
  font-weight: bold;
  vertical-align: bottom;
}
.microfilmIndex th:first-of-type {
  border-left: solid thin #000;
}
.microfilmIndex th:last-of-type {
  border-right: solid thin #000;
}

.microfilmIndex th,
.microfilmIndex td {
  padding: .25em;
}

.microfilmIndex td {
  border-left: solid thin #000;
  border-bottom: solid thin #000;
}
.microfilmIndex td:first-of-type {
  border-left: 0;
}

.microfilmIndex tr:nth-of-type(2n+1) {
  background: #eee;
}

.microfilmIndex thead tr:nth-of-type(1) {
  background: #fff;
}

.microfilmIndex td:nth-of-type(n+3) {
  text-align: center;
}

body>footer {
  background: transparent;
  font-family: Arial, Helvetica, sans-serif;
  padding: 1em;
  text-align: center;
}

/* Media queries */
@media screen and (max-width: 800px) {
  .topHeader nav {
    width: auto
  }
  
  main section,
  main article {
    width: auto;
    font-size: 16px
  }
}

@media screen and (max-width: 500px) {
  /* Make tables mobile-friendly */
  .microfilmIndex .mobileOnly {
    display: inline;
    font-weight: bold;
  }

  .microfilmIndex table {
    border: 0;
    border-collapse: collapse;
    width: 100%
  }

  .microfilmIndex table,
  .microfilmIndex thead,
  .microfilmIndex tbody,
  .microfilmIndex tfoot,
  .microfilmIndex tr,
  .microfilmIndex th,
  .microfilmIndex td,
  .microfilmIndex td:nth-of-type(n+3) {
    display: block;
    text-align: left;
  }

  .microfilmIndex tr {
    border-top: solid 2px #000;
    margin-bottom: .5em;
  }
  
  .microfilmIndex td,
  .microfilmIndex td:first-of-type {
    border: solid thin #000;
    border-top: 0;
  }

  .microfilmIndex thead tr {
    position: absolute;
    top: -9999px;
    left: -9999px;
  }
}

@media screen and (max-width: 480px) {
  .topHeader h1 {
    font-size: 2em;
  }

  .topHeaderContent {
    padding-bottom: .5rem
  }

  .logo {
    float: left;
    width: 25%;
  }

  .logo img {
    width: 100%;
  }

  .topHeader nav>ul {
    overflow: visible;
    white-space: normal;
  }

  .topHeader nav>ul>li {
    display: block;
    padding-left: 1em;
    text-indent: -1em;
  }

  .topHeader nav>ul>li.issueNumber_nav {
    margin-left: .6em;
  }

  .topHeader nav>ul>li.transcription_nav {
    margin-left: 1.2em;
  }

  .topHeader nav>ul>li:hover ol {
    left: -99999px;
  }

  .topHeader nav>ul>li.open ol {
    left: 0;
  }

  .topHeader nav>ul:hover {
    white-space: normal;
  }
}

@media screen and (max-width: 435px) {
  .topHeader h1 {
    font-size: 1.75em
  }
}

@media screen and (max-width: 380px) {
  .topHeader h1 {
    font-size: 1.4em
  }
}
